Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

archive::any(3pm) [debian man page]

Archive::Any(3pm)					User Contributed Perl Documentation					 Archive::Any(3pm)

NAME
Archive::Any - Single interface to deal with file archives. SYNOPSIS
use Archive::Any; my $archive = Archive::Any->new($archive_file); my @files = $archive->files; $archive->extract; my $type = $archive->type; $archive->is_impolite; $archive->is_naughty; DESCRIPTION
This module is a single interface for manipulating different archive formats. Tarballs, zip files, etc. new my $archive = Archive::Any->new($archive_file); my $archive = Archive::Any->new($archive_file, $type); $type is optional. It lets you force the file type in-case Archive::Any can't figure it out. extract $archive->extract; $archive->extract($directory); Extracts the files in the archive to the given $directory. If no $directory is given, it will go into the current working directory. files my @file = $archive->files; A list of files in the archive. mime_type my $mime_type = $archive->mime_type(); Returns the mime type of the archive. is_impolite my $is_impolite = $archive->is_impolite; Checks to see if this archive is going to unpack into the current directory rather than create its own. is_naughty my $is_naughty = $archive->is_naughty; Checks to see if this archive is going to unpack outside the current directory. DEPRECATED
type my $type = $archive->type; Returns the type of archive. This method is provided for backwards compatibility in the Tar and Zip plugins and will be going away soon in favor of "mime_type". PLUGINS
For detailed information on writing plugins to work with Archive::Any, please see the pod documentation for Archive::Any::Plugin. AUTHOR
Clint Moore <cmoore@cpan.org> AUTHOR EMERITUS
Michael G Schwern SEE ALSO
Archive::Any::Plugin SUPPORT
You can find documentation for this module with the perldoc command. perldoc Archive::Any You can also look for information at: o AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/Archive-Any> o CPAN Ratings <http://cpanratings.perl.org/d/Archive-Any> o RT: CPAN's request tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Archive-Any> o Search CPAN <http://search.cpan.org/dist/Archive-Any> LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.10.0 2008-06-25 Archive::Any(3pm)

Check Out this Related Man Page

Archive::Zip::MemberRead(3)				User Contributed Perl Documentation			       Archive::Zip::MemberRead(3)

NAME
Archive::Zip::MemberRead - A wrapper that lets you read Zip archive members as if they were files. SYNOPSIS
use Archive::Zip; use Archive::Zip::MemberRead; $zip = Archive::Zip->new("file.zip"); $fh = Archive::Zip::MemberRead->new($zip, "subdir/abc.txt"); while (defined($line = $fh->getline())) { print $fh->input_line_number . "#: $line "; } $read = $fh->read($buffer, 32*1024); print "Read $read bytes as :$buffer: "; DESCRIPTION
The Archive::Zip::MemberRead module lets you read Zip archive member data just like you read data from files. METHODS
Archive::Zip::Member::readFileHandle() You can get a "Archive::Zip::MemberRead" from an archive member by calling "readFileHandle()": my $member = $zip->memberNamed('abc/def.c'); my $fh = $member->readFileHandle(); while (defined($line = $fh->getline())) { # ... } $fh->close(); Archive::Zip::MemberRead->new($zip, $fileName) Archive::Zip::MemberRead->new($zip, $member) Archive::Zip::MemberRead->new($member) Construct a new Archive::Zip::MemberRead on the specified member. my $fh = Archive::Zip::MemberRead->new($zip, 'fred.c') setLineEnd(expr) Set the line end character to use. This is set to by default except on Windows systems where it is set to . You will only need to set this on systems which are not Windows or Unix based and require a line end diffrent from . This is a class method so call as "Archive::Zip::MemberRead"->"setLineEnd($nl)" rewind() Rewinds an "Archive::Zip::MemberRead" so that you can read from it again starting at the beginning. input_record_separator(expr) If the argumnet is given, input_record_separator for this instance is set to it. The current setting (which may be the global $/) is always returned. input_line_number() Returns the current line number, but only if you're using "getline()". Using "read()" will not update the line number. close() Closes the given file handle. buffer_size([ $size ]) Gets or sets the buffer size used for reads. Default is the chunk size used by Archive::Zip. getline() Returns the next line from the currently open member. Makes sense only for text files. A read error is considered fatal enough to die. Returns undef on eof. All subsequent calls would return undef, unless a rewind() is called. Note: The line returned has the input_record_separator (default: newline) removed. read($buffer, $num_bytes_to_read) Simulates a normal "read()" system call. Returns the no. of bytes read. "undef" on error, 0 on eof, e.g.: $fh = Archive::Zip::MemberRead->new($zip, "sreeji/secrets.bin"); while (1) { $read = $fh->read($buffer, 1024); die "FATAL ERROR reading my secrets ! " if (!defined($read)); last if (!$read); # Do processing. .... } AUTHOR
Sreeji K. Das, <sreeji_k@yahoo.com> See Archive::Zip by Ned Konz without which this module does not make any sense! Minor mods by Ned Konz. COPYRIGHT
Copyright 2002 Sreeji K. Das. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.1 2009-06-30 Archive::Zip::MemberRead(3)
Man Page