Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

pack(1) OSS Shell and Utilities Reference Manual
NAME
pack - Compresses files
SYNOPSIS
pack [-f][-] file ...
FLAGS
- Displays statistics about the input files. The statistics are calculated from a Huffman
minimum redundancy code tree built on a byte-by-byte basis. Repeating the - (dash)
on the command line toggles this function.
-f Forces compaction of input files.
DESCRIPTION
The pack command stores the specified file in a compressed form. The input file is replaced by a
packed file with a name derived from the original filename (file.z). The pack command tries to
preserve the access modes, access and modification dates, and owner from the original file, but it
can do so only if you have the appropriate privileges (see the chmod(1) reference page); other-
wise, pack compresses the file and assigns your owner and group ID to the new file.
Directories cannot be compressed.
If pack cannot create a smaller file, it stops processing and reports that it is unable to save space,
unless you specify -f. (The -f flag forces packing to occur even if the files cannot benefit from
packing.) A failure to save space generally happens with small files or files with uniform charac-
ter distribution.
The amount of space saved depends on the size of the input file and the character frequency dis-
tribution. Because a decoding tree forms the first part of each .z file, you will generally not be
able to save space with files smaller than three blocks. Typically, text files are reduced 25 to 40
percent. Object files, which use a larger character set and have a more uniform distribution of
characters, show only a 10-percent reduction when packed.
Packing is not done if any of the following conditions are true:
The file is already packed.
The file has hard links.
The file is a directory.
The file cannot be opened.
No storage blocks are saved by packing.
A file called file.z already exists.
The .z file cannot be created.
An I/O error occurs during processing.
The filename is more than NAME_MAX-2 bytes long.
The file is empty and the -f option has not been specified.
Environment Variables
This command supports the use of the LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and
NLSPATH environment variables.
72 Hewlett-Packard Company 527188-004