home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 August - Disc 3 / chip_20018103_hu.iso / segedlet / lha255e.exe / LHA255.TXT < prev    next >
Text File  |  1996-01-10  |  45KB  |  877 lines

  1. ------------------------------------------------------------------------
  2.                          LHA Version 2.55E Manual
  3.                                                Ver 2.55  Jan. 04, 1996
  4. ------------------------------------------------------------------------
  5.                           Haruyasu Yoshizaki   SDI00506@niftyserve.or.jp    
  6.                                           pcs02846@asciinet.or.jp
  7.                                         FEM12376@pcvan.or.jp
  8. ------------------------------------------------------------------------
  9. Translated and Edited by: Hitoshi Ozawa        h_ozawa@bekkoame.or.jp
  10.                           homepage:  http://www.bekkoame.or.jp/~h_ozawa/
  11. ------------------------------------------------------------------------
  12.  
  13. 0. Liability
  14. -----------------
  15.     The author and the developer of this software will not take
  16.     responsibility for any damage that may result from the use of this
  17.     software.  The files contained in LHA255.EXE are distributed "as is"
  18.     and without any expressed and implied warranties.  The user assumes
  19.     the entire risk of using the software.
  20.  
  21. 1.  Introduction
  22. -----------------
  23.      LHarc, a precursor to the LHA file utility, became one of the
  24.      standard file compression/extraction utility in Japan despite its
  25.      slowness. I am also pleased that some overseas users have taken
  26.      to using this tool.
  27.  
  28.      I, however, have continued on my research for a new compression
  29.      algorithm even after releasing LHarc to the public. The fruit of
  30.      my two years of research is incorporated in the new utility, LHA
  31.      which I would now like to make public.
  32.                                               (Feb. 24, 1991 Yoshizaki)
  33.      Differences between LHA and LHarc:
  34.      ----------------------------------
  35.      Improvements:
  36.      - Higher compression
  37.        LHA offers a higher compression rate than LHarc especially when
  38.        compressing large files. On the other hand, compression rate is
  39.        worse for files smaller than few hundred bytes.
  40.      - Faster file extraction
  41.        Extraction algorithm was changed to static Huffman algorith from
  42.        dynamic Huffman algorithm to decrease file extraction time.
  43.        Nevertheless, compression time did not decrease as much as I
  44.        expected.
  45.      Degradation:
  46.      - Increased memory usage
  47.        LHA requires more memory. Use caution when executing LHA from
  48.        another program or in a child process. When LHA detects memory
  49.        shortage, it will try to continue by decreasing compression rate.
  50.      - Only upward compatible with LHarc
  51.        Files compressed by LHA can not be extracted by LHarc. However,
  52.        files compressed by LHarc may be extracted by LHA.
  53.  
  54. 2. Copyright
  55. -----------------
  56.      LHA is copyrighted by Haruyasu Yoshizaki.
  57.  
  58.      Microsoft is a registered trademark and MS-DOS is a trademark of
  59.      Microsoft Corporation in the United States of America and other
  60.      countries.  Other brand and product names are trademarks or
  61.      registered trademarks of their respective holders.
  62.  
  63. 3. Simple Usage Examples
  64. -------------------------
  65.   To extract files with directories:
  66.      lha x [archive file name]
  67.      NOTE: Extension should be specified with archive file name.
  68.      Example: lha x temp.lzh
  69.                The above command extracts all files contained in archive
  70.                 file TEMP.LZH.
  71.   To archive files to an archive file:
  72.      lha a [archive file name] [file name]
  73.      NOTE: Do not specify archive file name extension. Archived files
  74.            are created with extension LZH.
  75.      Example: lha a temp test1.txt test2.txt
  76.            The above command compresses files TEST1.TXT and TEXT2.TXT
  77.            and creates an archive file TEMP.LZH.
  78.   To convert an archive to to self-extraction format:
  79.      lha a [archive file name]
  80.      NOTE: Do not specify file extension. Self-extracting file with EXE
  81.            extension is created from archive file with LZH extension.
  82.      Example: lha s temp
  83.            The above command creates self-extracting file TEMP.EXE with
  84.            files contained in archive file TEMP.LZH.
  85.  
  86. 4.  Usage
  87. ---------
  88.   A.  General Format:
  89.   ==================
  90.   ü@LHA <command> [-<option>[-+012|WDIR]...] LZH [[DIR\] [FILE]...]...
  91.  
  92.     <command>: One or more command listed in section B.
  93.                When omitted, displays quick LHA help
  94.     <option>:  one of options below:
  95.                LZH:       archive filename
  96.                DIR:       base directory name
  97.                FILE:      compression/extraction file name
  98.                           (may include path)
  99.                WDIR:      working directory name
  100.   B.  <command>
  101.   =============
  102.    a (Add)     Add file to an archive file
  103.                File(s) specified by FILE are compressed and added to the
  104.                archive file (LZH file). If the archive file does not
  105.                exists, it will be created. If the file already exists
  106.                in the archive file, it will be overwritten. (Refer also
  107.                to u (Update) and m (Move) commands.)
  108.      < Example 1 >  LHA a ex *.exe
  109.                Compress all files with extension EXE in the current
  110.                directory and add to (or create) a EX.LZH archive file. 
  111.  
  112.    u (Update)  Add/Update file in an archive file
  113.                File(s) specified by FILE are compressed and added to the
  114.                archive file (LZH file). If the file already exists in
  115.                the archive file, the file will be added to the archive
  116.                only when the modification date of the file is more
  117.                recent than the one in the archive file. (Refer also to a
  118.                (Add) and m (Move) commands.)
  119.      < Example 2 > LHA u ex *.c
  120.                Compress all files with extension C in the current
  121.                directory and add/update to a EX.LZH archive file.
  122.                If the file already exists in the archive file, the file
  123.                will be added to the archive only when the modification
  124.                date of the file are more recent than the one in the archive.
  125.  
  126.    m (Move)    Move file to an archive file
  127.                File(s) specified by FILE are compressed and moved to the
  128.                archive file (LZH file). If the file already exists in
  129.                the archive file, the file will be added to the archive
  130.                only when the modification date of the file is more
  131.                recent than the one in the archive file. All files
  132.                (including those that were not actually updated to the
  133.                archive file) will be deleted.
  134.                Specify the -c option to override the date comparision
  135.                and update all specified files.
  136.       < Example 3 > LHA m ex *.c
  137.                Similar to Example 2, but delete all files with extension
  138.                C in the current drive after updating the archive file.
  139.                Have the same result as executing the following 2
  140.                operations:
  141.                   LHA u ex *.c
  142.                   del *.c
  143.  
  144.    f (Freshen) Replace file in an archive file
  145.                Similar to the u (update) option but only update the file
  146.                that already exists in the archive file. Files that do
  147.                not already exist in the archive files are not added to
  148.                the archive.
  149.                Specify the -c option to override the date comparison and
  150.                replace all specified files.
  151.      < Example 4 > LHA f ex lha.doc
  152.                Replace file LHA.DOC in the archive file EX.LZH if the
  153.                modification date is more recent than those in the
  154.                archive file.
  155.  
  156.    d (Delete)  Delete file from an archive file
  157.                File(s) specified by FILE are deleted from the archive
  158.                file (LZH file).
  159.      < Example 5 > LHA d ex lha.doc
  160.                Deletes file LHA.DOC from the archive file EX.LZH.
  161.  
  162.    e (Extract) Extract file from the archive file
  163.                File(s) specified by FILE are extracted from the archive
  164.                file (LZH file). If FILE is not specified, all files
  165.                in the archive file are extracted.
  166.                If the file to be extracted already exists in the current
  167.                directory, the file will be extracted only when the
  168.                modification date of the file is more recent than the one
  169.                in the current directory.
  170.                Specify -c option to override the date comparison and
  171.                extract all specified files.
  172.                Files compressed by LHarc (-lzs-, -lz4-, -lz5-) may also
  173.                be extracted.
  174.      <Example 6 > LHA e ex
  175.                Extract all the files included in the archive file
  176.                EX.LZH.
  177.      < Example 7 > LHA e ex *.com
  178.                Extract all the files with extension COM from the
  179.                archive file EX.LZH.
  180.  
  181.   x (eXtract)  Extracts directory with files from the archive file
  182.                File(s) specified by FILE are extracted with their
  183.                corresponding directory from the archive file (LZH file).
  184.                If the directories does not exist, they are created.
  185.                If FILE is not specified, all files in the archive
  186.                file are extracted.
  187.                Same as executing LHA E -x1m1.
  188.       < EXample 8 > LHA x ex
  189.                Extract all the files included in the archive file
  190.                EX.LZH with their directories. If file \BIN\CG86.EXE is
  191.                included in the archive file EX.LZH, BIN directory is
  192.                created in the current directory and CG86.EXE file is
  193.                extracted to this sub-directory.
  194.  
  195.    p (Print)   Print content of an archive to the standard output
  196.                File(s) specified by FILE are extracted and their
  197.                contents are printed to the standard output. If FILE is
  198.                omitted, contents of all files in the archive file is
  199.                printed to the standard output.
  200.      < Example 9 >  LHA  p ex lha.doc
  201.                Extracts file LHA.DOC from the archive file EX.LZH and
  202.                displays its contents on a screen.
  203.      < Example 10 > LHA p ex lha.doc > prn
  204.                Extracts file LHA.DOC from the archive file EX.LZH and
  205.                print it out to a default printer.
  206.  
  207.    l (List)    Lists file names
  208.                Information corresponding to file(s) specified by FILE
  209.                are printed to the standard output. If FILE is omitted,
  210.                information concerning all files in the archive file is
  211.                printed to the standard output.
  212.                To display the full path name with the file names,
  213.                specify x option. Files with path are displayed with a
  214.                '+' prefixed to their names.
  215.      <Example 11> LHA l ex
  216.                Information concerning all files in the archive file
  217.                EX.LZH are displayed on the screen.
  218.  
  219.    v (View)    View file information
  220.                Same as l -x1.
  221.  
  222.    t (Test)    Execute CRC test on the archived file
  223.                CRC (cyclic redundancy check) test is  executed on
  224.                file(s) specified by FILE.
  225.                This option is also used to check for the originality of
  226.                the distributed LHA.EXE file. The original LHA.EXE
  227.                displays "This file seems to be ORIGINAL distributed
  228.                from H.Yoshi." when LHA t lha.exe is executed.
  229.                It may not make too much sense testing itself, but
  230.                testing if the new copy of the LHA.EXE program for
  231.                originality may prevent unsolicited problems.
  232.                LHA is not able to test files that have been altered by
  233.                LEXEM, DIET, PKLITE, and LZEXE and files compressed by
  234.                LHarc.
  235.      < Example 12 > LHA t ex
  236.                Test integrity of all files contained in file EX.LZH. 
  237.      < Example 13 > LHA t lha.exe
  238.                Test if the file LHA.EXE is the original file distributed
  239.                by Haruyasu Yoshizaki.
  240.  
  241.    s (Self-extract)
  242.                Convert archive file (LZH file) to self-extracting
  243.                format (SFX file). Two types of self-extracting files
  244.                may be created. The default option, -x0, which is assumed
  245.                when type if not specified, creates a small model file
  246.                that may only self-extract to the current directory.
  247.                Size of a file created by this option is smaller than
  248.                the file created by the large model, but sub-directories
  249.                may not be recreated nor files executed during file
  250.                extraction.
  251.                The second type, the large self-extracting model, is
  252.                able to recreate subdirectories and execute programs
  253.                during file extraction but the archive file is larger
  254.                then those created by the small model.
  255.      < Example 14 > LHA s ex
  256.                Convert archive file, EX.LZH, to small model
  257.                self-extraction file, EX.EXE.
  258.      WARNING:  It is necessary to first create an archive file that is
  259.                to be converted to a self-extracting format. 's' option
  260.                does not create a self-extracting file directly a regular
  261.                file.
  262.  
  263.   C.  <-option>
  264.   =============
  265.                Options may be specified to more fully customize file
  266.                manipulation operations. Generally, options are specified
  267.                with numericals 0, 1, 2, or 3, but some commands do not
  268.                distinguish between 1 and 2. For some options, it is
  269.                possible to toggle between values 0 and 1 by specifying
  270.                '+' and '-'. Additionally, options may also be prefixed
  271.                by a '/' instead  of a '-' to conform to the MS-DOS
  272.                command syntax.
  273.  
  274.      -x[0|1]   Use eXtended file names
  275.                When -x1 is specified as a file compression option, path
  276.                name is saved along with the file name.
  277.                When -x1 is specified as a file extraction option, files
  278.                saved with directory information are extracted to their
  279.                corresponding directories. If a directory does not exist,
  280.                they are created.
  281.                When -x0 is specified, only file name is save to the
  282.                archive file and files are extracted to the current path.
  283.  
  284.                If file tc\include\sys\stat.h is compressed to an
  285.                archive file with its path, -x0 option compressed only
  286.                file name STAT.H to the archive file while -x1 saves
  287.                the complete path tc\include\sys\ with the file name.
  288.                When extracting from the created archive, -x0 extracts
  289.                STAT.H file to the current directory while -x1 creates
  290.                directories tc\include\sys in the current directory
  291.                and extracts STAT.H file in created directory.
  292.                When -x0 option is specified with the -l option, only
  293.                file names are listed with their attributes while
  294.                -x1 option lists directory names with files names.
  295.  
  296.      -p[0|1]   Distinguish files by Path names
  297.                When -p1 is specified as a file extraction option, files
  298.                with a same name in different paths are distinguished.
  299.                When a numerical is omitted after the 'p', 1 is assumed.
  300.  
  301.                If files stat.h and tc\include\sys\stat.h is compressed
  302.                to an archive file, TC.LZH:
  303.                   LHA e TC.LZH stat.h
  304.                       tries to extracts both file stat.h and file
  305.                       tc\include\sys\stat.h to the current directory.
  306.                       (Only the one most recently modified file is
  307.                        extracted.)
  308.                   LHA e -p TC.LZH stat.h
  309.                       extracts only the stat.h file without the path
  310.                       name in the current directory.
  311.                   LHA e TC.LZH sys\stat.h
  312.                       extracts only the file stat.h file in the
  313.                       tc\include\sys\ directory to the current
  314.                       directory.
  315.  
  316.      -c[0|1]  (ignore file modification day/time)
  317.                When -c1 is specified with 'u', 'f', 'e', or 'x' command,
  318.                file modification time check is not executed. This
  319.                option may be used to restore the old copy of a file
  320.                from the archive file.
  321.                When a numerical is omitted after the 'c', 1 is assumed.
  322.  
  323.      -m[0|1|2]  (do not display query Messages)
  324.                When -m1 or -m2 is specified as an option, all query
  325.                messages (eg. Overwrite? [Y/N]) are answered with a
  326.                Y(es).
  327.                -m1 and -m2 differs in the following ways when extracting
  328.                files from an archive:
  329.                   -m1 Overwrite a file only when last modification
  330.                       date/time of archive file is more recent.
  331.                   -m2 Extract all files regardless of modification date.
  332.                       Affix consecutive number from 000 to 999 as file
  333.                       extension when file with the same already exists.  
  334.                                     
  335.      -a[0|1|2] (ignore file Attributes)
  336.                When -a1 or -a2 is specified, file attribute is ignored
  337.                when compressing files (ie. system and hidden files are
  338.                also compressed) and file attributes are preserved when
  339.                extracting files from an archive file.
  340.                Compression:
  341.                  -a0 (default setting)
  342.                      System and hidden files are not compressed to an
  343.                      archive file. However, files with read-only
  344.                      attribute are compressed with their attribute
  345.                      intact in the archive file.
  346.                  -a1 Compress all files with their attributes
  347.                  -a2 Compress all files with their attributes but also
  348.                      keep directory name when specified with -r2x1
  349.                      option (same as -d1 option). Directory name is
  350.                      listed with -lhd- attribute when archive is listed.
  351.                 Extraction:
  352.                  -a0 System and hidden files are not extracted from the
  353.                      archive file. Read-only files are extracted, but
  354.                      files attributes will not be preserved.
  355.                  -a1 All files are extracted with their attributes
  356.                      intact.
  357.  
  358.      -r[0|1|2] (Recurse operation)
  359.                When -r1 or -r2 is specified, a command is executed 
  360.                recursively in specified subdirectories.
  361.                  -r0 Do not search sub-directories. (default option)
  362.                  -r1 File name specification mode
  363.                      Path name is extracted from the FILE name, and
  364.                      command is executed recursively in its
  365.                      subdirectories. Used to apply command all files
  366.                      with matching files names in different directories.
  367.                  -r2 Directory specification mode
  368.                      Apply command recursively to all files in a
  369.                      specified directory and its subdirectories.
  370.                  WARNING: LHarc actually replaced -r with -x when
  371.                           extracting files. However, LHA treats -x
  372.                           and -r differently. Be sure to use the proper
  373.                           option.
  374.      < Example 15 > LHA a -r1 source.lzh \source.c \source\*.h
  375.               Compress files with extensions C and H from directory
  376.               \SOURCE and all its subdirectories.           
  377.  
  378.      < Example 16 > LHA a -r2x1 a:\*.*
  379.               Compress all files in drive A and all files in its
  380.               subdirectories with their directories intact.
  381.      Frequently Asked Questions
  382.         (1) How do I backup disk A: ?
  383.                         LHA a /r2x1 temp a:\
  384.             where temp is the name of the archive file
  385.         (2) How do I extract all directories and files to drive b:?
  386.                         LHA x arc.lzh b:\
  387.             where ARC.LZH is the name of the archive file.
  388.  
  389.      -w[0|1|<Directory name>] (assign Working directory)
  390.               Specify directory where temporary files are created.
  391.               When -w is followed by a directory name, temporary files
  392.               are created in the specified directory. If only -w1 is
  393.               specified without a directory, temporary files are created
  394.               in the current directory.
  395.               When -w option is entirely omitted, temporary files are
  396.               created in the same directory as the archive file and this
  397.               temporary file is renamed to an archive file name at the
  398.               end of the operation.
  399.               Additionally, when environmental parameters TMP or TEMP is
  400.               set, the specified directory is used.
  401.               'w' option may be benefitial in the following situations:
  402.                  1. When there are not enough free space in the
  403.                     directory (drive) where the archive file resides.
  404.                  2. To speed operations by creating temporary files on
  405.                     devices with faster I/O access time such as RAM
  406.                     disk or hard disk instead of fds.
  407.      < Example 17 > LHA a -wd:\  arc.lzh *.*
  408.                Create temporary files on drive D: to compress all files
  409.                in the current directory to archive file ARC.LZH.
  410.  
  411.      -t[0|1] (update Time stamp)
  412.                When -t1 is specified, modification date and time of the
  413.                archive file is set to the most recent date/time of files
  414.                contained in the archive.
  415.                When -t0 (default) is specified, modification date/time
  416.                of the archive file is set to date/time when the archive
  417.                file was created or modified.
  418.  
  419.      -z[0|1|2] (Zero compress file to archive)
  420.                When -z1 or -z2 is specified, files are archived to an
  421.                archive file without being compressed.
  422.                  -z1 Do not compress all files that are to be archived.
  423.                  -z2 Do not compress files with extension ARC, LZH, LZS,
  424.                      PAK, ZIP, and ZOO. Compress other files.
  425.                  -z3<extension>
  426.                      Beside files with extension specified with -z2
  427.                      options, do not compress files with extension
  428.                      <extension>.
  429.                      Wildcard characters '*' and '?' may be used to
  430.                      specify <extension>. (Refer to section F for
  431.                      further information on wild card characters.)
  432.                      Extension separator '.' is ignored. It may be
  433.                      included in <extension> or excluded.
  434.                      To specify files without any extension, specify
  435.                      '-z.' as an option.
  436.                      Multiple extensions may be specified by
  437.                      sequentially defining extensions to be
  438.                      uncompressed.
  439.                      (eg. -zexe -zcom)
  440.      < Example 18 > LHA a -zcom -zexe archive.lzh *.*
  441.                Archive all files in the current drive to file
  442.                ARCHIVE.LZH but do not compress files with extension COM
  443.                and EXE.
  444.  
  445.      -o[0|1] (use Old compression algorithm)
  446.                When -o1 is specified, files are compressed in an format
  447.                that can be extracted using LHarc ver1.xx. -h0 option
  448.                is automatically specified when -o1 is specified.
  449.                Using this option with LHA creates archive file that is
  450.                more compressed than using LHarc.
  451.  
  452.       -h[0|1|2] (select Header format)
  453.                Select header format of the archive file. The default
  454.                setting is -h1.
  455.  
  456.       -i[0|1] (do not Ignore case)
  457.                When -i1 is specified, file(s) specified by FILE are
  458.                treated case sensitivity.
  459.                Some OSs are case sensitive to file names. Thus, files
  460.                contained in an archive file may contain files names with
  461.                upper and lower case characters. Use -i1 option to
  462.                extract files from these archives.
  463.                NOTE: File names of files archieved from MS-DOS are all
  464.                      converted to upper case letters.
  465.  
  466.                a. When manipulating files in an archive file
  467.                   (commands f, d, s, e, x, t, p, l, v)
  468.                  -i0 Do not distinguish between upper and lower case
  469.                      file names.
  470.                  -i1, -i2
  471.                      Distinguish between upper and lower case file
  472.                      names.
  473.                b. When compressing files to an archive file
  474.                   (commands a, u, m)
  475.                  -i0 Convert all file names to upper case letters.
  476.                  -i1 Convert all file names with wild card characters
  477.                      ('*' and '?') to upper case letters.
  478.                  -i2 Convert all file names with wild card characters
  479.                      ('*' and '?') to lower case letters.
  480.                 (Refer to section F for further information on wild
  481.                  card characters.)
  482.      -n[0|1|2] (do Not display progress report)
  483.                When -n1 or -n2 is specified, file compress/extraction
  484.                progress are not displayed.
  485.                  -n0 Display progress report.
  486.                  -n1 Do not display ooo..... progress report.
  487.                  -n2 Do not display ooo..... progress report and
  488.                      file names.
  489.  
  490.      -l[0|1|2] (display Long file name)
  491.                When -l1 or -l2 is specified, path name is displayed with
  492.                file name.
  493.                  -l0 Display only file name.
  494.                  -l1 Display path name to be/save in archive file with
  495.                      file name. Used to display where in the archive
  496.                      file the file is being archived.
  497.                  -l2 Display path name of accessed file name with file
  498.                      name. Used to display where the files being
  499.                      archived is located.
  500.                Note:When -l1 or -l2 is specified, each file is displayed
  501.                     in 2 rows.
  502.      < Example 19 > LHA a -r1x1l2 link.lzh c:\link.*
  503.                Archives all files named 'link.' in all directories
  504.                below C:\ and display path name of file being archived
  505.                with the file name.
  506.  
  507.      --[0|1|2] (allow file name starting with option switch indicator)
  508.                When --1 or --2 is specified, file name may start with
  509.                a LHA option switch indicator, '-' and '@'.
  510.                (Refer to Section E for information on file starting with
  511.                 '@'.)
  512.                  /-0 Do not allow file name to start with '-' and '@'
  513.                  -l1 Allow file name to start with '@'.
  514.                  -l2 Allow file name to start with '@' and '-'.
  515.               WARNING: Do not use --0. LHA will mistake it for a
  516.                        file name.
  517.  
  518.      -s[0|1] (Do not display Skipped file message)
  519.                 When -s1 is specified, 'Skipped <Filename>' message is
  520.                 not displayed. LHA by default displays a skipped message
  521.                 and do not archive/extract files if a file with the same
  522.                 name but with more recent modification date already
  523.                 exist.
  524.                  -s0 Display skipped file message.
  525.                  -s1 Do not display skipped file message. Used when LHA
  526.                      is executed from a batch file.
  527.  
  528.      -d[0|1] (save Directory name)
  529.                 When -d1 is specified, all files (including system and
  530.                 hidden files) and all files in all subdirectories are
  531.                 archived.
  532.                 NOTE: Same as specifying -r2x1a2 option.
  533.  
  534.     -f[0|1] (Forcefully write files without checking free disk space)
  535.                 When -f1 is specified, files are archived/extracted
  536.                 without first checking for free disk space.
  537.                 Specify this switch when an error occurs executing LHA
  538.                 on some networked computers.
  539.  
  540.   D.  Base Directory
  541.   ==================
  542.      Base directory may be specified to compress files from and to
  543.      extract files to several different directories.
  544.      Base directory may be specified instead of moving to another drive
  545.      and directory to archive/extract files. Furthermore, several
  546.      different directories may be specified in one statement.
  547.      NOTE: When fd drive (eg. A:) is specified, LHA uses the current
  548.            drive. (Current drive may be displayed by changing to the
  549.            drive.)
  550.  
  551.   < Example 20 >
  552.      A>LHA x program c:\bin\ *.exe *.com c:\temp\ *.man *.doc
  553.                      ~~~~~~~             ~~~~~~~~
  554.  
  555.      The above statement is equivalent to executing the following
  556.      set of commands:
  557.  
  558.              A>C:
  559.              C>CD \BIN
  560.              C>LHA x d:\program *.com *.exe
  561.              C>cd \temp
  562.              C>LHA x d:\program *.man *.doc
  563.  
  564.      To extract a single file to several directories, it is necessary
  565.      repeatly extracted to each directory.
  566.  
  567.      WARNING: When several extract to directories are specified to
  568.               extract a single file, the file is only extracted to the
  569.               first specified directory.
  570.  
  571.   E.  MS-DOS Redirection and Batch File
  572.   =====================================
  573.      MS-DOS file redirection and pipes and LHA batch file are used to
  574.      compress/extract many files.
  575.      MS-DOS restricts number of characters on a single command line.
  576.      This restriction limits length of a LHA command disallowing many
  577.      files to be compressed/extracted with a single command.
  578.  
  579.  a.  Batch File
  580.      Batch files contains command, options, and parameters  to be
  581.      executed.
  582.        1. Batch files name are refered by prefixing the file name with
  583.           with a character '@'.
  584.        2. A command may extend across multiple lines. A carriage return
  585.           is replaced with a space when batch file is executed.
  586.      WARNING: Batch file may not be called from within another batch
  587.               file.
  588.               File name starting with a '@' within a batch file is 
  589.               treated as a regular file starting with character '@'.
  590.  
  591.  b.  Pipes and Redirections.
  592.      A regular text file with content obeying LHA batch file guidelines
  593.      (refer to a. above) may be piped or redirected to LHA.EXE.
  594.      However, a batch file may be specified from this text file.
  595.  
  596.      < Example 21 >
  597.          C> LHA l /n1 parts > files.txt
  598.          C> LHA a newparts @filess.txt
  599.      The first command line writes contents of archive file, PARTS.LZH,
  600.      to a textfile FILES.TXT.
  601.      The second command line takes the content of this FILES.TXT and
  602.      creates a new archive file named NEWPARTS.LZH.
  603.      Optional parameters may be added to the first command line to
  604.      create a new archive file containing files selected from the
  605.      original archive file, PARTS.LZH.
  606.  
  607.      < Example 22 >
  608.          C> dir /b | sort | lha a all
  609.      This command line makes a list of files in a current directory
  610.      (excluding system and hidden files) without displaying file
  611.      attributes, sort this list, and create an archive file, ALL.LZH,
  612.      containing these files.
  613.      Thus, ALL.LZH file will contain files in the current directory
  614.      in alphabetical order.
  615.  
  616.   F. Wild Card Characters (supported after Ver.2.54)
  617.   ==================================================
  618.      Along with the regular MS-DOS wild card character set, LHA supports
  619.      wild card character supported by LSI C. LHA supports the following
  620.      set of wild card characters:
  621.          ?  replace with one other character excluding '.' character.
  622.          *  replace with text string excluding '.' character.
  623.             (may be null string)
  624.          +  replace with text string including '.' character.
  625.             (may be null string)
  626.          [] replace with a character within the parenthesis. Able to
  627.             specify range using '-' character. (eg. [a-z] to specify
  628.             all lower case characters between 'a' and 'z'.)
  629.  
  630.      < Example 23 >
  631.          FLABO[_~][1-9A] matches with files FLABO_1 through FLABO_A, 
  632.                          FLABO~1 through FLABO~A but does not match with
  633.                          FLABO_ and FLABO..
  634.          FLABO[_~]*      matches with all files except FLABO..
  635.          FLABO[_~]+      matches with all files.
  636.  
  637.   G.  Environmental Variables
  638.   ===========================
  639.      Environment variables are usually set in MS-DOS in the AUTOEXEC.BAT
  640.      file. Use a text editor to set the following variable in this file.
  641.  a.  LHA and LHARC
  642.      Set whether to use LHA.EXE or LHARC.EXE. The default setting is
  643.      LHA.EXE.
  644.  
  645.  b.  TMP and TEMP
  646.      Set working directory (directory where temporary files are created).
  647.      When omitted or when the specified directory could not be found,
  648.      working directory is set to the current directory.
  649.      When both TMP and TEMP are set, working directory is set to the
  650.      directory set by TMP. (Refer also to -w option.) 
  651.  
  652.  c.  TZ
  653.      Set the time zone (eg. EST, PST). Used to adjust time when archiving
  654.      with -h2 option or when extracting files archived by -h2 option.
  655.      If time zone is not set correctly, file version control supported by
  656.      LHA may not work properly, and files may not be updated.
  657.      To set to the Eastern Standard Time (US), SET TZ=EST+5. To set to
  658.      Japanese time zone, SET TZ=JST-9.
  659.  
  660.   H.  Return Codes
  661.   ================
  662.      LHA returns the following return codes after execution. They may be
  663.      used in batch files or in other programs to detect errors.
  664.  
  665.      Code  Description
  666.       0    Normal termination (No error).
  667.       1    File extraction error. CRC error, not enough free disk space,
  668.            or file not found when extracting files from archive.
  669.       2    Fatal error.  Process terminated without modifying archive
  670.            file.
  671.       3    Failed to convert temporary files to an archive file.
  672.            Temporary archive files named LHTMP???.LZH, created in the
  673.            working directory, may manually be renamed to an archive file
  674.            (extension LZH).
  675.  
  676.   I.  Temporary File Names
  677.   ========================
  678.      LHA finds the first available file name with LHTMPxxx.LZH (where
  679.      xxx is a consecutive number between 000 and FFF) in the working
  680.      directory to use as a temporary file. It is usually not necessary
  681.      to know about this file during normal LHA execution.
  682.  
  683. 5. Self-Extracting Archive File (SFX)
  684. -------------------------------------
  685.       General Extraction Format:
  686.          <Self-extraction file> [-x] [-!] [-eDIR] [DIR]
  687.            /x: do not create new directory.
  688.            /!: auto-execution batch enable.
  689.            /a: restore file attributes.
  690.            [/eDIR],[DIR]; specify directory to extract.
  691.  
  692.      Self-extraction files are executable archive files (with EXE
  693.      extension) that extract files within itself when executed. They may
  694.      also be extracted using LHA tools. Example of a self-extracting
  695.      file is the LHA file that this file was archived in.
  696.      LHA is only able to convert archive files created by LHA utility
  697.      to a self-extraction file. It is not able to convert archive files
  698.      created by LHarc.
  699.      Specifying either -x0 and -x1 options creates small model and large
  700.      model self-extracting files respectively. LHA self-extracting files
  701.      also have the following features:
  702.        A.  Telop
  703.        =========
  704.           When files are self-extracted from a LHA archive, file named
  705.           '!' is extracted in a memory and its contents is display on a
  706.           screen instead of being extracted to a file on a disk. After
  707.           displaying the content of a file, user is prompted with [Y/N].
  708.           If 'Y' is entered, process is continued. If 'N' is entered,
  709.           process is terminated.
  710.        B.  Directory Specification (effective only when self-extracting
  711.        =========================== archive file was created with -x1
  712.                                   option. i.e. large model self-
  713.                                   extraction files.)
  714.           Directory where files in a large model self-extracting archive
  715.           file are to be extracted may be specified.
  716.      < Example 24 >
  717.          LHA255.EXE c:\user
  718.          Extracts files in self-extracting archive file, LHA255.EXE to
  719.          directory C:\USER. Files may also be extracted to a directory
  720.          using LHA with the 'e' command:
  721.                 LHA e -x0 lha255.exe c:\user
  722.        C.  Auto Execution (effective only when self-extracting
  723.        =================== archive file was created with -x1 option.
  724.                            i.e. large model self-extraction files.)
  725.          A batch file named !.BAT in the archive may automatically be
  726.          executed after extracting files from large model
  727.          self-extraction file by specifying -! option. !.BAT file is
  728.          always extracted to the current directory even when extraction
  729.          directory is specified. If a file named !.BAT already exists in
  730.          the currently directory, it will be over written. Furthermore,
  731.          !.BAT must be included in the archive file. A file named !.BAT
  732.          in the current directory will not be executed after files are
  733.          self-extracted.
  734.  
  735.      There are 2 types of LHA self-extracting files, small and large.
  736.      They are created by specifying -x0 and -x1 options when converting
  737.      an archive file to a self-extracting format.
  738.  
  739.  a.  Small Model (Default)
  740.      Creation command format: LHA s -x0 <archive file> 
  741.      Small model self-extracting files only contains file name
  742.      information and do not contain directory information. Even if
  743.      archive file to be converted contains directory information,
  744.      created self-extracting file will not. Thus, small model self-
  745.      extracting files can only be extracted to the current directory.
  746.      Furthermore, !.BAT file will not be executed when small model file
  747.      is extracted. However, telop files are extracted in memory.
  748.      Finally, LHA small model self-extraction file does not have archive
  749.      file limitation as is imposed with LHarc.
  750.  
  751.  b.  Large Model
  752.      Creation command format: LHA s -x1 <archive file>
  753.      Large model self-extracting files has an advantage of supporting
  754.      all functions described above. Additionally, if archive file that
  755.      was converted contained directory information, large model files
  756.      creates necessary directories when files are extracted. To stop
  757.      directories from being created, specify the -x option when
  758.      invoking self-extraction.
  759.  
  760. 6.  Compatibility between LHA and  LHarc
  761. ----------------------------------------
  762.      LHA is upward compatible with LHarc but much has been changed.
  763.      Followings are only some of the differences between these two
  764.      tools and is not a comprehensive list.
  765.      Files are not sorted
  766.         The major difference between LHA and LHarc is that LHarc sorts
  767.         files when creating a new archive file while LHA does not.
  768.         To archive file in sorted order, use an utility such as dsort,
  769.         ordir, and fd to sort the files in the directory before
  770.         archiving them. Files in an archive file may also be sorted
  771.         by executing a following command line:
  772.             C> dir /b | sort | lha a all
  773.         This command archives all files excluding hidden and system
  774.         files to ALL.LZH in ascending sorted order.
  775.      -x option must be explicitly specified with -r option
  776.         -r option is supported to extract files in LHA. Therefore,
  777.         -x option is no longer activated with -r option. 
  778.      Support x command
  779.         x command is supported in LHA to create subdirectories and
  780.         extract files. x command is equivalent to 'e -x1m1' command.
  781.      Self-extraction file changes
  782.         LHA executes !.BAT file in the self-extracting file while LHarc
  783.         executes AUTOLARC.BAT file. Furthermore, -! option must be used
  784.         to execute a batch file, and keyword may not be used in LHA to
  785.         stop execution.
  786.      Internal date/time convension
  787.         LHA keeps track of date/time by recording time difference
  788.         measured in seconds between 1970-01-01 00:00:00 UTC and current
  789.         date/time. If erroneous date/time is specified, LHA is unable
  790.         to record them.
  791.  
  792. 7. Acknowledgments
  793. ------------------
  794.      Following software were used to develop LHA:
  795.         A-MACROS /Structured Assembler Macros, from AMSCLS.INC
  796.                   (c) Hortense S. Endoh 1986,1987 ver.2.10.
  797.        Thank you very much for offering this excellent software.
  798.  
  799.      Furthermore, following software were used to develop LHA ver.2.55:
  800.        1. LSI C-86 ver 3.30b  by LSI Japan
  801.  
  802.      I was just content that I thought that I was able to contribute to
  803.      improvement in data compression algorithm and influence tools such
  804.      PKZIP and PAK, but I would like thank people who have further
  805.      encouraged me to continue with my research to make this version
  806.      possible.
  807.           I would like to express my sincere gratitude to Haruhiko
  808.         Okumura and members of SIG Science on PCVAN BBS (Japan) for
  809.         the assisting in improving compression algorithms.
  810.           To K. Miki who provided me with an place to hold a research
  811.         in archiving and also for offering an opportunity to introduced
  812.         archiver tools to the public.
  813.           To K.Okubo who introduced and supported LH113c on overseas
  814.         networks such as CompuServe and GEnie.
  815.           To the late Irvin Hoff, CP/M sysop Compuserve, who reviewed
  816.         the English version for spelling, grammar, and phrasing
  817.         correctness while struggling with cancer.
  818.           To the members of FHONYAKU forum in Nifty Serve who prepared
  819.         the original English LHA manual.
  820.           Finally, I would like to offer the deepest gratitude to all
  821.         LHarc and LHA users.
  822.  
  823. 8. Distribution
  824. -------------------
  825.         LHA may be freely distributed if the following conditions are
  826.         obeyed: 
  827.         1. Copyright notifications must not be altered in any way.
  828.         2. All documentation files must be included with the
  829.            distribution file.
  830.         3. If any modification is made to any of the files, part that
  831.            was modified must be explicitly stated with the name and
  832.            contact address (Email, street address, or phone number) of
  833.            the person who made the modification.
  834.     4. Make it apparent that LHA is FREE SOFT.
  835.        It is necessary to state this in the program description.
  836.     5. If this program is to be mentioned or included in any
  837.            publication, it is necessary to state LHA copyright
  838.            information.
  839.         6. LHA must be distribution on a medium that is not
  840.            copyprotected.
  841.      If all of the above conditions are satisfied, it is not necessary
  842.      and even discouraged to send the author a mail to obtain a
  843.      distribution permission.
  844.  
  845.      Lastly, all files have have been compressed (including self-
  846.      extraction files) using LHA may be distributed without any
  847.      notification.
  848.  
  849. 9.  Support
  850. -------------------
  851.      LHA is supported in FLABO forum on Nifty Serve BBS (Japan).
  852.      To users who do not have accesss to Nifty Serve, support for LHA
  853.      is provided by internet E-mail. 
  854.      Please send all bug report, questions, opinions, suggestions, or
  855.      any other comments to:
  856.  
  857.      Haruyasu Yoshizaki   SDI00506@niftyserve.or.jp    
  858.                           pcs02846@asciinet.or.jp
  859.                           FEM12376@pcvan.or.jp
  860.      
  861.      Hitoshi Ozawa        h_ozawa@bekkoame.or.jp
  862.                           homepage:  http://www.bekkoame.or.jp/~h_ozawa/
  863. 10.  References
  864. -------------------
  865.   1.  Knuth, D.E., "Dynamic Huffman Coding", J.Algorithms, 6:163-180.
  866.   2.  Kurita, T.,  "Hard Disk Cook Book", 1987, Shoeisha,Tokyo.
  867.   3.  Kurita, T.,  "Tool Box of Computing", Huffman Coding, BIT,
  868.                     70:100-101,1988.
  869.   4.  Okumura,K.,Masuyama,K.,Miki,K., "Practice and theory of Data
  870.       Compression",  The Basic, 70(March):1-65,1989.
  871.   5.  Fiala,E.R., and Greene,D.H., "Data Compression with Finite Win-
  872.       dows", Communication ofACM, 32:490-595,1989.
  873.   6.  Okumura,H., and Yoshizaki,H.,  "Introduction to Compression
  874.       Algorithm", C Magazine 3:1:44-68,1991.
  875.  
  876.                               - end -
  877.