in reply to Archive::Zip - How to selectively copy files from one archive to another one?
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 +';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Archive::Zip - How to selectively copy files from one archive to another one?
by Gigabyte1907 (Initiate) on Aug 11, 2012 at 18:08 UTC | |
by Mr. Muskrat (Canon) on Aug 12, 2012 at 21:53 UTC |