in reply to Re^2: Script to check for multiple files on FTP and print the one missing
in thread Script to check for multiple files on FTP and print the one missing
However, as I do not know the format of @directory_listing, you might need some extra processing where indicated on line 12.use strict; use warnings; my @files_to_check = ( 'abc.txt', 'xyz.txt', 'efg.txt' ); # list +of files to check my @directory_listing = $ftp->ls($dir); my %files_on_FTP_server; foreach my $file (@directory_listing) { # extra processing here? $files_on_FTP_server{$file} = 1; } foreach my $file (@files_to_check) { if ( ! $files_on_FTP_server{$file} ) { print "File $file is missin +g\n"; } }
|
|---|