padawan_linuxero has asked for the wisdom of the Perl Monks concerning the following question:
my @fileList = glob "m*.*"; foreach my $file (@fileList) { chomp($file); if ( $file =~ /.+\.\d{1,}/ ) { # one or more characters, a '.' foll +owed by one or more digits print STDOUT "<Nombre valido del Archivo> " . $file . "\n"; my $server = "xxx.xx.xx.xx"; my $username = "xxxxx"; my $pass = "xxxxxxxxxx"; my $ftp; print "Connecting to $server.."; # Set up connection $ftp = Net::FTP->new( $server, Passive => 1, Debug => 0 ) o +r die $@; print "..authenticating.."; # Log in... $ftp->login( $username, $pass ) or die $ftp->message; print "..done!\n"; $ftp->cwd('Envio') or die $ftp->message; print $ftp->pwd (), "\n"; $ftp->ascii(); $ftp->put("$file") or die $ftp->message; print "Logging out.."; #or die $ftp->message; $ftp->quit; print "..done!\n"; } else { print STDOUT "<Nombre Invalido del Archivo> " . $file . "\n"; } } for (@transferFileList) { print "$_\n"; system ("del",$_); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to make sure a file send by ftp get to the server complete???
by NetWallah (Canon) on Apr 17, 2008 at 03:18 UTC | |
|
Re: How to make sure a file send by ftp get to the server complete??? (rename after)
by tye (Sage) on Apr 17, 2008 at 03:36 UTC | |
by nbartusi (Scribe) on Apr 17, 2008 at 13:27 UTC | |
|
Re: How to make sure a file send by ftp get to the server complete???
by swampyankee (Parson) on Apr 17, 2008 at 01:05 UTC | |
|
Re: How to make sure a file send by ftp get to the server complete???
by poolpi (Hermit) on Apr 17, 2008 at 06:35 UTC | |
|
Re: How to make sure a file send by ftp get to the server complete???
by salva (Canon) on Apr 17, 2008 at 09:45 UTC | |
|
Re: How to make sure a file send by ftp get to the server complete???
by apl (Monsignor) on Apr 17, 2008 at 11:56 UTC |