home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / finance / zpay3_2.zip / LHARC.MAN next >
Text File  |  1991-01-04  |  41KB  |  1,196 lines

  1. /*----------------------------------------------------------------------
  2.  
  3.       User's Manual for High-Performance File-Compression Program
  4.  
  5.                            LHARC  Version 1.14ß
  6.                                 07/31/89
  7.  
  8.            Copyright (c) Haruyasu Yoshizaki (Yoshi), 1988-89
  9.  
  10.                                                     Nifty Serve PFF00253
  11.                                                     ASCII PCS   pcs02846
  12.  
  13. ----------------------------------------------------------------------*/
  14.  
  15. 0. It Came to Pass One Day...
  16.  
  17.    After reading "A Hard Disk Cookbook" from Shouei Press, I had a
  18.    strong desire to write my own archiving utility.  On the Nifty Serve
  19.    network, I was first exposed to Mr. Miki's Larc, which surpasses the
  20.    well-known PKware in compression ratios, as reported in the Forum
  21.    Software Debut and Review.  The next shock came when I saw Mr.
  22.    Okumura's LZari, which has even better compression-ratio performance.
  23.    I started to rewrite LZari in assembly language, trying to make it
  24.    run faster, but I could find hardly no good way to speed up the
  25.    process of un-archiving.
  26.  
  27.    So, as an alternative, I used adaptive Huffman coding with an LZSS
  28.    encoder in order to achieve similar compression ratios with shorter
  29.    decompression times.  This is the idea used in  LHARC .
  30.  
  31.    No one can be sure of eradicating all possible bugs, yet if SPACE is
  32.    more valuable than TIME to you, please give this program a try.  It
  33.    may be slower in execution, but it achieves the tightest compression
  34.    ratios of any general archiver in the present "shareware" environ-
  35.    ment.
  36.  
  37.    (Copyright reserved).
  38.  
  39.  
  40. 1. How to Use It:
  41.  
  42.    Just type "LHARC" to see a concise help screen of the program's
  43.    command structure.
  44.  
  45.  
  46.    Command-line synopsis:
  47.    ======================
  48.  
  49.     LHARC  [<command>] [{{/|-}{<switch>[-|+|2|<option>]}}...] <archive_name>
  50.          [{<drive_name>:}|{<home_directory_name>\}] [<path_name> ...]
  51.  
  52.    Only a single command can be specified on the command line, but a
  53.    group of switches can be specified together after the '/' or '-'
  54.    delimiter.  You may place switch(es) anywhere following the command.
  55.  
  56.    Hitting 'Ctrl-Break' or 'Ctrl-C' at any time will abort  LHARC 's
  57.    current operation and return you to the DOS prompt.
  58.  
  59.  
  60.  
  61.  LHARC  User's Manual                                               page 2
  62.  
  63.  
  64.  
  65.    Terminology:
  66.    ============
  67.  
  68.    A path name comprises a directory name and a file name:
  69.  
  70.         a:\tc\include\stdio.ext
  71.         |<---- Path_name ---->|
  72.         |<Directory_>||<File_>|
  73.         |<-- name -->||<name >|
  74.  
  75.    Both the archive name and file name(s) specified in the command line
  76.    can optionally include a path i.e., a drive or directory name.  If
  77.     LHARC  becomes excessively confused by your typing, it will just stop
  78.    and wait for keyboard input.  Hit 'CTRL-Break' or 'CTRL-C' to escape
  79.    back to the prompt and then use the DOS function keys to edit and
  80.    reenter your command line.   LHARC  will continue to answer your
  81.    request.
  82.  
  83.  
  84.  
  85.  LHARC  User's Manual                                               page 3
  86.  
  87.  
  88.  
  89.    Commands:
  90.    =========
  91.  
  92.    a (Add files to archive)
  93.  
  94.       LHARC  a ARCHIVE.LZH file1.ext
  95.  
  96.         Adds 'file1.ext' to 'ARCHIVE.LZH'.  If 'ARCHIVE.LZH' does
  97.         not exist, then  LHARC  will create it.  If a file with the
  98.         name 'file1.ext' already exists in the archive,  LHARC  will
  99.         replace it with the specified file.
  100.  
  101.         Including the extension '.LZH' with the archive name is
  102.         optional and  LHARC  will default to using it unless you
  103.         specify otherwise (see below under "Archive name").
  104.         However, you would certainly need to include the extension
  105.         (or just '.' for a blank extension) with any single-
  106.         character archive name or file name that might look like
  107.         one of  LHARC 's commands.
  108.  
  109.  
  110.  
  111.    u (Update files to archive)
  112.  
  113.       LHARC u ARCHIVE.LZH file1.ext
  114.  
  115.         Adds 'file1.ext' to 'ARCHIVE.LZH', the same as with the 'a'
  116.         command.  However, if 'file1.ext' already exists in the
  117.         archive,  LHARC  will check its time stamp and will keep the
  118.         newer one and ignore the older one.  (Use the /c switch to
  119.         tell  LHARC  to skip this time-stamp comparison.)
  120.  
  121.  
  122.    m (Move new files into archive)
  123.  
  124.       LHARC m ARCHIVE.LZH file1.ext
  125.  
  126.         is equivalent to
  127.  
  128.       LHARC u ARCHIVE.LZH file1.ext
  129.      DEL file1.ext
  130.  
  131.         Beware the fact that the second line is implicit.  You might
  132.         lose 'file1.ext' forever.
  133.  
  134.    f (Freshen files in archive)
  135.  
  136.       LHARC f ARCHIVE.LZH file1.ext
  137.  
  138.         Replaces 'file1.ext' in 'ARCHIVE.LZH' with the newer one
  139.         only if a file with this name already exists in the archive.
  140.         Otherwise, no action is taken.  (Use the /c switch to tell
  141.          LHARC  to skip this time-stamp comparison.)
  142.  
  143.  
  144.  
  145.  LHARC  User's Manual                                               page 4
  146.  
  147.  
  148.  
  149.    e or x (EXtract files from archive)
  150.  
  151.       LHARC e ARCHIVE.LZH d:\temp\
  152.  
  153.         Extracts all the files from 'ARCHIVE.LZH
  154.         directory \temp\ on drive D:.  If the specified directory
  155.         does not exist, then  LHARC  will prompt you whether to create
  156.         it with the message "Make directory? [Y/N]".  If no home
  157.         directory name is specified,  LHARC  will extract all files to
  158.         the current directory.
  159.  
  160.       LHARC e ARCHIVE.LZH file1.ext
  161.  
  162.         Extracts only 'file1.ext' from 'ARCHIVE.LZH'.  If a file
  163.         with the name 'file1.ext' exists in the home directory,
  164.          LHARC  will compare their time stamps and if the existing
  165.         file is older, then  LHARC  will prompt you whether to
  166.         overwrite it.  (Use the /c switch to tell  LHARC  to skip this
  167.         time-stamp comparison.)
  168.  
  169.       LHARC e ARCHIVE.LZS file.ext
  170.  
  171.         Extracts 'file.ext' from an .LZS file archived with Larc
  172.         3.xx.
  173.  
  174.         Note:  Larc is another popular archiver on Japanese PDS's.
  175.  
  176.  
  177.    p (disPlay files in archive)
  178.  
  179.       LHARC p ARCHIVE.LZH file1.ext
  180.  
  181.         Extracts 'file1.ext' from 'ARCHIVE.LZH' and redirects it to
  182.         standard output.
  183.  
  184.       LHARC p /v ARCHIVE.LZH file1.ext
  185.  
  186.         Uses the default utility LESS to format and display the
  187.         redirected output.   LHARC  creates a temporary file
  188.         '  LHARC.TMP' for viewing.  It will be deleted afterward.
  189.  
  190.       LHARC p /vsee ARCHIVE.LZH file1.ext
  191.  
  192.         Invokes the text formatter SEE, which then displays
  193.         'file1.ext' to standard output in a paged format.  Refer to
  194.         PC-LESS.ARC, LIST64A.ARC and SEE15.ARC.  (These should be
  195.         available in most BBS libraries.)
  196.  
  197.  
  198.    d (Delete files from archive)
  199.  
  200.       LHARC d ARCHIVE.LZH file1.ext
  201.  
  202.         Deletes 'file1.ext' from 'ARCHIVE.LZH'.
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  LHARC  User's Manual                                               page 5
  212.  
  213.  
  214.  
  215.    l (List files in archive)
  216.  
  217.       LHARC l ARCHIVE.LZH
  218.  
  219.         Lists information about all the files in 'ARCHIVE.LZH':
  220.         name, original size, stored size, compression ratio, date
  221.         and time, attributes, compression type (see below under
  222.         "Archive File Header") and CRC check.  Each file takes one
  223.         line of output.  A '+' before a file name indicates that a
  224.         directory name is stored with the file name.  (Use the /x
  225.         switch to tell  LHARC  to also display these directory names.)
  226.  
  227.         If you specify any file names and extensions, then only the
  228.         files with matching names or extensions will be listed:
  229.  
  230.       LHARC l ARCHIVE.LZH *.c *.h readme.doc
  231.  
  232.         Lists information on all the .C, .H and README.DOC files
  233.         in 'ARCHIVE.LZH'.
  234.  
  235.  
  236.    v (View list of files in archive)
  237.  
  238.       LHARC v ARCHIVE.LZH
  239.  
  240.         Which is equivalent to:
  241.  
  242.       LHARC l /x ARCHIVE.LZH
  243.  
  244.         Lists information about all the files in 'ARCHIVE.LZH',
  245.         except that each listing takes two lines: the first for the
  246.         full path name and the second for the rest of the
  247.         information.  The /x switch tells  LHARC  to display file
  248.         names extended with directory names.
  249.  
  250.  
  251.    s (make Self-extracting archive)
  252.  
  253.       LHARC s ARCHIVE.LZH d:\temp\
  254.  
  255.         Creates a "small" self-extracting file 'ARCHIVE.COM' (or
  256.         'ARCHIVE.EXE' if larger than 64K) from 'ARCHIVE.LZH' in the
  257.         directory \temp\ on drive D:.  If no home directory name is
  258.         specified, then  LHARC  will create this file in the current
  259.         directory.
  260.  
  261.         A "small" self-extracting archive (SFX) can be as large as
  262.         DOS' working memory space (640K), but normally no larger
  263.         than about 400K for safety.  A "large" SFX, however, is
  264.         limited only by available disk storage (see below under
  265.         "Self-Extracting Archives").
  266.  
  267.  
  268.  
  269.  LHARC  User's Manual                                               page 6
  270.  
  271.  
  272.  
  273.       LHARC s /x ARCHIVE.LZH
  274.  
  275.         Creates a "large" self-extracting file 'ARCHIVE.EXE' from
  276.         'ARCHIVE.LZH'.  The /x switch tells  LHARC  to use the
  277.         "large" (extended) SFX model. You must first have an .LZH
  278.         file, before you can have a Self-Extracting file.
  279.  
  280.  
  281.    t (Test integrity of archive)
  282.  
  283.       LHARC  t ARCHIVE.LZH
  284.  
  285.         Tests the integrity of 'ARCHIVE.LZH' by running a CRC check
  286.         on each file and comparing the result against the file's
  287.         stored CRC value.
  288.  
  289.  
  290.    (no command specified)
  291.  
  292.       LHARC  ARCHIVE.LZH
  293.  
  294.         Acts exactly the same as the 'l' command.  This optional
  295.         action is temporary.  Don't count on it in future versions.
  296.  
  297.  
  298.  
  299.  LHARC  User's Manual                                               page 7
  300.  
  301.  
  302.  
  303.    Switches:
  304.    =========
  305.  
  306.    Specify switch(es) following the switch delimiter '/' or '-'.  If
  307.    you want to specify more than one switch, type characters
  308.    continuously without any intervening spaces, like "/rx-we:\work" or
  309.    "/cxvless".  When the 'v' and 'w' switches are used with other
  310.    switches, they must be specified at the end of a sequence, as shown
  311.    in the above examples.
  312.  
  313.    You may place a '+' or '-' sign after switches, with the following
  314.    meanings: '+' turns the switch on and '-' turns the switch off.
  315.    The '2' creates a special option for the /r and /v switches (see
  316.    below).  If you just specify /<switch> without '+' or '-', then
  317.    <switch> will be toggled from 'on' to 'off' or vARC versa, e.g., to
  318.    override any switch set in an environment variable (see below).
  319.  
  320.    NOTE:  Use only lowercase letters for switches.  Capital letters
  321.           are reserved for future use.
  322.  
  323.  
  324.      /x[-|+] (allow eXtended file names)
  325.  
  326.         By default,  LHARC  stores only the file names of archived
  327.         files and disregards the names of the directory(s) in which
  328.         they reside.  This switch tells  LHARC  to extend all file
  329.         names with directory names and to extract archived files
  330.         together with their stored directory names.
  331.  
  332.         Example: Suppose you are in the root directory, \ and you
  333.         have two files 'stat.h' and '\tc\include\sys\stat.h':
  334.  
  335.       LHARC  a ARCHIVE.LZH stat.h
  336.  
  337.         Adds only the file 'stat.h' from the current (root)
  338.         directory to 'ARCHIVE.LZH', but
  339.  
  340.       LHARC  a ARCHIVE.LZH stat.h \tc\include\sys\stat.h
  341.  
  342.         Will cause  LHARC  to abort with the message "Same names in
  343.         another path", because directory names are normally
  344.         disregarded when storing file names.  However,
  345.  
  346.       LHARC  a /x ARCHIVE.LZH stat.h \tc\include\sys\stat.h
  347.  
  348.         Adds both files to 'ARCHIVE.LZH'.  Then,
  349.  
  350.       LHARC  e ARCHIVE.LZH stat.h
  351.  
  352.         Extracts both 'stat.h' files to the current directory and
  353.         compares their time stamps and if one is newer, then  LHARC 
  354.         will prompt you with the message "'STAT.H': Already exists.
  355.         Overwrite? [Y/N]".
  356.  
  357.  
  358.  
  359.  LHARC  User's Manual                                               page 8
  360.  
  361.  
  362.  
  363.       LHARC  e /x ARCHIVE.LZH stat.h
  364.  
  365.         Extracts both 'stat.h' files together with their directory names:
  366.         one to the current directory and the other to the directory
  367.         \tc\include\sys\.  If this directory does not exist, then  LHARC 
  368.         will prompt you whether to create it.
  369.  
  370.         You can also use the /r switch to tell  LHARC  to archive all
  371.         files with the same file name by recursively searching
  372.         directories.  Thus,
  373.  
  374.       LHARC  a /r ARCHIVE.LZH stat.h
  375.  
  376.         Adds two 'stat.h' files, with path names, to 'ARCHIVE.LZH':
  377.         one from the root directory and the other from the directory
  378.         \tc\include\sys\.
  379.  
  380.         The /r switch sets the /x switch simultaneously.  If you
  381.         don't want full path names, include /x- after specifying the
  382.         /r switch.
  383.  
  384.       LHARC  s /x ARCHIVE.LZH
  385.  
  386.         Creates the "large" (= extended) self-extracting archive
  387.         'ARCHIVE.EXE' from 'ARCHIVE.LZH' (see below under "Self-
  388.         Extracting ARCHIVEs").
  389.  
  390.  
  391.      /p[-|+] (distinguish full Path names)
  392.  
  393.         By default,  LHARC  disregards directory names when extracting
  394.         files.  This switch tells  LHARC  to distinguish files by full
  395.         path name during un-archiving.
  396.  
  397.         Example: Suppose your archive 'tc.LZH' contains both
  398.         'stat.h' and 'sys\stat.h'.  Then,
  399.  
  400.       LHARC  e tc stat.h
  401.  
  402.         Extracts both 'stat.h' files to the current directory and
  403.         the older one will be overwritten by the newer one, whereas
  404.  
  405.       LHARC  e /p tc stat.h
  406.  
  407.         Extracts only 'stat.h' to the current directory and ignores
  408.         'sys\stat.h', because its path name is not specified.
  409.  
  410.         If you specify full path names without the /p switch,  LHARC 
  411.         will extract only those files from your archive, but
  412.         otherwise it will disregard stored directory names.  (If you
  413.         want to extend file names with directory names, use the /x
  414.         switch.)
  415.  
  416.  
  417.  
  418.  LHARC  User's Manual                                               page 9
  419.  
  420.  
  421.       LHARC  e tc sys\stat.h
  422.  
  423.         Extracts only 'sys\stat.h' to the current directory.
  424.  
  425.  
  426.      /c[-|+] (skip time-stamp Comparison)
  427.  
  428.       LHARC  [e|f|u|x] /c ARCHIVE.LZH [file1.ext file2.ext ...]
  429.  
  430.         If a file with the same name is to be created,  LHARC  will
  431.         default to comparing the time stamp of each pair of files,
  432.         and so some files will be overwritten and some just ignored.
  433.         This switch tells  LHARC  to overwrite any existing files with
  434.         extracted ones with the same name.
  435.  
  436.  
  437.      /m[-|+] (no Message for query)
  438.  
  439.       LHARC  [<command>] /m ARCHIVE.LZH [file1.ext file2.ext ...]
  440.  
  441.         By default, before operations that alter files or
  442.         directories,  LHARC  will query you with messages like
  443.         "Overwrite? [Y/N]".  This switch suppresses these messages
  444.         and tells  LHARC  to proceed as if "y" is typed in.
  445.  
  446.  
  447.      /a[-|+] (allow any Attribute of files)
  448.  
  449.       LHARC  a /a ARCHIVE.LZH file1.arc
  450.  
  451.         adds 'file1.arc' to 'ARCHIVE.LZH'.
  452.  
  453.         By default,  LHARC  will not archive files with the hidden,
  454.         read-only or system attribute.  This switch tells  LHARC 
  455.         also to archive files with these attributes.
  456.  
  457.  
  458.      /r[-|+|2] (Recursively collect files)
  459.  
  460.  
  461.  
  462.  LHARC  User's Manual                                              page 10
  463.  
  464.  
  465.  
  466.       LHARC  has three modes of collecting the files to be archived:
  467.  
  468.         (a) specified file(s):  /r-
  469.  
  470.              LHARC  a /r- ARCHIVE.LZH file1.ext [file2.ext ...]
  471.  
  472.                  Adds to 'ARCHIVE.LZH' only the specified files
  473.                  (default mode).
  474.  
  475.         (b) across directories:  /r or /r+
  476.  
  477.              LHARC  a /r ARCHIVE.LZH *.c
  478.  
  479.                  Adds to 'ARCHIVE.LZH' all the files with
  480.                  extension .C on the current drive, starting
  481.                  from the current directory.   LHARC  will store
  482.                  all file names extended with directory names.
  483.                  Use this switch to archive all versions of a
  484.                  file or all files of a certain type.
  485.  
  486.         (c) specified directory(s):  /r2
  487.  
  488.              LHARC  a /r2 ARCHIVE.LZH \doc
  489.  
  490.                  Adds to 'ARCHIVE.LZH' all the files in the
  491.                  directory specified by the path \doc and its
  492.                  branches, similar to the Unix -r option.  Use
  493.                  this switch to archive complete directories.
  494.  
  495.         The /r and /r2 switches set the /x switch simultaneously.
  496.         You may have to toggle the /x switch off (with /x-) after
  497.         using /r or /r2.  The /x- switch tells  LHARC  to disregard
  498.         stored directory names.
  499.  
  500.  
  501.      /w[-|+|<directory_name>] (set Working directory)
  502.  
  503.       LHARC  a /w[d:\temp] ARCHIVE.LZH [file1.ext file2.ext ...]
  504.  
  505.         Creates all the temporary files for 'ARCHIVE.LZH' in the
  506.         directory \temp\ on drive D:.  If no directory name is
  507.         specified with this switch, then the current directory
  508.         becomes the working directory and all the temporary files
  509.         created in the process of archiving will reside in this
  510.         directory and be deleted afterward.
  511.  
  512.      Use the /w switch when
  513.  
  514.         (1) you have no room in the directory where the archive is,
  515.             or
  516.         (2) you want your work done silently and swiftly on a RAM
  517.             disk.
  518.  
  519.  
  520.  
  521.  LHARC  User's Manual                                              page 11
  522.  
  523.  
  524.  
  525.         This switch overrides the working directory that may be
  526.         specified in an environment variable (see below).
  527.  
  528.  
  529.      /v[-|+|2|<utility_name>] (View file by another utility)
  530.  
  531.       LHARC  p /v ARCHIVE.LZH file1.ext
  532.  
  533.         Extracts 'file1.ext' from 'ARCHIVE.LZH' and invokes the
  534.         default utility LESS for formatted display to standard
  535.         output.
  536.  
  537.         NOTE:  LESS.COM is an utility similar to MORE.COM of
  538.                MS-DOS and something more, but less than the
  539.                "LESS" of American Unix networks.  PC-LESS.ARC,
  540.                LIST64A.ARC or SEE15.ARC (available from many
  541.                BBS sources in the U.S.A.) work as well as the
  542.                Japanese utility.
  543.  
  544.          LHARC  first creates an un-archived file '  LHARC.TMP' and then
  545.         invokes the specified utility, usually a page formatter like
  546.         LIST.EXE or SEE.EXE.  Temporary files will normally be
  547.         deleted after you have viewed their output.
  548.  
  549.       LHARC  p /v2 /vbrowse ARCHIVE.LZH file1.ext
  550.  
  551.         Invokes BROWSE.COM for paged display of 'file1.ext' to
  552.         standard output, but suppresses the output of file names or
  553.         path names.  This special '2' option is provided for viewing
  554.         binary files with a dump utility.
  555.  
  556.      /n[-|+] (No Indicator)
  557.  
  558.         Suppress progress display oooo... in the process of
  559.         archiving and de-archiving.  The display is on the standard
  560.         error stream so that the dsiplay is on even in the process
  561.         of redirection.
  562.  
  563.  
  564.     /k<keyword> (Keyword for AUTOLARC.BAT)
  565.  
  566.         When used together with the /x switch to make a "large"
  567.         self-extracting archive (SFX), this switch tells  LHARC  to
  568.         embed the specified keyword into the .EXE file and then to
  569.         turn on the AUTOLARC.BAT auto-execution feature.  That is,
  570.         if the SFX contains a file named 'AUTOLARC.BAT' (which can
  571.         consist of any sequence of batch commands), this file will
  572.         be executed immediately after all the files are extracted,
  573.         but only if the correct keyword is supplied along with the
  574.         SFX name.
  575.  
  576.  
  577.  
  578.  LHARC  User's Manual                                              page 12
  579.  
  580.  
  581.  
  582.       LHARC  s /x /kon ARCHIVE.LZH
  583.  
  584.         Creates the "large" SFX 'ARCHIVE.EXE' from 'ARCHIVE.LZH'
  585.         and turns on auto-execution of AUTOLARC.BAT, conditional
  586.         upon typing the keyword "on".  Then,
  587.  
  588.      C:\>ARCHIVE
  589.  
  590.         Executes 'ARCHIVE.EXE' and extracts all the files, but does
  591.         not auto-execute AUTOLARC.BAT, whereas
  592.  
  593.      C:>ARCHIVE on
  594.  
  595.         Extracts all the files and immediately executes AUTOLARC.BAT.
  596.  
  597.         Note:  Because DOS ignores case on the command line,
  598.                this keyword cannot be made case sensitive.
  599.  
  600.  
  601.      /t[-|+] (Time Stamp)
  602.  
  603.         Update the time stamps of Archive to the newest file in the
  604.         archive, effective with switches (a,u,m,f,d).
  605.  
  606.       LHARC  a /t ARCHIVE.LZH file1.ext
  607.  
  608.         Will set the time stamp of ARCHIVE.LZH to that of file1.ext
  609.         if it has the newest time stamp in ARCHIVE.LZH, otherwise
  610.         ARCHIVE.LZH has the time stamp of command-line execution
  611.         above.
  612.  
  613.  
  614.  
  615.  LHARC  User's Manual                                              page 13
  616.  
  617.  
  618.  
  619.    Archive name (path name):
  620.    =========================
  621.  
  622.    All the files archived by  LHARC  have the same format as those
  623.    archived by Larc, except that Larc uses the extension '.LZS'.  If you
  624.    specify a different extension,  LHARC  will prompt you whether to use
  625.    it with the message "Extension of archive is not '.LZH.' Continue
  626.    processing? [Y/N]".
  627.  
  628.    Wildcards are valid in specified file names with the 'e', 'x', 'p',
  629.    'l', 'v' and 's' commands:
  630.  
  631.       LHARC  e *.LZH *.c
  632.  
  633.         Extracts all files with extension .C from all archives in
  634.         the current directory.
  635.  
  636.  
  637.    Home directory name (drive name):
  638.    =================================
  639.  
  640.    If you specify a home directory name, then  LHARC  will refer to that
  641.    directory as if it is the current directory.  Specify a home
  642.    directory name ending with either '\' or ':'.  All files will be
  643.    archived without storing this directory name unless you also use the
  644.    /r or /x switch.
  645.  
  646.    Example:  Suppose you have the following directory tree:
  647.  
  648.                          |-- BIN --
  649.                          |
  650.         |-- \ --|-- TC --|-- LIB --
  651.                          |
  652.                          |-- INCLUDE --|-- SYS --|-- STAT.H
  653.  
  654.    From the root directory, \,
  655.  
  656.     LHARC  a /r ARCHIVE.LZH stat.h tc\include\
  657.  
  658.         adds '\tc\include\sys\stat.h' to 'ARCHIVE.LZH' with the path
  659.         name 'sys\stat.h' from your home directory \tc\include\.
  660.  
  661.  
  662.    File name (path name):
  663.    ======================
  664.  
  665.    The file names or path names of files to be archived must be
  666.    specified or else  LHARC  will assume *.* with no directory names.
  667.    The wildcards '*' and '?' behave exactly as in DOS.  You cannot use
  668.    them to specify directories except with the /r2 switch, similar to
  669.    the Unix -r option for cp, mv and rm.
  670.  
  671.  
  672.  
  673.  LHARC  User's Manual                                              page 14
  674.  
  675.  
  676.  
  677.    Switch delimiter:
  678.    =================
  679.  
  680.    If you are currently using some other character, like '-', in place
  681.    of the forward slant '/' as a switch delimiter (from the undocu-
  682.    mented DOS Function 37H, Set/Query Switchar), then you have to use
  683.    your character in place of '/', like "-cx".  This makes '/' available
  684.    as a directory delimiter instead of '\', as in Unix convention.  (You
  685.    can use '-' as a switch delimiter with  LHARC  anyway.)
  686.  
  687.    The above comment may not apply unless you are running MS-DOS 3.xx.
  688.  
  689.  
  690. 2. Setting Switches in an Environment Variable
  691.  
  692.    You may set any of  LHARC 's default switches with the environment
  693.    variable '  LHARC':
  694.  
  695.      SET   LHARC=/we: /r2
  696.  
  697.         will set drive E: as the working directory and archive all
  698.         files in directory mode.
  699.  
  700.    You may also specify  LHARC 's working directory with the environment
  701.    variable 'TMP':
  702.  
  703.      SET TMP=E:
  704.  
  705.         but the /w switch will override this setting.
  706.  
  707.  
  708.  
  709.  LHARC  User's Manual                                              page 15
  710.  
  711.  
  712.  
  713. 3. Self-Extracting Files
  714.  
  715.     LHARC  can create a self-extracting archive (SFX), which makes file
  716.    transfers very easy because the recipient does not need to have
  717.     LHARC  itself to extract the contents.
  718.  
  719.    There are two models of SFX: "small" and "large." A "small" SFX is
  720.    designed to fit in working memory, but a "large" SFX depends only on
  721.    available disk storage.  When run, each model will sign on with a
  722.    corresponding screen message: " LHARC  SFX 1.14ß ".
  723.  
  724.    On execution, either model SFX looks first for an archived file with
  725.    the name '!' and displays it to the screen followed by the simple
  726.    message "[Y/N]", which is prompting you whether or not to extract the
  727.    rest of the files.  This option, called a telop, is provided for your
  728.    convenience; it might be used for an announcement, an invitation, a
  729.    cover letter for E-mail, a shipping label, an ANSI graphics screen,
  730.    or whatever you please.  Thus, the telop will politely reassure the
  731.    recipient of your SFX as to sender, contents and intentions.  To
  732.    make a telop, simply create a suitable ASCII file with your favorite
  733.    text editor and then rename it to '!' before archiving.
  734.  
  735.    If you create a file with the name 'AUTOLARC.BAT' (which can consist
  736.    of any sequence of batch commands) and include in a "large" SFX, you
  737.    can optionally embed a keyword that will activate auto-execution of
  738.    this batch file immediately after all the files are extracted.
  739.    Otherwise, any AUTOLARC.BAT file will simply be harmlessly extracted
  740.    along with the rest of the files.
  741.  
  742.    It is, of course, possible to smuggle destructive "jokes" or so-
  743.    called viruses into this AUTOLARC.BAT file (a "Trojan horse"). So, to
  744.    guard against such unscrupulous use of this powerful feature of
  745.     LHARC , I have provided a measure of security with the telop and the
  746.    keyword.
  747.  
  748.    The attribute byte of all the extracted files will normally be 20h.
  749.    If you specify /x switch in Large SFX files, then you may restore any
  750.    attributes.  This feature is only for Large model.  A typical command
  751.    line looks like:
  752.  
  753.      ARCHIVE [/kword] [/edirectory_name][/x][/a].
  754.  
  755.    Note:  In MS-DOS2.xx a program has no way to know its filename
  756.           or pathname for its own.  So move the self-extracting
  757.           .EXE file on the very directory where is is going to be
  758.           de-archived.  Then execute.
  759.  
  760.  
  761.  
  762.  LHARC  User's Manual                                              page 16
  763.  
  764.  
  765.  
  766.    "Small" model:
  767.    ==============
  768.  
  769.    A "small" SFX must fit within the size of your available memory, so
  770.    theoretically it can be as large as DOS' 640K workspace.  In
  771.    practARC, however, it should not be much larger than 400K, especially
  772.    when you distribute your program, it is not YOU who extract the file.
  773.    Think of people who may not have a fully memory populated machine.
  774.  
  775.       LHARC  s ARCHIVE.LZH
  776.  
  777.         Creates 'ARCHIVE.COM' or 'ARCHIVE.EXE', depending on the
  778.         size of your original archive.  Then,
  779.  
  780.      C:\>ARCHIVE
  781.  
  782.         Displays the telop file '!' on the screen and prompts you
  783.         whether to proceed to extract files, with the simple message
  784.         "[Y/N]" (add your own message to the end of the telop to
  785.         take advantage of this prompt).  The telop itself is not
  786.         extracted; to record it to disk, type
  787.  
  788.      C:\>ARCHIVE >!
  789.  
  790.  
  791.  
  792.  LHARC  User's Manual                                              page 17
  793.  
  794.  
  795.  
  796.    "Large" model:
  797.    ==============
  798.  
  799.    A "large" SFX is limited in size only by available disk storage and
  800.    will optionally auto-execute an AUTOLARC.BAT file immediately after
  801.    extracting all the files.
  802.  
  803.       LHARC  s /x /kon ARCHIVE.LZH
  804.  
  805.         Creates 'ARCHIVE.EXE' (the extension is always .EXE in this
  806.         case) and turns on auto-execution of AUTOLARC.BAT,
  807.         conditional upon typing the keyword "on".
  808.  
  809.    Auto-execution of AUTOLARC.BAT will take place if and only if you
  810.    supply the keyword (case insensitive) along with the SFX name.  For
  811.    the above example,
  812.  
  813.      C:\>ARCHIVE on
  814.  
  815.        or
  816.  
  817.      C:\>ARCHIVE ON
  818.  
  819.         Extracts all the files and immediately executes AUTOLARC.BAT,
  820.         whereas:
  821.  
  822.      C:\>ARCHIVE
  823.  
  824.         Just extracts all the files after displaying the telop, if
  825.         any.
  826.  
  827.         Note:  If a file with the name 'AUTOLARC.BAT' already
  828.                exists in the current directory, it will auto-
  829.                matically be overwritten.
  830.  
  831.  
  832.  
  833.  LHARC  User's Manual                                              page 18
  834.  
  835.  
  836.  
  837.    Destination directory(s):
  838.    =========================
  839.  
  840.    You can use the /e switch with the SFX name to specify the
  841.    destination directory for all the extracted files, but only for a
  842.    "large" SFX:
  843.  
  844.      C:\>ARCHIVE /ed:\temp
  845.  
  846.         Extracts all the files in 'ARCHIVE.EXE' to the directory \
  847.         temp\ on drive D:.
  848.  
  849.    In addition, if any directory names are stored with the file names
  850.    in the original archive, you can use the /x switch to extract files
  851.    with full path names:
  852.  
  853.      C:\>ARCHIVE /ed: /x
  854.  
  855.         Extracts all the files to drive D: and extends file names
  856.         with directory names.  If any of these directories does not
  857.         exist, then it will be automatically created.  Any
  858.         AUTOLARC.BAT file, however, is always extracted to the
  859.         current directory, whether you use the /x switch or not.
  860.  
  861.  
  862.  
  863.    View Self-extracting files.
  864.    ===========================
  865.  
  866.    From version 1.12b on, you may handle self-extracting .COM or .EXE
  867.    files as .LZH files with commands e, x, p, t, l, v, s.  Please use
  868.    full filename with extension .com or .exe.  Like:
  869.  
  870.       LHARC  l ARCHIVE.exe
  871.  
  872.    To take a list of files inside a self-extracting ARCHIVE.exe file.
  873.    Be ALERT to the danger of overwriting or creating a new file with
  874.    the 's' switch.  Try to keep a backup when viewing.
  875.  
  876.  
  877.  
  878.  
  879.  LHARC  User's Manual                                              page 19
  880.  
  881.  
  882.  
  883. 4. Archive File Header
  884.  
  885.     LHARC 's header is compatible with that of Larc.  Methods of
  886.    archiving are two:
  887.  
  888.      -lh0-   stored as it was and
  889.      -lh1-   compressed by LHARCuf coding.
  890.  
  891.     LHARC  can also extract files stored in Larc-created archives (with
  892.    the extension .LZS) if they are type 4 or 5.
  893.  
  894.    NOTE:  Larc is another Japanese archiver, with source code
  895.           published in a journal.  It is now also available in the
  896.           United States.  Larc, also, has a SFX self-extractor.
  897.           The structure of self-extracting large SFX file looks
  898.           like:  (SFX + "key word") archived + header + archived
  899.           file.
  900.  
  901.  
  902. 5. Result Codes
  903.  
  904.     LHARC  returns the following result codes to the parent process:
  905.  
  906.         0   Normally finished.
  907.  
  908.         1   Process finished with nonexistent file names ignored
  909.             during archiving or CRC error occurred during
  910.             un-archiving.
  911.  
  912.         2   Process terminated by fatal error; no archive created
  913.             or files moved.
  914.  
  915.         3   Unable to write temporary files into the archive.  Work
  916.             file renamed to '  LHARC.)2(' and original archive
  917.             deleted.  Try renaming   LHARC.)2( as your archive,
  918.             although it might be damaged.
  919.  
  920.  
  921. 6. Temporary Files
  922.  
  923.           LHARC.)1(   Original archive, renamed.
  924.           LHARC.)2(   Work file used to create new archive.
  925.           LHARC.TMP   Work file created for viewing by another utility.
  926.  
  927.    If a file with one of these file names already exists in the working
  928.    directory, then the behavior of  LHARC  is unpredictable.
  929.  
  930.  
  931.  
  932.  LHARC  User's Manual                                              page 20
  933.  
  934.  
  935.  
  936. 7. My Distribution Policy
  937.  
  938.    Under the following conditions, you may freely copy and distribute
  939.    this software:
  940.  
  941.    1. Under all circumstances, "Copyright by Haruyasu Yoshizaki"
  942.       must be attached to the copy.
  943.  
  944.    2. This manual or its hardcopy should go together with the
  945.       software.
  946.  
  947.    3. You may modify the program, but in that case, you must distri-
  948.       bute the complete source code for the program, including your
  949.       specific contributions and you must make it clear that you
  950.       have made such modifications.
  951.  
  952.    4. You must try to distribute the latest version available.
  953.  
  954.    5. I assume no warranty for any claim of damage you may sustain
  955.       by using this software.
  956.  
  957.    6. I have no obligation to revise the program to correct any
  958.       fault in this software.
  959.  
  960.    7. For any commercial use of this software, I add the following:
  961.  
  962.       a. The entire software made incorporating this program should
  963.          not be copy protected in the sense that the DISKCOPY
  964.          program of MS-DOS makes an imperfect copy.
  965.  
  966.       b. Every part of the package should print the name " LHARC " and
  967.          the copyright banner.
  968.  
  969.       c. The distribution policy of this software should be printed
  970.          either in the manual, in the package or on the disk label.
  971.  
  972.          Comment:  If a commercial package or a shareware
  973.                    product uses  LHARC  with self-extracting SFX
  974.                    form for the distribution, then the Copy-
  975.                    right statement must appear with SFX header.
  976.                    I consider this as a claim of  LHARC 's Banner.
  977.  
  978.  
  979.  
  980.  LHARC  User's Manual                                              page 21
  981.  
  982.  
  983.  
  984. 8. Acknowledgments
  985.  
  986.    Special gratitude to Haruhiko Okumura, who uploaded the code for
  987.    LZari to PC-VAN on which my LHARCuf coding is based; and to Kazuhiko
  988.    Miki, the author of Larc I, who re-posted LZari on Nifty Serve.  To
  989.    all who contributed reviews, comments and bug reports, I express my
  990.    thanks.
  991.  
  992.    Thanks also to Prof. Kenjirou Okubo who has spent much of his own
  993.    time in reviewing the English manual and resources in distributing
  994.     LHARC  into the United States.
  995.  
  996.    The .EXE file for  LHARC  is nearly 2K smaller owing to use of
  997.    pcs27162 by S. Takanami.  I honor this utility and thank him for
  998.    letting me use it to prepare  LHARC .
  999.  
  1000.    I have made so many revisions to  LHARC , yet I do not think I can
  1001.    ever expel all the bugs dwelling inside.  I would appreciate any
  1002.    comments and bug reports.  Please route them to me via the SDR
  1003.    Forum on Nifty Serve or salon.pds of ASCII Net.  In the United
  1004.    States, CompuServe subscribers can contact me through Kenjirou
  1005.    Okubo 74100,2565 or on GEnie via 'K.OKUBO'.
  1006.  
  1007.  
  1008. 9. References
  1009.  
  1010.    1) Labo, A.P., A Hard Disk Cookbook:  Shouei Press (1987).
  1011.  
  1012.    2) Kurita, T., Huffman coding, bit:  Jewelry Box of Computing 43,
  1013.       vol. 20, no. 7, pp. 100-101 (1988).
  1014.  
  1015.    3) Miki, K., Documentation for Larc:  LARC.MAN.
  1016.  
  1017.  
  1018.  
  1019.  LHARC  User's Manual                                              page 22
  1020.  
  1021.  
  1022.  
  1023. 10. History of Revisions
  1024.  
  1025. v1.14b
  1026.     1. Modified the '.' and the 'o' , to '░' and '█' for the graph
  1027.        when (Un)LHARC'ing. This was done because someone patched my
  1028.        v1.13 to do this and then called it ICE, preventing (s)he was
  1029.        me!
  1030.  
  1031.  
  1032. v1.13c
  1033.     1. Following Mr.Okumura's sugestion, a check is now made for
  1034.        the size of extractable files being added.
  1035.     2. Check size of the specified directory for extraction.
  1036.     3. In using temporary files,  LHARC  checks the size of available
  1037.        area and in case of shortage, restore in old archives.
  1038.  
  1039. v1.13b
  1040.     1. /t switch to update even if no transaction is made.
  1041.     2.  LHARC  accepts self-extracting .COM &.EXE files like .LZH
  1042.        files in e, x, p, t, l and s commands.
  1043.     3. Bugs in B: D: drive specification removed.
  1044.  
  1045. v1.13a
  1046.     1. New /t switch added
  1047.     2. Display redirected to standard error stream.
  1048.     3. Bugs fixed in large SFX model.
  1049.     4. /a switch in large SFX model.
  1050.     5. Some trial t let a program know its path_name and own name.
  1051.     6. Some mixed dislay when a file_name contains '$'.
  1052.     7. User's Manual rewritten to reflect changes since v1.00.
  1053.  
  1054. v1.12b
  1055.     1. Fixed bug in auto-execution of AUTOLARC.BAT after self-
  1056.        extraction.
  1057.  
  1058. v1.12
  1059.     1. Added 't' command.
  1060.     2. Changed screen display to show new commands and switches.
  1061.     3. Fixed bug in CRC error check with archived file of zero
  1062.        length.
  1063.     4. Revisions to self-extracting archives:
  1064.        - "large" and "small" SFXs
  1065.        - telop file '!'
  1066.        - /k switch for security against Trojan horses
  1067.  
  1068. v1.01
  1069.     1. Minor touchups to help screen and program messages.
  1070.     2. User's Manual rewritten for clarity and intelligibility.
  1071.  
  1072. v1.00
  1073.     1. Mode without work file added.
  1074.     2. /r switch forces /x switch on simultaneously.
  1075.  
  1076. v0.07c
  1077.     1. Removed bug in detecting memory shortage.
  1078.     2. Compacted self-extraction program.
  1079.  
  1080. v0.07a
  1081.     1. Vers. 0.05-0.07 break down heap areas.  Corrected.
  1082.     2. Now accepts any directory name with any attributes.
  1083.  
  1084.  
  1085.  
  1086.  LHARC  User's Manual                                              page 23
  1087.  
  1088.  
  1089.  
  1090. v0.07
  1091.     1. Prohibited actions to a write-protected archive.
  1092.     2. 'm' command now removes files made by older versions.
  1093.     3. Error-handling routine revised in dealing with wildcards for
  1094.        archive names.
  1095.     4. No command specified is now interpreted as 'l' command
  1096.        specified.
  1097.     5. Error level 1 returned when CRC checking detects an error
  1098.        during un-archiving.
  1099.     6. Program now halts when self-extraction process meets an
  1100.        error.
  1101.     7. Bug fixed in CRC checking when a directory name is met in
  1102.        the un-archiving process.
  1103.  
  1104. v0.06b
  1105.     1. Removed possibility of a damaged cluster appearing in failing
  1106.        to re-create (= freshen) an archived file.
  1107.     2. Removed '+' bug in redirecting output with 'p' command.
  1108.  
  1109. v0.06
  1110.     1. If a file transaction fails with 'u', 'm' or 'f' command,
  1111.         LHARC  will leave the archive as it was.
  1112.     2. File attributes were sometimes misunderstood by 'f' command.
  1113.        This possibility eliminated.
  1114.  
  1115. v0.05
  1116.  
  1117.     1. CRC checks extended to self-extracting archives.
  1118.     2. Completely recursive modes made possible for 'a,u,m' commands.
  1119.     3. Meets requirements of APPEND.EXE of MS-DOS version 3.3.
  1120.     4. '\' no longer needed at end of working directory name with /w
  1121.        switch.
  1122.  
  1123. v0.04
  1124.     1. Support for environment variable 'TMP'.
  1125.  
  1126.     2. " LHARC  p /v a.ARC a_file" used to delete 'a_file' in case of
  1127.        an error.  Bug fixed.
  1128.     3. Added check for a file with the same name in making a self-
  1129.        extracting archive.
  1130.     4. In a self-extracting archive, if a file with the same name
  1131.        of larger size existed, then  LHARC  kept the difference when
  1132.        it was overwritten by one of smaller size.  This bug removed.
  1133.  
  1134. v0.03
  1135.     1. Environment variable '  LHARC' sets some of the switches.
  1136.     2. Made it possible to specify '+', '-' with switches.
  1137.     3. /v switch included.
  1138.     4. Wildcards can now be used for archive names with 'e,x,p,l,v,s'
  1139.        commands.
  1140.     5. Home directory names had some interactions with Kanji-code.
  1141.        Fixed.
  1142.     6. Fixed header-file bugs of self-extracting .EXE files.
  1143.  
  1144.  
  1145.  
  1146.  LHARC  User's Manual                                              page 24
  1147.  
  1148.  
  1149.  
  1150. v0.02
  1151.     1. Support for 'm' command.
  1152.     2. Larc 3.xx compatibility.  Type 4, 5 .LZS files are un-
  1153.        archived.
  1154.     3. Accommodation to systems with different switch characters.
  1155.     4. Minor bugs fixed with 'e' command.
  1156.     5. Revised format for 'l' command.
  1157.  
  1158. v0.01
  1159.     1. Support for self-extracting archives.
  1160.     2. 'p' command added.
  1161.     3. /c switch applies to more combinations of commands and
  1162.        switches.
  1163.     4. Error handling revised.
  1164.     5. Bug fixed in 'l' command.
  1165.     6. New algorithm introduced in sorting path names.
  1166.  
  1167.  
  1168.  
  1169. 11. Comments
  1170.  
  1171.  a. Some other algorithms I have in mind.
  1172.  
  1173.     With some specific files, the compression ratios are not as good as
  1174.     with PKware's PKZIP.  For such files, I may use LZSS compression
  1175.     with correlated arithmetic compression.  This is an effective
  1176.     method and my experiments show that the ratios are no less than
  1177.     PKware's.  Yet it takes too much time in both the archiving and
  1178.     un-archiving processes, with much higher memory consumption.
  1179.     Consequently, I intend to keep working on the algorithm.
  1180.  
  1181.     Naturally, I am ready to receive any comments and I continue to
  1182.     experiment.
  1183.  
  1184.  
  1185.  b. Naming of  LHARC 
  1186.  
  1187.         I have named the New program LHARC, because it goes along better
  1188.         with the wording within the program such as FREEZING,FROZEN,
  1189.         MELTING,MELTED alot better than .LZH was.
  1190.  
  1191.         Plus when an .LZH file is listed in a directory, you can 
  1192.         more easily figure out which program will unARC it.
  1193.  
  1194.  
  1195.                                 -=≡ end ≡=-
  1196.