Archive::Any::Plugin(3pm)

Archive::Any::Plugin3pm

Anatomy of an archive::any plugin.

Usage

Explains what is required for a working plugin to Archive::Any.

Version

version 0.0946

Plugins

Archive::Any requires that your plugin define three methods, all of which are passed the absolute filename of the file. This module uses the source of Archive::Any::Plugin::Tar as an example.

Subclass Archive::Any::Plugin
 use base 'Archive::Any::Plugin';
can_handle

This returns an array of mime types that the plugin can handle.

 sub can_handle {
    return(
           'application/x-tar',
           'application/x-gtar',
           'application/x-gzip',
          );
 }
files

Return a list of items inside the archive.

 sub files {
    my( $self, $file ) = @_;
    my $t = Archive::Tar->new( $file );
    return $t->list_files;
 }
extract

This method should extract the contents of $file to the current directory. Archive::Any::Plugin handles negotiating directories for you.

 sub extract {
    my ( $self, $file ) = @_;
    my $t = Archive::Tar->new( $file );
    return $t->extract;
 }

Releases

9 releases since Debian 5.0 (Lenny); the text changed 2 times.

  1. 5.0–8
  2. 9–10
  3. 11–13

Authors

•

Clint Moore

•

Michael G Schwern (author emeritus)

•

Olaf Alders (current maintainer)

From libarchive-any-perl 0.0946-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.