Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Using NET::FTP with Unkown File Names

by lhoward (Vicar)
on Jul 06, 2001 at 23:17 UTC ( #94568=note: print w/replies, xml ) Need Help??


in reply to Using NET::FTP with Unkown File Names

No Net::FTP does not support wildcards directly, but Net::FTP has an ls method that you can use to get a list of files on the remote server. Then just loop through this list and download them...
use Net::FTP; $ftp = Net::FTP->new("some.host.name", Debug => 0); $ftp->login("anonymous",'me@here.there'); $ftp->cwd("/pub"); my @l=$ftp->ls(); foreach(@l){ $ftp->get($_); } $ftp->quit;
be sure to add error checking code to the above for "real live" use

Replies are listed 'Best First'.
Re: Re: Using NET::FTP with Unkown File Names
by mikeB (Friar) on Jul 07, 2001 at 00:11 UTC
    As an additional sanity check, you may want to add something like
    if ( $ftp->size($remoteFileName) <> -s $localFileName) { die "file size mismatch\n"; }
    after the transfer. We have seen cases where the get() succeeded but the file was not complete.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2019-08-21 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?