Net::Ftp has its own Timeout value available in the constructor Net::FTP->new('somehost.com', Timeout=>...).
So I don't see the problem with forking.
mitd-Made in the Dark
'My favourite colour appears to be grey.' | [reply] |
If I recall; that timeout value only has an effect when
connecting to the FTP server; not for transfers. Net::FTP
will wait for a put or get to either complete or to fail before it returns control back to the script.
| [reply] |
# from perldoc perlipc
eval {
local $SIG{ALRM} = sub { die "alarm clock restart" };
alarm 10;
# ftp op here
alarm 0;
};
if ($@ and $@ !~ /alarm clock restart/) { die }
but this won't make it a background task, just interruptable. oh, and if you're on a doze box alarm isn't implemented.
larryk
perl -le "s,,reverse killer,e,y,rifle,lycra,,print" | [reply] [d/l] [select] |
wow; i really should look through the documentation more extensively
thanks! :)
| [reply] |