home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / OS2LHX.LZH / LHX.MAN < prev    next >
Text File  |  1989-04-15  |  8KB  |  202 lines

  1. NAME
  2.     lhx - A file test/recovery tool for LHARC archives
  3.  
  4.  
  5. SYNOPSIS
  6.     lhx [-command] [@recovery_info] arcname [filename ...]
  7.  
  8.  
  9. DESCRIPTION
  10.     The newest archive tool out of Japan, LHARC, does a very good job of file
  11.     compression but it does not handle damaged archives well at all.  LHX is a
  12.     tool designed to assist in the recovery of data from damaged LHARC
  13.     archives.
  14.  
  15.     LHX can be used to list the contents of an LHARC archive, test the
  16.     integrity of an archive, scan a damaged archive to look for recoverable
  17.     files, and to extract files from an archive.
  18.  
  19.  
  20.     The commands are:  "l" to list archive contents, "t" to test the integrity
  21.     of an archive, "e" to extract files from an archive, and "s" to scan an
  22.     archive for possible file headers.  The default command is "l".
  23.  
  24.     'arcname' is the name of the archive files to be used.  This is the only
  25.     required argument.  MS-DOS wildcard characters '*' and '?' are allowed.  If
  26.     no extension is given, .LZH is assumed.
  27.  
  28.     'filename' arguments are files to list/test/extract from the archive.  If
  29.     no 'filename's are given, all files will be selected.  MS-DOS wildcard
  30.     characters '*' and '?' are allowed.  LHX ignores any pathnames stored in
  31.     the archive when selecting files.
  32.  
  33.  
  34.     LIST COMMAND
  35.         The list command generates an 'ls -l' like listing of the selected
  36.         files in the archive.  Any file headers in the archive with checksum
  37.         errors will be marked with a '?'.
  38.  
  39.                 > lhx -l test
  40.  
  41.                 Listing archive TEST.LZH
  42.                   --rw-     651 /     331  11 Apr 89  22:01:34   TEST\DIR
  43.                 ? --rw-    1161 /     715   5 Apr 89  09:07:38   REaDME
  44.                   --rw-    8435 /    8435  12 Apr 89  19:55:38   TEST2.LZH
  45.  
  46.         The file README has a bad header.  In this case, the error is due to
  47.         the change in the filename.
  48.  
  49.  
  50.     TEST COMMAND
  51.         The test command checks the file headers and file contents of the
  52.         selected files in the archive.
  53.  
  54.                 > lhx -t test
  55.  
  56.                 Testing archive TEST.LZH
  57.                   TEST\DIR -- data CRC error
  58.                   REaDME -- bad file header, data OK
  59.                   TEST2.LZH -- data OK
  60.                 2 errors detected
  61.  
  62.         The file TEST\DIR has an error in the data portion of the file.  LHX
  63.         will be able to extract the file, but the data will be bad.  The file
  64.         README has an error in the file header, but its data is intact.  LHX
  65.         will be able to extract the file with no errors.
  66.  
  67.  
  68.     EXTRACT COMMAND
  69.         This command extracts the selected files from the archive.  If one of
  70.         the files exists, the user will be prompted whether or not he wants to
  71.         overwrite the file.  LHX ignores the path and attribute information in
  72.         the archive; the files will be created in the current working directory
  73.         with standard attributes.
  74.  
  75.                 > lhx -e test
  76.  
  77.                 Extracting archive TEST.LZH
  78.                   TEST\DIR -- extracted with CRC error
  79.                   REaDME --
  80.                 file exists; overwrite (y/n) ? y
  81.                 exacted OK
  82.                   TEST2.LZH --
  83.                 file exists; overwrite (y/n) ? n
  84.                 1 error detected
  85.  
  86.         File DIR did not exist in the current working directory so it was
  87.         extracted without query; it is probably bad due to the CRC error.  The
  88.         files README and TEST2.LZH already exist so LHX asks if they should be
  89.         overwritten.
  90.  
  91.  
  92.     SCAN COMMAND
  93.         This command scans damaged archives looking for anything that looks
  94.         like it might be a file header.  Information about these possible file
  95.         headers is reported.  This information can be given to LHX test/list/
  96.         extract commands via the '@' option so that it can attempt to recover
  97.         files from the damaged archive.
  98.  
  99.                 > lhx -s test
  100.  
  101.                 Scanning file TEST.LZH
  102.                   @0,{32 | 32},651,1  TEST\DIR
  103.                   @363,{393 | 393},1161,1  REaDME
  104.                   @1108,{1141 | 1141},8435,0  TEST2.LZH
  105.                   @1141,{1175 | 1175},955,1  ADDBFCRC.C
  106.                   @1758,{1791 | 1791},2560,1  CRCDEFS.C
  107.                   @2851,{2880 | 2880},5058,1  LHX.C
  108.                   @4721,{4752 | 4752},15337,1  LZHUF.C
  109.  
  110.         The numbers in each of these output lines are:
  111.             the starting offset of the file header,
  112.             the starting offset of the file data--calculated from two different
  113.                 values in the header--the first value is the one that LHX
  114.                 normally uses.  If the values are different and the filename
  115.                 looks correct, the second number is more likely to be correct.
  116.             the output file length, and
  117.             the compression flag.
  118.  
  119.         These numbers are used in the same order in the '@' parameter.  Any
  120.         values that are not supplied to the '@' parameter are read from the
  121.         header.  If a filename is supplied in the '@' parameter, only one file
  122.         will be processed by LHX.
  123.  
  124.         In this example, LHX found the headers for all the files in TEST.LZH
  125.         and also found all the headers in TEST2.LZH that was stored
  126.         uncompressed in the archive.  TEST2 could be directly listed/tested/
  127.         extracted by using '@1141'.
  128.  
  129.  
  130.     SELF-EXTRACTING ARCHIVES
  131.         Due to the growing number of "virus" programs that are circulating in
  132.         the PC community, people are leery about running self-extracting
  133.         archives because they may not be as advertised.  LHX can be used to
  134.         extract the files from a self-extracting archive.
  135.  
  136.                 > lhx -s lharc10e.com
  137.  
  138.                 Scanning file LHARC10E.COM
  139.                   @1290,{1323 | 1323},27498,1  LHARC.EXE
  140.                   @18852,{18885 | 18885},21984,1  LHARC.MAN
  141.                   @27919,{27949 | 27949},1161,1  README
  142.  
  143.         This file can be manipulated by LHX like any other archive by using the
  144.         "@1290" option:
  145.  
  146.                 > lhx -l @1290 lharc10e.com
  147.  
  148.                 Listing archive LHARC10E.COM
  149.                   --rw-   27498 /   17529   4 Mar 89  18:07:22   LHARC.EXE
  150.                   --rw-   21984 /    9034   5 Apr 89  09:07:28   LHARC.MAN
  151.                   --rw-    1161 /     715   5 Apr 89  09:07:38   README
  152.  
  153.                 > lhx -e @1290 lharc10e.com
  154.  
  155.                 Extracting archive ..\LHARC10E.COM
  156.                   LHARC.EXE -- extracted OK
  157.                   LHARC.MAN -- extracted OK
  158.                   README -- extracted OK
  159.  
  160.  
  161.     A JOURNEY INTO THE ABSURD
  162.         Just to show what can be done with LHX, let's play with LHARC10E.COM a
  163.         little bit more; first we'll extract LHARC.MAN, still compressed, into
  164.         LHARCMAN.Z, then we'll uncompress LHARCMAN.Z into LHARC.MAN.
  165.  
  166.                 > lhx -e @18852,,9034,0,lharcman.z lharc10e.com
  167.  
  168.                 Extracting archive LHARC10E.COM
  169.                   lharcman.z -- extracted with CRC error
  170.                 1 error detected
  171.  
  172.         The CRC error is expected since the CRC in the header is that of the
  173.         uncompressed file.  LHARCMAN.Z now contains the raw compressed data for
  174.         LHARC.MAN.  This file can be decompressed by:
  175.  
  176.                 > lhx -e @0,0,21984,1,lharc.man lharcman.z
  177.  
  178.                 Extracting archive LHARC.Z
  179.                   lharc.man --
  180.                 file exists; overwrite (y/n) ? y
  181.                 extracted with CRC error
  182.                 1 error detected
  183.  
  184.         The CRC error is expected since there was no header on the file.
  185.         (Actually, we told LHX to read the header from the beginning of the raw
  186.         data file, but it didn't use any of the data it read.)
  187.  
  188.  
  189. ACKNOWLEDGEMENTS
  190.     This program was written using code from the Usenet distribution of LZHUF.C
  191.     written by Haruyasu Yoshizaki, Haruhiko Okumura, and Kenji Rikitake.  This
  192.     is copyrighted code with permission granted for non-commercial use.
  193.  
  194.     I also used ADDBFCRC.C and CRCDEFS.C from the Usenet ZOO 2.01 distribution.
  195.     Rahul Dhesi claims no copyright on them but I acknowledge him anyway--he
  196.     saved me a bunch of typing.
  197.  
  198.  
  199. AUTHOR
  200.     Mark Armbrust
  201.     maa@nbires.nbi.com
  202.