GIF89a;
EcchiShell v1.0
/
/
proc/
self/
root/
usr/
share/
perl5/
_create(undef, @_);
}
sub bzip2
{
my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bzip2Error);
$obj->_def(@_);
}
sub mkHeader
{
my $self = shift ;
return '';
}
sub getExtraParams
{
my $self = shift ;
use IO::Compress::Base::Common 2.061 qw(:Parse);
return (
'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1],
'workfactor' => [IO::Compress::Base::Common::Parse_unsigned, 0],
'verbosity' => [IO::Compress::Base::Common::Parse_boolean, 0],
);
}
sub ckParams
{
my $self = shift ;
my $got = shift;
# check that BlockSize100K is a number between 1 & 9
if ($got->parsed('blocksize100k')) {
my $value = $got->getValue('blocksize100k');
return $self->saveErrorString(undef, "Parameter 'BlockSize100K' not between 1 and 9, got $value")
unless defined $value && $value >= 1 && $value <= 9;
}
# check that WorkFactor between 0 & 250
if ($got->parsed('workfactor')) {
my $value = $got->getValue('workfactor');
return $self->saveErrorString(undef, "Parameter 'WorkFactor' not between 0 and 250, got $value")
unless $value >= 0 && $value <= 250;
}
return 1 ;
}
sub mkComp
{
my $self = shift ;
my $got = shift ;
my $BlockSize100K = $got->getValue('blocksize100k');
my $WorkFactor = $got->getValue('workfactor');
my $Verbosity = $got->getValue('verbosity');
my ($obj, $errstr, $errno) = IO::Compress::Adapter::Bzip2::mkCompObject(
$BlockSize100K, $WorkFactor,
$Verbosity);
return $self->saveErrorString(undef, $errstr, $errno)
if ! defined $obj;
return $obj;
}
sub mkTrailer
{
my $self = shift ;
return '';
}
sub mkFinalTrailer
{
return '';
}
#sub newHeader
#{
# my $self = shift ;
# return '';
#}
sub getInverseClass
{
return ('IO::Uncompress::Bunzip2');
}
sub getFileInfo
{
my $self = shift ;
my $params = shift;
my $file = shift ;
}
1;
__END__
=head1 NAME
IO::Compress::Bzip2 - Write bzip2 files/buffers
=head1 SYNOPSIS
use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ;
my $status = bzip2 $input => $output [,OPTS]
or die "bzip2 failed: $Bzip2Error\n";
my $z = new IO::Compress::Bzip2 $output [,OPTS]
or die "bzip2 failed: $Bzip2Error\n";
$z->print($string);
$z->printf($format, $string);
$z->write($string);
$z->syswrite($string [, $length, $offset]);
$z->flush();
$z->tell();
$z->eof();
$z->seek($position, $whence);
$z->binmode();
$z->fileno();
$z->opened();
$z->autoflush();
$z->input_line_number();
$z->newStream( [OPTS] );
$z->close() ;
$Bzip2Error ;
# IO::File mode
print $z $string;
printf $z $format, $string;
tell $z
eof $z
seek $z, $position, $whence
binmode $z
fileno $z
close $z ;
=head1 DESCRIPTION
This module provides a Perl interface that allows writing bzip2
compressed data to files or buffer.
For reading bzip2 files/buffers, see the companion module
L.
=head1 Functional Interface
A top-level function, C, is provided to carry out
"one-shot" compression between buffers and/or files. For finer
control over the compression process, see the L"OO Interface">
section.
use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ;
bzip2 $input => $output [,OPTS]
or die "bzip2 failed: $Bzip2Error\n";
The functional interface needs Perl5.005 or better.
=head2 bzip2 $input => $output [, OPTS]
C expects at least two parameters, C<$input> and C<$output>.
=head3 The C<$input> parameter
The parameter, C<$input>, is used to define the source of
the uncompressed data.
It can take one of the following forms:
=over 5
=item A filename
If the C<$input> 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.
=item A filehandle
If the C<$input> parameter is a filehandle, the input data will be
read from it.
The string '-' can be used as an alias for standard input.
=item A scalar reference
If C<$input> is a scalar reference, the input data will be read
from C<$$input>.
=item An array reference
If C<$input> is an array reference, each element in the array must be a
filename.
The input data will be read from each file in turn.
The complete array will be walked to ensure that it only
contains valid filenames before any data is compressed.
=item An Input FileGlob string
If C<$input> is a string that is delimited by the characters "<" and ">"
C will assume that it is an I. The
input is the list of files that match the fileglob.
If the fileglob does not match any files ...
See L for more details.
=back
If the C<$input> parameter is any other type, C will be returned.
=head3 The C<$output> parameter
The parameter C<$output> is used to control the destination of the
compressed data. This parameter can take one of these forms.
=over 5
=item A filename
If the C<$output> parameter is a simple scalar, it is assumed to be a
filename. This file will be opened for writing and the compressed
data will be written to it.
=item A filehandle
If the C<$output> parameter is a filehandle, the compressed data
will be written to it.
The string '-' can be used as an alias for standard output.
=item A scalar reference
If C<$output> is a scalar reference, the compressed data will be
stored in C<$$output>.
=item An Array Reference
If C<$output> is an array reference, the compressed data will be
pushed onto the array.
=item An Output FileGlob
If C<$output> is a string that is delimited by the characters "<" and ">"
C will assume that it is an I