GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ARCHIVE::EXTRACT::LIBARCHIVE (3)

.ds Aq ’

NAME

Archive::Extract::Libarchive - A generic archive extracting mechanism (using libarchive)

CONTENTS

SYNOPSIS



  use Archive::Extract::Libarchive;

  # build an Archive::Extract object
  my $ae = Archive::Extract::Libarchive->new( archive => foo.tgz );

  # extract to cwd()
  my $ok = $ae->extract;

  # extract to /tmp
  my $ok = $ae->extract( to => /tmp );

  # what if something went wrong?
  my $ok = $ae->extract or die $ae->error;
   
  # files from the archive
  my $files   = $ae->files;

  # dir that was extracted to
  my $outdir  = $ae->extract_path;
   
  # absolute path to the archive you provided
  $ae->archive;



DESCRIPTION

Archive::Extract is a generic archive extraction mechanism. This module has a similar interface to Archive::Extract, but instead of using Perl modules and external commands, it uses the libarchive C libary (<http://code.google.com/p/libarchive/>), which you must have installed (libarchive-dev package for Debian/Ubuntu). It supports many different archive formats and compression algorithms and is fast.

For example, unpacking the whole of CPAN using this module is about ten times faster than using Archive::Extract.

METHODS

CW$ae = Archive::Extract::Libarchive->new(archive => ’/path/to/archive’)

Creates a new Archive::Extract::Libarchive object based on the archive file you passed it.

CW$ae->extract( [to => ’/output/path’] )

Extracts the archive represented by the Archive::Extract::Libarchive object to the path of your choice as specified by the to argument. Defaults to cwd().

It will return true on success, and false on failure.

On success, it will also set the follow attributes in the object:
$ae->extract_path This is the directory that the files where extracted to.
$ae->files This is an array ref with the paths of all the files in the archive, relative to the to argument you specified. To get the full path to an extracted file, you would use:



  File::Spec->catfile( $to, $ae->files->[0] );



ACCESSORS

CW$ae->error()

Returns the last encountered error as string.

CW$ae->extract_path

This is the directory the archive got extracted to. See extract() for details.

CW$ae->files

This is an array ref holding all the paths from the archive. See extract() for details.

CW$ae->archive

This is the full path to the archive file represented by this Archive::Extract::Libarchive object.

AUTHOR

Leon Brocard <acme@astray.com>

COPYRIGHT

Copyright (C) 2011, Leon Brocard.

LICENSE

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ARCHIVE::EXTRACT::LIBARCHIVE (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.