Re: FTP file handle question
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Thu, 27 Dec 2007 11:51:13 -0800
Sturdevant, Robert W Mr CTR USA AMC wrote:
Hi group,
Hello,
I'm troubleshooting a perl 5.6 Win32 app that uses Net::FTP. I am trying
to ftp using a file handle instead of a local file name.
POD says something like $ftp->put(LOCAL_FILE [REMOTE_FILE]) where
LOCAL_FILE may be a file name or a file handle. I know $filename does
exist, I can see it!
This works: $ftp->put( $filename, $somename) ;
But this fails with "Cannot open local file HANDLE: No such file or
directory"
open( HANDLE, "< $filename");
You should verify that the file was opened correctly:
open HANDLE, '<', $filename or die "Cannot open '$filename' $!";
$ftp->put( HANDLE, $somename);
open() does open the file. fileno() says a descriptor is assigned. The
error is thrown by put(), specifically IO::Handle. Can someone tell me
what I am doing wrong??
perldoc -q "How do I pass filehandles between subroutines"
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
.
- References:
- FTP file handle question
- From: Robert W Mr CTR USA AMC Sturdevant
- FTP file handle question
- Prev by Date: FTP file handle question
- Next by Date: Problem with adding a connection with Win32::NetResource
- Previous by thread: FTP file handle question
- Next by thread: Problem with adding a connection with Win32::NetResource
- Index(es):
Relevant Pages
|
|