pack(1) pack(1)NAME pack, pcat, unpack - compress and expand files SYNOPSIS pack [-] [-f] file... pcat file... unpack file... ARGUMENTS - Sets an internal flag 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 file will cause the internal flag to be set and reset. -f Forces the packing of file. This is useful for causing an entire directory to be packed, even if some of the files will not benefit. If pack is successful, file will be removed. Packed files can be restored to their original form using unpack or pcat. file Specifies the file to be compressed or expanded. DESCRIPTION pack attempts to store the specified files in a compressed form. Wherever possible (and useful), each input file is replaced by a packed file file.z with the same access modes, access and modified dates, and owner as those of file. The pack program uses Huffman (minimum redundancy) codes on a byte-by-byte basis. 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 to 75 percent 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 percent of the original size. The pack program returns a value that is the number of files that it failed to compress. January 1992 1
pack(1) pack(1)No packing will occur if: the file appears to be already packed; the filename has more than 12 characters; the file has links; the file is a directory; the file cannot be opened; no disk storage blocks will be saved by packing; the file is of zero length; a file called file.z already exists; the .z file cannot be created; an I/O error occurred during processing. The last segment of the filename must contain no more than 12 characters to allow space for the appended .z extension. Directories cannot be compressed. The pcat command does for packed files what cat(1) does for ordinary files, except that pcat cannot be used as a filter. The specified files are unpacked and written to the standard output. Thus to view a packed file named file.z use: pcat file.z or just: pcat file To make an unpacked copy, say nnn, of a packed file named file.z (without destroying file.z) use the command: pcat file > nnn The pcat program returns the number of files it was unable to unpack. Failure may occur if: the filename (exclusive of the .z) has more than 12 characters; the file cannot be opened; the file does not appear to be the output of pack. The unpack program expands files created by pack. For each file specified in the command, a search is made for a file called file.z (or just file, if file 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. The unpack program 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, as well as for the following: a file with the ``unpacked'' name already exists; 2 January 1992
pack(1) pack(1)if the unpacked file cannot be created. EXAMPLES The command: pack file1 will pack the file, file1, into the file, file1.z, then removes file1 if packing is successful. FILES /usr/bin/pack Executable file /usr/bin/pcat Executable file /usr/bin/unpack Executable file SEE ALSO cat(1), compact(1) January 1992 3