------------------------------------------------------------------------ ------------------------------------------------------------------------ LHa Vrs. 2.08 for OSK (OS9/68000) Compatible with version 2.11 of Lha for MSDOS systems OSK port by Mike Haaland (CompuServe: 72300,1433) June 15, 1992 Last Updated: Dec. 2, 1994 ------------------------------------------------------------------------ ------------------------------------------------------------------------ --- Introduction --- Lha is an archive program such as Arc and Zoo. It can store several files in one archive in a compressed form which is generally more efficent than that used by Arc and Zoo. It also supplies all of the archive handling capabilities that an archive program should have. Another important feature of Lha is its ability to preserve the file attributes. Its only weakness is compression speed: Zoo 2.0, for example, is faster, but if compression efficency is more important for you than compression time you'll surely appreciate this progam. (anyway decompression is much faster than compression) --- How to use --- Lha is run from shell with the following command line: Lha -[] [] items in square brackets are optional. can be any of the following (case is not significant): e,x extract files from archive Extracts files from archives. If you specify some file names or patterns only those files satisfying the patterns are extracted, otherwise all the files in the archive are extracted. While extracting files, Lha checks if a file by the same name already exsists in the destination directory and prompts you before overwriting the old file with the extracted one (unless you specified the -f option) If the files have a path name stored in the archive, they are extracted with their path and needed directories are automatically created. l List archives contents Displays the names of the files in an archive along with their date, time, CRC, original length and compressed length. v Verbose list of archives contents Same as 'l', but will show extended header info and machine that the archive was created on. Moreover 'v' will also show all attributes etc. p extract and print files to screen same as 'e' and 'x', but extracted files are sent to stdout A print header is also shown and looks like: ::::::::::FILENAME:::::::::: This feature is included so when redirected to the printer, you know which file you printed. You may turn off the print header by using -pq (The'q' singifies quiet mode) a Add to existing archives or create a new archives Files are stored in alphabetical order. If you try to archive a file and a file by the same name already exists in the archive the file will not be added and a message will be printed on the screen to inform you. Also, by default file attributes are stored, use the 'g' option to create [GENERIC] format archives. m Move files into archive Same as add, but deletes original files after archiving them d Delete files from archives You can delete from an archive. u Update files in archives Same as with the 'a' command. However, if a file already exists in the archive, Lha will check its time stamp and will keep the newer one and ignore the older one. c reConstruct an archive Replaces a file in the archive with the newer one only if a file with the same name already exists in the archive. Otherwise, no action is taken. t Test integrity of the archive Allows making sure the archive is intact. is the name (eventually preceded by a path) of the archive you want to work on. If no extension is specified the default extension .LZH is used. [] represents an optional number of file names They indicate which files to extract/compress/list/delete, etc. Lha is case sensitive, therefor while extracting files from an archive individually, the [] must match, exactly, the file names stored in the archive. When extracting you may specify a directory as a [] and all files and sub-directories that are stored in that directory will be extracted from the archive. For example, it the archive myfiles.lzh contained the following files: TEST/TEST1/filet1 TEST/TEST1/filet2 TEST/file1 TEST/file2 file and you wanted to extract all files in TEST/TEST1 only: lha -x myfiles "TEST/TEST1/*" This would extract TEST/TEST1/filet1 and TEST/TEST1/filet2 only. lha -x myfiles "TEST/*" will extract the TEST directory, all files within it and also extract TEST/TEST1 and all it's files also. [] represents an optional number of switches that are used to change the behavior of the program. A switch is composed by a leading '-' followed by a command and then may immediatly followed by one or more options. Example: Lha -pq archive.lzh readme.txt This tells Lha to extract 'readme.txt' from 'archive.lzh' and print it to standard out, with no print header. You need not supply an option in the switch, but must supply a command. Here is a summary of the available options: v Verbose prints lots of neat info to let you know exactly what LHa is doing. q Quiet mode Suppresses the display of what files are being processed during compression or decompression. Also inhibits the output of the print header during '-p' operations. f Force overwrite on EXtraction/Update modes Suppresses all the queries Lha normally issues before overwriting existing files. g create GENERIC archive By default Lha will stores and restores file descriptor info indicating creation date, last modification, and file attributes, in an extended header. This option will create archives compatible with the MSDOS version: in other words it will store files with an attribute bit pattern which is suitable for MSDOS machines while during extraction it will ignore the attributes stored in the archives, setting the attributes of the extracted files to the usual read and write attributes. If you do not use this switch, on the contrary, files will be stored with their original attributes and during extraction the stored attributed will be restored. Remember that, to effectively preserve file attributes, you must not use this switch during compression. Of course OSK file attributes are meaningless to MSDOS and vice-versa. t Text mode When using the 't' option. Lha will attempt to change all CR/LF combinations to CR's during extraction and change CR's to CR/LF during compression. This is useful when you are extracting text files or source code. This will, as of release 2.03, change LF's to CR's during extraction if the file contains no only LF's. (IE: Amiga [generic] and UNIX text files) r Recursive expansion of directories (used with -a/c/u) This option, when used with the command '-a', will expand and archive any directories or sub-directories given as file arguments. Great for archiving entire disks. n Don't execute the command Just show what LHa would do if the command was actually executed, but don't actually create/extract the files. d Delete files (used with -a/u/c) Will delete the file after archiving it to the .lzh file. i Ignore file paths (used with -e/x) ignore any filepaths stored in the archive and extract the files to the current working directory of the directory specified by the -w option. s Don't compress files (use with -a/u/c) Store the files as-is. Don't attempt to compress them. z get list of files to act on from standard input. Before you could redirect stdin without this switch, this caused problems when trying to run lha from a shell script. o use LHarc compatible compression methods (used with -a/u/c) This allows creation of .lzh files that the older LHarc's can take apart. 0/1/2 Header level Specify the header level to use when creating .lzh files. w= allows extraction to Handy when you don't want the to extract to the current working directory. c take apart .lzh files created with the first (broken) version of LHarc for 6809/OS9. (used with -x/e/l/v) --- Temporary files --- While compressing files Lha creates a temporary file called 'LhXXXXXX' where XXXXXX is a hex digit representing the process ID. This file is created in the current working directory. You may specify a different directory to create the 'LHXXXXXX' file in by setting the environment variable TMPDIR. The reason for the XXXXXX part of the name is that if you run multiple copies of Lha at the same time each copy will create its own temporary file with a different name (usefull for multiuser systems for example). Also, if adding files to an existing .LZH file, Lha will rename the original .LZH file to file.bak. If file.bak already exists it will be silently overwritten. NOTE: rename no longer must be available for use by Lha. --- Bugs --- No known bugs at this time. If you find any, please notify me by any means available to you. --- FYI --- If you supply only an archive name on the command line, LHa will use the -l command on the archive and give you a listing of it's contents. LHa can now read a list of files from stdin an example would be to pipe the output of 'dir -u' or re-direct the input from a file having filenames 1 per line. Such as: dir -u ! lha -az myfiles or lha -az myfiles ] archive_file [file...] Function: Archive Management Utility Commands: Options: a Add (create/replace) to archive q quiet x,e EXtract from archive v verbose l,v List / Verbose List n not execute u Update newer files to archive f force (over write at extract) d Delete from archive t FILES are TEXT file m Move to archive (means 'ad') o use LHarc compatible method (a/u) c re-Construct new archive w= specify extract directory (x/e) p Print to STDOUT from archive d delete FILES after (a/u/c) t Test file CRC in archive i ignore directory path (x/e) g [Generic] format (for compatiblity) 0/1/2 header level (a/u) c bad CoCo OS-9 archive (x/l) s store - don't compress files (a/u) z get list of file from standard input r Recursive expansion of dirs (a/u) The environment variable TMPDIR may be set to specify the directory used for creating temporary files while archiving --------------------------------------------------------------------