We could better help you if you showed us the actual code you used with extractMember and addFile. When I use those, it works fine.
#!perl use strict; use warnings; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); # Include actual filenames in the next three lines my $oldfile = 'oldzip.zip'; my $newfile = 'newzip.zip'; my @wanted = ( 'perl.log', 'perld.log' ); my $oldzip = Archive::Zip->new(); $oldzip->read( $oldfile ) == AZ_OK or die 'read error'; my $newzip = Archive::Zip->new(); for my $file ( @wanted ) { $oldzip->extractMember( $file ); $newzip->addFile( $file ); } $newzip->writeToFileNamed( $newfile ) == AZ_OK or die 'error somewhere +';
In reply to Re: Archive::Zip - How to selectively copy files from one archive to another one?
by Mr. Muskrat
in thread Archive::Zip - How to selectively copy files from one archive to another one?
by Gigabyte1907
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |