Annotation of 43BSDTahoe/old/compact/compact.1, revision 1.1.1.1

1.1       root        1: .\" Copyright (c) 1980 Regents of the University of California.
                      2: .\" All rights reserved.  The Berkeley software License Agreement
                      3: .\" specifies the terms and conditions for redistribution.
                      4: .\"
                      5: .\"    @(#)compact.1   6.1 (Berkeley) 4/29/85
                      6: .\"
                      7: .TH COMPACT 1 "April 29, 1985"
                      8: .UC 4
                      9: .SH NAME
                     10: compact, uncompact, ccat \- compress and uncompress files, and cat them
                     11: .SH SYNOPSIS
                     12: .B compact
                     13: [
                     14: .B \-v
                     15: ] [ name ... ]
                     16: .br
                     17: .B uncompact
                     18: [
                     19: .B \-v
                     20: ] [ name ...  ]
                     21: .br
                     22: .B ccat
                     23: [
                     24: .B \-v
                     25: ] [ file ... ]
                     26: .SH DESCRIPTION
                     27: .I Compact
                     28: compresses the named files using an adaptive Huffman code.  If no file
                     29: names are given, the standard input is compacted to the standard output.
                     30: .I Compact
                     31: operates as an on-line algorithm.  Each time a byte is read,
                     32: it is encoded immediately according to the current prefix code.
                     33: This code is an optimal Huffman code for the set of frequencies seen so far.
                     34: It is unnecessary to prepend a decoding tree to the compressed file
                     35: since the encoder and the decoder start in the same state and stay
                     36: synchronized.  Furthermore,
                     37: .I compact
                     38: and
                     39: .I uncompact
                     40: can operate as filters.  In particular,
                     41: .sp
                     42:        ... | compact | uncompact | ...
                     43: .br
                     44: .sp
                     45: operates as a (very slow) no-op.
                     46: .PP
                     47: When an argument
                     48: .I file
                     49: is given, it is compacted and the resulting file is placed in
                     50: .I file.C;
                     51: .I file
                     52: is unlinked.  The first two bytes of the compacted file code the
                     53: fact that the file is compacted.  This code is used to prohibit recompaction.
                     54: .PP
                     55: The amount of compression to be expected depends on the type of file being
                     56: compressed.  Typical values of compression are:
                     57: Text (38%), Pascal Source (43%), C Source (36%) and Binary (19%).
                     58: These values are the percentages of file bytes reduced.
                     59: .PP
                     60: .I Uncompact
                     61: restores the original file from a file compressed by
                     62: .I compact.
                     63: If no file names are given, the standard input is uncompacted to
                     64: the standard output.
                     65: .PP
                     66: .I Ccat
                     67: cats the original file from a file compressed by
                     68: .I compact,
                     69: without uncompressing the file (it is just a shell script which
                     70: directs the uncompacted output to the standard output).
                     71: .PP
                     72: .IR Compact ,
                     73: .IR uncompact ,
                     74: and
                     75: .I ccat
                     76: normally do their work silently.  If a
                     77: .B \-v
                     78: flag is supplied, 
                     79: .I compact
                     80: will report the compression percentage for each compacted
                     81: file while 
                     82: .I uncompact
                     83: and
                     84: .I ccat
                     85: will print out the name of each file as they're uncompacted.
                     86: .SH RESTRICTION
                     87: The last segment of the filename must be short enough
                     88: to allow space for the appended '.C'.
                     89: .SH FILES
                     90: .ta 1i
                     91: *.C    compacted file created by compact, removed by uncompact
                     92: .SH "SEE ALSO"
                     93: Gallager, Robert G., `Variations on a Theme of Huffman',
                     94: .I "I.E.E.E.  Transactions on Information Theory,"
                     95: vol. IT-24, no. 6, November 1978, pp. 668 - 674.
                     96: .SH AUTHOR
                     97: Colin L. Mc Master

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.