Arch::Tarball3pm
An interface to create and work with tarballs
Usage
use Arch::Tarballmy $tarball = Arch::Tarball->new;my $pipe = $tarball->create(dir => '/path/to/subdir-to-pack',base_name => 'new-subdir-to-pack',pipe => 1,);
Overview
Arch::Tarball provides an object oriented interface to work with (create, examine or extract) standard gzipped tarballs.
Note: As functionality is added only when needed, a lot of features are currently not implemented.
Methods
The following functions are available:
new, create, extract, list.
new%opts-
Creates a new Arch::Tarball object.
The following parameters can be set via %opts:
tar-
The name of the tar executable. Defaults to
"tar".
file-
The filename of the Tarball.
create%opts-
Creates a new tarball (tar.gz) from a given directory structure.
createunderstands the following options:dir(mandatory)-
Specifies the base directory for the tarball. The given directory and recursively its content will be added to the tarball. The directory's basename will be used as the first and the only subdirectory in the tarball.
base_name-
Allow the programmer to specify a different base directory name for the tarball content than the basename of
dir. In this case, 'cp' process is launched to temporarily rename the last element ofdir.
pipe-
When set,
createdoes not create a physical tarball but writes the tarballs content to a newly created pipe. The pipe is returned by thecreatemethod.
Note:Currently thepipeoption is mandatory.
extract%opts-
Extracts the tarball to a given target directory, specified by
diroption. Ifdiroption is not given, a temporary directory is created that will hold the extracted dirs/files. This directory is returned.The
fileoption specifies the tarball file name. It may be given in the constructor instead.
list%opts (not implemented yet)-
Returns a list of files and directories in the tarball.
Releases
8 releases since Debian 4.0 (Etch); the text changed 3 times.