Solved

FTP problem

Posted on 2006-10-19
7
795 Views
Last Modified: 2008-02-01
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:

  ChangeDir (FolderName);
  Delete (FileName1);
  Delete (FileName2);
  ChangeDirUp;
  RemoveDir (FolderName);

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?
0
Comment
Question by:adlabac
  • 3
  • 2
7 Comments
 

Expert Comment

by:thundt2
ID: 17771065
I'd try not ChangeDiring into that folder, and instead deleting foldername + filename.  In other words, eliminate steps 1 and 4 from your list.  (Perhaps the ftp server is slow to realize you aren't still visiting the folder.)
0
 
LVL 2

Author Comment

by:adlabac
ID: 17772024
Thank you for the answer!

Actually, I did it like you said the first time. Since it did not work, I tried to enter/leave folder just to be sure that I am not inside. Total comander does it the same way - enters, gets list of files, deletes every file, leaves and, finally, it deletes the folder.
0
 

Expert Comment

by:thundt2
ID: 17772074
The next thing I would try is look for a log from the ftp daemon -- see if it has more details on what you are doing vs what Commander is doing.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Author Comment

by:adlabac
ID: 17772114
Yes, I thought of that. The problem is that it is some non-standard FTP server in modified Windows version (by Ericsson), and I cannot find any configuration utility to enable logging... I will try to trace it with Ethereal today.
0
 
LVL 2

Author Comment

by:adlabac
ID: 17840439
I finally found the cause of the problem. Unfortunately there was no right solution, just a workaround.

What I discovered is that there is a problem only if I download the file first! If not, the file is deleted instantly! The same is with Total Commander, as well - If I firstly download (large) file it says that it is deleted OK, but it is still in the folder for some time (usually 20-30 seconds). I even tried to disconnect and reconnect after downloading, bit problem remained.

I am, right not, waiting for folder to be empty before deleting it. If nobody has the some idea, this question should be closed.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18016342
PAQed with points refunded (250)

Computer101
EE Admin
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
EvenOdd challenge 10 83
object oriented javascript web form 8 76
mapShare challenge 13 69
SUM 2 INTEGER ARRAYS INTO 1 10 63
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now