Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Archive::Any::Plugin(3User Contributed Perl DocumentatiArchive::Any::Plugin(3)

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

VERSION
       version 0.0946

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

	    sub	extract	{
	       my ( $self, $file ) = @_;

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

SEE ALSO
       Archive::Any

AUTHORS
       o   Clint Moore

       o   Michael G Schwern (author emeritus)

       o   Olaf	Alders (current	maintainer)

COPYRIGHT AND LICENSE
       This software is	copyright (c) 2016 by Michael G	Schwern, Clint Moore,
       Olaf Alders.

       This is free software; you can redistribute it and/or modify it under
       the same	terms as the Perl 5 programming	language system	itself.

perl v5.32.0			  2019-04-05	       Archive::Any::Plugin(3)

NAME | VERSION | SYNOPSIS | PLUGINS | SEE ALSO | AUTHORS | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Archive::Any::Plugin&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help