Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my $host="myserver"; my $dir = "/home/ftp/files/"; my $login = "xyz"; my $pw = "XYZ"; my $name; my $path = "c:/files/"; my $ftp = Net::FTP->new($host) or die "Cannot connect to $host: $@"; $ftp->login($login,$pw) or die "Cannot login to $host as $login: $@"; $ftp->cwd($dir) or die "Cannot change working directory: $@"; my @files=$ftp->ls or die "Cannot list current directory: $@"; foreach my $x_files(@files) { $ftp->get($x_files, "$path".$x_files) or die "Can't fetch $x_files: $!\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FTP - Downloading New Files Only
by apl (Monsignor) on Mar 10, 2008 at 19:46 UTC | |
by apl (Monsignor) on Mar 10, 2008 at 20:21 UTC | |
by Anonymous Monk on Mar 10, 2008 at 20:02 UTC |