# sierrathedog04, jonathansamuel@yahoo.com, August 2001 # place this script in the target directory and # pass it the name of the source directory from the # command line. # This utility requires that the diff command works on the user's system. use strict; my $sourceDir = shift || die "Please pass the name of a source directory enclosed in quotes. \n"; chomp $sourceDir; $sourceDir =~ s/\/\$/\$/; unless (-d $sourceDir) { die "$sourceDir is not a valid source directory. Please pass the name of a valid source directory enclosed in quotes. \n"; } opendir THISDIR, "."; my @allFiles = readdir THISDIR; closedir THISDIR; foreach (@allFiles) { if (-e "$sourceDir/$_") { print "$_ in target differs from that in source directory $sourceDir\n" if `diff $_ $sourceDir/$_`; } else { print "$_ found in target but not in source directory $sourceDir\n"; } } print "\nFinished checking target\n"; opendir SOURCEDIR, $sourceDir; my @allSourceFiles = readdir SOURCEDIR; foreach (@allSourceFiles) { unless (-e "./$_") { print "$_ found in source directory $sourceDir but not in target\n"; } }