home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 300.lha / LHarc_v1.0 / lharc.doc < prev    next >
Encoding:
Text File  |  1980-12-06  |  18.1 KB  |  462 lines

  1. ________________________________________________________________________
  2. ------------------------------------------------------------------------
  3.  
  4.  
  5.                         LHARC        vers. 1.0
  6.  
  7.                         for the Commodore AMIGA
  8.          Compatible with version 1.13 of Lharc for MSDOS systems
  9.  
  10.                   by Paolo Zibetti  (FidoNet 2:331/101.6)
  11.  
  12.  
  13.  
  14. ------------------------------------------------------------------------
  15.  IMPORTANT NOTICE:  This program is copyrighted by Paolo Zibetti, but can
  16.  be freely distributed, providing that the following rules are respected.
  17.  - No change is made to the program nor to the accompaning documentation
  18.  - The package is always distributed in its complete form consisting of 
  19.    3 files: "Lharc", "Lharc.doc" and "Changes".
  20.  - Every form of distribution is allowed and encouraged, but no fee can 
  21.    be charged for this program exept for, possibly, the cost of magnetic 
  22.    media.
  23.  - It cannot be distributed in any commercial product without the written
  24.    consent of the author.
  25.  By copying, distributing and/or using the program you indicate your 
  26.  acceptance of the above rules.
  27.  Also remember that this program is supplied 'as is': the entire risk as
  28.  to the quality of the program is to the user. In no event will the author 
  29.  be liable for direct or indirect damage or loss resulting from the use
  30.  of this program.
  31. ------------------------------------------------------------------------
  32.  
  33. ________________________________________________________________________
  34. ------------------------------------------------------------------------
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. Lharc is an archive program such as Arc and Zoo. It can store several
  46. files in one archive in a compressed form which is generally more
  47. efficent than that used by Arc and Zoo.  It also supplies all of the
  48. archive handling capabilities that an archive program should have.
  49. Its only weakness is compression speed: Zoo 2.0, for example, is much
  50. faster, but if compression efficency is more important for you than
  51. compression time you'll surely appreciate this progam. (anyway
  52. decompression is much faster than compression)
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. Lharc is run from CLI with the following command line:
  61.  
  62.   Lharc [<switches>] <Command> <Archive> [<dest path>] [<file patterns>]
  63.  
  64. items in square brackets are optional.
  65.  
  66.  
  67.  
  68.  
  69. <Command> can be any of the following (case is not significant):
  70.  
  71.  
  72.   e,x  extract files from archive
  73.        Extracts files from archives. If you specify some file names
  74.        or patterns only those files satisfying the patterns are
  75.        extracted, otherwise all the files in the archive are
  76.        extracted.
  77.        While extracting files, Lharc checks if a file by the same
  78.        name already exsists in the destination directory and prompts 
  79.        you before overwriting the old file with the extracted one 
  80.        (unless you specified the -m switch)
  81.        See below under '<dest path>' for a discussion on where the
  82.        extracted files are put.
  83.  
  84.   l,v  show archives contents
  85.        Displays the names of the files in an archive along with their
  86.        date, time, CRC, compression type, original lenght and
  87.        compressed lenght.
  88.        If the -x switch is specified file names are listed complete
  89.        with their path (if present in the archive), otherwise
  90.        only the name of the files is listed.
  91.  
  92.   p    extract and print files to screen
  93.        same as 'e' and 'x', but extracted files are sent to stdout
  94.  
  95.   t    test archive integrity
  96.        Checks CRCs and checksums to ensure that the archive is not
  97.        corrupted
  98.  
  99.   a    create archives or add to existing archives
  100.        If you try to archive a file and a file by the same name
  101.        already exists in the archive the file will not be added
  102.        and a message will be printed on the screen to inform you. 
  103.        By default only file names are stored in the archive, use the 
  104.        -x switch to store file names complete with their paths.
  105.        Also, by default file attributes are not stored, use the '-a'
  106.        switch to obtain this.
  107.  
  108.   m    move files into archivs
  109.        Same as add, but deletes original files after archiving them
  110.        [ Please, see below 'Bugs']
  111.  
  112.   d    delete files from archives
  113.        You can delete from an archive a maximum of 150 files at a time,
  114.        if you find that they are too little, please let me know!  
  115.  
  116.   u    update files in archives
  117.        Same as with the 'a' command.  However, if a file already 
  118.        exists in the archive, LHarc will check its time stamp and will
  119.        keep the newer one and ignore the older one.
  120.  
  121.   f    freshen files in archives
  122.        Replaces a file in the archive with the newer one only if a file
  123.        with the same name already exists in the archive.
  124.        Otherwise, no action is taken.
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132. <Archive> is the name (eventually preceded by a path) of the
  133. archive you want to work on. If no extension is specified the default
  134. extension .LZH is used. 
  135. With the 'l' (or 'v'), 'e' (or 'x'), 'p', 't' and 'a' commands you can
  136. work on multiple archives by using wildcards (see 'file patterns'
  137. below for a list of accepted wildcards). For example "lharc v *.LZH"
  138. will show the contents of all the archives in the current directory,
  139. while "lharc x *.LZH *.c" will extract all the C source files
  140. contained in all the archives in the current directory.
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. [<dest path>] 
  148. This parameter is significant only with the 'x' (or 'e') command and is
  149. ignored otherwise. It tells where to put the extracted files; if not
  150. specified, extracted files will go to the current directory.
  151. Similarly, if you specify the -x switch, files will be extracted
  152. to the path specified in the archive with respect to <dest path>
  153. or with respect to the current directory if <dest path> is omitted.
  154. Please note that this paramenter must always end with '/' or ':'
  155. otherwise it will not be recognized as such and will be considered
  156. as one of the file patterns. 
  157. If the path specified by <dest path> (or equivalently the path stored in
  158. the archive if you are using the -x switch) deos not already exist,
  159. you will be prompted if you want new directories to be automatically
  160. created (unless you specified the -m switch, in which case directories
  161. will be created without any prompt).
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168. [<file patterns>] rappresents an optional number of file names
  169. or file patterns. They indicate which files to
  170. extract/compress/list/delete, ecc. 
  171. Accepted wild cards are the standard AmigaDOS '#' and '?' plus the '*'
  172. which is a synonim of '#?'. Since however the asterisk is a valid
  173. caracter in AmigaDOS file names I provided the '**' sequence as an
  174. escape.  So if you want to refer to a file name containing an asterisk
  175. just double the asterisk in the file name.  
  176. Example:  '*.c' is equivalent to '#?.c' and refers to all the files
  177. ending with '.c', while 'my**file' refers to the file 'my*file'.
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184. [<switches>] rappresents an optional number of switches that are used
  185. to change the behaviour of the program.
  186. A switch is composed by  a leading '-' followed by one letter; unlike
  187. commands which are case insensitive, switches are case sensitive.
  188. An important point is that if you want to specify more than one switch,
  189. every switch must be preceded by its own dash, i.e. to activate the 'x' and
  190. 'm' switches you must enter "-x -m" and NOT "-xm". 
  191. Here is a summary of the available switches:
  192.  
  193.  
  194.   -p  Pause after loading        [note that this is lowercase 'p']
  195.       Causes Lharc to wait for the user to press RETURN before
  196.       executing a command. This allows floppy disk users to swap disks
  197.       after loading Lharc.
  198.  
  199.   -m  no Message for query
  200.       Suppresses all the queries Lharc normally issues before
  201.       overwriting existing files or before creating new directories
  202.       If you specify this switch Lharc will behave as if you typed 'Y'
  203.       in response to all the prompts.
  204.  
  205.   -x  use eXtended file names
  206.       By default, LHarc stores only the file names of
  207.       files and disregards the names of the directories in which
  208.       they reside.  This switch, used with the 'a' command, tells LHarc 
  209.       to extend all file names with directory names; used with the 'e' 
  210.       command tells Lharc to extract archived files together with their
  211.       stored directory names, eventually creating the needed directories
  212.       if they don't already exist; used with the 'l' command tells Lharc
  213.       to list files with their full path name.
  214.       So it should be clear that to preserve the directory structure you
  215.       must use this switch both during compression and during extraction.
  216.  
  217.   -n  No progress indicator
  218.       Suppresses the display of the number of bytes beeing processed
  219.       during compression or decompression. May be useful if you
  220.       redirect to a file the output of Lharc.
  221.       Note: this version of Lharc allows the -N switch as a synonim of -n :
  222.       but this might change in future versions, so preferibly use the
  223.       lowercase letter.
  224.  
  225.   -w  set Work directory
  226.       Use this switch to choose your own directory for temporary files.
  227.       The directory name must immediatly follow the letter 'w' without
  228.       any leading space, i.e. to set the 'temp' directory on your
  229.       hard-disk as the working directory you must write "-wdh0:temp".
  230.       See below "Temporary files" for a discussion on where temporary
  231.       files are stored in the absence of this switch. 
  232.  
  233.   -P  set Priority          [note that this is uppercase 'P']
  234.       Use this switch to set the priority with which Lharc will be
  235.       executed. Priority must be in the range -5..+5  and must
  236.       immediately follow the 'P' letter without blanks in between.
  237.       By default Lharc is excuted with the same priority of
  238.       the task that invoked it; using this switch will set the new
  239.       priority immediatley after loading and will set back the priority
  240.       to the original value immediately after terminating.
  241.       If you want to do something else with your Amiga, for example
  242.       editing a letter, while Lharc is compressing a long file, I
  243.       suggest that you set Lharc's priority to one less than that of
  244.       the other program, i.e. if you started your editor with the usual
  245.       priority of zero then invoke Lharc with the '-P-1' switch to set its
  246.       priority to -1
  247.  
  248.   -a  consider file Attributes
  249.       By default Lharc will ignore file attributes (i.e. the flags
  250.       indicating protection from deletion, and so on) for maximum
  251.       compatibility with the MSDOS version: in other words it will
  252.       store files with an attribute bit pattern which is suitable for 
  253.       MSDOS machines while during extraction it will ignore the
  254.       attributes stored in the archives, setting the attributes of the
  255.       extracted files to the usual '----rwed'.
  256.       If you use this switch, on the contrary, files will be stored
  257.       with their original attributes and during extraction the
  258.       stored attributed will be restored.
  259.       Remember that, to effectively preserve file attributes, you must
  260.       use this switch both during compression and during extraction.
  261.       Of course AmigaDOS file attributes are meaningless to MSDOS and
  262.       vice-versa; so extract files with the -a switch only if you are
  263.       sure that they contain AmigaDOS file attributes and similarly
  264.       compress files with the -a switch only if you are sure that the
  265.       archive will be unpacked only by Amigas and not by MSDOS
  266.       machines. (Anyway no harm is done if this rule is not respected:
  267.       extracted files will simply have strange attributes)
  268.  
  269.   -u  convert file names to Uppercase
  270.       By default Lharc stores file names/paths with thier original case,
  271.       if you use this switch they will be converted to uppercase.
  272.       See below 'Compatibility' for a possible use of this switch.
  273.  
  274.   -r  Recursively collect files
  275.       This switch instructs Lharc to search for files matching the
  276.       specified patterns not only in the specified directories, but also
  277.       in all the subdirectories that may be found in the specified
  278.       directories. For example: "Lharc -r a archive.lzh df1:source/*.c" 
  279.       will search for files whose name ends with ".c" in "df1:source/"
  280.       and in all the subdirectories that may be contained in the
  281.       "df1:source" directory. 
  282.       Another example: "Lharc -r a archive.lzh df1:*" will archive the
  283.       entire disk in drive df1:, including all its subdirectories.
  284.       Very powerfull, isn't it ?
  285.       When you specify the -r switch, files are always stored with their
  286.       path name, i.e. the -r switch automatically turns on the -x switch,
  287.       too.
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297. -Temporary files.
  298.  
  299. While compressing files Lharc creates a temporary file called
  300. 'Lharc.TMP_XXXXXX' where XXXXXX is a hex digit representing the address
  301. of its own Task structure as returned by Exec's FindTask(NULL).  
  302. The reason for the XXXXXX part of the name is that if you run multiple
  303. copies of Lharc at the same time each copy will create its own temporary
  304. file with a different name (usefull for multiline BBSes for example).
  305. Here is how Lharc decides where to store temporary files.
  306. If you specify a path with the -w switch temporary files are stored
  307. there, otherwise if the T:  logical device is assigned they will be
  308. stored in that directory, otherwise they will go to the current
  309. directory.  
  310. If you are not using the -w switch, in order to increase compression
  311. speed, I raccomand that you assign T:  to a directory in the ram-disk.
  312. Note however that T:  is usually automatically assigned to 'ram:t' in
  313. the startup-sequence of the standard Workbench, so, unless you have
  314. modified the startup-sequence, you don't have to worry about this.
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326. -Corrupted archives
  327.  
  328. This version al Lharc for the Amiga has the capability of automatically
  329. handle corrupted archives.
  330. A Lharc archive is made up of several compressed files each precedeed by
  331. a header containing information about file name, date, lenght,...
  332. To ensure that the archive is not corrupted the header also contains a
  333. 16 bit CRC of the file and an 8 bit checksum of the header itself.
  334. If during extraction Lharc finds a corrupted file (i.e. one whose CRC
  335. does not match with the one stored in the header) the file is extracted
  336. anyway, but a warning is printed on the screen.
  337. The worst case comes when the header of a file is corrupted: in this case
  338. the file cannot be extracted even if the file itself is not corrupted.
  339. In this case Lharc will automatically skip the corrupted entry by
  340. starting a search for the next valid entry in the archive and will
  341. print a message like "WARNING: skipping extraneous/corrupted data"
  342. The reason for which it says "extraneous/corrupted" is that an Lharc
  343. archive might happen to contain parts that Lharc cannot recognize as valid
  344. archive entries even it's not corrupted. This happens when you are
  345. extracting files from a self-extracting archive produced by the MSDOS
  346. version of Lharc, since a self-extracting archive contains 8086
  347. extraction code which the Amiga-Lharc sees as extraneous data.
  348. The only extraneous data which is passed without warnings is additional
  349. bytes at the end of an archive: since they are likely to consist of
  350. zero padding due to XMODEM transfer they are totally ignored.
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361. -Bugs
  362. The only relevant bug remaining in this version is that the 'move'
  363. command doesn't always work with wildcards (often Lharc stops after
  364. succesfully moving the first file, even if there are other files that
  365. should be moved).
  366. I have found the source of the problem, but since I plan to rewrite
  367. almost entirely the offending part of code in next version (I want to
  368. give users an option to alphabetically sort files beeing added), I
  369. decided not to correct the bug in this version. Anyway the move command
  370. is seldom used.
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380. -Compatibility.
  381.  
  382. This program is aimed at full compatibility with the MSDOS version
  383. 1.13 of Lharc. 
  384. A few little problems might arise from some file names that are legal
  385. under AmigaDOS, but illegal under MSDOS. As a matter of facts AmigaDOS
  386. allows a wider range of file names (almost every caracter in the ASCII
  387. set is allowed and file names can be longer than 8 characters). For
  388. the greatest convenience of Amiga users, I choose not to restrict the
  389. file name range to accomplish the MSDOS rules, but if you expect that
  390. your archives will be unpacked on an MSDOS machine you'd better
  391. rispect the MSDOS limits.
  392. Also note that, although MSODS Lharc version 1.13 CAN extract files
  393. whose names contain lowercase letters, its pattern matching functions
  394. don't work properly with lowercase file names. So if you want to
  395. extract an Amiga-created archive on an MSDOS machine by using pattern
  396. matching functions (for example to extract only some files instead of
  397. the whole archive) you have to create the archive on the Amiga with
  398. the -u switch. 
  399. Finally, to attain 100% compatibility you shuold not use the '-a' switch
  400. (see above in the switch descriptions)
  401.  
  402. Also note that the MSDOS version of Lharc has the additional
  403. capability of extracting files from archives produced by Larc (a
  404. pupular Giapanise archive program): this feature will not be
  405. implemented in the Amiga version.
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415. -Acknowledgements:
  416.  
  417. First of all I give credit to Haruyasu Yoshizaki for devising such an
  418. efficent compression algorythm as LZHUF.
  419. Second, since the source to the MSDOS version of Lharc is scarcely
  420. portable (lots of 8086 assembler ruotines and MSDOS-dependent C
  421. functions), I had to rewrite the program from scratch. Note howerer
  422. that for LZHUF compression/decompression I have used with few
  423. modifications a 'C' source for an example of single file compression
  424. which I found on a BBS. For sake of correctness I quote here the the
  425. header of this source:  
  426.  
  427. /*
  428.  * LZHUF.C English version 1.0
  429.  * Based on Japanese version 29-NOV-1988
  430.  * LZSS coded by Haruhiko OKUMURA
  431.  * Adaptive Huffman Coding coded by Haruyasu YOSHIZAKI
  432.  * Edited and translated to English by Kenji RIKITAKE
  433.  */
  434.  
  435. I whish to thank the above people whose work has been of
  436. foundamental importance for this project.
  437. Many thanks also go to all the people who contributed with suggestions
  438. and bug reports and particularly to Luca Spada for his invaluable beta
  439. testing work.
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451. Please send suggestions, comments and bug reports to:
  452.  
  453. Paolo Zibetti       Fidonet 2:331/101.6
  454.  
  455. node 2:331/101 (AmnesiA) is also the official distribution node for
  456. Amiga-lharc: you'll always find the latest version available on this
  457. board. If you are an officially listed FidoNet node you can f'request
  458. the latest version of Lharc with the magic file name AMILHARC.
  459.  
  460. Amnesia (2:331/101)  phone +39-331-263425  (v32/HST, upto 14400 bps)
  461.  
  462.