Skip Menu |

This queue is for tickets about the Net-FTPSSL CPAN distribution.

Report information
The Basics
Id: 49378
Status: resolved
Priority: 0/
Queue: Net-FTPSSL

People
Owner: Nobody in particular
Requestors: brentd42 [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.11
Fixed in: 0.12



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
Good catch, I didn't notice that bug in the code before. The -f test has been updated in my v0.12 code base. Thanks for the sample code for the fix. But it may be a while before v0.12 comes out. Curtis
The bug has been fixed. Enjoy! Curtis