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