What are you asking for? An LS listing of files on the ftp server?
If that is the case you will find that it depends. The mod is not complete(you will see mget is missing) and some FTP clients don't have all the commands
Here is a snippet of old code I threw together when building an autodownloader for virus DAT files. I needed an LS of the directory since mget did not work and there were multple files to choose from:
sub ftp_sdat {
my $path = "pub/antivirus/datfiles/4.x/";
use constant HOST => 'ftp.nai.com';
use constant DIR => 'pub\antivirus\datfiles\4.x';
my $depost = "D:\\Depot\\McAfee\\updateNT\\";
my $ftp = Net::FTP->new(HOST) or die "Couln't connect: $@\n";
$ftp ->login("anonymous",'user@domain.com') or die $ftp->message;
$ftp->binary or die $ftp->message;
#
# Since the Mget command is missing. We get a ls listing and then
# look for the current SDAT file.
my @dirlist = $ftp->ls("$path") or die $ftp->message;
foreach my $file (@dirlist) {
if ($file =~ /sdat/) {
print "dat $file\n";
$ftp->get("$file") or die $ftp->message;
}
}
$ftp->quit;
return $file;
}
If this is not the case, reply back with more details.... |