Hello,
I'm looking for some code that deletes all files in a directory on a FTP server.
I already can connect to a FTP server and change to a directory there.
But now I need to delete all files in the current FTP directory.
With DeleteFTPFile() I can delete a single file.. so I guess that I must enumerate all files in the current FTP folder and delete each file?
Thanks
FTP - delete all files in a FTP Server directory
-
- User
- Posts: 19
- Joined: Tue Apr 27, 2010 4:35 pm
- Location: Germany
Re: FTP - delete all files in a FTP Server directory
Correct. FTP does not support the deletion of non-empty directories, for whatever strange reason.spacewalker wrote:With DeleteFTPFile() I can delete a single file.. so I guess that I must enumerate all files in the current FTP folder and delete each file?
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: FTP - delete all files in a FTP Server directory
You can enumerate the FTP folder in a similar way to a desktop folder:
http://www.purebasic.com/documentation/ ... ctory.html
http://www.purebasic.com/documentation/ ... ctory.html
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.