Posted on 2006-10-19
I am trying to delete folder on FTP server with two files inside. The procedure is the following:
1. Enter the folder;
2. Delete the frist file (big one);
3. Delete the second file (small one)
4. Leave the folder
5. Delete the folder
I always receive the message that folder is not empty (the big file is still there)! I am using Indy TIdFTP component from Delphi/C++ Builder:
If I make a longer pause before RemoveDir method everything is OK! I tried to insert a loop before ChangeFolderUp method which checked if folder is empty once a second. After about 25 seconds the file was finaly deleted and everything finished OK!?!
TotalCommander finishes job fast, an there is nothing inside its log different from this I already did (except TC first tried to delete non-empty folder (RMD) and to delete it like it was file (DELE) prior to entering the folder and deleting its files.
Any idea what should I do to make it work fast?