Hi Graham,

I found an issue with Net::FTP::close().
It throws a timeout error,when it is invoked after a
partial read().


This strange behaviour of close(), took lot of my time
to figure out that this is not an issue with FTPServer
or this is not our hardware setup problem.


The following script reproduces that issue.
----------------------------------------------
use strict;
use Net::FTP;

my $host = 'FTPSERVER';
my $file = 'FILE';

my $ftp = new Net::FTP($host, Debug => 0);
$ftp->login('userid', 'passwd') or die "Cannot login :
" . $ftp->message();
$ftp->binary();

my $fh = $ftp->retr($file);
my $buffer = '';
my $size   = 128*1024;

while (my $len = $fh->read($buffer, $size))
{ last; }

$fh->close();
$ftp->quit();
----------------------------------------------------

I could overcome this problem by invoking an abort()
instead of a close(), but why should close() throws
an irrelevant error?

Thanks
Srini 

________________________________________________________________________
Yahoo! India Careers: Over 65,000 jobs online
Go to: http://yahoo.naukri.com/

Reply via email to