FTP problem with delete

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm using the perl ftp module and have successfully automated
incoming and outgoing FTP to a number of sites.

To test a site, I place a file on it, verify it shows up in a
listing, delete it and verify it doesn't show up in a listing.
This has been working great for years.

However, I now have a problem with a new site where I
delete (returns true indicating success) but the file
is still on the site (although with no permissions) and it
disappears after 20-40 seconds.

Of course, this is breaking my automated check which not only
checks the return value of delete but also verifies a listing.

This does not occur with command-line FTP or with ws_ftp (the
file immediately disappears) so I'm lead to believe it has
something to do with the perl FTP module.

Debug shows that the ftp site is running manatee Microsoft FTP
Service (Version 4.0).  The debug output also validates that
the DELE command is successful (250 DELE command successful).

Has anyone seen this before?


Re: FTP problem with delete

Richard Guse wrote:
Quoted text here. Click to load it

I presume that by "verifies a listing" you mean verification by another
call to the module's "dir" or "ls" method -- as distinct from, say,
checking the site's index.html page.

Quoted text here. Click to load it

Has the OS from which you are running this script changed?  (I ask
because I have one script using Net::FTP that works fine when I call it
from Windows or Linux but fails when called from Darwin.  I have not
figured out why this is so, but suspect it may be because the
underlying 'ftp' program differs among these systems.)


Re: FTP problem with delete

Yes, I perform an "ls" to get a listing and verify that the file I
deleted is not in that listing.

The OS which I'm running this script has not changed.

Re: FTP problem with delete

Quoted text here. Click to load it

Can you verify that both the 'ls' command that you run from the perl script,
and the 'ls' command that you run from the command line FTP client, initiate
the running of the same (identical) command on the FTP server ? Maybe they
don't .... and maybe the 'ls' from the perl script makes the FTP server run
a process that is a little behind the times .... whereas the 'ls' from the
command line client initiates a process that is very much up-to-date.

My other thought was that perhaps the $ftp->ls() result that you see after
the deletion is a cache of an earlier $ftp->ls() call .... but that doesn't
sound very likely to me .....

Other than that .... do you really need to run that double check ? If the
FTP server says it deleted the file, then that should be good enough
shouldn't it ? - and the fact that it takes half a minute or so for
$ftp->ls() to catch up, whilst an interesting puzzle,  is inconsequential ?


Site Timeline