Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: FTP Transfer

by McMahon (Chaplain)
on Jun 01, 2004 at 18:54 UTC ( [id://358389]=note: print w/replies, xml ) Need Help??


in reply to FTP Transfer

I'm not sure what you were thinking when you decided to roll your own with IO::Socket, but here's an easier way:

use warnings; use strict; use Net::Ftp; use File::Find; my $ftp = Net::FTP->new("192.168.123.456", Debug => 0) or die "Cannot connect to host: $@"; $ftp->login("user",'password') or die "Cannot login ", $ftp->message; my @files = $ftp->ls(); foreach my $file(@files) { $ftp->get($file) or die "get failed", $ftp->message; }

Replies are listed 'Best First'.
Re: Re: FTP Transfer
by meetraz (Hermit) on Jun 01, 2004 at 20:38 UTC
    Is File::Find really required for this? Or is there something I'm missing ?
      I included that part as an illustration of how to get around the lack of "mget" in Net::Ftp.
Re: Re: FTP Transfer
by o0lit3 (Friar) on Jun 01, 2004 at 20:54 UTC
    Many thanks. I've never used Net::Ftp

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-16 21:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found