COMPACT(1) UNIX Programmer's Manual COMPACT(1) NAME compact, uncompact, ccat - compress and uncompress files, and cat them SYNOPSIS compact [ name ... ] uncompact [ name ... ] ccat [ file ... ] DESCRIPTION _C_o_m_p_a_c_t compresses the named files using an adaptive Huffman code. If no file names are given, then the standard input is compacted to the standard output. _C_o_m_p_a_c_t 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, _c_o_m_p_a_c_t and _u_n_c_o_m_p_a_c_t can operate as filters. In particular, ... | compact | uncompact | ... operates as a (very slow) no-op. When an argument _f_i_l_e is given, it is compacted and the resulting file is placed in _f_i_l_e._C; _f_i_l_e is unlinked. The first two bytes of the compacted file code the fact that the file is compacted. This code is used to prohibit recompac- tion. 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. _U_n_c_o_m_p_a_c_t restores the original file from a file compressed by _c_o_m_p_a_c_t. If no file names are given, then the standard input is uncompacted to the standard output. _C_c_a_t cats the original file from a file compressed by _c_o_m_- _p_a_c_t, without uncompressing the file. RESTRICTION The last segment of the filename must contain fewer than thirteen characters to allow space for the appended '.C'. FILES *.C compacted file created by compact, removed by uncompact Printed 7/22/83 1 COMPACT(1) UNIX Programmer's Manual COMPACT(1) SEE ALSO Gallager, Robert G., "Variations on a Theme of Huffman", _I._E._E._E. _T_r_a_n_s_a_c_t_i_o_n_s _o_n _I_n_f_o_r_m_a_t_i_o_n _T_h_e_o_r_y, vol. IT-24, no. 6, November 1978, pp. 668 - 674. AUTHOR Colin L. Mc Master Printed 7/22/83 2