Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Archive::Any::Plugin
Anatomy of an Archive::Any plugin.

Archive::Any::Plugin - Anatomy of an Archive::Any plugin.


NAME

Archive::Any::Plugin - Anatomy of an Archive::Any plugin.


SYNOPSIS

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


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. the Archive::Any::Plugin manpage handles negotiating directories for you.

 sub extract {

    my ( $self, $file ) = @_;

 

    my $t = Archive::Tar->new( $file );

    return $t->extract;

 }


AUTHOR

Clint Moore <cmoore@cpan.org>


SEE ALSO

Archive::Any

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy