fjaenale has asked for the wisdom of the Perl Monks concerning the following question:

Hello Wise Monks:

I am still investigating the problem you can find in the following post: "Question about FTP.pm rename operation" made by me. I have new questions about how the FTP.pm module works. To make a connection I have the following code:

$self->{ftp} = Net::FTP->new($host, BlockSize => 32768, Timeout => 120 +)

I have found that the FTP.pm constructor opens a socket to the port 21 with a Blocksize 32768, using tcp and a timeout of 120. Only the timeout part interest me for the moment.

Now the question is:

1.- żIs this the equivalent to do an ftp -T 120?, -T is the timeout option on the ftp command.

EDIT 1:

Thank you Corion. What I try to demostrate is that the following FTP bug: "4500116 ftp -T <timeout> is broken, ftp client does not exit upon network disruption" that can be found on a Solaris 8 System that is not properly patch, can affect a perl program that uses FTP.pm.

The problem is that I have received a "550: No such file or directory". error after a rename operation, however the file has been renamed correctly. This happens once per 2 to 3 months.

The hipotesis is: We send a file but just after the transference is finished but before the server close all and send the successfull return we have a puntual network disruption but because the timeout bug the conection remains connected and after a timeout sends "550: No such file or directory."

This may not be the place to ask this, sorry if its the case, but I am hoping that others may had the same problem.

Francisco Jaen

Replies are listed 'Best First'.
Re: Question About How FTP.pm opens a socket.
by Corion (Patriarch) on Nov 15, 2004 at 09:46 UTC

    You didn't get a more elaborate answer to this when you asked in the CB earlier, most likely because some details are missing. My guess is "maybe", because I don't know whatever ftp program you are using and how that program is implemented.

    Maybe you can tell us what problem you are trying to solve by playing around with timeouts instead, so we can point you in the direction of a solution?

Re: Question About How FTP.pm opens a socket.
by pg (Canon) on Nov 15, 2004 at 17:09 UTC

    FTP protocol itself does not define any sort of time out. The only time it gets impacted by any time out is the the time out of the underlying TCP layer.

    If timeout is defined for TCP socket (used as data channel for FTP), the socket can not be reopened right after its closing, but FTP requires its closing as an indication of the termination of a session.

    As you observed, yes, that Timeout parameter you passed to FTP new() was used to construct socket.