pcat name . . .
unpack name . . . .
pack uses Huffman (minimum redundancy) codes on a byte-by-byte basis. If the ``-'' argument is used, an internal flag is set that causes the number of times each byte is used, its relative frequency, and the code for the byte to be printed on the standard output. Additional occurrences of - in place of name will cause the internal flag to be set and reset.
The amount of compression obtained depends on the size of the input file and the character frequency distribution. Because a decoding tree forms the first part of each .z file, it is usually not worthwhile to pack files smaller than three blocks, unless the character frequency distribution is very skewed, which may occur with printer plots or pictures.
Typically, text files are reduced to 60-75% of their original size. Load modules, which use a larger character set and have a more uniform distribution of characters, show little compression, the packed versions being about 90% of the original size.
pack returns a value that is the number of files that it failed to compress.
No packing will occur if:
pcat returns the number of files it was unable to unpack. Failure may occur if:
unpack expands files created by pack. For each file name specified in the command, a search is made for a file called name.z (or just name, if name ends in .z). If this file appears to be a packed file, it is replaced by its expanded version. The new file has the .z suffix stripped from its name, and has the same access modes, access and modification dates, and owner as those of the packed file.
unpack returns a value that is the number of files it was unable to unpack. Failure may occur for the same reasons that it may in pcat, or if a file with the unpacked name already exists.