summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm52
1 files changed, 39 insertions, 13 deletions
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Bzip2.pm
index 1c0d027abdc..13d3b4674df 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.084 ;
+use IO::Compress::Base 2.093 ;
-use IO::Compress::Base::Common 2.084 qw();
-use IO::Compress::Adapter::Bzip2 2.084 ;
+use IO::Compress::Base::Common 2.093 qw();
+use IO::Compress::Adapter::Bzip2 2.093 ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error);
-$VERSION = '2.084';
+$VERSION = '2.093';
$Bzip2Error = '';
@ISA = qw(IO::Compress::Base Exporter);
@@ -51,7 +51,7 @@ sub getExtraParams
{
my $self = shift ;
- use IO::Compress::Base::Common 2.084 qw(:Parse);
+ use IO::Compress::Base::Common 2.093 qw(:Parse);
return (
'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1],
@@ -183,7 +183,6 @@ IO::Compress::Bzip2 - Write bzip2 files/buffers
binmode $z
fileno $z
close $z ;
-
=head1 DESCRIPTION
@@ -210,7 +209,8 @@ The functional interface needs Perl5.005 or better.
=head2 bzip2 $input_filename_or_reference => $output_filename_or_reference [, OPTS]
C<bzip2> expects at least two parameters,
-C<$input_filename_or_reference> and C<$output_filename_or_reference>.
+C<$input_filename_or_reference> and C<$output_filename_or_reference>
+and zero or more optional parameters (see L</Optional Parameters>)
=head3 The C<$input_filename_or_reference> parameter
@@ -223,7 +223,7 @@ It can take one of the following forms:
=item A filename
-If the <$input_filename_or_reference> parameter is a simple scalar, it is
+If the C<$input_filename_or_reference> parameter is a simple scalar, it is
assumed to be a filename. This file will be opened for reading and the
input data will be read from it.
@@ -319,9 +319,9 @@ in C<$output_filename_or_reference> as a concatenated series of compressed data
=head2 Optional Parameters
-Unless specified below, the optional parameters for C<bzip2>,
-C<OPTS>, are the same as those used with the OO interface defined in the
-L</"Constructor Options"> section below.
+The optional parameters for the one-shot function C<bzip2>
+are (for the most part) identical to those used with the OO interface defined in the
+L</"Constructor Options"> section. The exceptions are listed below
=over 5
@@ -389,6 +389,22 @@ Defaults to 0.
=head2 Examples
+Here are a few example that show the capabilities of the module.
+
+=head3 Streaming
+
+This very simple command line example demonstrates the streaming capabilities of the module.
+The code reads data from STDIN, compresses it, and writes the compressed data to STDOUT.
+
+ $ echo hello world | perl -MIO::Compress::Bzip2=bzip2 -e 'bzip2 \*STDIN => \*STDOUT' >output.bz2
+
+The special filename "-" can be used as a standin for both C<\*STDIN> and C<\*STDOUT>,
+so the above can be rewritten as
+
+ $ echo hello world | perl -MIO::Compress::Bzip2=bzip2 -e 'bzip2 "-" => "-"' >output.bz2
+
+=head3 Compressing a file from the filesystem
+
To read the contents of the file C<file1.txt> and write the compressed
data to the file C<file1.txt.bz2>.
@@ -400,6 +416,8 @@ data to the file C<file1.txt.bz2>.
bzip2 $input => "$input.bz2"
or die "bzip2 failed: $Bzip2Error\n";
+=head3 Reading from a Filehandle and writing to an in-memory buffer
+
To read from an existing Perl filehandle, C<$input>, and write the
compressed data to a buffer, C<$buffer>.
@@ -414,6 +432,8 @@ compressed data to a buffer, C<$buffer>.
bzip2 $input => \$buffer
or die "bzip2 failed: $Bzip2Error\n";
+=head3 Compressing multiple files
+
To compress all files in the directory "/my/home" that match "*.txt"
and store the compressed data in the same directory
@@ -488,7 +508,7 @@ return undef.
=head2 Constructor Options
-C<OPTS> is any combination of the following options:
+C<OPTS> is any combination of zero or more the following options:
=over 5
@@ -768,6 +788,12 @@ See L<IO::Compress::FAQ|IO::Compress::FAQ/"Apache::GZip Revisited">
See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP">
+=head1 SUPPORT
+
+General feedback/questions/bug reports should be sent to
+L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
+L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
+
=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::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>
@@ -778,7 +804,7 @@ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
L<Archive::Tar|Archive::Tar>,
L<IO::Zlib|IO::Zlib>
-The primary site for the bzip2 program is L<http://www.bzip.org>.
+The primary site for the bzip2 program is L<https://sourceware.org/bzip2/>.
See the module L<Compress::Bzip2|Compress::Bzip2>