Ronnie has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w # use Net::FTP ; # Used because se +ctran requires a responder on the PC # # ############################################################### # FTP Variables # ############################################################### # my $file_in = "TRISCAN.txt.*" ; my $password = 'summit' ; my $username = 'summitelse' ; my $host = 'PCxxxx' ; my $ftp = undef ; my $msg = undef ; # #################################################################### # P R O C E S S I N G # #################################################################### # print "\n\tNet::FTP Test begins\n" ; # if ($ftp = Net::FTP->new($host, Debug => 0, Timeout => 10)) { print "\n\tFTP Connection established with $host\n" ; } else { $msg = "\n\tFTP Connection failed with $host\n" ; print $msg ; exit 0 ; } # ################################################################ # Login with the username/password details # ################################################################ # if ($ftp->login($username,$password)) { print "\n\t$username login accepted\n" ; } else { $msg = "Username $username or password invalid!" ; print "\n\t$msg\n" ; exit 0 ; } # ############################################################### # Try and get the file # ############################################################### # if ($ftp->get("$file_in")) { print "\n\tYippee we goat the bleedin' file!\n" ; } else { $msg = "Oh Frag we didnae get the blighter!" ; print "\n\t$msg\n" ; exit 0 ; } # ############################################################## # Try and quit the FTP # ############################################################## # $ftp->quit ; # ###################################################################### +##### # Check that the transfer went okay. If the file doesn't exist the + # # transfer definitely failed. + # ###################################################################### +##### # if (! -e $file_in) { $msg = "No $file_in exists after FTP has completed" ; exit 0 ; } # ############################################################# # Toodle pip # ############################################################# # print "\n\tNet::FTP Test Ends\n" ;
READMORE tags added by Arunbear
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FTP & MD5
by thor (Priest) on Jun 21, 2005 at 13:42 UTC | |
by Fletch (Bishop) on Jun 21, 2005 at 13:46 UTC | |
by shiza (Hermit) on Jun 22, 2005 at 00:13 UTC | |
|
Re: FTP & MD5
by bofh_of_oz (Hermit) on Jun 21, 2005 at 13:42 UTC | |
|
Re: FTP & MD5
by anonymized user 468275 (Curate) on Jun 21, 2005 at 14:07 UTC | |
by bofh_of_oz (Hermit) on Jun 21, 2005 at 14:12 UTC | |
by kral (Monk) on Jun 22, 2005 at 07:49 UTC | |
by Eyck (Priest) on Jun 22, 2005 at 09:50 UTC | |
by kral (Monk) on Jun 22, 2005 at 11:58 UTC | |
by bofh_of_oz (Hermit) on Jun 22, 2005 at 13:25 UTC | |
by kral (Monk) on Jun 22, 2005 at 14:30 UTC | |
by Eyck (Priest) on Jun 22, 2005 at 06:45 UTC | |
by bofh_of_oz (Hermit) on Jun 22, 2005 at 13:41 UTC | |
by Eyck (Priest) on Jun 23, 2005 at 07:11 UTC |