Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Need Net::FTP rmdir time out help

by salva (Canon)
on Feb 01, 2017 at 08:37 UTC ( [id://1180743]=note: print w/replies, xml ) Need Help??


in reply to Need Net::FTP rmdir time out help

Well, if the remote rmdir operation is reliably terminated every time you reconnect to the machine then, you can just check if the directory exists and in that case restart the deletion:
while(1) { my $ftp = Net::FTP->new(...); defined $ftp->mdtm($dir) or last; $ftp->rmdir($dir); sleep 10; }

Replies are listed 'Best First'.
Re^2: Need Net::FTP rmdir time out help
by Todd Chester (Scribe) on Feb 01, 2017 at 08:41 UTC
    Hmmmm. Maybe I open a second connection to the server and check in a loop to see if the directory still exists or is gone. That "should" (watch the weasel word) keep the original connection from terminating.

      Or perhaps run (via rsh) a script to handle the deletes? It could use a semaphore file to indicate it is still running. Your other process could check for the presence of that file at intervals and continue once it has disappeared.

      But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1180743]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-03-19 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found