File: README

package info (click to toggle)
libarchive-any-create-perl 0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 124 kB
  • ctags: 19
  • sloc: perl: 126; makefile: 2
file content (52 lines) | stat: -rw-r--r-- 1,751 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
NAME
    Archive::Any::Create - Abstract API to create archives (tar.gz and zip)

SYNOPSIS
      use Archive::Any::Create;

      my $archive = Archive::Any::Create->new;

      $archive->container('foo');               # top-level directory
      $archive->add_file('bar.txt', $data);     # foo/bar.txt
      $archive->add_file('bar/baz.txt', $data); # foo/bar/baz.txt

      $archive->write_file('foo.tar.gz');
      $archive->write_file('foo.zip');

      $archive->write_filehandle(\*STDOUT, 'tar.gz');

DESCRIPTION
    Archive::Any::Create is a wrapper module to create tar/tar.gz/zip files
    with a single easy-to-use API.

METHODS
    new Create new Archive::Any::Create object. No parameters.

    container($dir)
        Specify a top-level directory (or folder) to contain multiple files.
        Not necessary but recommended to create a good-manner archive file.

    add_file($file, $data)
        Add a file that contains $data as its content. $file can be a file
        in the nested subdirectory.

    write_file($filename)
        Write an archive file named $filename. This method is DWIMmy, in the
        sense that it automatically dispatches archiving module based on its
        filename. So, "$archive->write_file("foo.tar.gz")" will create a
        tarball and "$archive->write_file("foo.zip")" will create a zip file
        with the same contents.

    write_filehandle($fh, $format)
        Write an archive data stream into filehandle. $format is either,
        *tar*, *tar.gz* or *zip*.

AUTHOR
    Tatsuhiko Miyagawa <miyagawa@bulknews.net>

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

SEE ALSO
    Archive::Any, Archive::Tar, Archive::Zip