pcat file ...
unpack file ...
SUNWesu
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:
The last segment of the file name must contain no more than {NAME_MAX} bytes to allow space for the appended .z extension. Directories cannot be compressed.
- the file appears to be already packed
- the file name has more than {NAME_MAX} bytes
- the file has links
- the file is a directory
- the file cannot be opened
- the file is empty
- no disk storage blocks will be saved by packing
- a file called file.z already exists
- the .z file cannot be created
- an I/O error occurred during processing.
pcat returns the number of files it was unable to unpack. Failure may occur if:
- the file cannot be opened;
- the file does not appear to be the output of pack.
The unpack command 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.
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, as well as for the following:
- a file with the ‘‘unpacked’’ name already exists;
- the unpacked file cannot be created.
- the filename (excluding of the .z extension) has more than {NAME_MAX} bytes
example% pcat file.z
or just:
example% pcat file
To make an unpacked copy, say nnn, of a packed file named file.z (without destroying file.z) use the command:
example% pcat file >nnn