compact.1 (2010 09)
c
compact(1) compact(1)
NAME
compact, uncompact, ccat - compact and uncompact files, and cat them
SYNOPSIS
compact [ sfile] ...
uncompact [ cfile] ...
ccat [ cfile] ...
DESCRIPTION
compact compresses the named files using an adaptive Huffman code. If no file names are given, stan-
dard 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 prefix 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 file because the encoder and the decoder start in the same state and stay syn-
chronized. Furthermore,
compact and uncompact can operate as filters. In particular,
...
| compact | uncompact | ...
operates as a (very slow) no-op.
When an argument file is given, it is compacted, the resulting file is placed in file
.C, and file is unlinked.
The first two bytes of the compacted file code the fact that the file is compacted. These bytes are used to
prohibit recompaction.
The amount of compression to be expected depends on the type of file being compressed. Typical file size
reduction (in percent) through compression are: Text, 38%; Pascal Source, 43%; C Source, 36%; and
Binary, 19%.
uncompact restores the original file from a file compressed by compact. If no file names are specified,
standard input is uncompacted and sent to the standard output.
ccat writes the specified c_file , compressed by compact, to standard output, without uncompressing
the file.
Operands
The
compact commands recognize the following operands:
cfile Compacted file.
sfile Source file to compact or uncompact. If no file names are given, the commands use stan-
dard input and sent to the standard output.
compact places the compacted file in
file.C.
Access Control Lists (ACLs)
On systems that implement access control lists, when a new file is created with the effective user and
group ID of the caller, the original file’s ACL is copied to the new file after being altered to reflect any
change in ownership (see acl (5) and aclv (5)). In JFS file systems, files created by
compact, uncom-
pact or ccat do not inherit their parent directory’s default ACL entries (if any), but instead retain their
original ACLs. When a file being compacted or uncompacted resides on a JFS file system, and the com-
pacted or uncompacted file resides on an HFS file system (or vice versa), as the result of ccat or the use
of compact or uncompact as a filter, optional ACL entries are lost.
RETURN VALUE
These commands return the following values upon completion:
0 Completed successfully.
>0 An error occurred.
WARNINGS
On short-file-name systems, the last segment of the file name must contain 12 or fewer characters to
allow space for the appended
.C.
DEPENDENCIES
NFS
Access control list entries of networked files are summarized (as returned in
st_mode by stat()), but
not copied to the new file (see stat (2)).
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1