FTP file handle question



Hi group,

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");
$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??

Thanks,
Sturdy



Relevant Pages

  • Re: Open local file for output
    ... I am trying to send output to a local file and not having much luck ... of the reserved word in Perl. ... but to me they boil down to avoiding debugging and maintenance issues ...
    (comp.lang.perl.misc)
  • Re: monitoring changing web pages
    ... krakle wrote: ... > LOCAL file? ... The OP said he wanted to monitor "a ... program that Perl can call, but they often do have access to an SMTP ...
    (comp.lang.perl.misc)
  • Re: Good FTP program?
    ... >> overwrite a local file without crashing, ... > I have encountered that bug with KBear as well up to as recently as KDE ... > uploading and downloading files over FTP and it handles it pretty well. ... > One nice thing you can do with Konqueror is set up a separate FTP profile, ...
    (alt.os.linux.suse)
  • Re: If file exist in FTP location download, otherwise quit
    ... "Clay Calvert" wrote: ... My problem is if the file at the ftp location does ... ftp for some reason overwrites the local file and blanks it out (0 ... I need a way to make sure that if file is not in ftp location to leave ...
    (microsoft.public.scripting.wsh)
  • Re: Help: FTP File List
    ... Amy Lee wrote: ... and I wanna get a file list from ftp. ... prompting is on, ftp will prompt the user to verify that the ... If no local file is specified, ...
    (comp.os.linux.networking)