Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/perl/bin/perl -w use strict; use warnings; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use File::Find; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); $|=1; my $dir; my $zip ; my $zipped; print header(); #=comment # Read a Zip file my $somezip = Archive::Zip->new(); unless ( $somezip->read( 'c:/dir_test/cgi-bin/test/error.zip' ) == +AZ_OK ) { die 'read error'; } # Change the compression type for a file in the Zip my $member = $somezip->memberNamed( 'unzipped.txt' ); $member->desiredCompressionMethod(COMPRESSION_DEFLATED); unless ( $zip->writeToFileNamed( 'some.zip' ) == AZ_OK ) { die 'write error'; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unzipping a File
by Hofmator (Curate) on Nov 14, 2006 at 15:42 UTC | |
| |
|
Re: Unzipping a File
by andyford (Curate) on Nov 14, 2006 at 15:40 UTC | |
| |
|
Re: Unzipping a File
by ahmad (Hermit) on Nov 14, 2006 at 19:49 UTC | |
|
Re: Unzipping a File
by chanakya (Friar) on Nov 15, 2006 at 07:38 UTC | |
by Anonymous Monk on Nov 15, 2006 at 13:26 UTC |