COMPACT(1) COMMAND REFERENCE COMPACT(1)
NAME
compact - compress files
SYNOPSIS
compact [ filename ... ]
DESCRIPTION
Compact compresses the named files using an adaptive Huffman
code. If no filenames are given, the standard input is
compacted to the standard output. Compact operates as an
on-line algorithm. Each time a byte is read, it is encoded
immediately according to the current prefix code. This code
is an optimal Huffman code for the set of frequencies seen
so far. It is unnecessary to prepend a decoding tree to the
compressed file since the encoder and the decoder start in
the same state and stay synchronized. Furthermore, compact
and uncompact can operate as filters. In particular,
... | compact | uncompact | ...
operates as a (very slow) no-op.
When an argument filename is given, it is compacted and the
resulting file is placed in filename.C; filename is
unlinked. The first two bytes of the compacted file code the
fact that the file is compacted. This code is used to
prohibit recompaction.
The amount of compression to be expected depends on the type
of file being compressed. Typical values of compression are:
Text (38%), Pascal Source (43%), C Source (36%) and Binary
(19%). These values are the percentages of file bytes
reduced.
EXAMPLES
The following example compacts the file prog.c:
compact prog.c
The resulting compacted data is in the file prog.c.C. The
file prog.c is removed.
FILES
*.C Compacted file created by compact.
RETURN VALUE
[NO_ERRS] Command completed without error.
Printed 10/17/86 1
COMPACT(1) COMMAND REFERENCE COMPACT(1)
[NP_WARN] An error warranting a warning message
occurred. Execution continues.
[NP_ERR] An error occurred that was not a system
error. Execution terminated.
[P_WARN] A system error occurred. Execution continues.
See intro(2) for more information on system
errors.
SEE ALSO
ccat(1), uncompact(1).
Printed 10/17/86 2
%%index%%
na:72,60;
sy:132,146;
de:278,1575;
ex:1853,266;
fi:2119,106;
rv:2225,133;2502,392;
se:2894,149;
%%index%%000000000129