Title:  Document on LHARK Version 0.4d

I.      Introduction

            LHARK is an LZH-compatible archiving software with a new
        compression method that is faster and more efficient (makes
        smaller archives).
            Just like anything that's free, THIS DOES NOT COME WITH
        ANY WARRANTY! IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
        ANYTHING RESULTING FROM THE USE OF THIS SOFTWARE!

II.     Using LHARK

        A.  LHARK Modes

            There are two LHARK modes. The first one (known as
            LHARK-A) has a set of commands and options that is
            slightly different from LHA. The second mode (LHARK-B) has
            a set of commands and options that is compatible with LHA.

        B.  Commands

            In this section, the command names are given followed by
            how they are invoked (for LHARK-A and then for LHARK-B).
            The format is:
                command-name (LHARK-A command, LHARK-B command)

            1.  Add (a, a)
                    This command will cause LHARK to compress the
                files specified in the command line and add them to
                the archive. This command will create the archive if
                it does not exist.

            2.  Check (c,  )
                    This command will check LHARK to determine if it
                has been tampered or not.
                    This command is only available in LHARK-A.

            3.  Delete (d, d)
                    This command will delete from the archive all
                files specified in the command line.

            4.  Extract (e, e|x)
                    This command will decompress and recreate files
                from the archive. If no file is specified in the
                command line, all files in the archive is decompressed
                and recreated.
                    When directory paths are needed to be extracted,
                the "-p" option should be used for LHARK-A. With
                LHARK-B, this is done with the command 'x'.

            5.  Freshen (f, f)
                    This command is like the Add command except that
                only those files that are already in the archive and
                is newer will be compressed and added to the archive.

            6.  List/View (l, l|v)
                    This command will display the names and other
                information of the files in the archive.
                    With LHA, the 'l' command is for listing filenames
                without their directory paths; 'v' is used for listing
                filenames with directory paths.
                    With LHARK, files are always listed with directory
                paths, so with LHARK-B, 'l' and 'v' are identical.

            7.  Move ( , m)
                    This command will "update" the archive file (see
                "update" command below), and all files added to the
                archive is removed (deleted).
                    This command is available only in LHARK-B. To
                achieve the same effect in LHARK-A, the "move option"
                ('-m') should be used.

            8.  Change mode (o, o)
                    This command will cause LHARK to toggle its mode
                between LHARK-A and LHARK-B. Several bytes in the
                executable file is altered by this command.

            9.  SFX (s, s)
                    This command will make an self-extracting archive
                from an existing archive file. This version of
                LHARK-SFX does not yet support encrypted archives.

            10. Test (t, t)
                    This command will decompress files from the
                archive and test the validity of their CRC. If no file
                is specified in the command line, all files in the
                archive is decompressed and tested.

            11. Update (u, u)
                    This command is like the Add command except that
                only those files that are not yet in the archive or is
                newer that those in the archive will be compressed and
                added to the archive.

        C.  Options

            In this section, the option names are given followed by
            how they are invoked (for LHARK-A and then for LHARK-B).
            The format is:
                option-name (LHARK-A option, LHARK-B option)

            1.  Add directories as archive entries (-d, -d)
                    This option allows the archiving of directories.
                Entries of directories in the archive have the "-lhd-"
                method.

            2.  Any attribute (-a, -a)
                    This option allows the archiving of files with
                "system" and "hidden" attributes.

            3.  Compression method (-c?, -z|-o)
                    This option controls the method of compressing
                files when adding them to the archive. The following
                methods can be used:
                    a.  No compression (-c0, -z)
                            No compression is done and files are
                            stored/copied to the archive.
                    b.  -lh5- (-c5, -o)
                            The "-lh5-" method (compatible with LHA
                            2.xx) is used.
                    c.  -lh7-
                            The new "-lh7-" method is used. This is
                            the default option.

            4.  Encrypt (-e, -e)
                    This option causes LHARK to encrypt files when
                compressing or decrypt when decompressing. LHARK will
                ask for the password that will be used as a key for
                encryption/decryption.
                    Care should be taken in using this option with
                this current version because LHARK does not record in
                the archive header whether a file is encrypted or not.
                This is because there is no provision on the basic
                header for a flag that denotes encrypted data. This
                flag can be stored on the extended header but there is
                no standard yet as to where it should be placed. I
                will have to consult this with Yoshizaki.
                    If this option is used in compressing, be sure to
                use this option again when decompressing.

            5.  Do not ignore file name case (-i, -i)
                    This option causes filenames to be treated as case
                sensitive.

            6.  Keep temporary file (-k, -k)
                    On errors, this option will prevent LHARK from
                deleting the temporary archive file that is generated
                when the archive file is updated.

            7.  Move (-m, )
                    This option works with Add, Update, and Freshen
                commands. With this option, all files added to the
                archive is removed (deleted).
                    This option is available only with LHARK-A. To
                achive the same effect with LHARK-B, the "move
                command" ('m') should be used.

            8.  Old method (-c5 , -o)
                    This option will cause LHARK to use the "-lh5-"
                compression method which is compatible with LHA.

            9.  Overwrite/no message for query (-o, -m)
                    This option works during decompression of files.
                This will cause an existing file of the same name to
                be overwitten without asking for confirmation.

            10. Path (-p, -x|-p)
                    When adding files to the archive, this option
                includes the directory names of the files to the names
                stored in the archive. LHARK-B uses '-x' to achieve
                this.
                    When extracting files from the archive, this
                option will create the directory of the files in the
                archive. LHARK-B uses '-p' to achieve this.

            11. Recurse directories (-r, -r)
                    When adding files to the archive, this option will
                search for files from all the subdirectories of the
                paths and files specified in the command line.

            12. Archive time stamp (-s, -t)
                    This option will cause the date and time stamp of
                resulting archive to be the same as the newest file in
                the archive.

            13. Compression type (-t??, -y?)
                    This option controls the speed and efficiency of
                the compression when using the "-lh7-" method. The
                following types can be used:
                    a.  Turbo/fast (-tt, -y0)
                            This option will use a very fast
                            compression routine at the cost of some
                            inefficiency.
                    b.  Acceptable-1 (-ta1, )
                            This option will use a routine that makes
                            use of a good trade-off of speed and
                            efficiency. This method finds match
                            distances of up to 32K. This option is not
                            available in LHARK-B.
                    c.  Acceptable-2 (-ta1, )
                            This option is like the "-ta1" option, but
                            will find match distances of more than
                            32K. This is a little slower but is more
                            efficient for large files. This option is
                            not available in LHARK-B.
                    d.  Optimum-A (-toa, -y1)
                            This option will use a routine that will
                            try to compresses better but at a slower
                            rate. This method finds match distances of
                            up to 32K. This is the default option.
                    e.  Optimum-B (-tob, -y2)
                            This option is like the "-toa/y2" option,
                            but will find match distances of more than
                            32K. This is a little slower but is more
                            efficient for large files.

            14. Verify (-v, -v)
                    This option will check the CRC of the files in the
                archive after the archive has been updated by the
                addition or deletion of files.

            15. Long file names (-l, -u)
                    This option will cause LHARK to support the long
                file names of Windows 95 (MS-DOS 7).

        D.  Reponse files

                Response files are specified by prepending their name
            with '@'. When a response file is encountered, commands
            and options are taken from the file as if it were given on
            the command line.

        E.  Base Directories

                Directory paths may be specified in the command line
            and this will cause the files being extracted to be placed
            on the specified directories.
                A base directory affects all file specifications that
            follow it until another base directory is encountered in
            the command line.

III.    Compatibility with LHA

        A.  Archive file format

                LHARK generates archive file headers that are
            compatible with LHA. Any archive created by LHARK can be
            operated on by LHA and LHARK can operate on any archive
            create by LHA.

        B.  Compresssion methods

                LHARK can generate compressed files using the "-lh5-"
            method compatible with LHA and can be decompressed by LHA.
            The default compression method used by LHARK ("-lh7-") is
            new and cannot be decompressed by LHA.
                LHARK can decompress files made by LHA using "-lh4-",
            "-lh5-" and "-lh6-" methods.

IV.     Reaching the Author

            I would greatly appreciate comments, suggestions and bug
        reports. I can be reached at:

            Internet e-mail: kerwin@infoserve.net

Kerwin F. Medina
Dec 12, 1996
