atnonis has asked for the wisdom of the Perl Monks concerning the following question:
which does the following#!/usr/bin/perl -w use strict; use Net::FTP; # change preferences to meet your needs my $ftp_srv = 'ftp.ntua.gr'; my $ftp_usr = 'anonymous'; my $ftp_pass = 'me@somewhere.com'; my $ftp_path = '/pub/linux/slackware/slackware-9.0/'; # the main program my $con; $con = Net::FTP->new($ftp_srv, Debug => 1) or die "Unable to connect to $ftp_srv\n". $con->message ."\n"; $con->login($ftp_usr,$ftp_pass) or die "Cannot login: ". $con->message ."\n"; $con->cwd($ftp_path) or die "Cannot change to $ftp_path dir\n".$con->message ."\n"; my @ls = $con->ls('.') or die "Cannot perfom ls command\n".$con->message."\n"; #print "$_\n" foreach @ls; my $what; foreach $what (@ls) { print "$what\n"; if (-d $what) { print "DIR DEBUG\n"; print "$what is a dir\n"; }elsif (-f $what) { print "FILE DEBUG\n"; print $what .' is a file '.$con->size($what)."\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use (of) Net::FTP for updating
by LazerRed (Pilgrim) on Jun 26, 2003 at 01:48 UTC | |
|
Re: use (of) Net::FTP for updating
by antirice (Priest) on Jun 26, 2003 at 01:42 UTC | |
by atnonis (Monk) on Jun 26, 2003 at 02:05 UTC | |
by atnonis (Monk) on Jun 26, 2003 at 02:58 UTC | |
by antirice (Priest) on Jun 26, 2003 at 04:07 UTC | |
by LazerRed (Pilgrim) on Jun 27, 2003 at 16:44 UTC | |
|
Re: use (of) Net::FTP for updating
by aquarium (Curate) on Jun 26, 2003 at 04:56 UTC |