try to recursively compare two folders (File::dircmp)

J

jiing24

I searched CPAN and found a module that is called
File::Dircmp(http://search.cpan.org/~schulte/File-Dircmp-1.30/Dircmp.pm)
, and I think it may be useful.

There are two folders, name '1' and '2' in my C:\ under windows. I
want to compare all the files in them recursively.
I have already use ppm to install File::Dircmp and successfully.

And wrote the code as following:

use strict;
use warnings;

use File::Dircmp;

my $dir1= "c:\\1\\";
my $dir2= "c:\\2\\";
my $diff= 1;
my $suppress = 1;

my @r = dircmp($dir1, $dir2, $diff, $suppress);

There are lots of warnings, but I can not figure out the argument $diff
and $suppress. Could anyone help me?

Thanks in advanced..

/jiing/
 
M

Mark Bole

I searched CPAN and found a module that is called
File::Dircmp(http://search.cpan.org/~schulte/File-Dircmp-1.30/Dircmp.pm)
, and I think it may be useful.
[...]

my @r = dircmp($dir1, $dir2, $diff, $suppress);

There are lots of warnings, but I can not figure out the argument $diff
and $suppress. Could anyone help me?

Some versions of Unix have a similar command "dircmp" -- it can be very
useful for system administration tasks. By default it lists the files
that are only in dir1, the files only in dir2, and for the files that
are common to both dirs, whether they are identical or not.

"diff" means, for the differing files, actually show the differing
contents, not just the filename. "suppress" means don't bother listing
filenames that are identical in both dirs.

-Mark Bole
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top