summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/IO
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-21 00:15:27 +0000
committerKarl Berry <karl@freefriends.org>2012-05-21 00:15:27 +0000
commita4c42bfb2337d37da89d789cb8cc226367994e32 (patch)
treec3eabdef5d565a4e515d2be0d9d4d0540bde0250 /Master/tlpkg/tlperl/lib/IO
parent8274475057f024d35332ac47c2e2f23ea156e6ed (diff)
perl 5.14.2 from siep
git-svn-id: svn://tug.org/texlive/trunk@26525 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/IO')
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Bzip2.pm6
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Deflate.pm6
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Identity.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Base.pm6
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Base/Common.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm10
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm20
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Gzip.pm26
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Gzip/Constants.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/RawDeflate.pm22
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Zip.pm83
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Zip/Constants.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Constants.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Extra.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Dir.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/IO/File.pm12
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Handle.pm25
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Pipe.pm8
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Poll.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Select.pm16
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Socket.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Bunzip2.pm6
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Identity.pm6
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Inflate.pm6
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/AnyInflate.pm30
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/AnyUncompress.pm46
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/Base.pm47
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/Bunzip2.pm10
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/Gunzip.pm26
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/Inflate.pm20
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/RawInflate.pm22
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Uncompress/Unzip.pm114
32 files changed, 342 insertions, 259 deletions
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Bzip2.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Bzip2.pm
index 3e2e89f8e12..c3718d1f0df 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Bzip2.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Bzip2.pm
@@ -4,13 +4,13 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(:Status);
+use IO::Compress::Base::Common 2.033 qw(:Status);
#use Compress::Bzip2 ;
-use Compress::Raw::Bzip2 2.024 ;
+use Compress::Raw::Bzip2 2.033 ;
our ($VERSION);
-$VERSION = '2.024';
+$VERSION = '2.033';
sub mkCompObject
{
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Deflate.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Deflate.pm
index f23a9819c67..33e56d08a04 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Deflate.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Deflate.pm
@@ -4,12 +4,12 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(:Status);
+use IO::Compress::Base::Common 2.033 qw(:Status);
-use Compress::Raw::Zlib 2.024 qw(Z_OK Z_FINISH MAX_WBITS) ;
+use Compress::Raw::Zlib 2.033 qw(Z_OK Z_FINISH MAX_WBITS) ;
our ($VERSION);
-$VERSION = '2.024';
+$VERSION = '2.033';
sub mkCompObject
{
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Identity.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Identity.pm
index 16f14d8e7f3..21a0be41080 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Identity.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Adapter/Identity.pm
@@ -4,10 +4,10 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(:Status);
+use IO::Compress::Base::Common 2.033 qw(:Status);
our ($VERSION);
-$VERSION = '2.024';
+$VERSION = '2.033';
sub mkCompObject
{
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Base.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Base.pm
index 5a20f60007b..d0d585ce761 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Base.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Base.pm
@@ -6,7 +6,7 @@ require 5.004 ;
use strict ;
use warnings;
-use IO::Compress::Base::Common 2.024 ;
+use IO::Compress::Base::Common 2.033 ;
use IO::File ;
use Scalar::Util qw(blessed readonly);
@@ -20,7 +20,7 @@ use bytes;
our (@ISA, $VERSION);
@ISA = qw(Exporter IO::File);
-$VERSION = '2.024';
+$VERSION = '2.033';
#Can't locate object method "SWASHNEW" via package "utf8" (perhaps you forgot to load "utf8"?) at .../ext/Compress-Zlib/Gzip/blib/lib/Compress/Zlib/Common.pm line 16.
@@ -974,7 +974,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Base/Common.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Base/Common.pm
index 4f8b4dadc36..1b38c59846a 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Base/Common.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Base/Common.pm
@@ -11,7 +11,7 @@ use File::GlobMapper;
require Exporter;
our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE);
@ISA = qw(Exporter);
-$VERSION = '2.024';
+$VERSION = '2.033';
@EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput
isaFileGlobString cleanFileGlobString oneTarget
@@ -635,7 +635,7 @@ sub IO::Compress::Base::Parameters::parse
++ $parsed{$canonkey};
return $self->setError("Muliple instances of '$key' found")
- if $parsed && $type & Parse_multiple == 0 ;
+ if $parsed && ($type & Parse_multiple) == 0 ;
my $s ;
$self->_checkType($key, $value, $type, 1, \$s)
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm
index 2a85ef55b19..5d478d91bd2 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm
@@ -5,16 +5,16 @@ use warnings;
use bytes;
require Exporter ;
-use IO::Compress::Base 2.024 ;
+use IO::Compress::Base 2.033 ;
-use IO::Compress::Base::Common 2.024 qw(createSelfTiedObject);
-use IO::Compress::Adapter::Bzip2 2.024 ;
+use IO::Compress::Base::Common 2.033 qw(createSelfTiedObject);
+use IO::Compress::Adapter::Bzip2 2.033 ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error);
-$VERSION = '2.024';
+$VERSION = '2.033';
$Bzip2Error = '';
@ISA = qw(Exporter IO::Compress::Base);
@@ -51,7 +51,7 @@ sub getExtraParams
{
my $self = shift ;
- use IO::Compress::Base::Common 2.024 qw(:Parse);
+ use IO::Compress::Base::Common 2.033 qw(:Parse);
return (
'BlockSize100K' => [0, 1, Parse_unsigned, 1],
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm
index 0f46e59d3a4..20329bb4284 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm
@@ -6,16 +6,16 @@ use bytes;
require Exporter ;
-use IO::Compress::RawDeflate 2.024 ;
+use IO::Compress::RawDeflate 2.033 ;
-use Compress::Raw::Zlib 2.024 ;
-use IO::Compress::Zlib::Constants 2.024 ;
-use IO::Compress::Base::Common 2.024 qw(createSelfTiedObject);
+use Compress::Raw::Zlib 2.033 ;
+use IO::Compress::Zlib::Constants 2.033 ;
+use IO::Compress::Base::Common 2.033 qw(createSelfTiedObject);
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError);
-$VERSION = '2.024';
+$VERSION = '2.033';
$DeflateError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
@@ -281,8 +281,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<deflate> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -327,6 +325,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -394,8 +394,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any compressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all compressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all compressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -923,7 +923,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Gzip.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Gzip.pm
index 1978b91b283..2a7894257d4 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Gzip.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Gzip.pm
@@ -8,12 +8,12 @@ use warnings;
use bytes;
-use IO::Compress::RawDeflate 2.024 ;
+use IO::Compress::RawDeflate 2.033 ;
-use Compress::Raw::Zlib 2.024 ;
-use IO::Compress::Base::Common 2.024 qw(:Status :Parse createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.024 ;
-use IO::Compress::Zlib::Extra 2.024 ;
+use Compress::Raw::Zlib 2.033 ;
+use IO::Compress::Base::Common 2.033 qw(:Status :Parse createSelfTiedObject);
+use IO::Compress::Gzip::Constants 2.033 ;
+use IO::Compress::Zlib::Extra 2.033 ;
BEGIN
{
@@ -27,7 +27,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError);
-$VERSION = '2.024';
+$VERSION = '2.033';
$GzipError = '' ;
@ISA = qw(Exporter IO::Compress::RawDeflate);
@@ -141,9 +141,9 @@ sub ckParams
if ( ! $got->parsed('ExtraFlags')) {
$got->value('ExtraFlags' => 2)
- if $got->value('Level') == Z_BEST_SPEED ;
- $got->value('ExtraFlags' => 4)
if $got->value('Level') == Z_BEST_COMPRESSION ;
+ $got->value('ExtraFlags' => 4)
+ if $got->value('Level') == Z_BEST_SPEED ;
}
my $data = $got->value('ExtraField') ;
@@ -392,8 +392,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<gzip> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -445,6 +443,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -512,8 +512,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any compressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all compressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all compressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -1235,7 +1235,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Gzip/Constants.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Gzip/Constants.pm
index 8504330d188..ca74d738837 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Gzip/Constants.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Gzip/Constants.pm
@@ -9,7 +9,7 @@ require Exporter;
our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names);
our ($GZIP_FNAME_INVALID_CHAR_RE, $GZIP_FCOMMENT_INVALID_CHAR_RE);
-$VERSION = '2.024';
+$VERSION = '2.033';
@ISA = qw(Exporter);
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/RawDeflate.pm b/Master/tlpkg/tlperl/lib/IO/Compress/RawDeflate.pm
index b97b51c0509..bb077f989c9 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/RawDeflate.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/RawDeflate.pm
@@ -7,16 +7,16 @@ use warnings;
use bytes;
-use IO::Compress::Base 2.024 ;
-use IO::Compress::Base::Common 2.024 qw(:Status createSelfTiedObject);
-use IO::Compress::Adapter::Deflate 2.024 ;
+use IO::Compress::Base 2.033 ;
+use IO::Compress::Base::Common 2.033 qw(:Status createSelfTiedObject);
+use IO::Compress::Adapter::Deflate 2.033 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
-$VERSION = '2.024';
+$VERSION = '2.033';
$RawDeflateError = '';
@ISA = qw(Exporter IO::Compress::Base);
@@ -142,8 +142,8 @@ sub getZlibParams
{
my $self = shift ;
- use IO::Compress::Base::Common 2.024 qw(:Parse);
- use Compress::Raw::Zlib 2.024 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+ use IO::Compress::Base::Common 2.033 qw(:Parse);
+ use Compress::Raw::Zlib 2.033 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
return (
@@ -368,8 +368,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<rawdeflate> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -414,6 +412,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -481,8 +481,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any compressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all compressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all compressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -1010,7 +1010,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Zip.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Zip.pm
index 5e37d78f97d..62acc8e1fa2 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Zip.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Zip.pm
@@ -4,26 +4,26 @@ use strict ;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(:Status createSelfTiedObject);
-use IO::Compress::RawDeflate 2.024 ;
-use IO::Compress::Adapter::Deflate 2.024 ;
-use IO::Compress::Adapter::Identity 2.024 ;
-use IO::Compress::Zlib::Extra 2.024 ;
-use IO::Compress::Zip::Constants 2.024 ;
+use IO::Compress::Base::Common 2.033 qw(:Status createSelfTiedObject);
+use IO::Compress::RawDeflate 2.033 ;
+use IO::Compress::Adapter::Deflate 2.033 ;
+use IO::Compress::Adapter::Identity 2.033 ;
+use IO::Compress::Zlib::Extra 2.033 ;
+use IO::Compress::Zip::Constants 2.033 ;
-use Compress::Raw::Zlib 2.024 qw(crc32) ;
+use Compress::Raw::Zlib 2.033 qw(crc32) ;
BEGIN
{
eval { require IO::Compress::Adapter::Bzip2 ;
- import IO::Compress::Adapter::Bzip2 2.024 ;
+ import IO::Compress::Adapter::Bzip2 2.033 ;
require IO::Compress::Bzip2 ;
- import IO::Compress::Bzip2 2.024 ;
+ import IO::Compress::Bzip2 2.033 ;
} ;
# eval { require IO::Compress::Adapter::Lzma ;
# import IO::Compress::Adapter::Lzma 2.020 ;
# require IO::Compress::Lzma ;
-# import IO::Compress::Lzma 2.024 ;
+# import IO::Compress::Lzma 2.033 ;
# } ;
}
@@ -32,7 +32,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZipError);
-$VERSION = '2.024';
+$VERSION = '2.033';
$ZipError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
@@ -156,7 +156,7 @@ sub mkHeader
my $extFileAttr = 0 ;
# This code assumes Unix.
- $extFileAttr = 0666 << 16
+ $extFileAttr = 0100644 << 16
if $osCode == ZIP_OS_CODE_UNIX ;
if (*$self->{ZipData}{Zip64}) {
@@ -513,8 +513,8 @@ sub getExtraParams
{
my $self = shift ;
- use IO::Compress::Base::Common 2.024 qw(:Parse);
- use Compress::Raw::Zlib 2.024 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+ use IO::Compress::Base::Common 2.033 qw(:Parse);
+ use Compress::Raw::Zlib 2.033 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
my @Bzip2 = ();
@@ -538,7 +538,10 @@ sub getExtraParams
'Time' => [0, 1, Parse_any, undef],
'exTime' => [0, 1, Parse_any, undef],
'exUnix2' => [0, 1, Parse_any, undef],
- 'ExtAttr' => [0, 1, Parse_any, 0],
+ 'ExtAttr' => [0, 1, Parse_any,
+ $Compress::Raw::Zlib::gzip_os_code == 3
+ ? 0100644 << 16
+ : 0],
'OS_Code' => [0, 1, Parse_unsigned, $Compress::Raw::Zlib::gzip_os_code],
'TextFlag' => [0, 1, Parse_boolean, 0],
@@ -770,8 +773,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<zip> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -823,6 +824,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -890,8 +893,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any compressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all compressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all compressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -932,28 +935,32 @@ compressed data to a buffer, C<$buffer>.
zip $input => \$buffer
or die "zip failed: $ZipError\n";
-To compress all files in the directory "/my/home" that match "*.txt"
-and store the compressed data in the same directory
+To create a zip file, C<output.zip>, that contains the compressed contents
+of the files C<alpha.txt> and C<beta.txt>
use strict ;
use warnings ;
use IO::Compress::Zip qw(zip $ZipError) ;
- zip '</my/home/*.txt>' => '<*.zip>'
+ zip [ 'alpha.txt', 'beta.txt' ] => 'output.zip'
or die "zip failed: $ZipError\n";
-and if you want to compress each file one at a time, this will do the trick
+Alternatively, rather than having to explicitly name each of the files that
+you want to compress, you could use a fileglob to select all the C<txt>
+files in the current directory, as follows
use strict ;
use warnings ;
use IO::Compress::Zip qw(zip $ZipError) ;
- for my $input ( glob "/my/home/*.txt" )
- {
- my $output = "$input.zip" ;
- zip $input => $output
- or die "Error compressing '$input': $ZipError\n";
- }
+ my @files = <*.txt>;
+ zip \@files => 'output.zip'
+ or die "zip failed: $ZipError\n";
+
+or more succinctly
+
+ zip [ <*.txt> ] => 'output.zip'
+ or die "zip failed: $ZipError\n";
=head1 OO Interface
@@ -1051,15 +1058,21 @@ This parameter defaults to 0.
=item C<< Name => $string >>
-Stores the contents of C<$string> in the zip filename header field. If
-C<Name> is not specified, no zip filename field will be created.
+Stores the contents of C<$string> in the zip filename header field.
+
+If C<Name> is not specified and the C<$input> parameter is a filename that
+will be used for the zip filename header field.
+
+If C<Name> is not specified and the C<$input> parameter is not a filename,
+no zip filename field will be created.
=item C<< Time => $number >>
Sets the last modified time field in the zip header to $number.
This field defaults to the time the C<IO::Compress::Zip> object was created
-if this option is not specified.
+if this option is not specified and the C<$input> parameter is not a
+filename.
=item C<< ExtAttr => $attr >>
@@ -1068,10 +1081,10 @@ header of the zip file. This is a 4 byte field.
If you are running a Unix derivative this value defaults to
- 0666 << 16
+ 0100644 << 16
This should allow read/write access to any files that are extracted from
-the zip file/buffer.
+the zip file/buffer`.
For all other systems it defaults to 0.
@@ -1605,7 +1618,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Zip/Constants.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Zip/Constants.pm
index c8cb95342a2..44fd5e891d0 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Zip/Constants.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Zip/Constants.pm
@@ -7,7 +7,7 @@ require Exporter;
our ($VERSION, @ISA, @EXPORT, %ZIP_CM_MIN_VERSIONS);
-$VERSION = '2.024';
+$VERSION = '2.033';
@ISA = qw(Exporter);
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Constants.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Constants.pm
index 10fcf345f63..4c2d5eb00f6 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Constants.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Constants.pm
@@ -9,7 +9,7 @@ require Exporter;
our ($VERSION, @ISA, @EXPORT);
-$VERSION = '2.024';
+$VERSION = '2.033';
@ISA = qw(Exporter);
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Extra.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Extra.pm
index 6812bb409dc..3b13e291cc6 100644
--- a/Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Extra.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Compress/Zlib/Extra.pm
@@ -8,9 +8,9 @@ use bytes;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS);
-$VERSION = '2.024';
+$VERSION = '2.033';
-use IO::Compress::Gzip::Constants 2.024 ;
+use IO::Compress::Gzip::Constants 2.033 ;
sub ExtraFieldError
{
diff --git a/Master/tlpkg/tlperl/lib/IO/Dir.pm b/Master/tlpkg/tlperl/lib/IO/Dir.pm
index cce392c2ce3..74d07784668 100644
--- a/Master/tlpkg/tlperl/lib/IO/Dir.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Dir.pm
@@ -19,14 +19,14 @@ use File::stat;
use File::Spec;
@ISA = qw(Tie::Hash Exporter);
-$VERSION = "1.07";
+$VERSION = "1.08";
$VERSION = eval $VERSION;
@EXPORT_OK = qw(DIR_UNLINK);
sub DIR_UNLINK () { 1 }
sub new {
- @_ >= 1 && @_ <= 2 or croak 'usage: new IO::Dir [DIRNAME]';
+ @_ >= 1 && @_ <= 2 or croak 'usage: IO::Dir->new([DIRNAME])';
my $class = shift;
my $dh = gensym;
if (@_) {
diff --git a/Master/tlpkg/tlperl/lib/IO/File.pm b/Master/tlpkg/tlperl/lib/IO/File.pm
index d33d090d0b2..1162c812e3a 100644
--- a/Master/tlpkg/tlperl/lib/IO/File.pm
+++ b/Master/tlpkg/tlperl/lib/IO/File.pm
@@ -10,25 +10,25 @@ IO::File - supply object methods for filehandles
use IO::File;
- $fh = new IO::File;
+ $fh = IO::File->new();
if ($fh->open("< file")) {
print <$fh>;
$fh->close;
}
- $fh = new IO::File "> file";
+ $fh = IO::File->new("> file");
if (defined $fh) {
print $fh "bar\n";
$fh->close;
}
- $fh = new IO::File "file", "r";
+ $fh = IO::File->new("file", "r");
if (defined $fh) {
print <$fh>;
undef $fh; # automatically closes the file
}
- $fh = new IO::File "file", O_WRONLY|O_APPEND;
+ $fh = IO::File->new("file", O_WRONLY|O_APPEND);
if (defined $fh) {
print $fh "corge\n";
@@ -137,7 +137,7 @@ require Exporter;
@ISA = qw(IO::Handle IO::Seekable Exporter);
-$VERSION = "1.14";
+$VERSION = "1.15";
@EXPORT = @IO::Seekable::EXPORT;
@@ -157,7 +157,7 @@ sub new {
my $type = shift;
my $class = ref($type) || $type || "IO::File";
@_ >= 0 && @_ <= 3
- or croak "usage: new $class [FILENAME [,MODE [,PERMS]]]";
+ or croak "usage: $class->new([FILENAME [,MODE [,PERMS]]])";
my $fh = $class->SUPER::new();
if (@_) {
$fh->open(@_)
diff --git a/Master/tlpkg/tlperl/lib/IO/Handle.pm b/Master/tlpkg/tlperl/lib/IO/Handle.pm
index 2f1f1b423bc..6ca3c8a35d6 100644
--- a/Master/tlpkg/tlperl/lib/IO/Handle.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Handle.pm
@@ -8,13 +8,13 @@ IO::Handle - supply object methods for I/O handles
use IO::Handle;
- $io = new IO::Handle;
+ $io = IO::Handle->new();
if ($io->fdopen(fileno(STDIN),"r")) {
print $io->getline;
$io->close;
}
- $io = new IO::Handle;
+ $io = IO::Handle->new();
if ($io->fdopen(fileno(STDOUT),"w")) {
$io->print("Some text\n");
}
@@ -268,7 +268,7 @@ use IO (); # Load the XS module
require Exporter;
@ISA = qw(Exporter);
-$VERSION = "1.28";
+$VERSION = "1.31";
$VERSION = eval $VERSION;
@EXPORT_OK = qw(
@@ -309,14 +309,25 @@ $VERSION = eval $VERSION;
sub new {
my $class = ref($_[0]) || $_[0] || "IO::Handle";
- @_ == 1 or croak "usage: new $class";
+ if (@_ != 1) {
+ # Since perl will automatically require IO::File if needed, but
+ # also initialises IO::File's @ISA as part of the core we must
+ # ensure IO::File is loaded if IO::Handle is. This avoids effect-
+ # ively "half-loading" IO::File.
+ if ($] > 5.013 && $class eq 'IO::File' && !$INC{"IO/File.pm"}) {
+ require IO::File;
+ shift;
+ return IO::File::->new(@_);
+ }
+ croak "usage: $class->new()";
+ }
my $io = gensym;
bless $io, $class;
}
sub new_from_fd {
my $class = ref($_[0]) || $_[0] || "IO::Handle";
- @_ == 3 or croak "usage: new_from_fd $class FD, MODE";
+ @_ == 3 or croak "usage: $class->new_from_fd(FD, MODE)";
my $io = gensym;
shift;
IO::Handle::fdopen($io, @_)
@@ -603,8 +614,8 @@ sub ioctl {
return ioctl($io, $op, $_[2]);
}
-# this sub is for compatability with older releases of IO that used
-# a sub called constant to detemine if a constant existed -- GMB
+# this sub is for compatibility with older releases of IO that used
+# a sub called constant to determine if a constant existed -- GMB
#
# The SEEK_* and _IO?BF constants were the only constants at that time
# any new code should just chech defined(&CONSTANT_NAME)
diff --git a/Master/tlpkg/tlperl/lib/IO/Pipe.pm b/Master/tlpkg/tlperl/lib/IO/Pipe.pm
index 827cc48bfcd..3b4313abb1f 100644
--- a/Master/tlpkg/tlperl/lib/IO/Pipe.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Pipe.pm
@@ -14,12 +14,12 @@ our($VERSION);
use Carp;
use Symbol;
-$VERSION = "1.13";
+$VERSION = "1.14";
sub new {
my $type = shift;
my $class = ref($type) || $type || "IO::Pipe";
- @_ == 0 || @_ == 2 or croak "usage: new $class [READFH, WRITEFH]";
+ @_ == 0 || @_ == 2 or croak "usage: $class->([READFH, WRITEFH])";
my $me = bless gensym(), $class;
@@ -166,7 +166,7 @@ IO::Pipe - supply object methods for pipes
use IO::Pipe;
- $pipe = new IO::Pipe;
+ $pipe = IO::Pipe->new();
if($pid = fork()) { # Parent
$pipe->reader();
@@ -184,7 +184,7 @@ IO::Pipe - supply object methods for pipes
or
- $pipe = new IO::Pipe;
+ $pipe = IO::Pipe->new();
$pipe->reader(qw(ls -l));
diff --git a/Master/tlpkg/tlperl/lib/IO/Poll.pm b/Master/tlpkg/tlperl/lib/IO/Poll.pm
index e7fb0135069..cf7ab26f75b 100644
--- a/Master/tlpkg/tlperl/lib/IO/Poll.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Poll.pm
@@ -13,7 +13,7 @@ use Exporter ();
our(@ISA, @EXPORT_OK, @EXPORT, $VERSION);
@ISA = qw(Exporter);
-$VERSION = "0.07";
+$VERSION = "0.08";
@EXPORT = qw( POLLIN
POLLOUT
@@ -140,7 +140,7 @@ IO::Poll - Object interface to system poll call
use IO::Poll qw(POLLRDNORM POLLWRNORM POLLIN POLLHUP);
- $poll = new IO::Poll;
+ $poll = IO::Poll->new();
$poll->mask($input_handle => POLLIN);
$poll->mask($output_handle => POLLOUT);
diff --git a/Master/tlpkg/tlperl/lib/IO/Select.pm b/Master/tlpkg/tlperl/lib/IO/Select.pm
index fc05fe70e9c..14b9797a957 100644
--- a/Master/tlpkg/tlperl/lib/IO/Select.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Select.pm
@@ -11,7 +11,7 @@ use warnings::register;
use vars qw($VERSION @ISA);
require Exporter;
-$VERSION = "1.17";
+$VERSION = "1.20";
@ISA = qw(Exporter); # This is only so we can do version checking
@@ -74,9 +74,9 @@ sub _update
foreach $f (@_)
{
my $fn = $vec->_fileno($f);
- next unless defined $fn;
- my $i = $fn + FIRST_FD;
if ($add) {
+ next unless defined $fn;
+ my $i = $fn + FIRST_FD;
if (defined $vec->[$i]) {
$vec->[$i] = $f; # if array rest might be different, so we update
next;
@@ -85,6 +85,12 @@ sub _update
vec($bits, $fn, 1) = 1;
$vec->[$i] = $f;
} else { # remove
+ if ( ! defined $fn ) { # remove if fileno undef'd
+ defined($_) && $_ == $f and do { $vec->[FD_COUNT]--; $_ = undef; }
+ for @{$vec}[FIRST_FD .. $#$vec];
+ next;
+ }
+ my $i = $fn + FIRST_FD;
next unless defined $vec->[$i];
$vec->[FD_COUNT]--;
vec($bits, $fn, 1) = 0;
@@ -346,8 +352,8 @@ listening for more connections on a listen socket
use IO::Select;
use IO::Socket;
- $lsn = new IO::Socket::INET(Listen => 1, LocalPort => 8080);
- $sel = new IO::Select( $lsn );
+ $lsn = IO::Socket::INET->new(Listen => 1, LocalPort => 8080);
+ $sel = IO::Select->new( $lsn );
while(@ready = $sel->can_read) {
foreach $fh (@ready) {
diff --git a/Master/tlpkg/tlperl/lib/IO/Socket.pm b/Master/tlpkg/tlperl/lib/IO/Socket.pm
index 6d4f6ab6123..31fa18f95d4 100644
--- a/Master/tlpkg/tlperl/lib/IO/Socket.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Socket.pm
@@ -23,7 +23,7 @@ require IO::Socket::UNIX if ($^O ne 'epoc' && $^O ne 'symbian');
@ISA = qw(IO::Handle);
-$VERSION = "1.31";
+$VERSION = "1.32";
@EXPORT_OK = qw(sockatmark);
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Bunzip2.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Bunzip2.pm
index 98677e3c09f..6703e59285a 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Bunzip2.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Bunzip2.pm
@@ -4,12 +4,12 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(:Status);
+use IO::Compress::Base::Common 2.033 qw(:Status);
-use Compress::Raw::Bzip2 2.024 ;
+use Compress::Raw::Bzip2 2.033 ;
our ($VERSION, @ISA);
-$VERSION = '2.024';
+$VERSION = '2.033';
sub mkUncompObject
{
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Identity.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Identity.pm
index 27de6e0f36b..0705a1c9d26 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Identity.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Identity.pm
@@ -4,13 +4,13 @@ use warnings;
use strict;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(:Status);
+use IO::Compress::Base::Common 2.033 qw(:Status);
our ($VERSION);
-$VERSION = '2.024';
+$VERSION = '2.033';
-use Compress::Raw::Zlib 2.024 ();
+use Compress::Raw::Zlib 2.033 ();
sub mkUncompObject
{
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Inflate.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Inflate.pm
index aac1e413ffe..dc0365ce009 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Inflate.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/Adapter/Inflate.pm
@@ -4,11 +4,11 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(:Status);
-use Compress::Raw::Zlib 2.024 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
+use IO::Compress::Base::Common 2.033 qw(:Status);
+use Compress::Raw::Zlib 2.033 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
our ($VERSION);
-$VERSION = '2.024';
+$VERSION = '2.033';
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/AnyInflate.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/AnyInflate.pm
index 68038f5d374..796230ec92a 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/AnyInflate.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/AnyInflate.pm
@@ -6,22 +6,22 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(createSelfTiedObject);
+use IO::Compress::Base::Common 2.033 qw(createSelfTiedObject);
-use IO::Uncompress::Adapter::Inflate 2.024 ();
+use IO::Uncompress::Adapter::Inflate 2.033 ();
-use IO::Uncompress::Base 2.024 ;
-use IO::Uncompress::Gunzip 2.024 ;
-use IO::Uncompress::Inflate 2.024 ;
-use IO::Uncompress::RawInflate 2.024 ;
-use IO::Uncompress::Unzip 2.024 ;
+use IO::Uncompress::Base 2.033 ;
+use IO::Uncompress::Gunzip 2.033 ;
+use IO::Uncompress::Inflate 2.033 ;
+use IO::Uncompress::RawInflate 2.033 ;
+use IO::Uncompress::Unzip 2.033 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError);
-$VERSION = '2.024';
+$VERSION = '2.033';
$AnyInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
@@ -48,7 +48,7 @@ sub anyinflate
sub getExtraParams
{
- use IO::Compress::Base::Common 2.024 qw(:Parse);
+ use IO::Compress::Base::Common 2.033 qw(:Parse);
return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ;
}
@@ -256,8 +256,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<anyinflate> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -302,6 +300,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -371,8 +371,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any uncompressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all uncompressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all uncompressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -562,7 +562,7 @@ the module will allow reading of it anyway.
In addition, if the input file/buffer does contain compressed data and
there is non-compressed data immediately following it, setting this option
-will make this module treat the whole file/bufffer as a single data stream.
+will make this module treat the whole file/buffer as a single data stream.
This option defaults to 1.
@@ -980,7 +980,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/AnyUncompress.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/AnyUncompress.pm
index 5984921e25b..64d2fa001a8 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/AnyUncompress.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/AnyUncompress.pm
@@ -4,16 +4,16 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(createSelfTiedObject);
+use IO::Compress::Base::Common 2.033 qw(createSelfTiedObject);
-use IO::Uncompress::Base 2.024 ;
+use IO::Uncompress::Base 2.033 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError);
-$VERSION = '2.024';
+$VERSION = '2.033';
$AnyUncompressError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
@@ -27,22 +27,22 @@ Exporter::export_ok_tags('all');
BEGIN
{
- eval ' use IO::Uncompress::Adapter::Inflate 2.024 ;';
- eval ' use IO::Uncompress::Adapter::Bunzip2 2.024 ;';
- eval ' use IO::Uncompress::Adapter::LZO 2.024 ;';
- eval ' use IO::Uncompress::Adapter::Lzf 2.024 ;';
+ eval ' use IO::Uncompress::Adapter::Inflate 2.033 ;';
+ eval ' use IO::Uncompress::Adapter::Bunzip2 2.033 ;';
+ eval ' use IO::Uncompress::Adapter::LZO 2.033 ;';
+ eval ' use IO::Uncompress::Adapter::Lzf 2.033 ;';
eval ' use IO::Uncompress::Adapter::UnLzma 2.020 ;';
eval ' use IO::Uncompress::Adapter::UnXz 2.020 ;';
- eval ' use IO::Uncompress::Bunzip2 2.024 ;';
- eval ' use IO::Uncompress::UnLzop 2.024 ;';
- eval ' use IO::Uncompress::Gunzip 2.024 ;';
- eval ' use IO::Uncompress::Inflate 2.024 ;';
- eval ' use IO::Uncompress::RawInflate 2.024 ;';
- eval ' use IO::Uncompress::Unzip 2.024 ;';
- eval ' use IO::Uncompress::UnLzf 2.024 ;';
- eval ' use IO::Uncompress::UnLzma 2.024 ;';
- eval ' use IO::Uncompress::UnXz 2.024 ;';
+ eval ' use IO::Uncompress::Bunzip2 2.033 ;';
+ eval ' use IO::Uncompress::UnLzop 2.033 ;';
+ eval ' use IO::Uncompress::Gunzip 2.033 ;';
+ eval ' use IO::Uncompress::Inflate 2.033 ;';
+ eval ' use IO::Uncompress::RawInflate 2.033 ;';
+ eval ' use IO::Uncompress::Unzip 2.033 ;';
+ eval ' use IO::Uncompress::UnLzf 2.033 ;';
+ eval ' use IO::Uncompress::UnLzma 2.033 ;';
+ eval ' use IO::Uncompress::UnXz 2.033 ;';
}
sub new
@@ -60,7 +60,7 @@ sub anyuncompress
sub getExtraParams
{
- use IO::Compress::Base::Common 2.024 qw(:Parse);
+ use IO::Compress::Base::Common 2.033 qw(:Parse);
return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ,
'UnLzma' => [1, 1, Parse_boolean, 0] ) ;
}
@@ -365,8 +365,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<anyuncompress> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -411,6 +409,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -480,8 +480,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any uncompressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all uncompressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all uncompressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -671,7 +671,7 @@ the module will allow reading of it anyway.
In addition, if the input file/buffer does contain compressed data and
there is non-compressed data immediately following it, setting this option
-will make this module treat the whole file/bufffer as a single data stream.
+will make this module treat the whole file/buffer as a single data stream.
This option defaults to 1.
@@ -1011,7 +1011,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/Base.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/Base.pm
index 33f2ac23758..77e4a8c5810 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/Base.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/Base.pm
@@ -9,12 +9,12 @@ our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS);
@ISA = qw(Exporter IO::File);
-$VERSION = '2.024';
+$VERSION = '2.033';
use constant G_EOF => 0 ;
use constant G_ERR => -1 ;
-use IO::Compress::Base::Common 2.024 ;
+use IO::Compress::Base::Common 2.033 ;
#use Parse::Parameters ;
use IO::File ;
@@ -34,9 +34,11 @@ sub smartRead
my $self = $_[0];
my $out = $_[1];
my $size = $_[2];
+ #$$out = "" ;
$$out = "" ;
my $offset = 0 ;
+ my $status = 1;
if (defined *$self->{InputLength}) {
@@ -69,11 +71,12 @@ sub smartRead
# because the filehandle may not support the offset parameter
# An example is Net::FTP
my $tmp = '';
- *$self->{FH}->read($tmp, $get_size) &&
- (substr($$out, $offset) = $tmp);
+ $status = *$self->{FH}->read($tmp, $get_size) ;
+ substr($$out, $offset) = $tmp
+ if defined $status && $status > 0 ;
}
else
- { *$self->{FH}->read($$out, $get_size) }
+ { $status = *$self->{FH}->read($$out, $get_size) }
}
elsif (defined *$self->{InputEvent}) {
my $got = 1 ;
@@ -105,6 +108,11 @@ sub smartRead
*$self->{InputLengthRemaining} -= length($$out) #- $offset
if defined *$self->{InputLength};
+ if (! defined $status) {
+ $self->saveStatus($!) ;
+ return STATUS_ERROR;
+ }
+
$self->saveStatus(length $$out < 0 ? STATUS_ERROR : STATUS_OK) ;
return length $$out;
@@ -776,8 +784,8 @@ sub readBlock
}
my $status = $self->smartRead($buff, $size) ;
- return $self->saveErrorString(STATUS_ERROR, "Error Reading Data")
- if $status < 0 ;
+ return $self->saveErrorString(STATUS_ERROR, "Error Reading Data: $!")
+ if $status == STATUS_ERROR ;
if ($status == 0 ) {
*$self->{Closed} = 1 ;
@@ -814,7 +822,7 @@ sub _raw_read
my $len = $self->smartRead(\$tmp_buff, *$self->{BlockSize}) ;
return $self->saveErrorString(G_ERR, "Error reading data: $!", $!)
- if $len < 0 ;
+ if $len == STATUS_ERROR ;
if ($len == 0 ) {
*$self->{EndStream} = 1 ;
@@ -980,7 +988,7 @@ sub gotoNextStream
#*$self->{EndStream} = 0 ;
if ( ! defined $magic) {
- if (! *$self->{Transparent} )
+ if (! *$self->{Transparent} || $self->eof())
{
*$self->{EndStream} = 1 ;
return 0;
@@ -1123,33 +1131,34 @@ sub read
sub _getline
{
my $self = shift ;
+ my $status = 0 ;
# Slurp Mode
if ( ! defined $/ ) {
my $data ;
- 1 while $self->read($data) > 0 ;
- return \$data ;
+ 1 while ($status = $self->read($data)) > 0 ;
+ return $status < 0 ? \undef : \$data ;
}
# Record Mode
if ( ref $/ eq 'SCALAR' && ${$/} =~ /^\d+$/ && ${$/} > 0) {
my $reclen = ${$/} ;
my $data ;
- $self->read($data, $reclen) ;
- return \$data ;
+ $status = $self->read($data, $reclen) ;
+ return $status < 0 ? \undef : \$data ;
}
# Paragraph Mode
if ( ! length $/ ) {
my $paragraph ;
- while ($self->read($paragraph) > 0 ) {
+ while (($status = $self->read($paragraph)) > 0 ) {
if ($paragraph =~ s/^(.*?\n\n+)//s) {
*$self->{Pending} = $paragraph ;
my $par = $1 ;
return \$par ;
}
}
- return \$paragraph;
+ return $status < 0 ? \undef : \$paragraph;
}
# $/ isn't empty, or a reference, so it's Line Mode.
@@ -1165,7 +1174,7 @@ sub _getline
return \$l;
}
- while ($self->read($line) > 0 ) {
+ while (($status = $self->read($line)) > 0 ) {
my $offset = index($line, $/);
if ($offset >= 0) {
my $l = substr($line, 0, $offset + length $/ );
@@ -1175,7 +1184,7 @@ sub _getline
}
}
- return \$line;
+ return $status < 0 ? \undef : \$line;
}
}
@@ -1445,7 +1454,7 @@ IO::Uncompress::Base - Base Class for IO::Uncompress modules
=head1 DESCRIPTION
This module is not intended for direct use in application code. Its sole
-purpose if to to be sub-classed by IO::Unompress modules.
+purpose if to to be sub-classed by IO::Uncompress modules.
=head1 SEE ALSO
@@ -1467,7 +1476,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/Bunzip2.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/Bunzip2.pm
index b3988c41851..39adbef079b 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/Bunzip2.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/Bunzip2.pm
@@ -4,15 +4,15 @@ use strict ;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(:Status createSelfTiedObject);
+use IO::Compress::Base::Common 2.033 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Base 2.024 ;
-use IO::Uncompress::Adapter::Bunzip2 2.024 ;
+use IO::Uncompress::Base 2.033 ;
+use IO::Uncompress::Adapter::Bunzip2 2.033 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error);
-$VERSION = '2.024';
+$VERSION = '2.033';
$Bunzip2Error = '';
@ISA = qw( Exporter IO::Uncompress::Base );
@@ -40,7 +40,7 @@ sub getExtraParams
{
my $self = shift ;
- use IO::Compress::Base::Common 2.024 qw(:Parse);
+ use IO::Compress::Base::Common 2.033 qw(:Parse);
return (
'Verbosity' => [1, 1, Parse_boolean, 0],
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/Gunzip.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/Gunzip.pm
index f3e4e6561f0..94fd6756d9e 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/Gunzip.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/Gunzip.pm
@@ -9,12 +9,12 @@ use strict ;
use warnings;
use bytes;
-use IO::Uncompress::RawInflate 2.024 ;
+use IO::Uncompress::RawInflate 2.033 ;
-use Compress::Raw::Zlib 2.024 qw( crc32 ) ;
-use IO::Compress::Base::Common 2.024 qw(:Status createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.024 ;
-use IO::Compress::Zlib::Extra 2.024 ;
+use Compress::Raw::Zlib 2.033 qw( crc32 ) ;
+use IO::Compress::Base::Common 2.033 qw(:Status createSelfTiedObject);
+use IO::Compress::Gzip::Constants 2.033 ;
+use IO::Compress::Zlib::Extra 2.033 ;
require Exporter ;
@@ -28,7 +28,7 @@ Exporter::export_ok_tags('all');
$GunzipError = '';
-$VERSION = '2.024';
+$VERSION = '2.033';
sub new
{
@@ -47,7 +47,7 @@ sub gunzip
sub getExtraParams
{
- use IO::Compress::Base::Common 2.024 qw(:Parse);
+ use IO::Compress::Base::Common 2.033 qw(:Parse);
return ( 'ParseExtra' => [1, 1, Parse_boolean, 0] ) ;
}
@@ -392,8 +392,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<gunzip> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -438,6 +436,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -507,8 +507,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any uncompressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all uncompressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all uncompressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -698,7 +698,7 @@ the module will allow reading of it anyway.
In addition, if the input file/buffer does contain compressed data and
there is non-compressed data immediately following it, setting this option
-will make this module treat the whole file/bufffer as a single data stream.
+will make this module treat the whole file/buffer as a single data stream.
This option defaults to 1.
@@ -1104,7 +1104,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/Inflate.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/Inflate.pm
index 956f62e0835..a7b12fcde4f 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/Inflate.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/Inflate.pm
@@ -5,15 +5,15 @@ use strict ;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.024 qw(:Status createSelfTiedObject);
-use IO::Compress::Zlib::Constants 2.024 ;
+use IO::Compress::Base::Common 2.033 qw(:Status createSelfTiedObject);
+use IO::Compress::Zlib::Constants 2.033 ;
-use IO::Uncompress::RawInflate 2.024 ;
+use IO::Uncompress::RawInflate 2.033 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError);
-$VERSION = '2.024';
+$VERSION = '2.033';
$InflateError = '';
@ISA = qw( Exporter IO::Uncompress::RawInflate );
@@ -313,8 +313,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<inflate> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -359,6 +357,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -428,8 +428,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any uncompressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all uncompressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all uncompressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -619,7 +619,7 @@ the module will allow reading of it anyway.
In addition, if the input file/buffer does contain compressed data and
there is non-compressed data immediately following it, setting this option
-will make this module treat the whole file/bufffer as a single data stream.
+will make this module treat the whole file/buffer as a single data stream.
This option defaults to 1.
@@ -975,7 +975,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/RawInflate.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/RawInflate.pm
index f017fa0f599..07d70e316c7 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/RawInflate.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/RawInflate.pm
@@ -5,16 +5,16 @@ use strict ;
use warnings;
use bytes;
-use Compress::Raw::Zlib 2.024 ;
-use IO::Compress::Base::Common 2.024 qw(:Status createSelfTiedObject);
+use Compress::Raw::Zlib 2.033 ;
+use IO::Compress::Base::Common 2.033 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Base 2.024 ;
-use IO::Uncompress::Adapter::Inflate 2.024 ;
+use IO::Uncompress::Base 2.033 ;
+use IO::Uncompress::Adapter::Inflate 2.033 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError);
-$VERSION = '2.024';
+$VERSION = '2.033';
$RawInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
@@ -461,8 +461,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<rawinflate> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -507,6 +505,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -576,8 +576,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any uncompressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all uncompressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all uncompressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -764,7 +764,7 @@ the module will allow reading of it anyway.
In addition, if the input file/buffer does contain compressed data and
there is non-compressed data immediately following it, setting this option
-will make this module treat the whole file/bufffer as a single data stream.
+will make this module treat the whole file/buffer as a single data stream.
This option defaults to 1.
@@ -1103,7 +1103,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/Master/tlpkg/tlperl/lib/IO/Uncompress/Unzip.pm b/Master/tlpkg/tlperl/lib/IO/Uncompress/Unzip.pm
index e7d6849f66b..a678251a899 100644
--- a/Master/tlpkg/tlperl/lib/IO/Uncompress/Unzip.pm
+++ b/Master/tlpkg/tlperl/lib/IO/Uncompress/Unzip.pm
@@ -8,14 +8,14 @@ use strict ;
use warnings;
use bytes;
-use IO::Uncompress::RawInflate 2.024 ;
-use IO::Compress::Base::Common 2.024 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Adapter::Inflate 2.024 ;
-use IO::Uncompress::Adapter::Identity 2.024 ;
-use IO::Compress::Zlib::Extra 2.024 ;
-use IO::Compress::Zip::Constants 2.024 ;
+use IO::Uncompress::RawInflate 2.033 ;
+use IO::Compress::Base::Common 2.033 qw(:Status createSelfTiedObject);
+use IO::Uncompress::Adapter::Inflate 2.033 ;
+use IO::Uncompress::Adapter::Identity 2.033 ;
+use IO::Compress::Zlib::Extra 2.033 ;
+use IO::Compress::Zip::Constants 2.033 ;
-use Compress::Raw::Zlib 2.024 qw(crc32) ;
+use Compress::Raw::Zlib 2.033 qw(crc32) ;
BEGIN
{
@@ -30,7 +30,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup);
-$VERSION = '2.024';
+$VERSION = '2.033';
$UnzipError = '';
@ISA = qw(Exporter IO::Uncompress::RawInflate);
@@ -63,7 +63,7 @@ sub unzip
sub getExtraParams
{
- use IO::Compress::Base::Common 2.024 qw(:Parse);
+ use IO::Compress::Base::Common 2.033 qw(:Parse);
return (
@@ -894,8 +894,6 @@ If C<$input> is a string that is delimited by the characters "<" and ">"
C<unzip> will assume that it is an I<input fileglob string>. The
input is the list of files that match the fileglob.
-If the fileglob does not match any files ...
-
See L<File::GlobMapper|File::GlobMapper> for more details.
=back
@@ -940,6 +938,8 @@ output is the list of files that match the fileglob.
When C<$output> is an fileglob string, C<$input> must also be a fileglob
string. Anything else is an error.
+See L<File::GlobMapper|File::GlobMapper> for more details.
+
=back
If the C<$output> parameter is any other type, C<undef> will be returned.
@@ -1009,8 +1009,8 @@ data to the output data stream.
So when the output is a filehandle it will carry out a seek to the eof
before writing any uncompressed data. If the output is a filename, it will be opened for
-appending. If the output is a buffer, all uncompressed data will be appened to
-the existing buffer.
+appending. If the output is a buffer, all uncompressed data will be
+appended to the existing buffer.
Conversely when C<Append> is not specified, or it is present and is set to
false, it will operate as follows.
@@ -1056,54 +1056,57 @@ C<InputLength> option.
=head2 Examples
-To read the contents of the file C<file1.txt.zip> and write the
-uncompressed data to the file C<file1.txt>.
+Say you have a zip file, C<file1.zip>, that only contains a
+single member, you can read it and write the uncompressed data to the
+file C<file1.txt> like this.
use strict ;
use warnings ;
use IO::Uncompress::Unzip qw(unzip $UnzipError) ;
- my $input = "file1.txt.zip";
+ my $input = "file1.zip";
my $output = "file1.txt";
unzip $input => $output
or die "unzip failed: $UnzipError\n";
-To read from an existing Perl filehandle, C<$input>, and write the
-uncompressed data to a buffer, C<$buffer>.
+If you have a zip file that contains multiple members and want to read a
+specific member from the file, say C<"data1">, use the C<Name> option
use strict ;
use warnings ;
use IO::Uncompress::Unzip qw(unzip $UnzipError) ;
- use IO::File ;
- my $input = new IO::File "<file1.txt.zip"
- or die "Cannot open 'file1.txt.zip': $!\n" ;
- my $buffer ;
- unzip $input => \$buffer
+ my $input = "file1.zip";
+ my $output = "file1.txt";
+ unzip $input => $output, Name => "data1"
or die "unzip failed: $UnzipError\n";
-To uncompress all files in the directory "/my/home" that match "*.txt.zip" and store the compressed data in the same directory
+Alternatively, if you want to read the C<"data1"> member into memory, use
+a scalar reference for the C<output> partameter.
use strict ;
use warnings ;
use IO::Uncompress::Unzip qw(unzip $UnzipError) ;
- unzip '</my/home/*.txt.zip>' => '</my/home/#1.txt>'
+ my $input = "file1.zip";
+ my $output ;
+ unzip $input => \$output, Name => "data1"
or die "unzip failed: $UnzipError\n";
+ # $output now contains the uncompressed data
-and if you want to compress each file one at a time, this will do the trick
+To read from an existing Perl filehandle, C<$input>, and write the
+uncompressed data to a buffer, C<$buffer>.
use strict ;
use warnings ;
use IO::Uncompress::Unzip qw(unzip $UnzipError) ;
+ use IO::File ;
- for my $input ( glob "/my/home/*.txt.zip" )
- {
- my $output = $input;
- $output =~ s/.zip// ;
- unzip $input => $output
- or die "Error compressing '$input': $UnzipError\n";
- }
+ my $input = new IO::File "<file1.zip"
+ or die "Cannot open 'file1.zip': $!\n" ;
+ my $buffer ;
+ unzip $input => \$buffer
+ or die "unzip failed: $UnzipError\n";
=head1 OO Interface
@@ -1163,6 +1166,10 @@ OPTS is a combination of the following options:
=over 5
+=item C<< Name => "membername" >>
+
+Open "membername" from the zip file for reading.
+
=item C<< AutoClose => 0|1 >>
This option is only valid when the C<$input> parameter is a filehandle. If
@@ -1199,7 +1206,7 @@ the module will allow reading of it anyway.
In addition, if the input file/buffer does contain compressed data and
there is non-compressed data immediately following it, setting this option
-will make this module treat the whole file/bufffer as a single data stream.
+will make this module treat the whole file/buffer as a single data stream.
This option defaults to 1.
@@ -1509,6 +1516,43 @@ Same as doing this
See L<IO::Uncompress::Unzip::FAQ|IO::Uncompress::Unzip::FAQ/"Compressed files and Net::FTP">
+=head2 Walking through a zip file
+
+The code below can be used to traverse a zip file, one compressed data
+stream at a time.
+
+ use IO::Uncompress::Unzip qw($UnzipError);
+
+ my $zipfile = "somefile.zip";
+ my $u = new IO::Uncompress::Unzip $zipfile
+ or die "Cannot open $zipfile: $UnzipError";
+
+ my $status;
+ for ($status = 1; ! $u->eof(); $status = $u->nextStream())
+ {
+
+ my $name = $u->getHeaderInfo()->{Name};
+ warn "Processing member $name\n" ;
+
+ my $buff;
+ while (($status = $u->read($buff)) > 0) {
+ # Do something here
+ }
+
+ last if $status < 0;
+ }
+
+ die "Error processing $zipfile: $!\n"
+ if $status < 0 ;
+
+Each individual compressed data stream is read until the logical
+end-of-file is reached. Then C<nextStream> is called. This will skip to the
+start of the next compressed data stream and clear the end-of-file flag.
+
+It is also worth noting that C<nextStream> can be called at any time -- you
+don't have to wait until you have exhausted a compressed data stream before
+skipping to the next one.
+
=head1 SEE ALSO
L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
@@ -1542,7 +1586,7 @@ See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2010 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2011 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.