Jag Thripp wrote:
Hello first question, maybe one of many!
Hello,
Code running on a windows machine connecting to Linux box. I am trying to capture an ls\dir command into a file from an FTP connection, similar to ls -lA > Ls.txt. I am trying to monitor files in a folder on a remote Red Hat server to make sure that the files do not get out of sequence. Sample code to date. use Net::FTP; use warnings; use diagnostics; my $filename; print "Retrieving file listing from Red hat machine\n"; my $ftp=Net::FTP->new("Red hat machine ", Debug => 0) or die "Cannot locate Red hat machine: $@ "; $ftp->login($usernam,$passwd) or die "Cannot login ", $ftp->message; $ftp->cwd("/some/path") or die "Cannot change working directory ", $ftp->message; $ftp->ls;
open my $FH, '>', 'Ls.txt' or die "Cannot open 'Ls.txt' $!"; print $FH $ftp->ls; close $FH;
$ftp->quit;
John -- The programmer is fighting against the two most destructive forces in the universe: entropy and human stupidity. -- Damian Conway -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/