Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pack(1) — sys5 — Apollo Domain/OS SR10.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

PACK(1)                              SysV                              PACK(1)



NAME
     pack, pcat, unpack - compress and expand files

SYNOPSIS
     pack [ - ] [ -f ] name ...

     pcat name ...

     unpack name ...

DESCRIPTION
     Pack attempts to store the specified files in a compressed form.
     Wherever possible and useful, it replaces each input file name by a
     packed file name.z with the same access modes, access and modified dates,
     and owner as those of name.

     If pack is successful, it removes name.  Packed files can be restored to
     their original form using unpack or pcat.

     Pack 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-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.  Pack returns a
     value equaling the number of files not compressed.

     No packing occurs if one or more of the following conditions exists:

          File appears to be already packed.
          Filename has more than 12 characters.
          File has links.
          File is a directory.
          File cannot be opened.
          No disk storage blocks will be saved by packing.
          A file called name.z already exists.
          .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.

     Pcat 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.  To view a packed file named name.z
     use:

          pcat name.z
     or just:
          pcat name

     To make an unpacked copy, say nnn, of a packed file named name.z (without
     destroying name.z ) use the command:
          pcat name > nnn

     Pcat returns the number of files it was unable to unpack, but will fail
     if one of the following conditions exist:

          Filename (exclusive of the .z ) has more than 12 characters.
          File cannot be opened.
          File does not appear to be the output of pack.

     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.  It also 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.  It will fail for the same reasons as those listed for pcat, as
     well as for the following additional reasons:

          a file with the "unpacked" name already exists
          the unpacked file cannot be created.

OPTIONS
     (Note that these options are only for use with pack.)

     -         Set 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 name cause the internal flag to be set and reset.

     -f        Force packing of name.  Useful for causing an entire directory
               to be packed even if some of the files will not benefit.

SEE ALSO
     cat (1).

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026