zarust
Rust implementation of the ZArchive format (.zar / .wua).
Command line
zarust <command> [options]
| Command | Description |
|---|---|
pack <dir> [archive] |
Create an archive from a directory |
extract <archive> [dir] |
Extract an archive into a directory |
list <archive> [path] |
List the entries in an archive |
info <archive> |
Show sizes and the compression ratio |
verify <archive> |
Check the stored integrity hash |
Options may appear before or after the command: -o/--output, -f/--force,
-v/--verbose, -q/--quiet, --tree, --check, --no-progress,
--color <auto|always|never>, -h/--help, -V/--version.
Progress is drawn on stderr only when it is a terminal, so piped output stays
clean. Color follows the terminal and honours NO_COLOR.
Exit codes are 0 success, 1 failure, 2 usage error.
Given a bare path, zarust packs a directory or extracts an archive, matching
the original ZArchive tool:
Library
ArchiveReader accepts any seekable reader and ArchiveWriter accepts any
writer; the binary is a filesystem adapter over them.
use ;
let mut writer = new;
writer.make_dir?;
writer.add_file?;
let bytes = writer.finish?.into_inner;
let mut reader = new?;
let file = reader.lookup_kind.unwrap;
assert_eq!;
assert!;
# Ok::
Path lookups are ASCII case-insensitive and accept either separator, as the format requires.
License
MIT-0