Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Need help with moving files via FTP
by marto (Cardinal) on Jun 23, 2006 at 13:44 UTC
    Anonymous Monk,

    If you are using the Net::FTP module you want to use the cwd method. The following example is from the documentation

    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
Re: Need help with moving files via FTP
by Asim (Hermit) on Jun 23, 2006 at 14:14 UTC

    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:

    1. See if the quot comamnd in Net::FTP allows you to do something like $ftp->quot('cp -R /home/dir1/* /home/dir2');, or
    2. 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.

Re: Need help with moving files via FTP
by sgifford (Prior) on Jun 23, 2006 at 15:44 UTC