stevee has asked for the wisdom of the Perl Monks concerning the following question:
Hi Venerable Monks,
I am struggling with a corrupt zip archive (another story really!) but to help me in wading through the analysis I have written the following code:
Thanks
Stevee
Now the zip archive is 5,914,271KB big, but running the above the count only gets to 22,780,549 bytes (giving a text output file of length 66,740KB). Obviously I am not reading the whole file in, but I can not see why. Does any Learned Brother or Sister have any idea?open (FILE, "< i:\\lenova_2008-03-28.zip"); open (OUT, "> i:\\fullhexdump.txt"); binmode(FILE); $count=0; while (<FILE>) { $count++; read(FILE, $buf, 1); $byte = unpack "H*", $buf; print "$byte"; print OUT "$byte "; } close FILE; close OUT; print "\n\n$count\n\n";
Thanks
Stevee
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Missing bytes??
by Corion (Patriarch) on Apr 06, 2008 at 15:36 UTC | |
by ikegami (Patriarch) on Apr 06, 2008 at 16:22 UTC | |
by stevee (Acolyte) on Apr 06, 2008 at 15:40 UTC | |
by Anonymous Monk on Apr 07, 2008 at 09:26 UTC | |
Re: Missing bytes??
by jwkrahn (Abbot) on Apr 06, 2008 at 18:19 UTC |
Back to
Seekers of Perl Wisdom