#
Chapter 21
`inflate.ss`: Inflating Compressed Data

To load: `(require (lib "inflate.ss"))`

`(gunzip``` `file``` [`output-name-filter`]`)` PROCEDURE

Extracts data that was compressed using the GNU `gzip` utility (or `gzip` in the `deflate.ss` library; see section 15), writing the uncompressed data directly to a file. The `file` argument is the name of the file containing compressed data. The default output file name is the original name of the compressed file as stored in `file`. If a file by this name exists, it will be overwritten. If no original name is stored in the source file, `"unzipped"` is used as the default output file name.

The `output-name-filter` procedure is applied to two arguments -- the default destination file name and a Boolean that is `#t` if this name was read from `file` -- before the destination file is created. The return value of the file is used as the actual destination file name (opened with the `'truncate` flag). The default `output-name-filter` procedure returns its first argument.

The return value is void. If the compressed data is corrupted, the `exn:fail` exception is raised.

`(gunzip-through-ports``` `in out``)` PROCEDURE

Reads the port `in` for compressed data that was created using the GNU `gzip` utility, writing the uncompressed data to the port `out`.

The return value is void. If the compressed data is corrupted, the `exn:fail` exception is raised.

`(inflate``` `in out``)` PROCEDURE

Reads `pkzip`-format ``deflated'' data from the port `in` and writes the uncompressed (``inflated'') data to the port `out`. The data in a file created by `gzip` uses this format (preceded with some header information).

The return value is void. If the compressed data is corrupted, the `exn:fail` exception is raised.