c

compact(1)

compact(1)

NAME

compact, uncompact, ccat - compact and uncompact ®les, and cat them

SYNOPSIS

compact [ name ...]

uncompact [ name ...]

ccat [ ®le ...]

DESCRIPTION

compact compresses the named ®les using an adaptive Huffman code. If no ®le names are given, standard input is compacted and sent to the standard output. compact operates as an on-line algorithm. Each time a byte is read, it is encoded immediately according to the current pre®x code. This code is an optimal Huffman code for the set of frequencies seen so far. It is unnecessary to attach a decoding tree in front of the compressed ®le because the encoder and the decoder start in the same state and stay synchron- ized. Furthermore, compact and uncompact can operate as ®lters. In particular,

... compact uncompact ...

operates as a (very slow) no-op.

When an argument ®le is given, it is compacted, the resulting ®le is placed in ®le.C, and ®le is unlinked. The ®rst two bytes of the compacted ®le code the fact that the ®le is compacted. These bytes are used to prohibit recompaction.

The amount of compression to be expected depends on the type of ®le being compressed. Typical ®le size reduction (in percent) through compression are: Text, 38%; Pascal Source, 43%; C Source, 36%; and Binary, 19%.

uncompact restores the original ®le from a ®le compressed by compact. If no ®le names are speci®ed, standard input is uncompacted and sent to the standard output.

ccat cats the original ®le from a ®le compressed by compact, without uncompressing the ®le.

Access Control Lists (ACLs)

On systems that implement access control lists, when a new ®le is created with the effective user and group ID of the caller, the original ®le's ACL is copied to the new ®le after being altered to re¯ect any change in ownership (see acl(5) and aclv(5)). In JFS ®le systems, ®les created by compact, uncompact or ccat do not inherit their parent directory's default ACL entries (if any), but instead retain their original ACLs. When a ®le being compacted or uncompacted resides on a JFS ®le system, and the compacted or uncompacted ®le resides on an HFS ®le system (or vice versa), as the result of ccat or the use of compact or uncompact as a ®lter, optional ACL entries are lost.

WARNINGS

On short-®lename systems, the last segment of the ®le name must contain 12 or fewer characters to allow space for the appended .C.

DEPENDENCIES

NFS

Access control list entries of networked ®les are summarized (as returned in st_mode by stat()), but not copied to the new ®le (see stat(2)).

FILES

*.C compacted ®le created by compact, removed by uncompact

SEE ALSO

compress(1), pack(1), acl(5), aclv(5).

Gallager, Robert G., ``Variations on a Theme of Huffman,'' I.E.E.E. Transactions on Information Theory, vol. IT-24, no. 6, November 1978, pp. 668 - 674.

AUTHOR

compact was developed by Colin L. Mc Master.

Section 1108

− 1 −

HP-UX Release 11i: December 2000