in reply to How control Net::FTP transfer

Oki bros,
Now questions 1. is done. Thank you for your replies.
But what about question 2.? We need method how to control if transfer is alive.... So maybe some transfer byte check.....

Any idea? Thank you very much.

Li Tin O've Weedle
mad Tsort's philosopher

Replies are listed 'Best First'.
Re: Re: How control Net::FTP transfer
by RhetTbull (Curate) on Apr 16, 2001 at 23:19 UTC
    I had a similar problem. When you create a Net::FTP object you can set a Timeout value. If the connection times out, you can trap the error and try to get the file again or re-login and start all over.

    I put the Net::FTP->get() call in an eval block so I could look at $@. If $@ contains something like "Timeout at ... FTP.pm' then I start all over again.

    I had special reasons for doing that (I needed to know if the server timed out or if there was some other error) but you could probably just do something like birdbrane does in his reply to my node. Net::FTP->get will return an error if it does not succeed.