Hello Monks,

I am writing a seismology remote seismograph station event data retrieval program. Big and long but trivial really. I use net::ftp. My problem is that occasionally one of the FTP's to one of the stations the transfer hangs up. (Lousy connections here in Panama) I get one of two results. One is that program just sits there and the other is that the net::ftp module times out sends a time out error message and tosses me out to the operating system. Both outcomes are lousy.

I need to recover from a failed FTP transfer in an orderly way. for instance:

$test = $ftp->get($remote_file,$local_file);

Works fine if the transfer was ok or if the transfer was damaged. In one case it return the name of the file retrieved and in the other returns false.

If the transfer hangs nothing happens and if it times out in one of the net::ftp pm's it tosses me out into the OS.

Am I using Net::FTP wrong?

Is there a way to trap the Net::FTP error message before find myself in the operating system so that I can act on it.

Is there a way to make my own timeout function?

Any other suggestions?

I have read the Net::ftp docs and understand them the best I can.

> Happy New year,

Angel Rodriguez, headline@volcanbaru.com


In reply to Net::FTP problems by panaman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.