home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / COMPR412.ZIP / compress.man < prev    next >
Text File  |  1992-07-18  |  6KB  |  122 lines

  1. NAME
  2.      compress, uncompress, zcat - compress and expand data (version 4.1)
  3.  
  4. SYNOPSIS
  5.      compress [ -f ] [ -v ] [ -c ] [ -V ] [ -r ] [ -b bits ] [ name ... ]
  6.      uncompress [ -f ] [ -v ] [ -c ] [ -V ] [ name ... ]
  7.      zcat [ -V ] [ name ... ]
  8.  
  9. DESCRIPTION
  10.      Compress reduces the size of the named files using adaptive
  11.      Lempel-Ziv coding.  Whenever possible, each file is replaced
  12.      by one with the extension .Z, while keeping the same owner-
  13.      ship modes, access and modification times.  If no files are
  14.      specified, the standard input is compressed to the standard
  15.      output.  Compressed files can be restored to their original
  16.      form using uncompress or zcat.
  17.  
  18.      The -f option will force compression of name. If -f is not
  19.      given and compress is run in the foreground, the user is
  20.      prompted as to whether an existing file should be overwrit-
  21.      ten.
  22.  
  23.      The -c option makes compress/uncompress write to the stan-
  24.      dard output; no files are changed.  The nondestructive
  25.      behavior of zcat is identical to that of uncompress -c.
  26.  
  27.      If the -r flag is specified, compress will operate recur-
  28.      sively. If any of the file names specified on the command
  29.      line are directories, compress will descend into the direc-
  30.      tory and compress all the files it finds there.
  31.  
  32.      Compress uses the modified Lempel-Ziv algorithm popularized
  33.      in "A Technique for High Performance Data Compression",
  34.      Terry A. Welch, IEEE Computer, vol. 17, no. 6 (June 1984),
  35.      pp. 8-19.  Common substrings in the file are first replaced
  36.      by 9-bit codes 257 and up.  When code 512 is reached, the
  37.      algorithm switches to 10-bit codes and continues to use more
  38.      bits until the limit specified by the -b flag is reached
  39.      (default 16).  Bits must be between 9 and 16.  The default
  40.      can be changed in the source to allow compress to be run on
  41.      a smaller machine.
  42.  
  43.      After the bits limit is attained, compress periodically
  44.      checks the compression ratio.  If it is increasing, compress
  45.      continues to use the existing code dictionary.  However, if
  46.      the compression ratio decreases, compress discards the table
  47.      of substrings and rebuilds it from scratch.  This allows the
  48.      algorithm to adapt to the next "block" of the file.
  49.  
  50.      Note that the -b flag is omitted for uncompress, since the
  51.      bits parameter specified during compression is encoded
  52.      within the output, along with a magic number to ensure that
  53.      neither decompression of random data nor recompression of
  54.      compressed data is attempted.
  55.  
  56.  
  57.  
  58.      The amount of compression obtained depends on the size of
  59.      the input, the number of bits per code, and the distribution
  60.      of common substrings.  Typically, text such as source code
  61.      or English is reduced by 50-60%.  Compression is generally
  62.      much better than that achieved by Huffman coding (as used in
  63.      pack), or adaptive Huffman coding (compact), and takes less
  64.      time to compute.
  65.  
  66.      Under the -v option, a message is printed yielding the per-
  67.      centage of reduction for each file compressed.
  68.  
  69.      If the -V option is specified, the current version and com-
  70.      pile options are printed on stderr.
  71.  
  72.      Exit status is normally 0; if the last file is larger after
  73.      (attempted) compression, the status is 2; if an error
  74.      occurs, exit status is 1.
  75.  
  76. SEE ALSO
  77.      pack(1), compact(1)
  78.  
  79. DIAGNOSTICS
  80.      Usage: compress [-dfvcV] [-b maxbits] [file ...]
  81.              Invalid options were specified on the command line.
  82.      Missing maxbits
  83.              Maxbits must follow -b.
  84.      file: not in compressed format
  85.              The file specified to uncompress has not been
  86.              compressed.
  87.      file: compressed with xx bits, can only handle yy bits
  88.              File was compressed by a program that could deal
  89.              with more bits than the compress code on this
  90.              machine.  Recompress the file with smaller bits.
  91.      file: already has .Z suffix -- no change
  92.              The file is assumed to be already compressed.
  93.              Rename the file and try again.
  94.      file: filename too long to tack on .Z
  95.              The file cannot be compressed because its name is
  96.              longer than 12 characters.  Rename and try again.
  97.              This message does not occur on BSD systems.
  98.      file already exists; do you wish to overwrite (y or n)?
  99.              Respond "y" if you want the output file to be
  100.              replaced; "n" if not.
  101.      uncompress: corrupt input
  102.              A SIGSEGV violation was detected which usually means
  103.              that the input file has been corrupted.
  104.      Compression: xx.xx%
  105.              Percentage of the input saved by compression.
  106.              (Relevant only for -v.)
  107.      -- not a regular file: unchanged
  108.              When the input file is not a regular file, (e.g. a
  109.              directory), it is left unaltered.
  110.      -- has xx other links: unchanged
  111.              The input file has links; it is left unchanged.  See
  112.              ln(1) for more information.
  113.      -- file unchanged
  114.              No savings is achieved by compression.  The input
  115.              remains virgin.
  116.  
  117. BUGS
  118.      Although compressed files are compatible between machines
  119.      with large memory, -b12 should be used for file transfer to
  120.      architectures with a small process data space (64KB or less,
  121.      as exhibited by the DEC PDP series, the Intel 80286, etc.)
  122.