# sierrathedog04, jonathansamuel@yahoo.com, August 2001 # First parameter is the target or VOB directory. # Optional second parameter is the source or current directory. # Ver. 1.1, Sept. 13, 2001. Now uses File::Compare instead of diff; # Modified printouts so only files are listed. (Not directories). use strict; require File::Compare; print "\n"; my $targetDir = shift || die "Please pass the name of a target directory enclosed in quotes. \n"; chomp $targetDir; $targetDir =~ s#/$##; # Removes any trailing forward slash from the directory. unless (-d $targetDir) { die "$targetDir is not a valid target directory. Please pass the name of a valid target directory enclosed in quotes. \n"; } my $sourceDir = shift || "."; opendir THISDIR, $sourceDir; my @allFiles = grep { $_ ne '.' and $_ ne '..' && -f $_} readdir THISDIR; closedir THISDIR; foreach (@allFiles) { print "$_ in source directory $sourceDir differs from that in target directory $targetDir\n\n" if File::Compare::compare("$sourceDir/$_", "$targetDir/$_") == 1; print "$_ found in source directory $sourceDir but not in target directory $targetDir\n\n" if File::Compare::compare("$sourceDir/$_", "$targetDir/$_") < 0; } print "\n...Finished checking source.\n\n\n"; opendir targetDIR, $targetDir; my @alltargetFiles = grep { $_ ne '.' and $_ ne '..' && -f $_} readdir targetDIR; foreach (@alltargetFiles) { print "$_ found in target directory $targetDir but not in source directory $sourceDir\n\n" if File::Compare::compare("$sourceDir/$_", "$targetDir/$_") < 0; }