Skip to main content

Module gzip

Module gzip 

Source
Expand description

The gzip family (gzip, gunzip, zcat, gzcat): stuffr behaving as the platform’s own gzip.

Two personalities share the member layer (member) and the format sniffer (sniff):

  • GNU (gnu/): GNU gzip 1.15, written from its manual, --help and black-box observation of the binary only. GNU gzip is GPLv3 and its source is never read. Its gunzip and zcat are shell scripts that run gzip -d and gzip -dc, so every message says gzip:; gzcat behaves as zcat. The module doc of gnu/mod.rs lists the behaviours reproduced and the deviations.
  • BSD (bsd/): Apple’s gzip 487, ported from file_cmds (BSD-2-Clause, LICENSE-gzip-bsd); its compressed bytes are Apple’s on the C tier. The module doc of bsd/mod.rs lists the behaviours reproduced and the deviations.

The flavour is default_flavour unless STUFFR_GZIP_FLAVOR says gnu or bsd; run reads the variable once, before any argument. Anything else in it is refused, exit 1, in stuffr’s own words (neither reference has the variable).

Enums§

Flavour
Which reference the gzip family follows.

Functions§

default_flavour
The flavour a build uses when STUFFR_GZIP_FLAVOR is unset or empty: BSD on Apple platforms and the BSDs, whose gzip is the FreeBSD/NetBSD one; GNU everywhere else, Windows included.
run
Entry point for gzip, gunzip, zcat and gzcat; name is the canonical invoked name and args the arguments after argv[0].