BSD 4_2 development
[unix-history] / usr / man / man1 / compact.1
CommitLineData
30b1626c
C
1.TH COMPACT 1 "18 January 1983"
2.UC 4
3.SH NAME
4compact, uncompact, ccat \- compress and uncompress files, and cat them
5.SH SYNOPSIS
6.B compact
7[ name ... ]
8.br
9.B uncompact
10[
11name ...
12]
13.br
14.B ccat
15[ file ... ]
16.SH DESCRIPTION
17.I Compact
18compresses the named files using an adaptive Huffman code. If no file
19names are given, the standard input is compacted to the standard output.
20.I Compact
21operates as an on-line algorithm. Each time a byte is read,
22it is encoded immediately according to the current prefix code.
23This code is an optimal Huffman code for the set of frequencies seen so far.
24It is unnecessary to prepend a decoding tree to the compressed file
25since the encoder and the decoder start in the same state and stay
26synchronized. Furthermore,
27.I compact
28and
29.I uncompact
30can operate as filters. In particular,
31.sp
32 ... | compact | uncompact | ...
33.br
34.sp
35operates as a (very slow) no-op.
36.PP
37When an argument
38.I file
39is given, it is compacted and the resulting file is placed in
40.I file.C;
41.I file
42is unlinked. The first two bytes of the compacted file code the
43fact that the file is compacted. This code is used to prohibit recompaction.
44.PP
45The amount of compression to be expected depends on the type of file being
46compressed. Typical values of compression are:
47Text (38%), Pascal Source (43%), C Source (36%) and Binary (19%).
48These values are the percentages of file bytes reduced.
49.PP
50.I Uncompact
51restores the original file from a file compressed by
52.I compact.
53If no file names are given, the standard input is uncompacted to
54the standard output.
55.PP
56.I Ccat
57cats the original file from a file compressed by
58.I compact,
59without uncompressing the file.
60.SH RESTRICTION
61The last segment of the filename must contain fewer than thirteen characters
62to allow space for the appended '.C'.
63.SH FILES
64.ta 1i
65*.C compacted file created by compact, removed by uncompact
66.SH "SEE ALSO"
67Gallager, Robert G., `Variations on a Theme of Huffman',
68.I "I.E.E.E. Transactions on Information Theory,"
69vol. IT-24, no. 6, November 1978, pp. 668 - 674.
70.SH AUTHOR
71Colin L. Mc Master