Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Net::FTP can't fetch file to local directory?

by hossman (Prior)
on Sep 04, 2007 at 05:37 UTC ( [id://636837]=note: print w/replies, xml ) Need Help??


in reply to Net::FTP can't fetch file to local directory?

I have not used Net::FTP in years, i remember nothing about it's API ... but sincei was bored i skimed your post, saw that the error was coming from the "get" method and read the perldocs. it appears you are calling it incorrectly -- it can take 3 args, and the third arg is refered to in the docs as "WHERE" but it is not a directory name...

If WHERE is given then the first WHERE bytes of the file will not be transferred, and the remaining bytes will be appended to the local file if it already exists.

...The error message being returned seems to be the FTP server complaining that it can't understand the "REST" command since it specifies a string instead of an int for the number of bytes to skip (a quick google search indicates that i am probably correct, "REST" is hte low level FTP command indicating that the next command only wants the "rest" of the file after so many bytes.

  • Comment on Re: Net::FTP can't fetch file to local directory?

Replies are listed 'Best First'.
Re^2: Net::FTP can't fetch file to local directory?
by rgkrishnas (Initiate) on Sep 04, 2007 at 10:32 UTC
    Hi, hossman comments are right! Third argument is Resume option (i.e. to download a partial file) I have worked extensively in Net::FTP module, I hope the below changes will work. $ftp->get($remote_file, "$new_directory/$remote_file");
    Gopal

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://636837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-18 00:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found