Your script (slightly modified) works for me:
use strict; use Archive::Zip qw(:CONSTANTS :ERROR_CODES); use File::Temp; warn "Using Archive::Zip $Archive::Zip::VERSION"; my $tmp = $ENV{'TEMP'}.'/zip/extractMember'; my $zip = Archive::Zip->new(); if ($zip->read('tmp2.zip') != AZ_OK) { die 'Einlesen klappt nicht.'; } foreach my $member ($zip->members()) { print($member->fileName()."\n"); my $target = File::Temp::tempnam($tmp, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXX'); print "First"; $member->extractToFileNamed($target); print "\n"; print "Second"; $target = File::Temp::tempnam($tmp, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +X'); $member->extractToFileNamed($target); print "\n"; } __END__ Using Archive::Zip 1.23 at tmp.pl line 5. tmp2.txt First Second
Note that I'm using an older version of Archive::Zip here. I also don't get the warning about the CRC32 mismatch:
format error: CRC or size mismatch while skipping data descriptor at C:/Programme/Perl/lib/Archive/Zip/ZipFileMember.pm line 189
Are you sure that your archive is OK? I created my test archive using 7zip.
I'll be upgrading to Archive::Zip 1.30 and retest.
Update: Upgraded to Archive::Zip 1.30 and it still works for me:
Using Archive::Zip 1.30 at tmp.pl line 5. tmp2.txt First Second
My guess is that your zip file is broken.
In reply to Re^2: unable to extract same file twice using Archive::Zip
by Corion
in thread unable to extract same file twice using Archive::Zip
by Pickwick
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |