Skip to main content

Module compress

Module compress 

Source
Expand description

The compress family (compress, uncompress): stuffr behaving as the platform’s own .Z compressor.

Two personalities, as the gzip and unzip families have:

  • Apple (apple/): Apple’s compress from file_cmds-487.0.1, ported from its compress.c and zopen.c (BSD-3-Clause, LICENSE-compress-bsd). The module doc of apple/mod.rs lists the behaviours reproduced and the deviations.
  • ncompress (ncompress/): ncompress 5.0 as Ubuntu’s 5.0-1 builds it, on every platform, ported from its compress.c (the Unlicense, LICENSE-ncompress). The module doc of ncompress/mod.rs lists the behaviours reproduced and the deviations.

The flavour is default_flavour unless STUFFR_COMPRESS_FLAVOR says apple or ncompress; 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). uncompress decompresses in both flavours, on every platform (Ubuntu’s own uncompress is gzip’s script, and its ncompress binary decompresses only as uncompress.real).

Enums§

Flavour
Which reference the family behaves as.

Functions§

default_flavour
The flavour a build uses when STUFFR_COMPRESS_FLAVOR is unset or empty: Apple on Apple platforms and the BSDs (the cfg of gzip::default_flavour), ncompress everywhere else, Windows included.
run
Entry point for compress and uncompress; name is the canonical invoked name and args the arguments after argv[0].