Using perl Syntax Highlighting
- #!/usr/bin/perl
- use Net::FTP;
- use Net::FTP::File;
- my $ftp_site = 'ftp.sitio.com';
- my $port = '21';
- my $ftp_dir = 'PDF';
- my $ftp_user = 'usuario';
- my $ftp_password = 'password';
- my $dir;
- my $file;
- my $dirOUT;
- my $ftp = Net::FTP->new($ftp_site, Debug => 0, Port => $port, Passive => 1, Binary => 1);
- $ftp->login($ftp_user, $ftp_password);
- $ftp->cwd($ftp_dir);
- $dir="/home/mario/PDF/IN/";
- $dirOUT="/home/mario/PDF/OUT/";
- opendir(DIR, $dir);
- foreach $file (readdir(DIR))
- {
- if(($file ne ".") && ($file ne ".."))
- {
- $ftp->put("$dir/$file",$file);
- system("mv $dir/$file $dirOUT/$file");
- print "Transfer file : $file\n";
- }
- }
- $ftp->quit();
Coloreado en 0.004 segundos, usando GeSHi 1.0.8.4