exiftool-vendored.exe 12.80.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/Changes +44 -0
- package/bin/exiftool_files/Licenses_Strawberry_Perl.zip +0 -0
- package/bin/exiftool_files/README +3 -2
- package/bin/exiftool_files/exiftool.pl +36 -14
- 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/Image/ExifTool/BuildTagLookup.pm +44 -31
- package/bin/exiftool_files/lib/Image/ExifTool/CanonVRD.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +20 -7
- package/bin/exiftool_files/lib/Image/ExifTool/GM.pm +543 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.pm +332 -149
- package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +9 -4
- package/bin/exiftool_files/lib/Image/ExifTool/M2TS.pm +32 -4
- package/bin/exiftool_files/lib/Image/ExifTool/MakerNotes.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Microsoft.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +331 -22
- package/bin/exiftool_files/lib/Image/ExifTool/NikonCustom.pm +55 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +1 -0
- package/bin/exiftool_files/lib/Image/ExifTool/OpenEXR.pm +21 -3
- package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +3 -3
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +40 -24
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +61 -30
- package/bin/exiftool_files/lib/Image/ExifTool/README +2 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +4815 -4775
- package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +931 -617
- package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +30 -8
- package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +10 -4
- package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +4 -2
- package/bin/exiftool_files/lib/Image/ExifTool.pm +77 -41
- package/bin/exiftool_files/lib/Image/ExifTool.pod +24 -11
- 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 +7 -5
- package/bin/exiftool_files/libgcc_s_dw2-1.dll +0 -0
- package/bin/exiftool_files/perl530.dll +0 -0
|
@@ -9,7 +9,7 @@ require Exporter;
|
|
|
9
9
|
our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names);
|
|
10
10
|
our ($GZIP_FNAME_INVALID_CHAR_RE, $GZIP_FCOMMENT_INVALID_CHAR_RE);
|
|
11
11
|
|
|
12
|
-
$VERSION = '2.
|
|
12
|
+
$VERSION = '2.100';
|
|
13
13
|
|
|
14
14
|
@ISA = qw(Exporter);
|
|
15
15
|
|
|
@@ -89,22 +89,22 @@ use constant GZIP_FEXTRA_SUBFIELD_ID_SIZE => 2 ;
|
|
|
89
89
|
use constant GZIP_FEXTRA_SUBFIELD_LEN_SIZE => 2 ;
|
|
90
90
|
use constant GZIP_FEXTRA_SUBFIELD_HEADER_SIZE => GZIP_FEXTRA_SUBFIELD_ID_SIZE +
|
|
91
91
|
GZIP_FEXTRA_SUBFIELD_LEN_SIZE;
|
|
92
|
-
use constant GZIP_FEXTRA_SUBFIELD_MAX_SIZE => GZIP_FEXTRA_MAX_SIZE -
|
|
92
|
+
use constant GZIP_FEXTRA_SUBFIELD_MAX_SIZE => GZIP_FEXTRA_MAX_SIZE -
|
|
93
93
|
GZIP_FEXTRA_SUBFIELD_HEADER_SIZE ;
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
if (ord('A') == 193)
|
|
97
97
|
{
|
|
98
|
-
# EBCDIC
|
|
98
|
+
# EBCDIC
|
|
99
99
|
$GZIP_FNAME_INVALID_CHAR_RE = '[\x00-\x3f\xff]';
|
|
100
100
|
$GZIP_FCOMMENT_INVALID_CHAR_RE = '[\x00-\x0a\x11-\x14\x16-\x3f\xff]';
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
}
|
|
103
103
|
else
|
|
104
104
|
{
|
|
105
105
|
$GZIP_FNAME_INVALID_CHAR_RE = '[\x00-\x1F\x7F-\x9F]';
|
|
106
106
|
$GZIP_FCOMMENT_INVALID_CHAR_RE = '[\x00-\x09\x11-\x1F\x7F-\x9F]';
|
|
107
|
-
}
|
|
107
|
+
}
|
|
108
108
|
|
|
109
109
|
use constant GZIP_FHCRC_SIZE => 2 ; # aka CONTINUATION in gzip
|
|
110
110
|
|
|
@@ -140,7 +140,7 @@ use constant GZIP_OS_DEFAULT=> 0xFF ;
|
|
|
140
140
|
GZIP_OS_DEFAULT() => 'Unknown',
|
|
141
141
|
) ;
|
|
142
142
|
|
|
143
|
-
use constant GZIP_MINIMUM_HEADER => pack("C4 V C C",
|
|
143
|
+
use constant GZIP_MINIMUM_HEADER => pack("C4 V C C",
|
|
144
144
|
GZIP_ID1, GZIP_ID2, GZIP_CM_DEFLATED, GZIP_FLG_DEFAULT,
|
|
145
145
|
GZIP_MTIME_DEFAULT, GZIP_XFL_DEFAULT, GZIP_OS_DEFAULT) ;
|
|
146
146
|
|
|
@@ -8,24 +8,24 @@ use bytes;
|
|
|
8
8
|
|
|
9
9
|
require Exporter ;
|
|
10
10
|
|
|
11
|
-
use IO::Compress::RawDeflate 2.
|
|
12
|
-
use IO::Compress::Adapter::Deflate 2.
|
|
11
|
+
use IO::Compress::RawDeflate 2.100 () ;
|
|
12
|
+
use IO::Compress::Adapter::Deflate 2.100 ;
|
|
13
13
|
|
|
14
|
-
use IO::Compress::Base::Common 2.
|
|
15
|
-
use IO::Compress::Gzip::Constants 2.
|
|
16
|
-
use IO::Compress::Zlib::Extra 2.
|
|
14
|
+
use IO::Compress::Base::Common 2.100 qw(:Status );
|
|
15
|
+
use IO::Compress::Gzip::Constants 2.100 ;
|
|
16
|
+
use IO::Compress::Zlib::Extra 2.100 ;
|
|
17
17
|
|
|
18
18
|
BEGIN
|
|
19
19
|
{
|
|
20
|
-
if (defined &utf8::downgrade )
|
|
20
|
+
if (defined &utf8::downgrade )
|
|
21
21
|
{ *noUTF8 = \&utf8::downgrade }
|
|
22
22
|
else
|
|
23
|
-
{ *noUTF8 = sub {} }
|
|
23
|
+
{ *noUTF8 = sub {} }
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $GzipError);
|
|
27
27
|
|
|
28
|
-
$VERSION = '2.
|
|
28
|
+
$VERSION = '2.100';
|
|
29
29
|
$GzipError = '' ;
|
|
30
30
|
|
|
31
31
|
@ISA = qw(IO::Compress::RawDeflate Exporter);
|
|
@@ -65,7 +65,7 @@ sub getExtraParams
|
|
|
65
65
|
return (
|
|
66
66
|
# zlib behaviour
|
|
67
67
|
$self->getZlibParams(),
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
# Gzip header fields
|
|
70
70
|
'minimal' => [IO::Compress::Base::Common::Parse_boolean, 0],
|
|
71
71
|
'comment' => [IO::Compress::Base::Common::Parse_any, undef],
|
|
@@ -105,7 +105,7 @@ sub ckParams
|
|
|
105
105
|
# Also check that they only contain ISO 8859-1 chars.
|
|
106
106
|
if ($got->parsed('name') && defined $got->getValue('name')) {
|
|
107
107
|
my $name = $got->getValue('name');
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
return $self->saveErrorString(undef, "Null Character found in Name",
|
|
110
110
|
Z_DATA_ERROR)
|
|
111
111
|
if $strict && $name =~ /\x00/ ;
|
|
@@ -132,16 +132,16 @@ sub ckParams
|
|
|
132
132
|
|
|
133
133
|
return $self->saveErrorString(undef, "OS_Code must be between 0 and 255, got '$value'")
|
|
134
134
|
if $value < 0 || $value > 255 ;
|
|
135
|
-
|
|
135
|
+
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
# gzip only supports Deflate at present
|
|
139
139
|
$got->setValue('method' => Z_DEFLATED) ;
|
|
140
140
|
|
|
141
141
|
if ( ! $got->parsed('extraflags')) {
|
|
142
|
-
$got->setValue('extraflags' => 2)
|
|
142
|
+
$got->setValue('extraflags' => 2)
|
|
143
143
|
if $got->getValue('level') == Z_BEST_COMPRESSION ;
|
|
144
|
-
$got->setValue('extraflags' => 4)
|
|
144
|
+
$got->setValue('extraflags' => 4)
|
|
145
145
|
if $got->getValue('level') == Z_BEST_SPEED ;
|
|
146
146
|
}
|
|
147
147
|
|
|
@@ -161,12 +161,13 @@ sub ckParams
|
|
|
161
161
|
sub mkTrailer
|
|
162
162
|
{
|
|
163
163
|
my $self = shift ;
|
|
164
|
-
return pack("V V", *$self->{Compress}->crc32(),
|
|
164
|
+
return pack("V V", *$self->{Compress}->crc32(),
|
|
165
165
|
*$self->{UnCompSize}->get32bit());
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
sub getInverseClass
|
|
169
169
|
{
|
|
170
|
+
no warnings 'once';
|
|
170
171
|
return ('IO::Uncompress::Gunzip',
|
|
171
172
|
\$IO::Uncompress::Gunzip::GunzipError);
|
|
172
173
|
}
|
|
@@ -184,7 +185,7 @@ sub getFileInfo
|
|
|
184
185
|
$params->setValue('name' => $filename)
|
|
185
186
|
if ! $params->parsed('name') ;
|
|
186
187
|
|
|
187
|
-
$params->setValue('time' => $defaultTime)
|
|
188
|
+
$params->setValue('time' => $defaultTime)
|
|
188
189
|
if ! $params->parsed('time') ;
|
|
189
190
|
}
|
|
190
191
|
|
|
@@ -207,7 +208,7 @@ sub mkHeader
|
|
|
207
208
|
$flags |= GZIP_FLG_FEXTRA if $param->wantValue('extrafield') ;
|
|
208
209
|
$flags |= GZIP_FLG_FNAME if $param->wantValue('name') ;
|
|
209
210
|
$flags |= GZIP_FLG_FCOMMENT if $param->wantValue('comment') ;
|
|
210
|
-
|
|
211
|
+
|
|
211
212
|
# MTIME
|
|
212
213
|
my $time = $param->valueOrDefault('time', GZIP_MTIME_DEFAULT) ;
|
|
213
214
|
|
|
@@ -218,7 +219,7 @@ sub mkHeader
|
|
|
218
219
|
my $os_code = $param->valueOrDefault('os_code', GZIP_OS_DEFAULT) ;
|
|
219
220
|
|
|
220
221
|
|
|
221
|
-
my $out = pack("C4 V C C",
|
|
222
|
+
my $out = pack("C4 V C C",
|
|
222
223
|
GZIP_ID1, # ID1
|
|
223
224
|
GZIP_ID2, # ID2
|
|
224
225
|
$method, # Compression Method
|
|
@@ -240,7 +241,7 @@ sub mkHeader
|
|
|
240
241
|
$name =~ s/\x00.*$//;
|
|
241
242
|
$out .= $name ;
|
|
242
243
|
# Terminate the filename with NULL unless it already is
|
|
243
|
-
$out .= GZIP_NULL_BYTE
|
|
244
|
+
$out .= GZIP_NULL_BYTE
|
|
244
245
|
if !length $name or
|
|
245
246
|
substr($name, 1, -1) ne GZIP_NULL_BYTE ;
|
|
246
247
|
}
|
|
@@ -257,7 +258,7 @@ sub mkHeader
|
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
# HEADER CRC
|
|
260
|
-
$out .= pack("v", Compress::Raw::Zlib::crc32($out) & 0x00FF )
|
|
261
|
+
$out .= pack("v", Compress::Raw::Zlib::crc32($out) & 0x00FF )
|
|
261
262
|
if $param->getValue('headercrc') ;
|
|
262
263
|
|
|
263
264
|
noUTF8($out);
|
|
@@ -270,7 +271,7 @@ sub mkFinalTrailer
|
|
|
270
271
|
return '';
|
|
271
272
|
}
|
|
272
273
|
|
|
273
|
-
1;
|
|
274
|
+
1;
|
|
274
275
|
|
|
275
276
|
__END__
|
|
276
277
|
|
|
@@ -285,7 +286,7 @@ IO::Compress::Gzip - Write RFC 1952 files/buffers
|
|
|
285
286
|
my $status = gzip $input => $output [,OPTS]
|
|
286
287
|
or die "gzip failed: $GzipError\n";
|
|
287
288
|
|
|
288
|
-
my $z =
|
|
289
|
+
my $z = IO::Compress::Gzip->new( $output [,OPTS] )
|
|
289
290
|
or die "gzip failed: $GzipError\n";
|
|
290
291
|
|
|
291
292
|
$z->print($string);
|
|
@@ -319,7 +320,6 @@ IO::Compress::Gzip - Write RFC 1952 files/buffers
|
|
|
319
320
|
binmode $z
|
|
320
321
|
fileno $z
|
|
321
322
|
close $z ;
|
|
322
|
-
|
|
323
323
|
|
|
324
324
|
=head1 DESCRIPTION
|
|
325
325
|
|
|
@@ -349,7 +349,8 @@ The functional interface needs Perl5.005 or better.
|
|
|
349
349
|
=head2 gzip $input_filename_or_reference => $output_filename_or_reference [, OPTS]
|
|
350
350
|
|
|
351
351
|
C<gzip> expects at least two parameters,
|
|
352
|
-
C<$input_filename_or_reference> and C<$output_filename_or_reference
|
|
352
|
+
C<$input_filename_or_reference> and C<$output_filename_or_reference>
|
|
353
|
+
and zero or more optional parameters (see L</Optional Parameters>)
|
|
353
354
|
|
|
354
355
|
=head3 The C<$input_filename_or_reference> parameter
|
|
355
356
|
|
|
@@ -362,7 +363,7 @@ It can take one of the following forms:
|
|
|
362
363
|
|
|
363
364
|
=item A filename
|
|
364
365
|
|
|
365
|
-
If the <$input_filename_or_reference> parameter is a simple scalar, it is
|
|
366
|
+
If the C<$input_filename_or_reference> parameter is a simple scalar, it is
|
|
366
367
|
assumed to be a filename. This file will be opened for reading and the
|
|
367
368
|
input data will be read from it.
|
|
368
369
|
|
|
@@ -466,9 +467,9 @@ in C<$output_filename_or_reference> as a concatenated series of compressed data
|
|
|
466
467
|
|
|
467
468
|
=head2 Optional Parameters
|
|
468
469
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
L</"Constructor Options"> section below
|
|
470
|
+
The optional parameters for the one-shot function C<gzip>
|
|
471
|
+
are (for the most part) identical to those used with the OO interface defined in the
|
|
472
|
+
L</"Constructor Options"> section. The exceptions are listed below
|
|
472
473
|
|
|
473
474
|
=over 5
|
|
474
475
|
|
|
@@ -536,6 +537,22 @@ Defaults to 0.
|
|
|
536
537
|
|
|
537
538
|
=head2 Examples
|
|
538
539
|
|
|
540
|
+
Here are a few example that show the capabilities of the module.
|
|
541
|
+
|
|
542
|
+
=head3 Streaming
|
|
543
|
+
|
|
544
|
+
This very simple command line example demonstrates the streaming capabilities of the module.
|
|
545
|
+
The code reads data from STDIN, compresses it, and writes the compressed data to STDOUT.
|
|
546
|
+
|
|
547
|
+
$ echo hello world | perl -MIO::Compress::Gzip=gzip -e 'gzip \*STDIN => \*STDOUT' >output.gz
|
|
548
|
+
|
|
549
|
+
The special filename "-" can be used as a standin for both C<\*STDIN> and C<\*STDOUT>,
|
|
550
|
+
so the above can be rewritten as
|
|
551
|
+
|
|
552
|
+
$ echo hello world | perl -MIO::Compress::Gzip=gzip -e 'gzip "-" => "-"' >output.gz
|
|
553
|
+
|
|
554
|
+
=head3 Compressing a file from the filesystem
|
|
555
|
+
|
|
539
556
|
To read the contents of the file C<file1.txt> and write the compressed
|
|
540
557
|
data to the file C<file1.txt.gz>.
|
|
541
558
|
|
|
@@ -547,6 +564,8 @@ data to the file C<file1.txt.gz>.
|
|
|
547
564
|
gzip $input => "$input.gz"
|
|
548
565
|
or die "gzip failed: $GzipError\n";
|
|
549
566
|
|
|
567
|
+
=head3 Reading from a Filehandle and writing to an in-memory buffer
|
|
568
|
+
|
|
550
569
|
To read from an existing Perl filehandle, C<$input>, and write the
|
|
551
570
|
compressed data to a buffer, C<$buffer>.
|
|
552
571
|
|
|
@@ -555,12 +574,14 @@ compressed data to a buffer, C<$buffer>.
|
|
|
555
574
|
use IO::Compress::Gzip qw(gzip $GzipError) ;
|
|
556
575
|
use IO::File ;
|
|
557
576
|
|
|
558
|
-
my $input =
|
|
577
|
+
my $input = IO::File->new( "<file1.txt" )
|
|
559
578
|
or die "Cannot open 'file1.txt': $!\n" ;
|
|
560
579
|
my $buffer ;
|
|
561
580
|
gzip $input => \$buffer
|
|
562
581
|
or die "gzip failed: $GzipError\n";
|
|
563
582
|
|
|
583
|
+
=head3 Compressing multiple files
|
|
584
|
+
|
|
564
585
|
To compress all files in the directory "/my/home" that match "*.txt"
|
|
565
586
|
and store the compressed data in the same directory
|
|
566
587
|
|
|
@@ -590,7 +611,7 @@ and if you want to compress each file one at a time, this will do the trick
|
|
|
590
611
|
|
|
591
612
|
The format of the constructor for C<IO::Compress::Gzip> is shown below
|
|
592
613
|
|
|
593
|
-
my $z =
|
|
614
|
+
my $z = IO::Compress::Gzip->new( $output [,OPTS] )
|
|
594
615
|
or die "IO::Compress::Gzip failed: $GzipError\n";
|
|
595
616
|
|
|
596
617
|
It returns an C<IO::Compress::Gzip> object on success and undef on failure.
|
|
@@ -635,7 +656,7 @@ return undef.
|
|
|
635
656
|
|
|
636
657
|
=head2 Constructor Options
|
|
637
658
|
|
|
638
|
-
C<OPTS> is any combination of the following options:
|
|
659
|
+
C<OPTS> is any combination of zero or more the following options:
|
|
639
660
|
|
|
640
661
|
=over 5
|
|
641
662
|
|
|
@@ -1204,6 +1225,12 @@ See L<IO::Compress::FAQ|IO::Compress::FAQ/"Apache::GZip Revisited">
|
|
|
1204
1225
|
|
|
1205
1226
|
See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP">
|
|
1206
1227
|
|
|
1228
|
+
=head1 SUPPORT
|
|
1229
|
+
|
|
1230
|
+
General feedback/questions/bug reports should be sent to
|
|
1231
|
+
L<https://github.com/pmqs/IO-Copress/issues> (preferred) or
|
|
1232
|
+
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Copress>.
|
|
1233
|
+
|
|
1207
1234
|
=head1 SEE ALSO
|
|
1208
1235
|
|
|
1209
1236
|
L<Compress::Zlib>, 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::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
|
|
@@ -1237,8 +1264,7 @@ See the Changes file.
|
|
|
1237
1264
|
|
|
1238
1265
|
=head1 COPYRIGHT AND LICENSE
|
|
1239
1266
|
|
|
1240
|
-
Copyright (c) 2005-
|
|
1267
|
+
Copyright (c) 2005-2021 Paul Marquess. All rights reserved.
|
|
1241
1268
|
|
|
1242
1269
|
This program is free software; you can redistribute it and/or
|
|
1243
1270
|
modify it under the same terms as Perl itself.
|
|
1244
|
-
|
|
@@ -6,15 +6,16 @@ use strict ;
|
|
|
6
6
|
use warnings;
|
|
7
7
|
use bytes;
|
|
8
8
|
|
|
9
|
-
use IO::Compress::Base 2.
|
|
10
|
-
use IO::Compress::Base::Common 2.
|
|
11
|
-
use IO::Compress::Adapter::Deflate 2.
|
|
9
|
+
use IO::Compress::Base 2.100 ;
|
|
10
|
+
use IO::Compress::Base::Common 2.100 qw(:Status :Parse);
|
|
11
|
+
use IO::Compress::Adapter::Deflate 2.100 ;
|
|
12
|
+
use Compress::Raw::Zlib 2.100 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
|
|
12
13
|
|
|
13
14
|
require Exporter ;
|
|
14
15
|
|
|
15
16
|
our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
|
|
16
17
|
|
|
17
|
-
$VERSION = '2.
|
|
18
|
+
$VERSION = '2.100';
|
|
18
19
|
$RawDeflateError = '';
|
|
19
20
|
|
|
20
21
|
@ISA = qw(IO::Compress::Base Exporter);
|
|
@@ -28,8 +29,8 @@ push @EXPORT_OK, @IO::Compress::Adapter::Deflate::EXPORT_OK ;
|
|
|
28
29
|
my %seen;
|
|
29
30
|
foreach (keys %EXPORT_TAGS )
|
|
30
31
|
{
|
|
31
|
-
push @{$EXPORT_TAGS{constants}},
|
|
32
|
-
grep { !$seen{$_}++ }
|
|
32
|
+
push @{$EXPORT_TAGS{constants}},
|
|
33
|
+
grep { !$seen{$_}++ }
|
|
33
34
|
@{ $EXPORT_TAGS{$_} }
|
|
34
35
|
}
|
|
35
36
|
$EXPORT_TAGS{all} = $EXPORT_TAGS{constants} ;
|
|
@@ -41,7 +42,7 @@ push @EXPORT_OK, @IO::Compress::Adapter::Deflate::EXPORT_OK ;
|
|
|
41
42
|
#push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
|
|
42
43
|
|
|
43
44
|
Exporter::export_ok_tags('all');
|
|
44
|
-
|
|
45
|
+
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
sub new
|
|
@@ -82,7 +83,7 @@ sub mkComp
|
|
|
82
83
|
return $self->saveErrorString(undef, $errstr, $errno)
|
|
83
84
|
if ! defined $obj;
|
|
84
85
|
|
|
85
|
-
return $obj;
|
|
86
|
+
return $obj;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
|
|
@@ -116,8 +117,6 @@ sub getExtraParams
|
|
|
116
117
|
return getZlibParams();
|
|
117
118
|
}
|
|
118
119
|
|
|
119
|
-
use IO::Compress::Base::Common 2.086 qw(:Parse);
|
|
120
|
-
use Compress::Raw::Zlib 2.086 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
|
|
121
120
|
our %PARAMS = (
|
|
122
121
|
#'method' => [IO::Compress::Base::Common::Parse_unsigned, Z_DEFLATED],
|
|
123
122
|
'level' => [IO::Compress::Base::Common::Parse_signed, Z_DEFAULT_COMPRESSION],
|
|
@@ -125,17 +124,18 @@ our %PARAMS = (
|
|
|
125
124
|
|
|
126
125
|
'crc32' => [IO::Compress::Base::Common::Parse_boolean, 0],
|
|
127
126
|
'adler32' => [IO::Compress::Base::Common::Parse_boolean, 0],
|
|
128
|
-
'merge' => [IO::Compress::Base::Common::Parse_boolean, 0],
|
|
127
|
+
'merge' => [IO::Compress::Base::Common::Parse_boolean, 0],
|
|
129
128
|
);
|
|
130
|
-
|
|
129
|
+
|
|
131
130
|
sub getZlibParams
|
|
132
131
|
{
|
|
133
|
-
return %PARAMS;
|
|
132
|
+
return %PARAMS;
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
sub getInverseClass
|
|
137
136
|
{
|
|
138
|
-
|
|
137
|
+
no warnings 'once';
|
|
138
|
+
return ('IO::Uncompress::RawInflate',
|
|
139
139
|
\$IO::Uncompress::RawInflate::RawInflateError);
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -144,7 +144,7 @@ sub getFileInfo
|
|
|
144
144
|
my $self = shift ;
|
|
145
145
|
my $params = shift;
|
|
146
146
|
my $file = shift ;
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
use Fcntl qw(SEEK_SET);
|
|
@@ -156,20 +156,20 @@ sub createMerge
|
|
|
156
156
|
my $outType = shift ;
|
|
157
157
|
|
|
158
158
|
my ($invClass, $error_ref) = $self->getInverseClass();
|
|
159
|
-
eval "require $invClass"
|
|
159
|
+
eval "require $invClass"
|
|
160
160
|
or die "aaaahhhh" ;
|
|
161
161
|
|
|
162
|
-
my $inf = $invClass->new( $outValue,
|
|
163
|
-
Transparent => 0,
|
|
162
|
+
my $inf = $invClass->new( $outValue,
|
|
163
|
+
Transparent => 0,
|
|
164
164
|
#Strict => 1,
|
|
165
165
|
AutoClose => 0,
|
|
166
166
|
Scan => 1)
|
|
167
167
|
or return $self->saveErrorString(undef, "Cannot create InflateScan object: $$error_ref" ) ;
|
|
168
168
|
|
|
169
169
|
my $end_offset = 0;
|
|
170
|
-
$inf->scan()
|
|
170
|
+
$inf->scan()
|
|
171
171
|
or return $self->saveErrorString(undef, "Error Scanning: $$error_ref", $inf->errorNo) ;
|
|
172
|
-
$inf->zap($end_offset)
|
|
172
|
+
$inf->zap($end_offset)
|
|
173
173
|
or return $self->saveErrorString(undef, "Error Zapping: $$error_ref", $inf->errorNo) ;
|
|
174
174
|
|
|
175
175
|
my $def = *$self->{Compress} = $inf->createDeflate();
|
|
@@ -178,10 +178,10 @@ sub createMerge
|
|
|
178
178
|
*$self->{UnCompSize} = *$inf->{UnCompSize}->clone();
|
|
179
179
|
*$self->{CompSize} = *$inf->{CompSize}->clone();
|
|
180
180
|
# TODO -- fix this
|
|
181
|
-
#*$self->{CompSize} = new
|
|
181
|
+
#*$self->{CompSize} = U64->new(0, *$self->{UnCompSize_32bit});
|
|
182
182
|
|
|
183
183
|
|
|
184
|
-
if ( $outType eq 'buffer')
|
|
184
|
+
if ( $outType eq 'buffer')
|
|
185
185
|
{ substr( ${ *$self->{Buffer} }, $end_offset) = '' }
|
|
186
186
|
elsif ($outType eq 'handle' || $outType eq 'filename') {
|
|
187
187
|
*$self->{FH} = *$inf->{FH} ;
|
|
@@ -189,8 +189,8 @@ sub createMerge
|
|
|
189
189
|
*$self->{FH}->flush() ;
|
|
190
190
|
*$self->{Handle} = 1 if $outType eq 'handle';
|
|
191
191
|
|
|
192
|
-
#seek(*$self->{FH}, $end_offset, SEEK_SET)
|
|
193
|
-
*$self->{FH}->seek($end_offset, SEEK_SET)
|
|
192
|
+
#seek(*$self->{FH}, $end_offset, SEEK_SET)
|
|
193
|
+
*$self->{FH}->seek($end_offset, SEEK_SET)
|
|
194
194
|
or return $self->saveErrorString(undef, $!, $!) ;
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -199,7 +199,7 @@ sub createMerge
|
|
|
199
199
|
|
|
200
200
|
#### zlib specific methods
|
|
201
201
|
|
|
202
|
-
sub deflateParams
|
|
202
|
+
sub deflateParams
|
|
203
203
|
{
|
|
204
204
|
my $self = shift ;
|
|
205
205
|
|
|
@@ -210,7 +210,7 @@ sub deflateParams
|
|
|
210
210
|
return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo})
|
|
211
211
|
if $status == STATUS_ERROR;
|
|
212
212
|
|
|
213
|
-
return 1;
|
|
213
|
+
return 1;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
|
|
@@ -231,7 +231,7 @@ IO::Compress::RawDeflate - Write RFC 1951 files/buffers
|
|
|
231
231
|
my $status = rawdeflate $input => $output [,OPTS]
|
|
232
232
|
or die "rawdeflate failed: $RawDeflateError\n";
|
|
233
233
|
|
|
234
|
-
my $z =
|
|
234
|
+
my $z = IO::Compress::RawDeflate->new( $output [,OPTS] )
|
|
235
235
|
or die "rawdeflate failed: $RawDeflateError\n";
|
|
236
236
|
|
|
237
237
|
$z->print($string);
|
|
@@ -265,7 +265,6 @@ IO::Compress::RawDeflate - Write RFC 1951 files/buffers
|
|
|
265
265
|
binmode $z
|
|
266
266
|
fileno $z
|
|
267
267
|
close $z ;
|
|
268
|
-
|
|
269
268
|
|
|
270
269
|
=head1 DESCRIPTION
|
|
271
270
|
|
|
@@ -295,7 +294,8 @@ The functional interface needs Perl5.005 or better.
|
|
|
295
294
|
=head2 rawdeflate $input_filename_or_reference => $output_filename_or_reference [, OPTS]
|
|
296
295
|
|
|
297
296
|
C<rawdeflate> expects at least two parameters,
|
|
298
|
-
C<$input_filename_or_reference> and C<$output_filename_or_reference
|
|
297
|
+
C<$input_filename_or_reference> and C<$output_filename_or_reference>
|
|
298
|
+
and zero or more optional parameters (see L</Optional Parameters>)
|
|
299
299
|
|
|
300
300
|
=head3 The C<$input_filename_or_reference> parameter
|
|
301
301
|
|
|
@@ -308,7 +308,7 @@ It can take one of the following forms:
|
|
|
308
308
|
|
|
309
309
|
=item A filename
|
|
310
310
|
|
|
311
|
-
If the <$input_filename_or_reference> parameter is a simple scalar, it is
|
|
311
|
+
If the C<$input_filename_or_reference> parameter is a simple scalar, it is
|
|
312
312
|
assumed to be a filename. This file will be opened for reading and the
|
|
313
313
|
input data will be read from it.
|
|
314
314
|
|
|
@@ -404,9 +404,9 @@ in C<$output_filename_or_reference> as a concatenated series of compressed data
|
|
|
404
404
|
|
|
405
405
|
=head2 Optional Parameters
|
|
406
406
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
L</"Constructor Options"> section below
|
|
407
|
+
The optional parameters for the one-shot function C<rawdeflate>
|
|
408
|
+
are (for the most part) identical to those used with the OO interface defined in the
|
|
409
|
+
L</"Constructor Options"> section. The exceptions are listed below
|
|
410
410
|
|
|
411
411
|
=over 5
|
|
412
412
|
|
|
@@ -474,6 +474,22 @@ Defaults to 0.
|
|
|
474
474
|
|
|
475
475
|
=head2 Examples
|
|
476
476
|
|
|
477
|
+
Here are a few example that show the capabilities of the module.
|
|
478
|
+
|
|
479
|
+
=head3 Streaming
|
|
480
|
+
|
|
481
|
+
This very simple command line example demonstrates the streaming capabilities of the module.
|
|
482
|
+
The code reads data from STDIN, compresses it, and writes the compressed data to STDOUT.
|
|
483
|
+
|
|
484
|
+
$ echo hello world | perl -MIO::Compress::RawDeflate=rawdeflate -e 'rawdeflate \*STDIN => \*STDOUT' >output.1951
|
|
485
|
+
|
|
486
|
+
The special filename "-" can be used as a standin for both C<\*STDIN> and C<\*STDOUT>,
|
|
487
|
+
so the above can be rewritten as
|
|
488
|
+
|
|
489
|
+
$ echo hello world | perl -MIO::Compress::RawDeflate=rawdeflate -e 'rawdeflate "-" => "-"' >output.1951
|
|
490
|
+
|
|
491
|
+
=head3 Compressing a file from the filesystem
|
|
492
|
+
|
|
477
493
|
To read the contents of the file C<file1.txt> and write the compressed
|
|
478
494
|
data to the file C<file1.txt.1951>.
|
|
479
495
|
|
|
@@ -485,6 +501,8 @@ data to the file C<file1.txt.1951>.
|
|
|
485
501
|
rawdeflate $input => "$input.1951"
|
|
486
502
|
or die "rawdeflate failed: $RawDeflateError\n";
|
|
487
503
|
|
|
504
|
+
=head3 Reading from a Filehandle and writing to an in-memory buffer
|
|
505
|
+
|
|
488
506
|
To read from an existing Perl filehandle, C<$input>, and write the
|
|
489
507
|
compressed data to a buffer, C<$buffer>.
|
|
490
508
|
|
|
@@ -493,12 +511,14 @@ compressed data to a buffer, C<$buffer>.
|
|
|
493
511
|
use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError) ;
|
|
494
512
|
use IO::File ;
|
|
495
513
|
|
|
496
|
-
my $input =
|
|
514
|
+
my $input = IO::File->new( "<file1.txt" )
|
|
497
515
|
or die "Cannot open 'file1.txt': $!\n" ;
|
|
498
516
|
my $buffer ;
|
|
499
517
|
rawdeflate $input => \$buffer
|
|
500
518
|
or die "rawdeflate failed: $RawDeflateError\n";
|
|
501
519
|
|
|
520
|
+
=head3 Compressing multiple files
|
|
521
|
+
|
|
502
522
|
To compress all files in the directory "/my/home" that match "*.txt"
|
|
503
523
|
and store the compressed data in the same directory
|
|
504
524
|
|
|
@@ -528,7 +548,7 @@ and if you want to compress each file one at a time, this will do the trick
|
|
|
528
548
|
|
|
529
549
|
The format of the constructor for C<IO::Compress::RawDeflate> is shown below
|
|
530
550
|
|
|
531
|
-
my $z =
|
|
551
|
+
my $z = IO::Compress::RawDeflate->new( $output [,OPTS] )
|
|
532
552
|
or die "IO::Compress::RawDeflate failed: $RawDeflateError\n";
|
|
533
553
|
|
|
534
554
|
It returns an C<IO::Compress::RawDeflate> object on success and undef on failure.
|
|
@@ -573,7 +593,7 @@ return undef.
|
|
|
573
593
|
|
|
574
594
|
=head2 Constructor Options
|
|
575
595
|
|
|
576
|
-
C<OPTS> is any combination of the following options:
|
|
596
|
+
C<OPTS> is any combination of zero or more the following options:
|
|
577
597
|
|
|
578
598
|
=over 5
|
|
579
599
|
|
|
@@ -948,6 +968,12 @@ See L<IO::Compress::FAQ|IO::Compress::FAQ/"Apache::GZip Revisited">
|
|
|
948
968
|
|
|
949
969
|
See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP">
|
|
950
970
|
|
|
971
|
+
=head1 SUPPORT
|
|
972
|
+
|
|
973
|
+
General feedback/questions/bug reports should be sent to
|
|
974
|
+
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
|
|
975
|
+
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
|
|
976
|
+
|
|
951
977
|
=head1 SEE ALSO
|
|
952
978
|
|
|
953
979
|
L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, 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::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
|
|
@@ -981,8 +1007,7 @@ See the Changes file.
|
|
|
981
1007
|
|
|
982
1008
|
=head1 COPYRIGHT AND LICENSE
|
|
983
1009
|
|
|
984
|
-
Copyright (c) 2005-
|
|
1010
|
+
Copyright (c) 2005-2021 Paul Marquess. All rights reserved.
|
|
985
1011
|
|
|
986
1012
|
This program is free software; you can redistribute it and/or
|
|
987
1013
|
modify it under the same terms as Perl itself.
|
|
988
|
-
|