Solved

FTP problem

Posted on 2006-10-19
7
797 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

820 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