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