exiftool-vendored.exe 12.82.0 → 12.82.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/bin/exiftool.exe +0 -0
- package/bin/exiftool_files/Licenses_Strawberry_Perl.zip +0 -0
- package/bin/exiftool_files/lib/Archive/Zip/Archive.pm +399 -65
- package/bin/exiftool_files/lib/Archive/Zip/DirectoryMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/FileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/Member.pm +499 -195
- package/bin/exiftool_files/lib/Archive/Zip/NewFileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/StringMember.pm +2 -2
- package/bin/exiftool_files/lib/Archive/Zip/ZipFileMember.pm +79 -20
- package/bin/exiftool_files/lib/Archive/Zip.pm +179 -29
- package/bin/exiftool_files/lib/AutoLoader.pm +453 -0
- package/bin/exiftool_files/lib/B/Deparse.pm +209 -137
- package/bin/exiftool_files/lib/B.pm +1 -1
- package/bin/exiftool_files/lib/Benchmark.pm +1123 -0
- package/bin/exiftool_files/lib/Class/Struct.pm +2 -2
- package/bin/exiftool_files/lib/Compress/Raw/Bzip2.pm +14 -9
- package/bin/exiftool_files/lib/Compress/Raw/Lzma.pm +982 -0
- package/bin/exiftool_files/lib/Compress/Raw/Zlib.pm +91 -86
- package/bin/exiftool_files/lib/Compress/Zlib.pm +105 -100
- package/bin/exiftool_files/lib/Config.pm +9 -9
- package/bin/exiftool_files/lib/Config_heavy.pl +36 -33
- package/bin/exiftool_files/lib/CryptX.pm +2 -82
- package/bin/exiftool_files/lib/Data/Dumper.pm +2 -2
- package/bin/exiftool_files/lib/Digest/MD5.pm +12 -9
- package/bin/exiftool_files/lib/Digest/Perl/MD5.pm +1 -191
- package/bin/exiftool_files/lib/Digest/base.pm +26 -20
- package/bin/exiftool_files/lib/DynaLoader.pm +7 -4
- package/bin/exiftool_files/lib/Encode.pm +3 -3
- package/bin/exiftool_files/lib/Errno.pm +13 -13
- package/bin/exiftool_files/lib/Exporter/Heavy.pm +2 -2
- package/bin/exiftool_files/lib/Exporter.pm +1 -1
- package/bin/exiftool_files/lib/ExtUtils/Command/MM.pm +323 -0
- package/bin/exiftool_files/lib/ExtUtils/Command.pm +382 -0
- package/bin/exiftool_files/lib/File/Find.pm +1 -1
- package/bin/exiftool_files/lib/File/Glob.pm +1 -8
- package/bin/exiftool_files/lib/File/GlobMapper.pm +2 -2
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Carbon.pm +2 -40
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Cocoa.pm +2 -34
- package/bin/exiftool_files/lib/File/HomeDir/Darwin.pm +2 -28
- package/bin/exiftool_files/lib/File/HomeDir/Driver.pm +2 -35
- package/bin/exiftool_files/lib/File/HomeDir/FreeDesktop.pm +2 -62
- package/bin/exiftool_files/lib/File/HomeDir/MacOS9.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Test.pm +2 -43
- package/bin/exiftool_files/lib/File/HomeDir/Unix.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Windows.pm +2 -69
- package/bin/exiftool_files/lib/File/HomeDir.pm +5 -416
- package/bin/exiftool_files/lib/File/Path.pm +3 -3
- package/bin/exiftool_files/lib/File/Spec/Win32.pm +2 -2
- package/bin/exiftool_files/lib/File/Temp.pm +70 -35
- package/bin/exiftool_files/lib/File/Which.pm +1 -240
- package/bin/exiftool_files/lib/File/stat.pm +3 -2
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Bzip2.pm +16 -17
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Deflate.pm +19 -20
- package/bin/exiftool_files/lib/IO/Compress/Base/Common.pm +5 -5
- package/bin/exiftool_files/lib/IO/Compress/Base.pm +35 -26
- package/bin/exiftool_files/lib/IO/Compress/Brotli.pm +159 -0
- package/bin/exiftool_files/lib/IO/Compress/Bzip2.pm +50 -25
- package/bin/exiftool_files/lib/IO/Compress/Gzip/Constants.pm +6 -6
- package/bin/exiftool_files/lib/IO/Compress/Gzip.pm +58 -32
- package/bin/exiftool_files/lib/IO/Compress/RawDeflate.pm +63 -38
- package/bin/exiftool_files/lib/IO/Compress/Zlib/Extra.pm +20 -20
- package/bin/exiftool_files/lib/IO/Dir.pm +1 -1
- package/bin/exiftool_files/lib/IO/File.pm +1 -1
- package/bin/exiftool_files/lib/IO/Handle.pm +1 -21
- package/bin/exiftool_files/lib/IO/Pipe.pm +1 -1
- package/bin/exiftool_files/lib/IO/Seekable.pm +1 -1
- package/bin/exiftool_files/lib/IO/Select.pm +16 -2
- package/bin/exiftool_files/lib/IO/Socket/INET.pm +14 -9
- package/bin/exiftool_files/lib/IO/Socket/UNIX.pm +17 -1
- package/bin/exiftool_files/lib/IO/Socket.pm +474 -126
- package/bin/exiftool_files/lib/IO/String.pm +425 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Adapter/Inflate.pm +13 -14
- package/bin/exiftool_files/lib/IO/Uncompress/Base.pm +142 -132
- package/bin/exiftool_files/lib/IO/Uncompress/Brotli.pm +119 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Gunzip.pm +43 -37
- package/bin/exiftool_files/lib/IO/Uncompress/RawInflate.pm +49 -43
- package/bin/exiftool_files/lib/IO.pm +2 -2
- package/bin/exiftool_files/lib/List/Util.pm +97 -8
- package/bin/exiftool_files/lib/MIME/Base64.pm +5 -5
- package/bin/exiftool_files/lib/MIME/Charset/_Compat.pm +106 -0
- package/bin/exiftool_files/lib/MIME/Charset.pm +1303 -0
- package/bin/exiftool_files/lib/Math/BigFloat.pm +444 -27
- package/bin/exiftool_files/lib/Math/BigInt/Calc.pm +296 -313
- package/bin/exiftool_files/lib/Math/BigInt/FastCalc.pm +1 -1
- package/bin/exiftool_files/lib/Math/BigInt/GMP.pm +2 -115
- package/bin/exiftool_files/lib/Math/BigInt/LTM.pm +2 -24
- package/bin/exiftool_files/lib/Math/BigInt/Lib.pm +61 -32
- package/bin/exiftool_files/lib/Math/BigInt.pm +292 -107
- package/bin/exiftool_files/lib/POSIX.pm +1 -1
- package/bin/exiftool_files/lib/PerlIO/scalar.pm +41 -0
- package/bin/exiftool_files/lib/PerlIO.pm +397 -0
- package/bin/exiftool_files/lib/Portable/CPAN.pm +94 -94
- package/bin/exiftool_files/lib/Portable/Config.pm +94 -94
- package/bin/exiftool_files/lib/Portable/FileSpec.pm +180 -180
- package/bin/exiftool_files/lib/Portable/HomeDir.pm +110 -110
- package/bin/exiftool_files/lib/Portable/LoadYaml.pm +430 -430
- package/bin/exiftool_files/lib/Portable/minicpan.pm +55 -55
- package/bin/exiftool_files/lib/Portable.pm +246 -320
- package/bin/exiftool_files/lib/Scalar/Util.pm +9 -4
- package/bin/exiftool_files/lib/Socket.pm +16 -12
- package/bin/exiftool_files/lib/Storable.pm +1444 -1441
- package/bin/exiftool_files/lib/TAP/Base.pm +133 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Base.pm +467 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Color.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/ParallelSession.pm +201 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/Session.pm +205 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File/Session.pm +95 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File.pm +56 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Session.pm +220 -0
- package/bin/exiftool_files/lib/TAP/Harness/Beyond.pod +426 -0
- package/bin/exiftool_files/lib/TAP/Harness/Env.pm +215 -0
- package/bin/exiftool_files/lib/TAP/Harness.pm +1054 -0
- package/bin/exiftool_files/lib/TAP/Object.pm +155 -0
- package/bin/exiftool_files/lib/TAP/Parser/Aggregator.pm +414 -0
- package/bin/exiftool_files/lib/TAP/Parser/Grammar.pm +584 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Array.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Process.pm +378 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Stream.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator.pm +162 -0
- package/bin/exiftool_files/lib/TAP/Parser/IteratorFactory.pm +339 -0
- package/bin/exiftool_files/lib/TAP/Parser/Multiplexer.pm +194 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Bailout.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Comment.pm +60 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Plan.pm +119 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Pragma.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Test.pm +271 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Unknown.pm +48 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Version.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/YAML.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result.pm +297 -0
- package/bin/exiftool_files/lib/TAP/Parser/ResultFactory.pm +183 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Job.pm +127 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Spinner.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler.pm +448 -0
- package/bin/exiftool_files/lib/TAP/Parser/Source.pm +381 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Executable.pm +184 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/File.pm +136 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Handle.pm +124 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Perl.pm +370 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/RawTAP.pm +130 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler.pm +191 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Reader.pm +332 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Writer.pm +254 -0
- package/bin/exiftool_files/lib/TAP/Parser.pm +1931 -0
- package/bin/exiftool_files/lib/Test/Builder/Formatter.pm +107 -0
- package/bin/exiftool_files/lib/Test/Builder/IO/Scalar.pm +659 -0
- package/bin/exiftool_files/lib/Test/Builder/Module.pm +182 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester/Color.pm +51 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester.pm +675 -0
- package/bin/exiftool_files/lib/Test/Builder/TodoDiag.pm +68 -0
- package/bin/exiftool_files/lib/Test/Builder.pm +2653 -0
- package/bin/exiftool_files/lib/Test/Harness.pm +618 -0
- package/bin/exiftool_files/lib/Test/More.pm +1997 -0
- package/bin/exiftool_files/lib/Test/Simple.pm +220 -0
- package/bin/exiftool_files/lib/Test/Tester/Capture.pm +241 -0
- package/bin/exiftool_files/lib/Test/Tester/CaptureRunner.pm +79 -0
- package/bin/exiftool_files/lib/Test/Tester/Delegate.pm +45 -0
- package/bin/exiftool_files/lib/Test/Tester.pm +695 -0
- package/bin/exiftool_files/lib/Test/Tutorial.pod +618 -0
- package/bin/exiftool_files/lib/Test/use/ok.pm +64 -0
- package/bin/exiftool_files/lib/Text/ParseWords.pm +303 -0
- package/bin/exiftool_files/lib/Tie/StdHandle.pm +2 -2
- package/bin/exiftool_files/lib/Time/HiRes.pm +73 -68
- package/bin/exiftool_files/lib/Time/Local.pm +82 -35
- package/bin/exiftool_files/lib/Time/Piece.pm +19 -4
- package/bin/exiftool_files/lib/Time/Seconds.pm +1 -1
- package/bin/exiftool_files/lib/UNIVERSAL.pm +203 -0
- package/bin/exiftool_files/lib/Unicode/GCString.pm +60 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak/Constants.pm +68 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak.pm +248 -0
- package/bin/exiftool_files/lib/Win32/API/Struct.pm +1 -177
- package/bin/exiftool_files/lib/Win32/API/Type.pm +1 -100
- package/bin/exiftool_files/lib/Win32/API.pm +1 -830
- package/bin/exiftool_files/lib/Win32/FindFile.pm +2 -123
- package/bin/exiftool_files/lib/Win32.pm +213 -89
- package/bin/exiftool_files/lib/Win32API/File.pm +1 -1
- package/bin/exiftool_files/lib/auto/B/B.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Bzip2/Bzip2.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/Lzma.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/autosplit.ix +3 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Zlib/Zlib.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/CryptX/CryptX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Cwd/Cwd.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Data/Dumper/Dumper.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/MD5/MD5.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/SHA/SHA.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Encode/Encode.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Fcntl/Fcntl.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/File/Glob/Glob.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/Compress/Brotli/Brotli.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/IO.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/List/Util/Util.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/MIME/Base64/Base64.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/FastCalc/FastCalc.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/GMP/GMP.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/POSIX/POSIX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/PerlIO/scalar/scalar.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Socket/Socket.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Storable/Storable.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/HiRes/HiRes.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/Piece/Piece.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Unicode/LineBreak/LineBreak.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/API/API.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/FindFile/FindFile.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/Win32.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32API/File/File.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/mro/mro.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/re/re.xs.dll +0 -0
- package/bin/exiftool_files/lib/feature.pm +49 -17
- package/bin/exiftool_files/lib/mro.pm +4 -20
- package/bin/exiftool_files/lib/overload.pm +15 -15
- package/bin/exiftool_files/lib/parent.pm +10 -2
- package/bin/exiftool_files/lib/re.pm +91 -33
- package/bin/exiftool_files/lib/warnings.pm +17 -6
- package/bin/exiftool_files/libgcc_s_seh-1.dll +0 -0
- package/bin/exiftool_files/liblzma-5__.dll +0 -0
- package/bin/exiftool_files/libstdc++-6.dll +0 -0
- package/bin/exiftool_files/libwinpthread-1.dll +0 -0
- package/bin/exiftool_files/perl.exe +0 -0
- package/bin/exiftool_files/perl532.dll +0 -0
- package/package.json +5 -3
- package/bin/exiftool_files/libgcc_s_dw2-1.dll +0 -0
- package/bin/exiftool_files/perl530.dll +0 -0
|
@@ -4,7 +4,7 @@ use strict;
|
|
|
4
4
|
use vars qw( $VERSION @ISA );
|
|
5
5
|
|
|
6
6
|
BEGIN {
|
|
7
|
-
$VERSION = '1.
|
|
7
|
+
$VERSION = '1.68';
|
|
8
8
|
@ISA = qw( Archive::Zip::Member );
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -49,7 +49,7 @@ sub contents {
|
|
|
49
49
|
length($self->{'contents'});
|
|
50
50
|
$self->{'compressionMethod'} = COMPRESSION_STORED;
|
|
51
51
|
}
|
|
52
|
-
return $self->{'contents'};
|
|
52
|
+
return wantarray ? ($self->{'contents'}, AZ_OK) : $self->{'contents'};
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
# Return bytes read. Note that first parameter is a ref to a buffer.
|
|
@@ -4,7 +4,7 @@ use strict;
|
|
|
4
4
|
use vars qw( $VERSION @ISA );
|
|
5
5
|
|
|
6
6
|
BEGIN {
|
|
7
|
-
$VERSION = '1.
|
|
7
|
+
$VERSION = '1.68';
|
|
8
8
|
@ISA = qw ( Archive::Zip::FileMember );
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -22,17 +22,19 @@ sub _newFromZipFile {
|
|
|
22
22
|
my $class = shift;
|
|
23
23
|
my $fh = shift;
|
|
24
24
|
my $externalFileName = shift;
|
|
25
|
-
my $
|
|
25
|
+
my $archiveZip64 = @_ ? shift : 0;
|
|
26
|
+
my $possibleEocdOffset = @_ ? shift : 0; # normally 0
|
|
26
27
|
|
|
27
28
|
my $self = $class->new(
|
|
28
|
-
'
|
|
29
|
+
'eocdCrc32' => 0,
|
|
29
30
|
'diskNumberStart' => 0,
|
|
30
31
|
'localHeaderRelativeOffset' => 0,
|
|
31
|
-
'dataOffset'
|
|
32
|
+
'dataOffset' => 0, # localHeaderRelativeOffset + header length
|
|
32
33
|
@_
|
|
33
34
|
);
|
|
34
35
|
$self->{'externalFileName'} = $externalFileName;
|
|
35
36
|
$self->{'fh'} = $fh;
|
|
37
|
+
$self->{'archiveZip64'} = $archiveZip64;
|
|
36
38
|
$self->{'possibleEocdOffset'} = $possibleEocdOffset;
|
|
37
39
|
return $self;
|
|
38
40
|
}
|
|
@@ -67,7 +69,7 @@ sub _seekToLocalHeader {
|
|
|
67
69
|
|
|
68
70
|
($status, $signature) =
|
|
69
71
|
_readSignature($self->fh(), $self->externalFileName(),
|
|
70
|
-
|
|
72
|
+
LOCAL_FILE_HEADER_SIGNATURE, 1);
|
|
71
73
|
return $status if $status == AZ_IO_ERROR;
|
|
72
74
|
|
|
73
75
|
# retry with EOCD offset if any was given.
|
|
@@ -110,6 +112,8 @@ sub _become {
|
|
|
110
112
|
delete($self->{'diskNumberStart'});
|
|
111
113
|
delete($self->{'localHeaderRelativeOffset'});
|
|
112
114
|
delete($self->{'dataOffset'});
|
|
115
|
+
delete($self->{'archiveZip64'});
|
|
116
|
+
delete($self->{'possibleEocdOffset'});
|
|
113
117
|
|
|
114
118
|
return $self->SUPER::_become($newClass);
|
|
115
119
|
}
|
|
@@ -155,12 +159,20 @@ sub _skipLocalFileHeader {
|
|
|
155
159
|
or return _ioError("skipping local file name");
|
|
156
160
|
}
|
|
157
161
|
|
|
162
|
+
my $zip64 = 0;
|
|
158
163
|
if ($extraFieldLength) {
|
|
159
164
|
$bytesRead =
|
|
160
165
|
$self->fh()->read($self->{'localExtraField'}, $extraFieldLength);
|
|
161
166
|
if ($bytesRead != $extraFieldLength) {
|
|
162
167
|
return _ioError("reading local extra field");
|
|
163
168
|
}
|
|
169
|
+
if ($self->{'archiveZip64'}) {
|
|
170
|
+
my $status;
|
|
171
|
+
($status, $zip64) =
|
|
172
|
+
$self->_extractZip64ExtraField($self->{'localExtraField'}, undef, undef);
|
|
173
|
+
return $status if $status != AZ_OK;
|
|
174
|
+
$self->{'zip64'} ||= $zip64;
|
|
175
|
+
}
|
|
164
176
|
}
|
|
165
177
|
|
|
166
178
|
$self->{'dataOffset'} = $self->fh()->tell();
|
|
@@ -180,13 +192,13 @@ sub _skipLocalFileHeader {
|
|
|
180
192
|
my $oldCompressedSize = $self->{'compressedSize'};
|
|
181
193
|
my $oldUncompressedSize = $self->{'uncompressedSize'};
|
|
182
194
|
|
|
183
|
-
my $status = $self->_readDataDescriptor();
|
|
195
|
+
my $status = $self->_readDataDescriptor($zip64);
|
|
184
196
|
return $status unless $status == AZ_OK;
|
|
185
197
|
|
|
186
|
-
# The buffer
|
|
198
|
+
# The buffer with encrypted data is prefixed with a new
|
|
187
199
|
# encrypted 12 byte header. The size only changes when
|
|
188
200
|
# the buffer is also compressed
|
|
189
|
-
$self->isEncrypted && $oldUncompressedSize > $self->{uncompressedSize}
|
|
201
|
+
$self->isEncrypted && $oldUncompressedSize > $self->{'uncompressedSize'}
|
|
190
202
|
and $oldUncompressedSize -= DATA_DESCRIPTOR_LENGTH;
|
|
191
203
|
|
|
192
204
|
return _formatError(
|
|
@@ -194,14 +206,16 @@ sub _skipLocalFileHeader {
|
|
|
194
206
|
if ( $oldCrc32 != $self->{'crc32'}
|
|
195
207
|
|| $oldUncompressedSize != $self->{'uncompressedSize'});
|
|
196
208
|
|
|
197
|
-
$self->{'crc32'} = 0
|
|
198
|
-
if $self->compressionMethod() == COMPRESSION_STORED ;
|
|
209
|
+
$self->{'crc32'} = 0
|
|
210
|
+
if $self->compressionMethod() == COMPRESSION_STORED ;
|
|
199
211
|
}
|
|
200
212
|
|
|
201
213
|
return AZ_OK;
|
|
202
214
|
}
|
|
203
215
|
|
|
204
|
-
# Read from a local file header into myself.
|
|
216
|
+
# Read from a local file header into myself. Returns AZ_OK (in
|
|
217
|
+
# scalar context) or a pair (AZ_OK, $headerSize) (in list
|
|
218
|
+
# context) if successful.
|
|
205
219
|
# Assumes that fh is positioned after signature.
|
|
206
220
|
# Note that crc32, compressedSize, and uncompressedSize will be 0 if
|
|
207
221
|
# GPBF_HAS_DATA_DESCRIPTOR_MASK is set in the bitFlag.
|
|
@@ -235,12 +249,22 @@ sub _readLocalFileHeader {
|
|
|
235
249
|
$self->fileName($fileName);
|
|
236
250
|
}
|
|
237
251
|
|
|
252
|
+
my $zip64 = 0;
|
|
238
253
|
if ($extraFieldLength) {
|
|
239
254
|
$bytesRead =
|
|
240
255
|
$self->fh()->read($self->{'localExtraField'}, $extraFieldLength);
|
|
241
256
|
if ($bytesRead != $extraFieldLength) {
|
|
242
257
|
return _ioError("reading local extra field");
|
|
243
258
|
}
|
|
259
|
+
if ($self->{'archiveZip64'}) {
|
|
260
|
+
my $status;
|
|
261
|
+
($status, $zip64) =
|
|
262
|
+
$self->_extractZip64ExtraField($self->{'localExtraField'},
|
|
263
|
+
$uncompressedSize,
|
|
264
|
+
$compressedSize);
|
|
265
|
+
return $status if $status != AZ_OK;
|
|
266
|
+
$self->{'zip64'} ||= $zip64;
|
|
267
|
+
}
|
|
244
268
|
}
|
|
245
269
|
|
|
246
270
|
$self->{'dataOffset'} = $self->fh()->tell();
|
|
@@ -254,7 +278,7 @@ sub _readLocalFileHeader {
|
|
|
254
278
|
$self->fh()->seek($self->{'compressedSize'}, IO::Seekable::SEEK_CUR)
|
|
255
279
|
or return _ioError("seeking to extended local header");
|
|
256
280
|
|
|
257
|
-
my $status = $self->_readDataDescriptor();
|
|
281
|
+
my $status = $self->_readDataDescriptor($zip64);
|
|
258
282
|
return $status unless $status == AZ_OK;
|
|
259
283
|
} else {
|
|
260
284
|
return _formatError(
|
|
@@ -263,7 +287,14 @@ sub _readLocalFileHeader {
|
|
|
263
287
|
|| $self->{'uncompressedSize'} != $uncompressedSize);
|
|
264
288
|
}
|
|
265
289
|
|
|
266
|
-
return
|
|
290
|
+
return
|
|
291
|
+
wantarray
|
|
292
|
+
? (AZ_OK,
|
|
293
|
+
SIGNATURE_LENGTH,
|
|
294
|
+
LOCAL_FILE_HEADER_LENGTH +
|
|
295
|
+
$fileNameLength +
|
|
296
|
+
$extraFieldLength)
|
|
297
|
+
: AZ_OK;
|
|
267
298
|
}
|
|
268
299
|
|
|
269
300
|
# This will read the data descriptor, which is after the end of compressed file
|
|
@@ -272,7 +303,8 @@ sub _readLocalFileHeader {
|
|
|
272
303
|
# Assumes that file is positioned immediately after the compressed data.
|
|
273
304
|
# Returns status; sets crc32, compressedSize, and uncompressedSize.
|
|
274
305
|
sub _readDataDescriptor {
|
|
275
|
-
my $self
|
|
306
|
+
my $self = shift;
|
|
307
|
+
my $zip64 = shift;
|
|
276
308
|
my $signatureData;
|
|
277
309
|
my $header;
|
|
278
310
|
my $crc32;
|
|
@@ -284,23 +316,40 @@ sub _readDataDescriptor {
|
|
|
284
316
|
if $bytesRead != SIGNATURE_LENGTH;
|
|
285
317
|
my $signature = unpack(SIGNATURE_FORMAT, $signatureData);
|
|
286
318
|
|
|
319
|
+
my $dataDescriptorLength;
|
|
320
|
+
my $dataDescriptorFormat;
|
|
321
|
+
my $dataDescriptorLengthNoSig;
|
|
322
|
+
my $dataDescriptorFormatNoSig;
|
|
323
|
+
if (! $zip64) {
|
|
324
|
+
$dataDescriptorLength = DATA_DESCRIPTOR_LENGTH;
|
|
325
|
+
$dataDescriptorFormat = DATA_DESCRIPTOR_FORMAT;
|
|
326
|
+
$dataDescriptorLengthNoSig = DATA_DESCRIPTOR_LENGTH_NO_SIG;
|
|
327
|
+
$dataDescriptorFormatNoSig = DATA_DESCRIPTOR_FORMAT_NO_SIG
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
$dataDescriptorLength = DATA_DESCRIPTOR_ZIP64_LENGTH;
|
|
331
|
+
$dataDescriptorFormat = DATA_DESCRIPTOR_ZIP64_FORMAT;
|
|
332
|
+
$dataDescriptorLengthNoSig = DATA_DESCRIPTOR_ZIP64_LENGTH_NO_SIG;
|
|
333
|
+
$dataDescriptorFormatNoSig = DATA_DESCRIPTOR_ZIP64_FORMAT_NO_SIG
|
|
334
|
+
}
|
|
335
|
+
|
|
287
336
|
# unfortunately, the signature appears to be optional.
|
|
288
337
|
if ($signature == DATA_DESCRIPTOR_SIGNATURE
|
|
289
338
|
&& ($signature != $self->{'crc32'})) {
|
|
290
|
-
$bytesRead = $self->fh()->read($header,
|
|
339
|
+
$bytesRead = $self->fh()->read($header, $dataDescriptorLength);
|
|
291
340
|
return _ioError("reading data descriptor")
|
|
292
|
-
if $bytesRead !=
|
|
341
|
+
if $bytesRead != $dataDescriptorLength;
|
|
293
342
|
|
|
294
343
|
($crc32, $compressedSize, $uncompressedSize) =
|
|
295
|
-
unpack(
|
|
344
|
+
unpack($dataDescriptorFormat, $header);
|
|
296
345
|
} else {
|
|
297
|
-
$bytesRead = $self->fh()->read($header,
|
|
346
|
+
$bytesRead = $self->fh()->read($header, $dataDescriptorLengthNoSig);
|
|
298
347
|
return _ioError("reading data descriptor")
|
|
299
|
-
if $bytesRead !=
|
|
348
|
+
if $bytesRead != $dataDescriptorLengthNoSig;
|
|
300
349
|
|
|
301
350
|
$crc32 = $signature;
|
|
302
351
|
($compressedSize, $uncompressedSize) =
|
|
303
|
-
unpack(
|
|
352
|
+
unpack($dataDescriptorFormatNoSig, $header);
|
|
304
353
|
}
|
|
305
354
|
|
|
306
355
|
$self->{'eocdCrc32'} = $self->{'crc32'}
|
|
@@ -356,6 +405,16 @@ sub _readCentralDirectoryFileHeader {
|
|
|
356
405
|
if ($bytesRead != $extraFieldLength) {
|
|
357
406
|
return _ioError("reading central dir extra field");
|
|
358
407
|
}
|
|
408
|
+
if ($self->{'archiveZip64'}) {
|
|
409
|
+
my ($status, $zip64) =
|
|
410
|
+
$self->_extractZip64ExtraField($self->{'cdExtraField'},
|
|
411
|
+
$self->{'uncompressedSize'},
|
|
412
|
+
$self->{'compressedSize'},
|
|
413
|
+
$self->{'localHeaderRelativeOffset'},
|
|
414
|
+
$self->{'diskNumberStart'});
|
|
415
|
+
return $status if $status != AZ_OK;
|
|
416
|
+
$self->{'zip64'} ||= $zip64;
|
|
417
|
+
}
|
|
359
418
|
}
|
|
360
419
|
if ($fileCommentLength) {
|
|
361
420
|
$bytesRead = $fh->read($self->{'fileComment'}, $fileCommentLength);
|
|
@@ -14,7 +14,7 @@ use FileHandle ();
|
|
|
14
14
|
use vars qw( $VERSION @ISA );
|
|
15
15
|
|
|
16
16
|
BEGIN {
|
|
17
|
-
$VERSION = '1.
|
|
17
|
+
$VERSION = '1.68';
|
|
18
18
|
|
|
19
19
|
require Exporter;
|
|
20
20
|
@ISA = qw( Exporter );
|
|
@@ -39,6 +39,7 @@ BEGIN {
|
|
|
39
39
|
%EXPORT_TAGS = (
|
|
40
40
|
CONSTANTS => [
|
|
41
41
|
qw(
|
|
42
|
+
ZIP64_SUPPORTED
|
|
42
43
|
FA_MSDOS
|
|
43
44
|
FA_UNIX
|
|
44
45
|
GPBF_ENCRYPTED_MASK
|
|
@@ -53,6 +54,9 @@ BEGIN {
|
|
|
53
54
|
IFA_TEXT_FILE_MASK
|
|
54
55
|
IFA_TEXT_FILE
|
|
55
56
|
IFA_BINARY_FILE
|
|
57
|
+
ZIP64_AS_NEEDED
|
|
58
|
+
ZIP64_EOCD
|
|
59
|
+
ZIP64_HEADERS
|
|
56
60
|
)
|
|
57
61
|
],
|
|
58
62
|
|
|
@@ -117,9 +121,13 @@ BEGIN {
|
|
|
117
121
|
DATA_DESCRIPTOR_SIGNATURE
|
|
118
122
|
DATA_DESCRIPTOR_FORMAT
|
|
119
123
|
DATA_DESCRIPTOR_LENGTH
|
|
124
|
+
DATA_DESCRIPTOR_ZIP64_FORMAT
|
|
125
|
+
DATA_DESCRIPTOR_ZIP64_LENGTH
|
|
120
126
|
|
|
121
127
|
DATA_DESCRIPTOR_FORMAT_NO_SIG
|
|
122
128
|
DATA_DESCRIPTOR_LENGTH_NO_SIG
|
|
129
|
+
DATA_DESCRIPTOR_ZIP64_FORMAT_NO_SIG
|
|
130
|
+
DATA_DESCRIPTOR_ZIP64_LENGTH_NO_SIG
|
|
123
131
|
|
|
124
132
|
CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE
|
|
125
133
|
CENTRAL_DIRECTORY_FILE_HEADER_FORMAT
|
|
@@ -137,6 +145,8 @@ BEGIN {
|
|
|
137
145
|
END_OF_CENTRAL_DIRECTORY_FORMAT
|
|
138
146
|
END_OF_CENTRAL_DIRECTORY_LENGTH
|
|
139
147
|
|
|
148
|
+
ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIGNATURE_STRING
|
|
149
|
+
ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE_STRING
|
|
140
150
|
END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING
|
|
141
151
|
)
|
|
142
152
|
],
|
|
@@ -148,6 +158,7 @@ BEGIN {
|
|
|
148
158
|
_printError
|
|
149
159
|
_ioError
|
|
150
160
|
_formatError
|
|
161
|
+
_zip64NotSupported
|
|
151
162
|
_subclassResponsibility
|
|
152
163
|
_binmode
|
|
153
164
|
_isSeekable
|
|
@@ -170,6 +181,9 @@ BEGIN {
|
|
|
170
181
|
|
|
171
182
|
}
|
|
172
183
|
|
|
184
|
+
# Zip64 format support status
|
|
185
|
+
use constant ZIP64_SUPPORTED => !! eval { pack("Q<", 1) };
|
|
186
|
+
|
|
173
187
|
# Error codes
|
|
174
188
|
use constant AZ_OK => 0;
|
|
175
189
|
use constant AZ_STREAM_END => 1;
|
|
@@ -232,6 +246,12 @@ use constant IFA_TEXT_FILE_MASK => 1;
|
|
|
232
246
|
use constant IFA_TEXT_FILE => 1;
|
|
233
247
|
use constant IFA_BINARY_FILE => 0;
|
|
234
248
|
|
|
249
|
+
# desired zip64 structures for archive creation
|
|
250
|
+
|
|
251
|
+
use constant ZIP64_AS_NEEDED => 0;
|
|
252
|
+
use constant ZIP64_EOCD => 1;
|
|
253
|
+
use constant ZIP64_HEADERS => 2;
|
|
254
|
+
|
|
235
255
|
# PKZIP file format miscellaneous constants (for internal use only)
|
|
236
256
|
use constant SIGNATURE_FORMAT => "V";
|
|
237
257
|
use constant SIGNATURE_LENGTH => 4;
|
|
@@ -242,13 +262,17 @@ use constant LOCAL_FILE_HEADER_FORMAT => "v3 V4 v2";
|
|
|
242
262
|
use constant LOCAL_FILE_HEADER_LENGTH => 26;
|
|
243
263
|
|
|
244
264
|
# PKZIP docs don't mention the signature, but Info-Zip writes it.
|
|
245
|
-
use constant DATA_DESCRIPTOR_SIGNATURE
|
|
246
|
-
use constant DATA_DESCRIPTOR_FORMAT
|
|
247
|
-
use constant DATA_DESCRIPTOR_LENGTH
|
|
265
|
+
use constant DATA_DESCRIPTOR_SIGNATURE => 0x08074b50;
|
|
266
|
+
use constant DATA_DESCRIPTOR_FORMAT => "V3";
|
|
267
|
+
use constant DATA_DESCRIPTOR_LENGTH => 12;
|
|
268
|
+
use constant DATA_DESCRIPTOR_ZIP64_FORMAT => "L< Q<2";
|
|
269
|
+
use constant DATA_DESCRIPTOR_ZIP64_LENGTH => 20;
|
|
248
270
|
|
|
249
271
|
# but the signature is apparently optional.
|
|
250
|
-
use constant DATA_DESCRIPTOR_FORMAT_NO_SIG
|
|
251
|
-
use constant DATA_DESCRIPTOR_LENGTH_NO_SIG
|
|
272
|
+
use constant DATA_DESCRIPTOR_FORMAT_NO_SIG => "V2";
|
|
273
|
+
use constant DATA_DESCRIPTOR_LENGTH_NO_SIG => 8;
|
|
274
|
+
use constant DATA_DESCRIPTOR_ZIP64_FORMAT_NO_SIG => "Q<2";
|
|
275
|
+
use constant DATA_DESCRIPTOR_ZIP64_LENGTH_NO_SIG => 16;
|
|
252
276
|
|
|
253
277
|
use constant CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE => 0x02014b50;
|
|
254
278
|
use constant CENTRAL_DIRECTORY_FILE_HEADER_FORMAT => "C2 v3 V4 v5 V2";
|
|
@@ -256,13 +280,16 @@ use constant CENTRAL_DIRECTORY_FILE_HEADER_LENGTH => 42;
|
|
|
256
280
|
|
|
257
281
|
# zip64 support
|
|
258
282
|
use constant ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIGNATURE => 0x06064b50;
|
|
259
|
-
use constant
|
|
260
|
-
|
|
283
|
+
use constant ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIGNATURE_STRING =>
|
|
284
|
+
pack("V", ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIGNATURE);
|
|
285
|
+
use constant ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_FORMAT => "Q< S<2 L<2 Q<4";
|
|
286
|
+
use constant ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_LENGTH => 52;
|
|
261
287
|
|
|
262
288
|
use constant ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE => 0x07064b50;
|
|
263
|
-
use constant
|
|
264
|
-
|
|
265
|
-
|
|
289
|
+
use constant ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE_STRING =>
|
|
290
|
+
pack("V", ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE);
|
|
291
|
+
use constant ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_FORMAT => "L< Q< L<";
|
|
292
|
+
use constant ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_LENGTH => 16;
|
|
266
293
|
|
|
267
294
|
use constant END_OF_CENTRAL_DIRECTORY_SIGNATURE => 0x06054b50;
|
|
268
295
|
use constant END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING =>
|
|
@@ -385,6 +412,14 @@ sub _error {
|
|
|
385
412
|
return AZ_ERROR;
|
|
386
413
|
}
|
|
387
414
|
|
|
415
|
+
# This is called if zip64 format is not supported but would be
|
|
416
|
+
# required.
|
|
417
|
+
sub _zip64NotSupported {
|
|
418
|
+
shift if ref($_[0]);
|
|
419
|
+
_printError('zip64 format not supported on this Perl interpreter');
|
|
420
|
+
return AZ_ERROR;
|
|
421
|
+
}
|
|
422
|
+
|
|
388
423
|
# Called when a subclass should have implemented
|
|
389
424
|
# something but didn't
|
|
390
425
|
sub _subclassResponsibility {
|
|
@@ -462,13 +497,20 @@ sub _newFileHandle {
|
|
|
462
497
|
|
|
463
498
|
# Returns next signature from given file handle, leaves
|
|
464
499
|
# file handle positioned afterwards.
|
|
500
|
+
#
|
|
465
501
|
# In list context, returns ($status, $signature)
|
|
466
|
-
# ( $status, $signature) = _readSignature( $fh, $fileName );
|
|
467
|
-
|
|
502
|
+
# ( $status, $signature ) = _readSignature( $fh, $fileName );
|
|
503
|
+
#
|
|
504
|
+
# This function returns one of AZ_OK, AZ_IO_ERROR, or
|
|
505
|
+
# AZ_FORMAT_ERROR and calls the respective error handlers in the
|
|
506
|
+
# latter two cases. If optional $noFormatError is true, it does
|
|
507
|
+
# not call the error handler on format error, but only returns
|
|
508
|
+
# AZ_FORMAT_ERROR.
|
|
468
509
|
sub _readSignature {
|
|
469
510
|
my $fh = shift;
|
|
470
511
|
my $fileName = shift;
|
|
471
512
|
my $expectedSignature = shift; # optional
|
|
513
|
+
my $noFormatError = shift; # optional
|
|
472
514
|
|
|
473
515
|
my $signatureData;
|
|
474
516
|
my $bytesRead = $fh->read($signatureData, SIGNATURE_LENGTH);
|
|
@@ -490,12 +532,17 @@ sub _readSignature {
|
|
|
490
532
|
&& $signature != ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE
|
|
491
533
|
)
|
|
492
534
|
) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
535
|
+
if (! $noFormatError ) {
|
|
536
|
+
my $errmsg = sprintf("bad signature: 0x%08x", $signature);
|
|
537
|
+
if (_isSeekable($fh)) {
|
|
538
|
+
$errmsg .= sprintf(" at offset %d", $fh->tell() - SIGNATURE_LENGTH);
|
|
539
|
+
}
|
|
497
540
|
|
|
498
|
-
|
|
541
|
+
$status = _formatError("$errmsg in file $fileName");
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
$status = AZ_FORMAT_ERROR;
|
|
545
|
+
}
|
|
499
546
|
}
|
|
500
547
|
|
|
501
548
|
return ($status, $signature);
|
|
@@ -546,7 +593,7 @@ sub _asZipDirName {
|
|
|
546
593
|
my ($volume, $directories, $file) =
|
|
547
594
|
File::Spec->splitpath(File::Spec->canonpath($name), $forceDir);
|
|
548
595
|
$$volReturn = $volume if (ref($volReturn));
|
|
549
|
-
my @dirs = map { $_ =~
|
|
596
|
+
my @dirs = map { $_ =~ y{/}{_}; $_ } File::Spec->splitdir($directories);
|
|
550
597
|
if (@dirs > 0) { pop(@dirs) unless $dirs[-1] } # remove empty component
|
|
551
598
|
push(@dirs, defined($file) ? $file : '');
|
|
552
599
|
|
|
@@ -722,6 +769,7 @@ COMPRESSION_STORED COMPRESSION_DEFLATED IFA_TEXT_FILE_MASK
|
|
|
722
769
|
IFA_TEXT_FILE IFA_BINARY_FILE COMPRESSION_LEVEL_NONE
|
|
723
770
|
COMPRESSION_LEVEL_DEFAULT COMPRESSION_LEVEL_FASTEST
|
|
724
771
|
COMPRESSION_LEVEL_BEST_COMPRESSION
|
|
772
|
+
ZIP64_SUPPORTED ZIP64_AS_NEEDED ZIP64_EOCD ZIP64_HEADERS
|
|
725
773
|
|
|
726
774
|
=item :MISC_CONSTANTS
|
|
727
775
|
|
|
@@ -1026,6 +1074,26 @@ members in scalar context.
|
|
|
1026
1074
|
# or
|
|
1027
1075
|
my $numberOfTextFiles = $zip->membersMatching( '.*\.txt' );
|
|
1028
1076
|
|
|
1077
|
+
=item zip64()
|
|
1078
|
+
|
|
1079
|
+
Returns whether the previous read or write of the archive has
|
|
1080
|
+
been done in zip64 format.
|
|
1081
|
+
|
|
1082
|
+
=item desiredZip64Mode()
|
|
1083
|
+
|
|
1084
|
+
Gets or sets which parts of the archive should be written in
|
|
1085
|
+
zip64 format: All parts as needed (ZIP64_AS_NEEDED), the default,
|
|
1086
|
+
force writing the zip64 end of central directory record
|
|
1087
|
+
(ZIP64_EOCD), force writing the zip64 EOCD record and all headers
|
|
1088
|
+
in zip64 format (ZIP64_HEADERS).
|
|
1089
|
+
|
|
1090
|
+
=item versionMadeBy()
|
|
1091
|
+
|
|
1092
|
+
=item versionNeededToExtract()
|
|
1093
|
+
|
|
1094
|
+
Gets the fields from the zip64 end of central directory
|
|
1095
|
+
record. These are always 0 if the archive is not in zip64 format.
|
|
1096
|
+
|
|
1029
1097
|
=item diskNumber()
|
|
1030
1098
|
|
|
1031
1099
|
Return the disk that I start on. Not used for writing zips,
|
|
@@ -1658,7 +1726,9 @@ but they don't add the new members to a zip.
|
|
|
1658
1726
|
Construct a new member from the given string. Returns undef
|
|
1659
1727
|
on error.
|
|
1660
1728
|
|
|
1661
|
-
my $member = Archive::Zip::Member->newFromString( 'This is a test'
|
|
1729
|
+
my $member = Archive::Zip::Member->newFromString( 'This is a test' );
|
|
1730
|
+
my $member = Archive::Zip::Member->newFromString( 'This is a test', 'test.txt' );
|
|
1731
|
+
my $member = Archive::Zip::Member->newFromString( { string => 'This is a test', zipName => 'test.txt' } );
|
|
1662
1732
|
|
|
1663
1733
|
=item newFromFile( $fileName [, $zipName ] )
|
|
1664
1734
|
|
|
@@ -1688,12 +1758,30 @@ Returns undef on error.
|
|
|
1688
1758
|
|
|
1689
1759
|
=back
|
|
1690
1760
|
|
|
1691
|
-
=head2 Member Simple
|
|
1761
|
+
=head2 Member Simple Accessors
|
|
1692
1762
|
|
|
1693
1763
|
These methods get (and/or set) member attribute values.
|
|
1694
1764
|
|
|
1765
|
+
The zip64 format requires parts of the member data to be stored
|
|
1766
|
+
in the so-called extra fields. You cannot get nor set this zip64
|
|
1767
|
+
data through the extra field accessors described in this section.
|
|
1768
|
+
In fact, the low-level member methods ensure that the zip64 data
|
|
1769
|
+
in the extra fields is handled completely transparently and
|
|
1770
|
+
invisibly to the user when members are read or written.
|
|
1771
|
+
|
|
1695
1772
|
=over 4
|
|
1696
1773
|
|
|
1774
|
+
=item zip64()
|
|
1775
|
+
|
|
1776
|
+
Returns whether the previous read or write of the member has been
|
|
1777
|
+
done in zip64 format.
|
|
1778
|
+
|
|
1779
|
+
=item desiredZip64Mode()
|
|
1780
|
+
|
|
1781
|
+
Gets or sets whether the member's headers should be written in
|
|
1782
|
+
zip64 format: As needed (ZIP64_AS_NEEDED), the default, or always
|
|
1783
|
+
(ZIP64_HEADERS).
|
|
1784
|
+
|
|
1697
1785
|
=item versionMadeBy()
|
|
1698
1786
|
|
|
1699
1787
|
Gets the field from the member header.
|
|
@@ -1809,17 +1897,20 @@ comparisons.
|
|
|
1809
1897
|
=item localExtraField( [ { field => $newField } ] )
|
|
1810
1898
|
|
|
1811
1899
|
Gets or sets the extra field that was read from the local
|
|
1812
|
-
header.
|
|
1813
|
-
|
|
1814
|
-
|
|
1900
|
+
header. The extra field must be in the proper format. If it is
|
|
1901
|
+
not or if the new field contains data related to the zip64
|
|
1902
|
+
format, this method does not modify the extra field and returns
|
|
1903
|
+
AZ_FORMAT_ERROR, otherwise it returns AZ_OK.
|
|
1815
1904
|
|
|
1816
1905
|
=item cdExtraField( [ $newField ] )
|
|
1817
1906
|
|
|
1818
1907
|
=item cdExtraField( [ { field => $newField } ] )
|
|
1819
1908
|
|
|
1820
1909
|
Gets or sets the extra field that was read from the central
|
|
1821
|
-
directory header. The extra field must be in the proper
|
|
1822
|
-
|
|
1910
|
+
directory header. The extra field must be in the proper format.
|
|
1911
|
+
If it is not or if the new field contains data related to the
|
|
1912
|
+
zip64 format, this method does not modify the extra field and
|
|
1913
|
+
returns AZ_FORMAT_ERROR, otherwise it returns AZ_OK.
|
|
1823
1914
|
|
|
1824
1915
|
=item extraFields()
|
|
1825
1916
|
|
|
@@ -1915,6 +2006,10 @@ Returns AZ_OK on success.
|
|
|
1915
2006
|
|
|
1916
2007
|
Returns true if I am a directory.
|
|
1917
2008
|
|
|
2009
|
+
=item isSymbolicLink()
|
|
2010
|
+
|
|
2011
|
+
Returns true if I am a symbolic link.
|
|
2012
|
+
|
|
1918
2013
|
=item writeLocalHeaderRelativeOffset()
|
|
1919
2014
|
|
|
1920
2015
|
Returns the file offset in bytes the last time I was written.
|
|
@@ -2005,6 +2100,10 @@ change the class of the member):
|
|
|
2005
2100
|
Extract (and uncompress, if necessary) the member's contents
|
|
2006
2101
|
to the given file handle. Return AZ_OK on success.
|
|
2007
2102
|
|
|
2103
|
+
For members representing symbolic links, pass the name of the
|
|
2104
|
+
symbolic link as file handle. Ensure that all directories in the
|
|
2105
|
+
path to the symbolic link already exist.
|
|
2106
|
+
|
|
2008
2107
|
=back
|
|
2009
2108
|
|
|
2010
2109
|
=head1 Archive::Zip::FileMember methods
|
|
@@ -2085,6 +2184,57 @@ If you are just going to be extracting zips (and/or other archives) you
|
|
|
2085
2184
|
are recommended to look at using L<Archive::Extract> instead, as it is much
|
|
2086
2185
|
easier to use and factors out archive-specific functionality.
|
|
2087
2186
|
|
|
2187
|
+
=head2 Zip64 Format Support
|
|
2188
|
+
|
|
2189
|
+
Since version 1.66 Archive::Zip supports the so-called zip64
|
|
2190
|
+
format, which overcomes various limitations in the original zip
|
|
2191
|
+
file format. On some Perl interpreters, however, even version
|
|
2192
|
+
1.66 and newer of Archive::Zip cannot support the zip64 format.
|
|
2193
|
+
Among these are all Perl interpreters that lack 64-bit support
|
|
2194
|
+
and those older than version 5.10.0.
|
|
2195
|
+
|
|
2196
|
+
Constant C<ZIP64_SUPPORTED>, exported with tag L<:CONSTANTS>,
|
|
2197
|
+
equals true if Archive::Zip on the current Perl interpreter
|
|
2198
|
+
supports the zip64 format. If it does not and you try to read or
|
|
2199
|
+
write an archive in zip64 format, anyway, Archive::Zip returns an
|
|
2200
|
+
error C<AZ_ERROR> and reports an error message along the lines of
|
|
2201
|
+
"zip64 format not supported on this Perl interpreter".
|
|
2202
|
+
|
|
2203
|
+
=head2 C<versionMadeBy> and C<versionNeededToExtract>
|
|
2204
|
+
|
|
2205
|
+
The zip64 format and the zip file format in general specify what
|
|
2206
|
+
values to use for the C<versionMadeBy> and
|
|
2207
|
+
C<versionNeededToExtract> fields in the local file header,
|
|
2208
|
+
central directory file header, and zip64 EOCD record. In
|
|
2209
|
+
practice however, these fields seem to be more or less randomly
|
|
2210
|
+
used by various archiver implementations.
|
|
2211
|
+
|
|
2212
|
+
To achieve a compromise between backward compatibility and
|
|
2213
|
+
(whatever) standard compliance, Archive::Zip handles them as
|
|
2214
|
+
follows:
|
|
2215
|
+
|
|
2216
|
+
=over 4
|
|
2217
|
+
|
|
2218
|
+
=item
|
|
2219
|
+
|
|
2220
|
+
For field C<versionMadeBy>, Archive::Zip uses default value 20
|
|
2221
|
+
(45 for the zip64 EOCD record) or any previously read value. It
|
|
2222
|
+
never changes that value when writing a header, even if it is
|
|
2223
|
+
written in zip64 format, or when writing the zip64 EOCD record.
|
|
2224
|
+
|
|
2225
|
+
=item
|
|
2226
|
+
|
|
2227
|
+
Likewise for field C<versionNeededToExtract>, but here
|
|
2228
|
+
Archive::Zip forces a minimum value of 45 when writing a header
|
|
2229
|
+
in zip64 format or the zip64 EOCD record.
|
|
2230
|
+
|
|
2231
|
+
=item
|
|
2232
|
+
|
|
2233
|
+
Finally, Archive::Zip never depends on the values of these fields
|
|
2234
|
+
in any way when reading an archive from a file or file handle.
|
|
2235
|
+
|
|
2236
|
+
=back
|
|
2237
|
+
|
|
2088
2238
|
=head2 Try to avoid IO::Scalar
|
|
2089
2239
|
|
|
2090
2240
|
One of the most common ways to use Archive::Zip is to generate Zip files
|
|
@@ -2133,11 +2283,11 @@ have to re-read the entire archive to try again with the correct password.
|
|
|
2133
2283
|
|
|
2134
2284
|
=head1 SUPPORT
|
|
2135
2285
|
|
|
2136
|
-
Bugs should be reported
|
|
2286
|
+
Bugs should be reported on GitHub
|
|
2137
2287
|
|
|
2138
|
-
L<
|
|
2288
|
+
L<https://github.com/redhotpenguin/perl-Archive-Zip/issues>
|
|
2139
2289
|
|
|
2140
|
-
For other issues contact the maintainer
|
|
2290
|
+
For other issues contact the maintainer.
|
|
2141
2291
|
|
|
2142
2292
|
=head1 AUTHOR
|
|
2143
2293
|
|