home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / INTERNET / GIGO0209.ZIP / GUTL0209.ZIP / COMPRESS.DOC < prev    next >
Text File  |  1994-01-10  |  7KB  |  161 lines

  1. COMPRESS 1 local
  2.  
  3. NAME compress, uncompress, zcat - compress and expand data
  4.  
  5. SYNOPSIS
  6.  
  7.      compress [-cCdDf?hkKvV][-b maxbits][-Iinpath][-Ooutpath][filenames...]
  8.      uncompress [-fCcvVkK?h][-Iinpath][-Ooutpath][filenames...]
  9.      zcat [-CvV?h][-Iinpath][-Ooutpath][filenames...]
  10.  
  11.      Argument Processing..case is significant:
  12.      MUST use '-' for switch character, all flags are optional.
  13.  
  14.      [options]
  15.      -V => print Version
  16.      -d => do_decomp default = off
  17.      -m => add "#! cunbatch\n" to top of file when compressing 
  18.            (see MODIFICATIONS, below)
  19.      -v => verbose
  20.      -f => force overwrite of output file default = off
  21.      -n => no header: useful to uncompress old files
  22.      -c => cat all output to stdout default = off
  23.      -C => generate output compatible with compress 2.0
  24.      -k => %s input file, default = keep
  25.      -K => %s output file on error, default = kill
  26.      -b maxbits  => default = 16  bits
  27.      -I pathname => infile path  = none
  28.      -O pathname => outfile path = none
  29.      -? -h => help, print full usage message
  30.  
  31. DESCRIPTION
  32.  
  33. This manual refers to compress v4.10 don release. The compression and
  34. decompression routines are modified from the current version 4.0 joe release.
  35. However, the compressed output is cross compatible.
  36.  
  37. Compress reduces the size of the named files using adaptive Lempel-Ziv coding.
  38. Whenever possible, each file is replaced by one with the extension .Z,
  39. while keeping the same ownership modes, access and modification times.
  40. If no files are specified, the standard input is compressed to the
  41. standard output.Compressed files can be restored to their original form using
  42. uncompress or zcat.
  43.  
  44. The -f option will force compression of name. This is useful for compressing
  45. an entire directory, even if some of the files do not actually shrink.
  46. If -f is not given and compress is run in the foreground,
  47. the user is prompted as to whether an existing file should be overwritten.
  48.  
  49. The -c option makes compress/uncompress write to the standard output;
  50. no files are changed.  The nondestructive behavior of zcat is identical to
  51. that of uncompress -c.
  52.  
  53. Compress uses the modified Lempel-Ziv algorithm popularized in
  54. "A Technique for High Performance Data Compression", Terry A. Welch,
  55. "IEEE Computer," vol. 17, no. 6 (June 1984), pp. 8-19.
  56. Common substrings in the file are first replaced by 9-bit codes 257 and up.
  57. When code 512 is reached, the algorithm switches to 10-bit codes and
  58. continues to use more bits until the limit specified by the -b
  59. flag is reached (default 16). Bits must be between 9 and 16.  The default
  60. can be changed in the source to allow compress to be run on a smaller machine.
  61.  
  62. After the bits limit is attained, compress periodically checks the compression
  63. ratio.  If it is increasing, compress continues to use the existing code
  64. dictionary.  However, if the compression ratio decreases, compress
  65. discards the table of substrings and rebuilds it from scratch.  This allows
  66. the algorithm to adapt to the next "block" of the file.
  67.  
  68. Note that the -b flag is omitted for uncompress, since the bits
  69. parameter specified during compression is encoded within the output,
  70. along with a magic number to ensure that neither decompression of random
  71. data nor recompression of compressed data is attempted.
  72.  
  73. The amount of compression obtained depends on the size of the input, the
  74. number of bits per code, and the distribution of common substrings.
  75. Typically, text such as source code or English is reduced by 50-60%.
  76. Compression is generally much better than that achieved by Huffman coding
  77. (as used in pack ), or adaptive Huffman coding ( compact ),
  78. and takes less time to compute.
  79.  
  80. Under the -v option, a message is printed yielding the percentage of
  81. reduction for each file compressed.
  82.  
  83. If the -V option is specified, the current version and compile options
  84. are printed on stderr.
  85.  
  86. MODIFICATIONS
  87.  
  88. For the compress 4.30d.gigo version, the "-m" parameter has been added.  This
  89. modification allows compress to automaticly skip over the "#! cunbatch" line
  90. when decompressing; it also allows compress to _create_ this line when
  91. compressing outbound news.  These modifications were made so that the 
  92. gateway software would not have to copy the original files to temporary files
  93. (+/- the #! cunbatch line) before and after compression, as this takes up 
  94. a lot of time.  
  95.  
  96. CAVEATS
  97.  
  98.  
  99. FILES
  100.  
  101.  
  102. RETURN VALUE
  103.  
  104. Exit status is normally 0;
  105. if the last file is larger after (attempted) compression, the status is 2;
  106. if an error occurs, exit status is 1.
  107.  
  108. SEE ALSO
  109.         pack(1), compact(1)
  110.  
  111. DIAGNOSTICS
  112.         Usage: compress [\-dfvcV] [\-b maxbits] [file ...]
  113.                 Invalid options were specified on the command line.
  114.         Missing maxbits
  115.                 Maxbits must follow -b.
  116.         file : not in compressed format
  117.                 The file specified to uncompress has not been compressed.
  118.         file : compressed with bits, can only handle yy bits
  119.                 File was compressed by a program that could deal with
  120.                 more bits than the compress code on this machine.
  121.                 Recompress the file with smaller bits.
  122.         file : already has .Z suffix -- no change
  123.                 The file is assumed to be already compressed.
  124.                 Rename the file and try again.
  125.         file : filename too long to tack on .Z
  126.                 The file cannot be compressed because its name is longer than
  127.                 12 characters.  Rename and try again.
  128.                 This message does not occur on BSD systems.
  129.         file already exists; do you wish to overwrite (y or n)?
  130.         Respond "y" if you want the output file to be replaced; "n" if not.
  131.         uncompress: corrupt input
  132.                 A SIGSEGV violation was detected which usually means that
  133.                 the input file has been corrupted.
  134.         Compression: "xx.xx%"
  135.                 Percentage of the input saved by compression.
  136.                 (Relevant only for -v.)
  137.         -- not a regular file: unchanged
  138.                 When the input file is not a regular file,
  139.                 (e.g. a directory), it is left unaltered.
  140.         -- has other links: unchanged
  141.                 The input file has links; it is left unchanged.  See
  142.                 ln "(1)" for more information.
  143.         -- file unchanged
  144.                 No savings is achieved by compression.  The input remains
  145.                 virgin.
  146.  
  147. BUGS
  148.  
  149. Although compressed files are compatible between machines with large memory,
  150. -b 12 should be used for file transfer to architectures with
  151. a small process data space (64KB or less, as exhibited by the DEC PDP
  152. series, the Intel 80286, etc.)
  153.  
  154. MISCELLANEOUS
  155.  
  156.  
  157. NOTES
  158.  
  159.  
  160.  
  161.