Subject: | Suppress "-f" operation if put method input is a tied filehandle and not a file |
Date: | Wed, 2 Sep 2009 14:15:13 -0600 |
To: | "bug-net-ftpssl [...] rt.cpan.org" <bug-net-ftpssl [...] rt.cpan.org> |
From: | Brent Davis <brentd42 [...] hotmail.com> |
The CPAN Net::FTP module supports use of tied file handles for "put" method input. This is highly useful to perform streaming operations such that the file being put does not necessarily need to exist on the local filesystem.
The Net::FTPSSL 0.11 put method performs an "-f" test at line 800 to ascertain if a file exists (if ( -f $file_loc) ...). In the case of tied filehandle input, this test results in an "-f on unopened filehandle" error.
Ideally, the "-f" test should not be performed for tied filehandle input. One suggestion is as follows ...
if ( ref $file_loc ne 'GLOB' && -f $file_loc ) {
my $size = -s $file_loc;
$self->alloc($size);
}
Show quoted text
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_facebook:082009