bofh_of_oz has asked for the wisdom of the Perl Monks concerning the following question:
Even though this behaviour seems logical to me, I cannot reproduce the same functionality when I use PKZIP/Winzip/any other utility... Is that an 'undocumented feature' of Perl or what?
The code used is here:
use Archive::Zip qw(:CONSTANTS :ERROR_CODES); use IO::Scalar; my $fname = 'file1.txt'; my $zipfile = 'filename.zip'; my $zip = Archive::Zip -> new(); if (-e $zipfile) { $zip ->read($zipfile); } my $member = $zip->memberNamed( $fname ); if ($member eq undef) { $member = $zip->addFile( $fname ); } $member -> desiredCompressionLevel( 9 ); $fname = 'autotransParams.txt'; $member = $zip->memberNamed( $fname ); if ($member eq undef) { $member = $zip->addFile( $fname ); } $member -> desiredCompressionLevel( 9 ); my $status = $zip -> overwriteAs($zipfile);
--------------------------------
An idea is not responsible for the people who believe in it...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple copies of the same file in same ZIP archive
by thundergnat (Deacon) on May 31, 2005 at 19:11 UTC | |
|
Re: Multiple copies of the same file in same ZIP archive
by marnanel (Beadle) on May 31, 2005 at 19:13 UTC | |
|
Re: Multiple copies of the same file in same ZIP archive
by PodMaster (Abbot) on May 31, 2005 at 18:38 UTC |