I have spent a lot of time and finally installed and made folder copy successfully,
from the source data folder (to_be_copied) on C:
to a target folder (Coped_to) on a network drive (for instance Z
.
However, I need to do folder comparison between these two folders to make sure the data are consistent without file corruption.
I found online states that File
ircmp is PASS and good to use. I installed it successfully on my Windows 2003 server and a Windows XP.
I copied 62 files in the datafolder from C: to Z: Thereafter,
I found that even I delete 2 files in the target folder (made 60 files left) on Z: before comparing, the File_Dircmp module still reports 62 files and no error!
The Perl code is:
-----------------------------------------------------------
use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
my $dataSource = "datafolder";
$locomp = Win32::NodeName(); #need to modify in Linux-Mac
my $dataDestin = @ARGV[0].":/"."_".$locomp."_WRITE";
my $diff=1;
my $suppress=1;
my $num_of_files_and_dirs = dircopy($dataSource,$dataDestin) || die "fail to copy";
print "falling sleep\n";
sleep 30; #during this 30 seconds for deleting 2 files in the target folder on Z:
print "woke up\n";
use File
ircmp; #run folder compare similar to "diff /b ...." in Linux
my @r = dircmp($dataDestin, $dataSource, $diff, $suppress) || die "fail to compare";
foreach (@r) {
print $_." files had been compared\n";
}
---------------------------------------------------------
Question:
1. Why in Linux, many online articles shown a lot of decent reports automatically generated by 'dircmp'; but in Windows there is none or not even echo in DOS command line?
2. When I use $suppress=1, at line 34 -->my @r = dircmp (.................; will fail to run.
==>Perl reported error: "fail to compare at copyfolder-fc.pl line 34".
3. When I use $suppress=0, starts to run the command line; after Perl reports 'falling sleep', deleted 2 files in the target folder on Z: ; after Perl reports 'woke up', it reports no error at all, period!
The command line and result:
---------------------------------------
==>perl copyfolder-fc.pl z
falling sleep
woke up
62 files had been compared.
---------------------------------------
Obviously 'dircmp' failed to do what it supposed to do in Windows!
What is going on?
What is wrong with it?
Please HELP!!!!!!!!!!!!!
Thanks in advanced.
from the source data folder (to_be_copied) on C:
to a target folder (Coped_to) on a network drive (for instance Z

However, I need to do folder comparison between these two folders to make sure the data are consistent without file corruption.
I found online states that File

I copied 62 files in the datafolder from C: to Z: Thereafter,
I found that even I delete 2 files in the target folder (made 60 files left) on Z: before comparing, the File_Dircmp module still reports 62 files and no error!
The Perl code is:
-----------------------------------------------------------
use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
my $dataSource = "datafolder";
$locomp = Win32::NodeName(); #need to modify in Linux-Mac
my $dataDestin = @ARGV[0].":/"."_".$locomp."_WRITE";
my $diff=1;
my $suppress=1;
my $num_of_files_and_dirs = dircopy($dataSource,$dataDestin) || die "fail to copy";
print "falling sleep\n";
sleep 30; #during this 30 seconds for deleting 2 files in the target folder on Z:
print "woke up\n";
use File

my @r = dircmp($dataDestin, $dataSource, $diff, $suppress) || die "fail to compare";
foreach (@r) {
print $_." files had been compared\n";
}
---------------------------------------------------------
Question:
1. Why in Linux, many online articles shown a lot of decent reports automatically generated by 'dircmp'; but in Windows there is none or not even echo in DOS command line?
2. When I use $suppress=1, at line 34 -->my @r = dircmp (.................; will fail to run.
==>Perl reported error: "fail to compare at copyfolder-fc.pl line 34".
3. When I use $suppress=0, starts to run the command line; after Perl reports 'falling sleep', deleted 2 files in the target folder on Z: ; after Perl reports 'woke up', it reports no error at all, period!
The command line and result:
---------------------------------------
==>perl copyfolder-fc.pl z
falling sleep
woke up
62 files had been compared.
---------------------------------------
Obviously 'dircmp' failed to do what it supposed to do in Windows!
What is going on?
What is wrong with it?
Please HELP!!!!!!!!!!!!!
Thanks in advanced.