CC: | Alan Haggai Alavi <alanhaggai [...] alanhaggai.org> |
Subject: | CRC Error on Second Extraction of File |
Date: | Sun, 22 Jan 2012 21:52:13 -0800 |
To: | bug-archive-zip [...] rt.cpan.org |
From: | "David E. Wheeler" <david [...] justatheory.com> |
First download this zip file:
http://api.pgxn.org/dist/sha/1.1.0/sha-1.1.0.zip
Then Run this command:
perl -MArchive::Zip -E 'my $z = Archive::Zip->new; $z->read(shift); $z->extractTree; say +($z->membersMatching(qr{sha-1.1.0/README}))[0]->contents' sha-1.1.0.zip
The output should be something like:
Show quoted text
> format error: CRC or size mismatch while skipping data descriptor
> at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Archive/Zip/ZipFileMember.pm line 189
> Archive::Zip::ZipFileMember::_skipLocalFileHeader('Archive::Zip::ZipFileMember=HASH(0x1f16cc8)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Archive/Zip/ZipFileMember.pm line 395
> Archive::Zip::ZipFileMember::rewindData('Archive::Zip::ZipFileMember=HASH(0x1f16cc8)') called at /var/virtuals/pgxn/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Archive/Zip/Member.pm line 960
> Archive::Zip::Member::contents('Archive::Zip::ZipFileMember=HASH(0x1f16cc8)') called at -e line 1
> 3
Then try the same command, but remove the `extractTree` call:
perl -MArchive::Zip -E 'my $z = Archive::Zip->new; $z->read(shift); say +($z->membersMatching(qr{sha-1.1.0/README}))[0]->contents' sha-1.1.0.zip
The README file contents will be output with no errors.
I realize that there may be something wonky with this zip file, but I don’t understand why the README’s contents can be extracted once without error, but not a second time. Thoughts?
Thanks,
David
Message body not shown because it is not plain text.