home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / gigop806.zip / COMPRESS.DOC < prev    next >
Text File  |  1994-07-28  |  8KB  |  190 lines

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