Seth Woolley's Man Viewer

Archive::Tar::Win32(3) - Tar - module for manipulation of tar archives - man 3 Archive::Tar::Win32

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

Archive::Tar::Win32(3)User Contributed Perl DocumentationArchive::Tar::Win32(3)



NAME
       Tar - module for manipulation of tar archives.

SYNOPSIS
           use Archive::Tar;

           # or use Archive::Tar::Win32 directly - not recommended
           # use Archive::Tar::Win32

           $tar = Archive::Tar->new();
           $tar->read(2,n,1 builtins)("origin.tar.gz",1);
           $tar->add_files("file(1,n)/foo.c", "file(1,n)/bar.c");
           $tar->add_data("file(1,n)/baz.c","This is the file(1,n) contents");
           $tar->write(1,2)("files.tar");

DESCRIPTION
       This is a module for the handling of tar archives.  Due to the nature
       of the Win32 environment, Archive::Tar falls back to an older version.
       Although less(1,3) in(1,8) features, it's proven to work.

       At the moment these methods are implemented:

       "new()"
           Returns a new Tar object. If given a filename as an argument, it
           will try to load(7,n) that as a tar file. If given a true value as a
           second argument, will assume that the tar file(1,n) is compressed, and
           will attempt to read(2,n,1 builtins) it using Compress::Zlib.

       "add_files(@filenamelist)"
           Takes a list of filenames and adds them to the in-memory archive.
           I suspect that this function will produce bogus tar archives when
           used under MacOS, but I'm not sure and I have no Mac to test it on.

       "add_data($filename,$data,$opthashref)"
           Takes a filename, a scalar full of data and optionally a reference
           to a hash with specific options. Will add a file(1,n) to the in-memory
           archive, with name $filename and content $data. Specific options
           can be set(7,n,1 builtins) using $opthashref, which will be documented later.

       "remove(@filenamelist)"
           Removes any entries with names matching any of the given filenames
           from the in-memory archive. String comparisons are done with "eq".

       "read(2,n,1 builtins)('file.tar',$compressed)"
           Try to read(2,n,1 builtins) the given tarfile into memory. If the second argument
           is a true value, the tarfile is assumed to be compressed. Will
           replace any previous content in(1,8) $tar!

       "write(1,2)('file.tar',$compressed)"
           Will write(1,2) the in-memory archive to disk. If no filename is given,
           returns the entire formatted archive as a string(3,n), which should be
           useful if(3,n) you'd like to stuff the archive into a socket(2,7,n) or a pipe(2,8)
           to gzip or something. If the second argument is true, the module
           will try to write(1,2) the file(1,n) compressed.

       "data()"
           Returns the in-memory archive. This is a list of references to
           hashes, the internals of which is not currently documented.

       "extract(@filenames)"
           Write files whose names are equivalent to any of the names in(1,8)
           @filenames to disk, creating subdirectories as neccesary. This
           might not work too well under VMS and MacOS.

       "list_files()"
           Returns a list with the names of all files in(1,8) the in-memory ar-
           chive.

       "get_content($file(1,n))"
           Return the content of the named(5,8) file.

       "replace_content($file(1,n),$content)"
           Make the string(3,n) $content be the content for the file(1,n) named(5,8) $file.

CHANGES
       Version 0.073
           Bundle Archive::Tar 0.072 and 0.22 together. Falling back to 0.072
           version(1,3,5) if(3,n) on a Win32 platform (now called Archive::Tar::Win32) and
           0.22 if(3,n) on another platform (now called Archive::Tar::Std).

           This change should work transparently for users.

           Added the error(8,n)() and set_error() methods as also available in(1,8) 0.22

       Version 0.071
           Minor release.

           Arrange to chmod(1,2)() at the very end in(1,8) case it makes the file(1,n) read-
           only.  Win32 is actually picky about that.

           SunOS 4.x tar makes tarfiles that contain directory entries that
           don't have typeflag set(7,n,1 builtins) properly.  We use the trailing slash to
           recognize directories in(1,8) such tarfiles.

       Version 0.07
           Fixed (hopefully) broken portability to MacOS, reported by Paul J.
           Schinder at Goddard Space Flight Center.

           Fixed two bugs with symlink handling, reported in(1,8) excellent detail
           by an admin at teleport.com called Chris.

           Primive tar program (called ptar) included with distribution. Use-
           age should be pretty obvious if(3,n) you've used a normal tar program.

           Added methods get_content and replace_content.

           Added support for paths longer than 100 characters, according to
           POSIX. This is compatible with just about everything except GNU
           tar.  Way to go, GNU tar (use a better tar, or GNU cpio).

           NOTE: When adding files to an archive, files with basenames longer
                 than 100 characters will be silently ignored. If the prefix
           part
                 of a path is longer than 155 characters, only the last 155
                 characters will be stored.

       Version 0.06
           Added list_files() method, as requested by Michael Wiedman.

           Fixed a couple of dysfunctions when run under Windows NT. Michael
           Wiedmann reported the bugs.

           Changed the documentation to reflect reality a bit better.

           Fixed bug in(1,8) format_tar_entry. Bug reported by Michael Schilli.

       Version 0.05
           Quoted lots of barewords to make "use strict;" stop complaining
           under perl version(1,3,5) 5.003.

           Ties to Compress::Zlib put in. Will warn if(3,n) it isn't available.

           $tar->write(1,2)() with no argument now returns the formatted archive.

       Version 0.04
           Made changes to write_tar so that Solaris tar likes the resulting
           archives better.

           Protected the calls to readlink(1,2)() and symlink(). AFAIK this module
           should now run just fine on Windows NT.

           Add method to write(1,2) a single entry to disk (extract)

           Added method to add entries entirely from scratch (add_data)

           Changed name of add() to add_file()

           All calls to croak() removed and replaced with returning undef and
           setting Tar::error.

           Better handling of tarfiles with garbage at the end.

COPYRIGHT
       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.



perl v5.8.5                       2003-01-21            Archive::Tar::Win32(3)

References for this manual (incoming links)