Forum Moderators: coopster & phranque

Message Too Old, No Replies

Move File with Net::FTP?

Move file on FTP server using Net::FTP

         

Shadi

7:41 am on Aug 28, 2003 (gmt 0)

10+ Year Member



Due to the immense lack of documentation on the internet for teh Net::FTP module am back with another question unfortunatly.

i have a file on the FTP server in lets say folder: /user/zip/myfile.zip and i would like the script then to move it to: /user/backup/myfile.zip but i can't find the command to do this, does it exist? is it possable?

Thanks in advance.

seindal

7:57 am on Aug 28, 2003 (gmt 0)

10+ Year Member



From my Net::FTP manual:

rename ( OLDNAME, NEWNAME )
Rename a file on the remote FTP server from "OLDNAME" to "NEWNAME".
This is done by sending the RNFR and RNTO commands.

MonkeeSage

8:01 am on Aug 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Shadi:

claus gave a good reference [xav.com] for NET::FTP module the other day.

I'm just learning to use Perl right now myself, so I probably can't help too much, but just a thought...what about something like:

$ftp->cwd("/user/backup/");
$ftp->binary();
$ftp->put($ftp->get("/user/zip/myfile.zip"));
$ftp->delete("/user/zip/myfile.zip");

Mabye something like that will work? Again...I'm a newbie, so mabye I'm telling you wrong and you'll end up in 500 internal server error oblivion...but then, mabye it will work. Doesn't hurt to try. :)

Jordan

========

Oops, didn't see seindal's post.