|
|
BSD 4.3tahoe
COMPACT(1) UNIX Programmer's Manual COMPACT(1)
NAME
compact, uncompact, ccat - compress and uncompress files,
and cat them
SYNOPSIS
compact [ -v ] [ name ... ]
uncompact [ -v ] [ name ... ]
ccat [ -v ] [ file ... ]
DESCRIPTION
_C_o_m_p_a_c_t compresses the named files using an adaptive Huffman
code. If no file names are given, 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, 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 (it is just a shell
script which directs the uncompacted output to the standard
output).
_C_o_m_p_a_c_t, _u_n_c_o_m_p_a_c_t, and _c_c_a_t normally do their work
silently. If a -v flag is supplied, _c_o_m_p_a_c_t will report the
compression percentage for each compacted file while _u_n_c_o_m_-
_p_a_c_t and _c_c_a_t will print out the name of each file as
they're uncompacted.
Printed 12/6/87 April 29, 1985 1
COMPACT(1) UNIX Programmer's Manual COMPACT(1)
RESTRICTION
The last segment of the filename must be short enough to
allow space for the appended '.C'.
FILES
*.C compacted file created by compact, removed by
uncompact
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 12/6/87 April 29, 1985 2
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.