Archive::Tar::Wrapper

API wrapper around the 'tar' utility
Download

Archive::Tar::Wrapper Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Michael Schilli
  • Publisher web site:
  • http://search.cpan.org/~mschilli/

Archive::Tar::Wrapper Tags


Archive::Tar::Wrapper Description

API wrapper around the 'tar' utility Archive::Tar::Wrapper is an Perl wrapper around the 'tar' command line utility. It never stores anything in memory, but works on temporary directory structures on disk instead. It provides a mapping between the logical paths in the tarball and the 'real' files in the temporary directory on disk.SYNOPSIS use Archive::Tar::Wrapper; my $arch = Archive::Tar::Wrapper->new(); # Open a tarball, expand it into a temporary directory $arch->read("archive.tgz"); # Iterate over all entries in the archive $arch->list_reset(); # Reset Iterator # Iterate through archive while(my $entry = $arch->list_next()) { my($tar_path, $phys_path) = @$entry; print "$tar_path "; } # Get a huge list with all entries for my $entry (@{$arch->list_all()}) { my($tar_path, $real_path) = @$entry; print "Tarpath: $tar_path Tempfile: $real_path "; } # Add a new entry $arch->add($logic_path, $file_or_stringref); # Remove an entry $arch->remove($logic_path); # Find the physical location of a temporary file my($tmp_path) = $arch->locate($tar_path); # Create a tarball $arch->write($tarfile, $compress); Requirements: · Perl


Archive::Tar::Wrapper Related Software