| 1 |
NAME |
| 2 |
Archive::Any::Create - Abstract API to create archives (tar.gz and zip) |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use Archive::Any::Create; |
| 6 |
|
| 7 |
my $archive = Archive::Any::Create->new; |
| 8 |
|
| 9 |
$archive->container('foo'); # top-level directory |
| 10 |
$archive->add_file('bar.txt', $data); # foo/bar.txt |
| 11 |
$archive->add_file('bar/baz.txt', $data); # foo/bar/baz.txt |
| 12 |
|
| 13 |
$archive->write_file('foo.tar.gz'); |
| 14 |
$archive->write_file('foo.zip'); |
| 15 |
|
| 16 |
$archive->write_filehandle(\*STDOUT, 'tar.gz'); |
| 17 |
|
| 18 |
DESCRIPTION |
| 19 |
Archive::Any::Create is a wrapper module to create tar/tar.gz/zip files |
| 20 |
with a single easy-to-use API. |
| 21 |
|
| 22 |
METHODS |
| 23 |
new Create new Archive::Any::Create object. No parameters. |
| 24 |
|
| 25 |
container($dir) |
| 26 |
Specify a top-level directory (or folder) to contain multiple files. |
| 27 |
Not necessary but recommended to create a good-manner archive file. |
| 28 |
|
| 29 |
add_file($file, $data) |
| 30 |
Add a file that contains $data as its content. $file can be a file |
| 31 |
in the nested subdirectory. |
| 32 |
|
| 33 |
write_file($filename) |
| 34 |
Write an archive file named $filename. This method is DWIMmy, in the |
| 35 |
sense that it automatically dispatches archiving module based on its |
| 36 |
filename. So, "$archive->write_file("foo.tar.gz")" will create a |
| 37 |
tarball and "$archive->write_file("foo.zip")" will create a zip file |
| 38 |
with the same contents. |
| 39 |
|
| 40 |
write_filehandle($fh, $format) |
| 41 |
Write an archive data stream into filehandle. $format is either, |
| 42 |
*tar*, *tar.gz* or *zip*. |
| 43 |
|
| 44 |
AUTHOR |
| 45 |
Tatsuhiko Miyagawa <[email protected]> |
| 46 |
|
| 47 |
This library is free software; you can redistribute it and/or modify it |
| 48 |
under the same terms as Perl itself. |
| 49 |
|
| 50 |
SEE ALSO |
| 51 |
Archive::Any, Archive::Tar, Archive::Zip |
| 52 |
|