in reply to Re: ftp'ing 'Find' results from an array
in thread ftp'ing 'Find' results from an array

Thanks for your notes. I have also tried
@data=$ftp->ls("-R"); foreach $line (@data) { $ftp->get($line); print $line."\n"; }
But it doesn't work because it stops at the . or .. directories. The 'get' line chokes there. My 'Find' question obviously won't work as it only returns me the local files. I am just out of tricks on this one. In short, what I am trying to do, is: FTP there cd to a dir. get all the files there and below. close connection. seems simple.

Replies are listed 'Best First'.
Re: Re: Re: ftp'ing 'Find' results from an array
by Tomte (Priest) on Aug 13, 2002 at 18:43 UTC

    You could try somthing like this (untested!)

    @data=$ftp->ls("-R"); foreach $line (@data) { if !($line =~ m/^\.{1,2}/){ print "fetching " . $line . "\n"; $ftp->get($line) ; } }

    It sounds though as if wget or rsync could be useful in your case ( I don't know if there are modules out there providing the same functionality). you can call both tools via system, if the ftp-get part is just a fraction of the big picture of your project.

    Update: changed punctuation to clarify the meaning


    regards,
    tomte