in reply to Re: Start windows .exe
in thread Start windows .exe
use IO; use File::Copy; use Fcntl ':mode'; use warnings; use Net::ftp; use Net::Ping; use Time::localtime; use POSIX ":sys_wait_h"; system ("color 1f"); my $indir = ".\\in"; my $outdir = ".\\out"; my $expr = "*.*"; my $RemFile = "*.*"; my $d; if ( ! -e $indir ){ print "$indir does not exist, attempting to create\n"; mkdir ($indir, 0777 ) or die "Can not create $indir: $!"; } if ( ! -e $outdir ) { print "$outdir does not exist, attempting to create\n"; mkdir ($outdir, 0777 ) or die "Can not create $outdir: $!"; } while(1){ $d = new IO::Dir "$indir"; tie %dir, IO::Dir, "$indir"; foreach (keys %dir) { #if the expr is found in the InDir it will be FTP'd if( ! S_ISDIR($dir{$_}->mode) && /^$expr/ ) { if($pid = fork){ waitpid(-1, &WNOHANG); } else{ $RemFile = $_; #move the file to the out directory move( "$indir/$_", "$_"); #chdir ($outdir); print "Starting to FTP: $_\n"; system("FTP_Client.exe $_"); print "Finished: $_ \n\n"; move( "$_", "$outdir/$_"); exit(1); } } #sleep(5); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Start windows .exe
by NateTut (Deacon) on Jul 14, 2005 at 12:55 UTC | |
|
Re^3: Start windows .exe
by NateTut (Deacon) on Jul 14, 2005 at 13:14 UTC |