use Net::FTP;
$ftp = Net::FTP->new("some.host.name", Debug => 0)
or die "Cannot connect to some.host.name: $@";
$ftp->login("anonymous",'-anonymous@')
or die "Cannot login ", $ftp->message;
$ftp->cwd("/pub")
or die "Cannot change working directory ", $ftp->message;
$ftp->get("that.file")
or die "get failed ", $ftp->message;
$ftp->quit;
Should you need information on how to install modules, check out Installing Modules from the Tutorials section of this site.
Update: Please read the PerlMonks FAQ and How do I post a question effectively? if you have not done so already. The title and the content of your post could be a lot better.
hope this helps.
Martin | [reply] [d/l] [select] |
Are you asking how to move directories within a site using FTP? If so, the FTP protocol, itself, is not really designed to do that. You are much, much better off finding a way to shell onto that system, and using it's native copy comamnds.
Otherwise, if you're stuck with FTP, 2 ideas come to mind:
- See if the quot comamnd in Net::FTP allows you to do something like $ftp->quot('cp -R /home/dir1/* /home/dir2');, or
- Simply get the files to your local system, and then put them into the new directory on the remove system.
Hopefully, some of this helps. It's hard to aid more without more on your situation, marto's comments and links to how to do a write-up are well worth the reading and using. Help us help you, please. :)
----Asim, known to some as Woodrow.
| [reply] [d/l] [select] |
Did you try the rename method of Net::FTP? That can move a directory from one place to another.
| [reply] [d/l] |