Subject: | extractMember method corrupts archive |
First, I've to say that Archive::Zip is a really nice and extremely use full module - nearly each of my applications uses it.
I'm using Archive::Zip on an AIX (AIX aix-ff9 3 4 004434FA4C00) with perl 5.8.0. I know these version both are pretty old (ok: completely out of date and unsopported) but I cannot upgrade any of these because the server is running important production systems :-(
I used Archive::Zip 0.11 for a very long time and I wanted to upgrade to 1.x (in order to use the overwrite and addTree methods). But after the upgrade the perl programs that use Archive::Zip did not work at all. I have reduced the error to a small program inserted below. It works fine under Archive::Zip 0.11 but produces the error listed below when I use Arche::Zip 1.14.
If I comment out the line
$Z1->extractMemberWithoutPaths( "t.pl" , "x.pl" );
everything works fine.
Can you give me a hint?
Thanks in advance
Helge
Here's the program:
=== SNIP ===
#!/usr/bin/perl
use strict;
use lib '/projects/patent/d03/bin/temp/az/Archive-Zip-1.14/blib/lib';
use Archive::Zip 0.11 qw( :ERROR_CODES :CONSTANTS );
my $Z0 = Archive::Zip->new();
$Z0->addFile( "t.pl" );
$Z0->writeToFileNamed( "test.zip" );
my $Z1 = Archive::Zip->new();
$Z1->read( "test.zip" );
$Z1->extractMemberWithoutPaths( "t.pl" , "x.pl" );
$Z1->writeToFileNamed( "test2.zip" );
=== SNIP ===
And here's the output:
=== SNIP ===
IO error: reading data :
Archive::Zip::ZipFileMember::_readRawChunk('Archive::Zip::ZipFileMember=HASH(0x203dcfb4)','SCALAR(0x203e2b04)',83) called at /projects/patent/d03/bin/temp/az/Archive-Zip-1.14/blib/lib/Archive/Zip.pm line 2048
Archive::Zip::Member::readChunk('Archive::Zip::ZipFileMember=HASH(0x203dcfb4)',32768) called at /projects/patent/d03/bin/temp/az/Archive-Zip-1.14/blib/lib/Archive/Zip.pm line 2344
Archive::Zip::Member::_writeData('Archive::Zip::ZipFileMember=HASH(0x203dcfb4)','IO::File=GLOB(0x203b7df8)') called at /projects/patent/d03/bin/temp/az/Archive-Zip-1.14/blib/lib/Archive/Zip.pm line 2313
Archive::Zip::Member::_writeToFileHandle('Archive::Zip::ZipFileMember=HASH(0x203dcfb4)','IO::File=GLOB(0x203b7df8)',1,0) called at /projects/patent/d03/bin/temp/az/Archive-Zip-1.14/blib/lib/Archive/Zip.pm line 778
Archive::Zip::Archive::writeToFileHandle('Archive::Zip::Archive=HASH(0x2005df74)','IO::File=GLOB(0x203b7df8)',1) called at /projects/patent/d03/bin/temp/az/Archive-Zip-1.14/blib/lib/Archive/Zip.pm line 756
Archive::Zip::Archive::writeToFileNamed('Archive::Zip::Archive=HASH(0x2005df74)','test2.zip') called at ./t.pl line 14