in reply to Comparing checksums of local/remote files.
As for your code - you should check the size of the file too as well as the CRC. The CRC has roughly a 1 chance in 2^32 of failing to detect an error. If you constrain that further by checking the length of the file then you'll add several orders of magnitude to that number (depending on the lengths of your files of course).
If you could install a module on the far end then I'd install Digest::MD5 and use that. If you can't install any stuff then what you've got looks pretty good to me.# Same to here then my @gg = split /\s+/, $g; my @hh = split /\s+/, $h; die "Files do not match" if $gg[0] != $hh[0] || $gg[1] != $hh[1];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Comparing checksums of local/remote files.
by Nooks (Monk) on Aug 31, 2000 at 03:41 UTC |