Archive-Tar

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN


get_files() returns a file of all Archive::Tar::File objects in the
current read-in archive.

0.23, 21/1/2003:

Bundled 0.072 and 0.22 to be able to work on Win32 and non-Win32
platforms. Since the previous version is almost 3 years old, bundling
seemed like the quickest way to get a working solution again.

Archive::Tar now transparently Does The Right Thing depending what
platform you are on -- Win32 users, read the Archive::Tar::Win32
documentation!

I also suppose this makes me the new maintainer...

0.20:

New class methods create_archive, extract_archive & list_archive.

Archive::Tar no longer keeps the entire archive in memory after

lib/Archive/Tar.pm  view on Meta::CPAN


Read the given tar file into memory.
The first argument can either be the name of a file or a reference to
an already open filehandle (or an IO::Zlib object if it's compressed)

The C<read> will I<replace> any previous content in C<$tar>!

The second argument may be considered optional, but remains for
backwards compatibility. Archive::Tar now looks at the file
magic to determine what class should be used to open the file
and will transparently Do The Right Thing.

Archive::Tar will warn if you try to pass a bzip2 / xz compressed file and the
IO::Uncompress::Bunzip2 / IO::Uncompress::UnXz are not available and simply return.

Note that you can currently B<not> pass a C<gzip> compressed
filehandle, which is not opened with C<IO::Zlib>, a C<bzip2> compressed
filehandle, which is not opened with C<IO::Uncompress::Bunzip2>, a C<xz> compressed
filehandle, which is not opened with C<IO::Uncompress::UnXz>, nor a string
containing the full archive information (either compressed or
uncompressed). These are worth while features, but not currently

lib/Archive/Tar.pm  view on Meta::CPAN

    my $compress = shift || 0;
    my $mode     = shift || READ_ONLY->( ZLIB ); # default to read only

    ### Check if file is a file handle or IO glob
    if ( ref $file ) {
	return $file if eval{ *$file{IO} };
	return $file if eval{ $file->isa(q{IO::Handle}) };
	$file = q{}.$file;
    }

    ### get a FH opened to the right class, so we can use it transparently
    ### throughout the program
    my $fh;
    {   ### reading magic only makes sense if we're opening a file for
        ### reading. otherwise, just use what the user requested.
        my $magic = '';
        if( MODE_READ->($mode) ) {
            open my $tmp, $file or do {
                $self->_error( qq[Could not open '$file' for reading: $!] );
                return;
            };



( run in 0.277 second using v1.01-cache-2.11-cpan-a1d94b6210f )