NAME
Zuzu::Module::Archive - std/archive bindings for ZuzuScript.
DESCRIPTION
Implements the std/archive module, exporting the Archive class.
This first backend concentrates on a small, portable surface: decode, encode, load, and dump.
Archive values are represented as a dict:
{
format: "zip",
entries: [
{ path: "hello.txt", data: BinaryString },
{ path: "nested/world.txt", data: BinaryString },
],
}
Only regular file entries are preserved in this API. Directory entries and other archive metadata are intentionally ignored to keep the surface small and portable.
CLASS
Archive
Static methods:
Archive.decode(bytes, format?)Decodes
BinaryStringarchive bytes into an archive dict. When the format is omitted orauto, the backend attempts to detect it from the bytes.Archive.encode(archive, format?)Encodes an archive dict into
BinaryStringbytes. The format may be taken fromarchive.format.Archive.load(path, format?)Reads archive bytes from a
std/ioPathand decodes them.Archive.dump(path, archive, format?)Encodes an archive dict and writes it to a
std/ioPath.
Perl currently supports zip, tar, tar.gz, tar.bz2, gz, and bz2.
COPYRIGHT AND LICENCE
Zuzu::Module::Archive is copyright Toby Inkster.
It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.