Created
February 15, 2014 21:39
-
-
Save parastuffs/9025560 to your computer and use it in GitHub Desktop.
Check crc32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
#use diagnostics; | |
use String::CRC32; | |
open(FD1, "ls |"); | |
my @files = <FD1>; | |
foreach my $f (@files) { | |
$f =~ s/\n//; | |
open(FD2,$f); | |
my $crc = crc32(*FD2); | |
close(FD2); | |
$crc = uc sprintf('%08x',$crc); | |
if($f =~ /\Q$crc/) { | |
print "$f\t OK\n"; | |
} | |
else { | |
print "\t >>Please check $f \t $crc\n"; | |
} | |
} | |
close(FD1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment