On Thu, 25 Jul 2002, William Black wrote:
> Hi All,
>
> I need an idea on how to approach a script. Say I had a directory X with 50
> files in it and I have another directory Y that is suppose to have the same
> exact files in it as X. How could someone approach checking directory Y
> aginst X to see if they had the same files?
By the same file if you mean same contents, check out File::Compare
The approach would be something like this.
use File::Compare;
opendir (DIRX, $dirX) or die ".....";
while (my $xfile = readdir(DIRX)) {
if (compare($xfile, "$dirY/$xfile") != 0) {
print "Your error messages";
}
}
closedir (DIRX);
Note, you will have to add a check to see if the number of files in dir X
and dir Y are the same.
>
> Thks,
>
>
> William Black
>
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]