?
Solved

FTP problem

Posted on 2006-10-19
7
Medium Priority
?
802 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Introduction to Processes
Suggested Courses

777 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