home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-12 | 60.2 KB | 1,244 lines |
-
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- Ver:0.75c0 HPACK - Multi-System Archiver 28/12/91
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
- The HPACK Multi-System Archiver is an archiver that was written to allow
- the transfer of archived data to different systems. In the past archivers
- have traditionally been available for single systems only, eg PKZIP(tm) and
- LHARC for the PC, Larc for the Amiga, StuffIt(tm) and Compactor for the
- Macintosh, and tar and compress for UNIX systems (while these archivers are
- available on other systems, their use is not widespread). It is intended to
- make HPACK a more universal archiver by offering versions for the following
- computer systems:
-
- * MSDOS systems
- * OS/2 systems (currently in development)
- * Archimedes (currently in development)
- * Macintosh (currently in development)
- * Atari ST (planned)
- * Commodore Amiga (planned)
- * UNIX
- * Apple IIgs (currently in development)
- * VMS (planned)
- * Primos (planned)
- * Any other system which people offer to port it to
-
- Using HPACK
- ===========
-
- HPACK is run with the following command:
-
- HPACK command [-options] archive [filenames.....][@scriptfiles.....]
-
- Allowed commands are:
-
- [A] - Add files to an archive.
- [X] - Extract files from an archive.
- [V] - Directory of files inside an archive.
- [P] - View a file within an archive.
- [T] - Test the integrity of an archive.
- [D] - Delete files from an archive.
- [F] - Freshen files to an archive.
- [R] - Replace files in an archive.
- [U] - Update files to an archive.
-
- Allowed options are:
-
- -b - Specify a base pathname for files.
- -c - Encryption options.
- -d - Directory options (Mkdir, Rmdir, Mvdir, path options etc).
- -e - Add error recovery information.
- -f - Store file attributes.
- -i - Interactive mode - prompt for all files.
- -k - Overwrite existing archives.
- -m - Create multipart archive.
- -o - Overwrite on extraction options (All, None, Smart).
- -p - Store directories.
- -r - Recurse through subdirectories.
- -s - Stealth mode.
- -t - Touch files on extraction.
- -v - View files options (Files, Directories, All).
- -w - Treat files as archive comments.
- -x - Translate options for text files.
- -z - Extended options (system-specific).
-
- Commands, options, and archive and file names may be given in upper or lower
- case (they are given in uppercase in the examples which follow merely for
- consistency). Options may be lumped together or may be given seperately
- preceded by the '-' delimiter.
-
- The default archive extension is '.HPK'. HPACK will always add this
- extension, changing any other given extension if necessary. Note that some
- quantum physics theories suggest that when the user is not directly
- observing the HPACK archive, it may cease to exist or will exist only in a
- vague and indeterminate state; in this case the existence of the '.HPK'
- extension cannot be guaranteed.
-
- The filenames may be zero or more filenames, defaulting to all files if no
- filenames are given (in other words archive all files in the current
- directory, or dearchive/view all files in the archive). HPACK uses
- UNIX-style wildcards (which are described in more detail below in the
- section "HPACK Wildcards"), and will accept UNIX-style directory seperators
- in place of the usual ones used by the systems' command interpreter, so that
- for example under MSDOS:
-
- HPACK A ARCHIVE /C/WORK/FILES
-
- is a perfectly acceptable alternative to the more usual:
-
- HPACK A ARCHIVE \C\WORK\FILES
-
- The scriptfiles are names of files preceded with an '@' character. When
- HPACK encounters one of these it will treat the filename as a file
- containing a list of files to process. Script files and normal filenames
- may be freely mixed on the command line. See the section "HPACK Script
- Files" below for more information.
-
- HPACK Wildcards:
- ================
-
- When HPACK scans any filename that has been given to it, it will check
- for the presence in the filename of any of the special characters:
-
- * ? [ ] \
-
- If one of these is detected, then the string of characters making up the
- filename will be treated as being a pattern for a filename, rather than the
- name of a specific file. These special characters have the following
- meanings when used in a filename string:
-
- * - Matches zero or more characters
- ? - Matches any one character
- [...] - Matches any of the enclosed range of characters '...' in turn.
- If two characters appearing in the pattern in alphabetical order
- are seperated by a dash '-', then any character in the
- alphabetic range between these two characters will be matched.
- This is a more selective version of the '?' form.
- [^...] - As above, but this time matches anything *not* in the enclosed
- range of characters '...'.
- \ - Treat the next character as a normal character rather than one
- of the special characters. This can be used to override the
- usual meaning of the '*', '?', '[]', and '\' characters. Note
- that the MSDOS version of HPACK uses '#' instead of '\' since
- DOS uses '\' in its pathnames.
-
- The case-sensitivity when handling filenames depends on the operating system
- HPACK is being run under. Under MSDOS, filenames are converted to
- uppercase, but are not case-sensitive; under OS/2, filenames are left as is,
- but are also not case sensitive (so that "FileName" will match "Filename",
- "FILENAME", and "filename"); under Unix, filenames are left as is, and are
- case sensitive, so that "makefile" and "Makefile" are treated as seperate
- names.
-
- These wildcards can be combined to create quite powerful expressions. For
- example, to match any file not beginning with an 'a', 'b', 'c', or 'f',
- and containing at least two characters, the required expression would be:
-
- [^a-cf]?*
-
- where the [^a-cf] would match anything but 'a', 'b', 'c', or 'f'; the '?'
- would match the second character required, and the '*' would match any
- remaining characters.
-
- For example, if we have an archive whose contents are:
-
- File1.Txt File2.Txt File3.Txt File4.Txt File5.Txt
- File6.Txt File7.Txt File8.Txt File9.Txt Index.Txt
-
- we could perform the following file matches on it:
-
- Expression: Matches files:
-
- * File1.Txt File2.Txt File3.Txt File4.Txt File5.Txt
- File6.Txt File7.Txt File8.Txt File9.Txt Index.Txt
-
- F* File1.Txt File2.Txt File3.Txt File4.Txt File5.Txt
- File6.Txt File7.Txt File8.Txt File9.Txt
-
- *4* File4.Txt
-
- FILE?.TXT File1.Txt File2.Txt File3.Txt File4.Txt File5.Txt
- File6.Txt File7.Txt File8.Txt File9.Txt
-
- FILE[1-4].TXT File1.Txt File2.Txt File3.Txt File4.Txt
-
- FILE[^1-4].TXT File5.Txt File6.Txt File7.Txt File8.Txt File9.Txt
-
- FILE[1-46].TXT File1.Txt File2.Txt File3.Txt File4.Txt File6.Txt
-
- FILE[^13-5].TXT File2.Txt File6.Txt File7.Txt File8.Txt File9.Txt
-
- Finally, note that these wildcards may not perform quite like the standard
- wildcards used by the system's command interpreter. For example under MSDOS
- to specify all files in a directory or archive, it is not necessary to use
- the usual sequence of "*.*". Instead simply typing "*" will match all the
- files in the archive (the DOS wildcards are in fact a bit of a hack - for
- example "*abc.*" will (incorrectly) match "*.*"). The extended wildcards
- act as true wildcards, so that "FILE.*" will not match "FILE" as it would
- under DOS, since there is a spurious "." in the DOS wildcard matching. These
- extended wildcards can be useful when extracting files which cannot normally
- be handled by the command interpreter from archives, for example to extract
- the file "Filename with spaces in it" from the archive ARCHIVE.HPK, you
- would type:
-
- HPACK X ARCHIVE FILENAME?WITH?SPACES?IN?IT
-
- where the '?' wildcard will match the spaces. Alternatively you can just
- type:
-
- HPACK X ARCHIVE FILENAME*
-
- which will do the same thing with a lot less typing involved.
-
- Another point is that these wildcards cannot be used to represent full
- regular expressions (the idea behind HPACK was to create an archiver, not a
- regular expression parser), so that, for example, '*?' will not work as an
- expression, and that they cannot be used inside pathnames (for example
- DATA/S*/FILE) as the UNIX wildcards can (adding this capability is in fact
- trivial, but since the extended wildcards are built on top of the usual
- operating system ones the resulting system runs very slowly).
-
- HPACK Commands:
- ===============
-
- [A] - Add files to an archive. The archive given in the command-line is
- opened, or created if it doesn't already exist, and is given the
- extension '.HPK' if this is not explicitly specified. Then all files
- given in the list of filenames are added to to it.
-
- Example: To add all files in the current directory to the archive
- ARCHIVE.HPK in the current directory:
-
- HPACK A ARCHIVE
-
- [X] - Extract files from an archive. All files are extracted from the
- archive given in the command line to the current directory. If the
- file already exists and no overwrite options are given (these are
- explained in the section "HPACK Options" below), you will be asked if
- you wish to overwrite it:
-
- File already exists - overwrite [y/n/a]
-
- 'Y' will replace the file with the file from the archive, 'N' will
- skip the extraction of this file, and 'A' will process all files from
- this point (in other words it will assume a 'Y' answer for each file
- from this point). In some cases the name of the file extracted will
- need to be translated to allow for the naming conventions of
- differnent operating systems. In these cases the original name will
- be printed, followed by the name it will be extracted under.
-
- On Apple systems data is divided into two sections in a file, a "data
- fork" and a "resource fork". Under DOS only the data fork will be
- extracted from an archive: the resource fork (which only Apple systems
- can make any use of) will be skipped.
-
- Example: To extract all files in ARCHIVE.HPK not beginning with an 'A'
- to the current directory:
-
- HPACK X ARCHIVE [^A]*
-
- [V] - Directory of which files are in an archive. If no view options are
- given (these are explained in the section "HPACK Options" below), a
- listing in the following format is produced:
-
- HPACK - The multi-system archiver Version 0.75c0 (shareware version)
- For MSDOS, OS/2, Macintosh, Apple IIgs, and UNIX
- Copyright (c) Peter Gutmann 1989 - 1991. Release date: 28/12/91
-
- Archive is 'ARCHIVE.HPK'
-
- System Length Size Ratio Date Time Name
- ------ ------ ----- ----- ---- ---- ----
- MSDOS 18537 6217 66% 04/05/90 11:32:48 README.TXT
- MSDOS 8301 3169 74% 27/12/90 21:02:39 LZSS.EXE
- UNIX 30061 9127 70% 24/11/89 16:52:57 compr.method.txt
- Mac 8481 3282 61% 22/12/90 08:58:52 Fast LZ Decoder using Bin...
- OS/2 0 0 0% 01/07/91 18:20:20 Comp.Test
- ------ ------ ------ ----- ----
- 65380 21795 67% Total of 4 files
-
- Done
-
- The archive used is displayed, followed by a list of all the files
- within the archive. The fields for each file inside the archive are
- as follows:
-
- System: The system the file was archived under.
-
- Length: The length of the file when unarchived.
-
- Size: The size of the compressed file within the archive.
-
- Ratio: The ratio of the compressed file to the uncompressed file.
-
- Date: The creation date of the file within the archive.
-
- Time: The creation time of the file within the archive.
-
- Name: The name of the file within the archive. If the name is too
- long to fit on the screen then a '..' is appended to indicate
- this. In addition files may have a single character prepended
- to them: an asterisk '*' before the name indicates that this
- file has been encrypted, a dash '-' indicates that it includes
- authentication information, and a hash '#' indicates that it is
- both encrypted and includes authentication information. Note
- that the name within the archive may not be the same as the name
- given to the unarchived file since translation may be necessary
- to allow for the naming conventions of different operating
- systems.
-
- Finally the total length of all files within the archive, uncompressed
- and compressed, the overall compression ratio for the archive, and the
- number of files within the archive, is given. If any filespecs are
- given, only files which match those filespecs will be displayed.
- This is useful when you only want to extract certain files and would
- like to see how much space they will use.
-
- If more than one archive is viewed, a grand total of the size and
- number of files in all the archives viewed is printed. The type of
- information printed may be controlled by using the view options (which
- are explained in the section "HPACK Options" below). The default is
- to print all files in the root directory of an archive. If the root
- directory contains no files, the error message "Nothing to do" will be
- printed. To recursively display the contents of all subdirectories,
- the [-r]ecurse subdirectories option should be used.
-
- Example: To view the contents of any archives on drive A:
-
- HPACK V A:*
-
- [P] - Display files from within an archive. This option will output the
- contents of one or more files within an archive, with a prompt for
- more between files. The output can be redirected in the standard
- manner, for example:
-
- HPACK P DATA CONTENTS.DOC > PRN:
-
- will send the file CONTENTS.DOC from within the archive DATA.HPK to
- the printer, and:
-
- HPACK P DATA DESCRIPTION.DOC | MORE
-
- will display the file DESCRIPTION.DOC with page breaks on your screen.
-
- Example: To display the file README.TXT from within the archive
- ARCHIVE.HPK:
-
- HPACK P ARCHIVE README.TXT
-
- [T] - Test the integrity of an archive. HPACK will display the usual
- messages about extracting data as it unpacks and tests the data, and
- if any computed checksums do not match the checksum stored with the
- file when it was archived, will issue the following warning message:
-
- Warning: File checksum does not match computed checksum
-
- Otherwise HPACK will display:
-
- File tested OK
-
- Note that this test is also performed automatically on extracting a
- file from an archive.
-
- Example: To test the integrity of all executable files in the archive
- ARCHIVE.HPK:
-
- HPACK T ARCHIVE *.COM *.EXE
-
- [D] - Delete file from an archive. All files given in the command-line are
- deleted from the given archive.
-
- Example: To delete all Pascal program files from the archive
- ARCHIVE.HPK:
-
- HPACK D ARCHIVE *PAS
-
- [F] - Freshen files in an archive. The dates of all specified files in the
- archive are compared with the dates of the same files on disk. If the
- version on disk is more recent than the stored version, the stored
- version is replaced by the version on disk.
-
- Example: To freshen all files in the archive ARCHIVE.HPK:
-
- HPACK F ARCHIVE.HPK
-
- [R] - Replace files in an archive. All given files in the archive are
- replaced by their counterparts on disk.
-
- Example: To replace the all files which begin with the letters A-G in
- the archive ARCHIVE.HPK with their couterparts on disk:
-
- HPACK R ARCHIVE [A-G]*
-
- [U] - Update an archive. All specified files not already in the archive are
- added to the archive, and all files already in the archive are
- replaced if the version on disk is more recent than the version
- already in the archive.
-
- Example: To update the archive ARCHIVE.HPK with all files from the
- directory B:/DATA/JUNK:
-
- HPACK U ARCHIVE B:/DATA/JUNK
-
- Note that the last four options need to create temporary work files on disk.
- Thus it is necessary to have at least twice as much free disk space to work
- with as the total length of the archive. All other options use only the
- archive file, so it is possible to use them with minimal free disk space.
-
- HPACK Options:
- ==============
-
- -b - Specify a base pathname for all files. This option is followed by the
- pathname which HPACK will use as a base path for all files to be added
- to or extracted from an archive. This option is very convenient when
- adding a number of files in the same directory to an archive or when
- extracting an archive to a directory which is not the same as the
- current directory. It is also useful for handling archives which
- contain subdirectories. To add files to a subdirectory within HPACK,
- the base pathname is used to specify the path to the subdirectory, with
- the actual file pathname given being the path inside HPACK in which the
- file will be stored. In this case the argument given with the [-b]ase
- path option is the part of the pathname outside the archive, and the
- file pathname is the part of the pathname inside the archive.
-
- Example: To extract all files in the archive ARCHIVE.HPK to the
- directory D:/OUTPUT/DATA:
-
- HPACK X -BD:/OUTPUT/DATA ARCHIVE
-
- Example: To add the files FILE1, FILE2, TEXT, and PROGRAM.EXE, all in
- the directory D:/JUNK/DATA, to the archive ARCHIVE.HPK:
-
- HPACK A -BD:/JUNK/DATA ARCHIVE FILE[1-2] TEXT PROGRAM.EXE
-
- Example: To add the files in C:/JUNK/DATA/FILES to the archive
- ARCHIVE.HPK inside the archive directory DATA/FILES:
-
- HPACK A -BC:/JUNK ARCHIVE DATA/FILES/*
-
- -c - Encrypt/decrypt files in the archive using the NSEA encryption
- algorithm. This has an optional parameter of '1' or '2' which can be
- used to specify the level of encryption, defaulting to Level 1 if no
- parameter is given. Level 1 is adequate for most purposes, while Level
- 2 is recommended for high-security applications. Using this option
- will prompt for a passphrase before any files are added, followed by a
- request to retype the passphrase for security if the data is being
- encrypted. The passphrase, which is not echoed to the screen, should
- be a minimum of six and a maximum of fifty characters long, and may
- contain any combination of upper and lowercase letters, numbers,
- spaces, and punctuation symbols. Be warned that forgetting or losing
- this key will present you with a fairly substantial exercise in
- cryptography. Note that using the encryption feature will result in
- the compressed file expanding by between 0 and 7 bytes due to the
- necessity of padding the data out with random noise to the block size
- used by the NSEA encryption algorithm.
-
- Example: To encrypt all files to be added to the archive ARCHIVE.HPK
- with an encryption level of 2:
-
- HPACK A -C2 ARCHIVE
-
- In addition, HPACK allows entire archives (rather than just the files in
- them) to be encrypted, meaning that not even the archive directory can
- be read by someone who does not have the decryption password. This
- feature is present but not currently supported.
-
- In order to comply with US export restrictions on encryption software
- HPACK has currently had the encryption code removed (see the section
- "HPACK Archive/Data Authentication" below). In future a version with
- full encryption may be available from non-US sites.
-
- -d - Directory options. This hideously complicated command has a large
- number of suboptions, which are as follows:
- <Note: Some of these aren't implemented yet: Feedback on whether this
- way of doing things is a good idea or not would be appreciated>.
-
- -dm - Mkdir: Create the given directories.
- <Not yet implemented - if necessary this can be faked by using
- 'hpack a -da <path> <non-matching filespec>' where path is the
- new directory to add and the non-matching filespec ensures that
- only the new directory, but none of the files in it, are added>
- -dr - Rmdir: Delete the given directories.
- <Not yet implemented>
- -dv - Mvdir: Move the given directory into the second given directory.
- Warning: Through injudicious use of this command it is possible
- to create circular directory references, or to cut off entire
- directory trees. Do not try to move directories into
- subdirectories of themselves! (Or should HPACK check for this??)
- <Not yet implemented>
- -da - Store all directories scanned, even if they contain no files.
- This option is useful for storing entire filesystems inside
- archives.
- -dn - Do not create the directory inside the archive if it doesn't
- already exist. If an attempt is made to add a file to a
- nonexistant directory, HPACK will exit with an error message.
-
- Example: To delete the directory DATA/JUNK inside the archive
- ARCHIVE.HPK:
-
- HPACK A -DR ARCHIVE DATA/JUNK
-
- Note the use of the [A]dd command as a dummy command: In this case the
- main command is ignored and only the directory option is used (ICK!).
-
- Example: To move all directories below and including DATA/JUNK in the
- archive ARCHIVE.HPK into the directory STUFF:
-
- HPACK A -DV ARCHIVE DATA/JUNK STUFF
-
- Example: To add all files and directories (even empty ones) in and
- below the current directory to the archive ARCHIVE.HPK:
-
- HPACK A -RPDA ARCHIVE
-
- -e - Add error recovery information to the archive. HPACK will write extra
- information with the file data which may be used to recover the data if
- the main archive directory is seriously damaged. This recovery
- information will increase the amount of data stored for each file by
- about 20-25 bytes.
-
- Example: To add all text files in the directory A:/DATA to archive
- ARCHIVE.HPK, adding error recovery information for each file:
-
- HPACK -E ARCHIVE A:/DATA/*.TXT
-
- -f - Store file attributes. Many operating systems support two levels of
- files, those classed as 'normal', and those classed as 'hidden',
- 'invisible', 'system files', and so on (for example the Macintosh and
- MSDOS both have these file types). By default HPACK will only add
- normal files to an archive. However using the [-f]ile attributes flag
- allows archiving of files with special attributes as well as full
- restoration of attributes when archives are extracted. In addition,
- HPACK will attempt to translate the attributes of files from different
- systems into equivalent file attributes for the local system. This has
- varying degrees of effectiveness: Many of the Macintosh, MSDOS, and
- Apple IIgs attributes are equivalent so a direct translation is
- possible; UNIX, the Archimedes, and the Apple IIgs also have some of
- the read/write attributes in common, and have a rough equivalent of a
- read-only file attribute in these attributes; and QNX has no equivalent
- file attributes.
-
- If the [-p]ath store option is used HPACK will also store directory
- attributes, and set the directory attributes to the stored values when
- creating the directories on extraction.
-
- Example: To extract all files in the root directory of the archive
- ARCHIVE.HPK, restoring all possible attribute information:
-
- HPACK X -F ARCHIVE
-
- -i - Interactive mode - prompt for each file before it is processed. This
- options works for all commands except [V]iew files (for which it would
- be pointless). Before the file is processed, HPACK will ask whether you
- wish to process this file; answering 'Y' will handle the file, 'N' will
- skip the file, and 'A' will process all files from this point (in other
- words it will assume a 'Y' answer for each file from this point).
-
- Example: To add all files in the current directory to the archive
- ARCHIVE.HPK, prompting for each file before adding it:
-
- HPACK A -I ARCHIVE *
-
- -k - Overwrite the archive if it already exists. This only works with the
- [A]dd command. Normally, using the [A]dd command will add any new
- files to the end of an existing archive. Using the [-k]ill switch
- will erase the old archive and create a new one.
-
- Example: To create the archive ARCHIVE.HPK on drive A:, overwriting it
- if it already exists, and add all files in the current directory to it:
-
- HPACK A -K A:ARCHIVE
-
- -m - Create a multipart archive. Normally when HPACK runs out of disk space
- it will exit with an error message. When this option is used HPACK
- will instead prompt for another disk and continue the archive on the
- new disk. In this manner it is possible to spread an archive which
- would be too large for a single disk over several disks. Due to
- their rather special nature, multipart archives do not support the
- [D]elete, [F]reshen, [R]eplace, or [U]pdate commands (since, for
- example, deleting a file from the middle of an archive which stretches
- over 15 disks would be quite time-consuming). All other operations are
- supported however.
-
- Example: To fully back up hard drive C: onto drive A:
-
- HPACK A -KMFRPDA A:ARCHIVE C:/*
-
- This will create the archive ARCHIVE.HPK on one or more disks in drive
- A: containing the complete contents of the drive C: (the options used
- are [-k]ill existing archive, [-m]ultipart archive, store [-f]ile and
- directory attributes, [-r]ecurse through all subdirectories, store file
- [-p]aths, and for [-d]irectories store [a]ll of them, even empty ones).
- Once each disk has been completely filled, HPACK will prompt:
-
- Please insert the next disk and press a key
-
- followed by the message:
-
- Continuing...
-
- as it continues the archive on the next disk inserted. Note the use of
- the [-k]ill existing archive option to overwrite any existing archive
- of the same name which may already exist on the disk - if HPACK finds
- an archive of the given name already on the disk and the [-k]ill
- option is not specified, it will not, by default, overwrite it but
- will exit with an error message.
-
- Multipart archives have a minimum size of around 500 bytes (roughly the
- size of a disk sector for many disk formats - storing archive parts of
- less than 500-odd bytes would be pointless). If a section of a multi-
- part archive is less than approximately 500 bytes HPACK will skip it
- and move it to the next (hopefully less full) disk after printing the
- following warning:
-
- Warning: Archive section too short, skipping...
-
- If a multipart archive is small enough to fit onto a single disk, HPACK
- will store the archive as a standard archive instead of a multipart
- one.
-
- Example: To view the files in the previously created multipart archive:
-
- HPACK V A:ARCHIVE
-
- HPACK will automatically determine whether the archive is a multipart
- archive or not so the [-m]ultipart command is only necessary when
- creating the archive. Since HPACK stores its directory information at
- the end of the archive, only the last disk or disks of the archive must
- be read to obtain the archive directory. Initially HPACK will
- prompt:
-
- Please insert the disk containing the last part of this archive and
- press a key.
-
- If the wrong disk is inserted, HPACK will prompt:
-
- This is part <n> of a multipart archive.
- Please insert the disk containing the last part of this archive and
- press a key.
-
- where <n> is the part number of this section of the archive.
-
- Example: To extract the single file LETTER.TXT from the previously
- created archive:
-
- HPACK X A:ARCHIVE LETTER.TXT
-
- HPACK will then prompt for the disk which contains the file LETTER.TXT:
-
- Please insert the disk containing part <n> of this archive and press
- a key.
-
- where <n> is the part number of the archive section which contains
- LETTER.TXT.
-
- Example: To fully restore hard drive C: from the previously created
- archive:
-
- HPACK X -RP A:ARCHIVE
-
- HPACK will prompt for the last part of the archive as usual and then
- for each disk in turn as it extracts the files from the archive.
-
- -o - Specify overwrite options for file extraction. Normally when HPACK
- tries to extract a file which already exists, it will prompt for
- whether the existing file should be overwritten or not. With this
- switch it is possible to specify a default action to be taken. There
- are three possibilities:
-
- -oa - Automatically overwrite [A]ll existing files on extraction.
- -on - Automatically overwrite [N]one of the existing files on
- extraction.
- -os - [S]mart overwrite. HPACK will change the extension of the file
- to be extracted to ".000", and try to extract this file. If a
- file of this name already exists, the extension will be changed
- to ".001" and so on until it is possible to extract the file.
- This option is very useful for files that have been archived on a
- system which allows filenames which are longer or more complex
- than those allowed by the local system and which due to the
- filename being truncated or translated end up with identical
- names.
- -op - [P]rompt for new filename. HPACK will ask for a new filename and
- try to use that name, repeating until a non-conflicting filename
- is given.
-
- Example: To extract all files from the archive ARCHIVE.HPK to the
- current directory, skipping any files that already exist:
-
- HPACK X -ON ARCHIVE
-
- -p - Store directories. This will create directories inside the archive
- corresponding to the directories containing the file(s) being archived,
- in effect allowing you to archive entire directory trees.
-
- HPACK will add directories traversed only if there are files contained
- in them. To add all directories regardless of whether they contain
- files or not, use the [-d]irectories [a]ll option (see section on -d
- options above).
-
- Example: To add all files in all directories, along with the
- directories themselves, in and below the current directory to the
- archive ARCHIVE.HPK:
-
- HPACK A -RP ARCHIVE *
-
- -r - Recurse through subdirectories. HPACK will step through all sub-
- directories of the current directory, and add all files with names
- matching those given on the command line.
-
- Example: To add all files in all directories in and below the current
- directory to the archive ARCHIVE.HPK:
-
- HPACK A -R ARCHIVE *
-
- -s - Run in stealth mode. All messages except warnings and error messages
- are suppressed. HPACK will automatically turn on stealth mode if it
- detects it is running in the background on operating systems which
- support background operation.
-
- Example: To add all files in the current directory to all archives in
- the current directory, without printing the usual progress reports to
- the screen:
-
- HPACK A -S *
-
- -t - Touch all files and directories on extraction. All file and directory
- dates and times will be set to the date/time they were extracted
- instead of the time they were archived.
-
- Example: To extract all files from the archive /DATA/ARCHIVE.HPK, and
- leave the file dates as the time of extraction:
-
- HPACK X -T DATA/ARCHIVE
-
- -v - View options. Normally when the [V]iew command is used, HPACK will
- print all the directories and files in an archive. With this options
- it is possible to specify which parts of the archive are to be viewed.
- There are three possible options:
-
- -vf - Display only the files within the archive.
- -vd - Display only the directories within the archive.
- -va - Display all files, directories, and subdirectories of directories
- within the archive. This is the same as a recursive directory
- command.
- -vs - Sort files. Normally files are displayed in the order in which
- they are stored within the archive. Using this option will sort
- the files by name before displaying them.
-
- Example: To print all the files, but not any directories or
- subdirectories, in the archive ARCHIVE.HPK:
-
- HPACK V -VF ARCHIVE.HPK
-
- -w - Treat file(s) as archive comments. This makes the [A]dd, [D]elete,
- [F]reshen, [R]eplace, and [U]pdate commands work for archive comments
- instead of normal files. Archive comments are files which are
- displayed when the [V]iew archive command is used, and may contain text
- describing the contents of the archive, ANSI extended characters,
- graphics, digitised sound, and so on. The MSDOS version of HPACK will
- currently only handle the displaying of plain text and ANSI-text type
- archive comments. Comments can be added, deleted, replaced, and so on
- just like normal files. Subdirectories can contain their own comments,
- and each directory can contain multiple comment files. In addition
- comment filenames are not treated as normal archive filenames, so a
- directory can contain a comment file and a normal archived file of the
- same name. Possible archive comment types are:
-
- -w - Plain text comment. This can be entered in free-form since HPACK
- will automatically word wrap the text to fit the screen size.
- Plain text comments may also contain formatting commands which
- control the way the text is displayed. For more information on
- formatting the text comments, see the extended documentation file
- HPACKEXT.DOC.
- -wa - ANSI text comment. This type of comment can contain the extended
- character set used by IBM PC's, as well as ANSI escape codes. No
- reformatting of any type is done on ANSI comments. Note that the
- plain text comment type is preferred, since many systems cannot
- display the extended ANSI character set or interpret ANSI escape
- codes. Also note that if an ANSI comment is stored as plain text
- HPACK will quietly delete all extended characters and ANSI escape
- codes when it displays the comment, to make it conform to the
- ASCII character set.
- -wg - GIF format graphics comment. Display of this comment format is
- generally only suported on systems running graphics-based user
- interfaces.
-
- Example: To view all comment-type files in the archive ARCHIVE.HPK as
- files instead of displaying them as comments:
-
- HPACK V -W ARCHIVE.HPK
-
- -x - Text file translate options. Different systems store text files in
- different formats, for example under Unix, these are stored in ASCII
- format with a linefeed at the end of each line; under MSDOS, there are
- carriage return/linefeed pairs at the end of each line; and on the
- Macintosh, there are carriage returns at the end of each line. Some
- systems store text in a non-ANSI format altogether, for example IBM
- systems which use the EBCDIC character set, and Prime systems which use
- their own bizarre text encoding technique. Using this option it is
- possible to specify translation of different character systems and
- end-of-line markers to the one used by the local system. In most
- cases the [-x]late option will suffice, however it is possible to
- override the translation using the following options:
-
- -x - Smart translate. HPACK will attempt to translate all files it
- recognises as text files from the textfile format used on the
- system the file was archived on. In most cases this option will
- be the only one necessary.
- -xr - Treat carriage return (ASCII 13) as end-of-line marker. The
- Macintosh stores text this way.
- -xl - Treat linefeed (ASCII 10) as end-of-line marker. Text on Amigas
- and UNIX systems is stored in this manner.
- -xc - Treat carriage return/linefeed pairs as end-of-line marker. MSDOS
- and OS/2 store text files like this.
- -xxnn-Treat the one- or two-character hexadecimal value 'n' or 'nn' as
- the character to use as the end-of-line delimiter. For example
- when moving textfiles from a QNX system (which uses the RS
- character, ASCII 30 or 1E hex), the option would be -xx1e.
- -xe - Translate the character set from EBCDIC to ASCII. Text on IBM
- systems is stored this way.
- -xp - Translate the character encoding from that used on Prime systems
- to ASCII.
- -xa - Translate from ASCII to ASCII.
-
- The textfile translation works by first translating entire character
- sets (either ASCII, Prime ASCII or EBCDIC) if necessary, and then
- translating the end-of-line characters, depending on the options
- specified.
-
- The end-of-line translation options are only available where they would
- make sense (for example the ability to translate linefeed to linefeed
- isn't particularly useful). The possible translation options are shown
- below, with LF being the linefeed character, CR being carriage return,
- and CRLF being carriage return/linefeed pairs:
-
- To | MSDOS Unix Macintosh
- From | OS/2 Amiga
- ----------+-----------------------------------------------
- MSDOS | [-xc] [-xc]
- OS/2 | --- CRLF -> LF CRLF -> CR
- |
- Unix | [-xl] [-xl]
- Amiga | LF -> CRLF --- LF -> CR
- |
- | [-xr] [-xr]
- Macintosh | CR -> CRLF CR -> LF ---
- |
-
- Example: To extract all files with the extension .TXT from the archive
- ARCHIVE.HPK, translating linefeed characters into whatever end-of-line
- character the local system uses:
-
- HPACK X -XL ARCHIVE *.TXT
-
- Example: To extract all files with the extension .TXT from the archive
- ARCHIVE.HPK, translating the files from EBCDIC to ASCII, and
- translating all carriage return characters to the end-of-line character
- used by the local system:
-
- HPACK X -XEXR ARCHIVE *.TXT
-
- -z - Extended options. These are highly system-specific and in general will
- only be present on one particular version of HPACK. They either
- support the storing/extraction of system-specific information in
- archives, or the special handling of data which has been archived on
- another system. The recognised options are:
-
- -zlower - UNIX version only. Force all file and directory names to
- lowercase. Some systems store file and directory names in
- uppercase only. Using this option all names will be
- converted to lowercase before any operations (such as [V]iew
- archive, [X]tract from archive, and so on), are performed on
- them. When processing MSDOS archives under UNIX the use of
- the -[zlower] option is recommended.
-
- -s - MSDOS version only. Check all files for [s]afe extraction. MSDOS
- has a serious problem in that when a file with the same name as a
- device driver is extracted (for example 'CON', 'COM1', or 'LPT1')
- it will force the contents of that file into the device driver.
- The damage can be minor for devices like 'CLOCK$' (it will at a
- minimum mangle the system date and time, perhaps scramble the CMOS
- ram, or cause the system to hang - even the changing of system
- dates can cause problems on a system running a computer bulletin
- board which relies on correct timestamps), all the way through to
- very serious for devices like 'SMARTAAR' (it will corrupt the disk
- cache and therefore corrupt the drives being cached).
-
- The [s]afe option will check each file before extracting it, and
- if it corresponds to a device driver will print the warning:
-
- File corresponds to device driver - skipping
-
- and move on to the next file. The only way in which HPACK will
- allow a file of this type to be extracted is by using the
- [o]verwrite [p]rompt option, in which you will be prompted for a
- new filename to extract under. Even [o]verwrite [s]mart is unsafe
- since the peculiar handling of device drivers by DOS makes the
- automatic substitution of a new filename very difficult.
-
- Filenames which can cause these problems are virtually unheard-of
- - they would have to be created deliberately by a malicious user,
- in which case there are few limits on the potential damage they
- can cause.
-
- HPACK Script Files:
- ===================
-
- Whenever HPACK encounters a filename beginning with an '@' char it treats
- the rest of the filename as a file containing a list of files to process
- combined with commands which control the operation of HPACK. Script files
- have the following format:
-
- - Leading spaces/tabs (whitespace) are ignored.
-
- - Lines with a '#' as the first non-whitespace character followed by at
- least one whitespace character are treated as comment lines. For
- compatibility with future versions of HPACK which will include scripting
- there should always be at least one whitespace character after the '#'.
- If HPACK finds a non-whitespace character following a '#', it will try
- and interpret it as a script command. If it cannot interpret the
- command, it will warn:
-
- Warning: Unknown script command
-
- - All other lines are treated as filenames for HPACK to process.
-
- - Lines may be terminated by either linefeeds, carriage returns, or
- carriage return/linefeed pairs (the latter being the DOS default method
- of storing text files).
-
- A sample script is:
-
- # Sample script file
-
- # Save latest work
- c:/users/peterg/hpack/src/*.c
- c:/users/peterg/hpack/src/*.h
- c:/users/peterg/hpack/src/asm/*.asm
-
- # Save correspondence
- d:/spool/mail/*
-
- Note that the script files themselves are not subject to being overridden by
- the base path specified with the -b option (see "HPACK Options" above).
- However filenames given within the script file will be overridden by the
- base path.
-
- Example: To freshen the archive ARCHIVE.HPK with all the files in the files
- matching SCRIPT* as well as MAIL.TXT and COMPMAIL.TXT:
-
- HPACK F ARCHIVE MAIL.TXT @SCRIPT* COMPMAIL.TXT
-
- HPACK Archive Integrity:
- ========================
-
- HPACK checks the integrity of files stored within an archive by encoding a
- continuous checksum as part of each file when it is archived, and decoding
- it as the file is extracted. As soon as an error is encountered, HPACK
- will skip over the rest of the file and move on to the next one. If the
- file checksums differ then it may be reasonably assumed that there is an
- error in the extracted data. This is important: The entire physical
- universe, including HPACK itself, may one day collapse back into an
- infinitely small space. Should another universe subsequently re-emerge, the
- integrity of HPACK archives in that universe cannot be guaranteed.
-
- HPACK also checksums the archive directory. If an error is found in the
- directory information, the message:
-
- Warning: Archive directory corrupted. Continue (y/n)
-
- will be displayed. Hitting 'N' at this point will abort any attempts to
- process the archive, hitting 'Y' will process the (damaged) archive. HPACK
- will attempt some error recovery in this case (for example files and
- directories which seem to be in impossible directories will be moved into
- the root directory), and some files may be able to be recovered. If error
- recovery information (specified with the [-e]rror recovery option (see
- "HPACK Options" above)) is present, chances of recovering data from an
- archive with a corrupted directory are greatly enhanced.
-
- HPACK Archive/Data Authentication:
- ==================================
-
- HPACK includes provisions for authenticating archived data by adding a
- unique digital signature to either entire archives or individual files
- within an archive. This works exactly like a normal signature on a piece of
- paper, proving that the sender was the true originator of the file or
- archive. Forgery of a digital signature of this sort is computationally
- infeasible, and once the data has been signed the sender cannot later
- disavow his or her signature. In addition a cryptographic checksum of the
- data or archive is made and included as part of the signature to allow
- detection of any attempts to tamper with the data. Like forging a
- signature, defeating the checksum is computationally infeasible.
-
- When the data in an archive with authentication information present is
- extracted or tested, an authentication check is performed for the entire
- archive before it is processed. The authentication system used is based on
- Philip Zimmermanns excellent PGP encryption software and uses the same data
- formats as PGP. In order for the authenticity check to be possible, a file
- called KEYRING.PUB which contains the public key of the person or
- organization who signed the file or archive is needed. Like PGP, HPACK will
- either search for this file in the current directory or use the environment
- variable PGPPATH to look for the file. The PGPPATH variable should contain
- the path to the KEYRING.PUB file, so for example if KEYRING.PUB was in the
- directory C:/UTILS/PGP, then PGPPATH should be set with:
-
- set PGPPATH=C:/UTILS/PGP/
-
- If the PGPPATH directory exists and there is a KEYRING.PUB file present in
- both the current and the PGPPATH directories, the keyring in the PGPPATH
- directory will be searched first, and if no matching key is found the local
- keyring will be checked. This means that by default the master keyring is
- always used, overriding any local keys if necessary.
-
- The data in the archive, or the archive itself, will then be checked for
- validity using this key. If the authentication check succeeds, the message:
-
- Good signature from <name>.
- Signature made on <date>.
-
- will be displayed, with <name> being the name of the person or organization
- who made the signature, and <date> being the date the signature was made (on
- MSDOS systems the signature time may be off by a few hours since DOS doesn't
- adjust the time for time zones). If the check fails, the message:
-
- Warning: Bad signature, doesn't match file contents.
- Bad signature from <name>.
- Signature made on <date>.
-
- If the archive is a multipart archive (for which the authentication check
- can take some time since an archive stretching over several disks needs to
- be processed), the message:
-
- Verify multipart archive authenticity [y/n]
-
- is displayed. 'Y' will check the authenticity of the archive, 'N' will skip
- the authenticity check and continue with processing the archive.
-
- The signature scheme used is the RSA public key cryptosystem (for more
- information on this and the PGP encryption package see the extended
- documentation HPACKEXT.DOC). This scheme involves the manipulation of very
- large numbers, which can be quite time-consuming on slow systems, where the
- signature check can take several minutes.
-
- Unlike encryption software, authentication code is not export-restricted
- from the US. The U.S. Code of Federal Regulations, Title 22 which includes
- sub-chapter M, "International Traffic in Arms Regulations" (ITAR), makes an
- exception for software that can only be used for authentication purposes and
- cannot not be used for general-purpose encipherment and decipherment, as is
- the case for HPACK in its current state with the encryption code removed.
-
- HPACK Error Messages:
- =====================
-
- The error messages given by HPACK are the following:
-
- [ Nothing to do ]
- The command you have given resulted in no changes being made to the
- archive(s) specified. There can be several reasons for this: The files
- you specified were not on the disk; there were no matching files to freshen
- /update; or there were no matching files in the root directory of the
- archive (HPACK will not, by default, check subdirectories: To handle
- subdirectories you must either give the full path within the archive, or
- use the [-r]ecurse subdirectories option).
-
- [ Out of disk space ]
- There is not enough room on the current disk to finish archiving/
- unarchiving a file.
-
- [ Unknown command ]
- You have given HPACK a command which it doesn't understand. Check the
- section "HPACK Commands" for valid HPACK commands.
-
- [ Unknown option ]
- You have given HPACK an option which it doesn't understand. Check the
- section "HPACK Options" for valid HPACK options.
-
- [ Unknown overwrite option ]
- You have specified an unknown option for the -o overwrite switch. This
- error may also be caused by forgetting to specify an option for the
- switch, in which case HPACK will treat the character following the -o as
- the option.
-
- [ Unknown view option ]
- You have specified an unknown option for the -o view options switch. This
- error may also be caused by forgetting to specify an option for the
- switch, in which case HPACK will treat the character following the -v as
- the option.
-
- [ Unknown directory option ]
- You have specified an unknown option for the -d directory options switch.
- This error may also be caused by forgetting to specify an option for the
- switch, in which case HPACK will treat the character following the -d as
- the option.
-
- [ Bad wildcard format ]
- You have used an incorrect format when using wildcards in filenames.
-
- [ Wildcard expression too complex ]
- You have used a very complex wildcard sequence, and HPACK doesn't have
- enough room to process it fully. Try simplifying the expression, or break
- it up into seperate simpler expressions.
-
- [ Not an HPACK archive ]
- The supposed archive file does not appear to be an archive created by
- HPACK.
-
- [ Cannot open archive file ]
- HPACK cannot open the archive file.
-
- [ Cannot open data file ]
- HPACK cannot open the data file to dearchive data to.
-
- [ Cannot open temp file ]
- HPACK cannot open the temporary work file it needs for the [D]elete,
- [F]reshen, [R]eplace, or [U]pdate commands.
-
- [ Cannot open script file ]
- HPACK cannot open the script file containing the list of files to process
- and HPACK control commands.
-
- [ Cannot access base directory ]
- The base directory you have specified does not exist.
-
- [ Cannot create directory ]
- HPACK cannot create a directory to unarchive files into.
-
- [ Cannot override base path ]
- This error message arises when using the -b base path option and either a
- drive specifier is given in the pathname of one of the files to process or
- the base path includes an actual path and the file pathname is specified
- as being off the root directory. Since the base path is prepended to the
- pathname of the file, the pathname cannot contain a drive specifier or
- absolute directory reference in it.
-
- [ Unknown archiving method - skipping ]
- The version of HPACK you are using is unfamiliar with the archiving method
- used for this file, and is skipping to the next file.
-
- [ Data is encrypted - skipping ]
- The data in this file is encrypted, and no means of decryption has been
- supplied by the user; therefore HPACK cannot process it and will move on
- to the next file.
-
- [ Cannot read encrypted archive ]
- The entire archive (rather than just the data in it) is encrypted, and
- HPACK cannot decrypt it to read it.
-
- [ Cannot update deleted archive ]
- You have used the [-k]ill original archive option along with the
- [R]eplace, [F]reshen, or [U]pdate options.
-
- [ Passwords not the same ]
- When encrypting data, HPACK will ask you to retype the password for
- security. If the second password doesn't match the first password, this
- error message is issued.
-
- [ Password must be between 6 and 50 characters long ]
- The passphrase you have entered is either less than six characters (making
- it dangerously short), or more than 50 characters (making it excessively
- long).
-
- [ Bad keyfile ]
- The keyfile containing the keys used for decrypting/authenticating data is
- corrupted.
-
- [ Bad security information ]
- The information used for authenticating the data in an archive has been
- corrupted.
-
- [ Out of memory ]
- There is not enough memory available for HPACK to continue.
-
- [ Path too long ]
- You have used more than 63 characters (the limit set by MS-DOS) in a
- pathname.
-
- [ Path not found ]
- You have asked HPACK to add a file to a nonexistant directory inside an
- archive.
-
- [ Bad character in filename ]
- Input lines in script files are given a basic check for being valid
- filenames. If blatantly incorrect characters are discovered in a line of
- input this warning will be printed.
-
- [ Errors detected in script file ]
- Errors (either illegal characters or too-long pathnames) have been
- detected in the script file.
-
- [ Maximum level of errors detected in script file ]
- More than 10 errors have been detected in the script file. This error
- message generally results from erroneously specifying a non-script file as
- a script file.
-
- [ Too many levels of directory nesting ]
- You have tried to go down through more than 15 levels of subdirectories
- using the [-r]ecurse subdirectories option.
-
- [ Too much auxiliary data ]
- This file has too much auxiliary data attached to it (comments, attributes,
- icons, security information, and so on). Each file can have a maximum of
- 64K of auxiliary data attached.
-
- [ Stopped at user request ]
- The user pressed Ctrl-Break during the archiving process.
-
- [ Warning: Truncated EOF padding ]
- In some implementations of the Xmodem and Ymodem transfer protocols, CPM
- end-of-file characters (Ctrl-Z's) are appended to the end of the
- transmitted file. When HPACK detects these spurious characters on the end
- of an archive, it will truncate the archive to its correct size and issue
- this warning message.
-
- [ Warning: Archive section too short, skipping... ]
- If part of a multipart archive is less than approximately 100 bytes long,
- HPACK will not attempt to create the archive but will move the data to the
- next, hopefully less full, disk.
-
- [ File error ]
- A miscellaneous type of file error occurred during the archiving process
- (for example some sort of network error). The message itself will contain
- more detail about the precise type of error.
-
- [ Internal error ]
- Some form of internal error occurred in HPACK. Contact the author.
-
- [ Long argument format not supported in DOS version ]
- Some versions of HPACK, notably the UNIX one, support a long argument
- format signalled by the -z switch, which is used to handle OS-specific
- options. The DOS version of HPACK does not support this argument format
- since there is no need for it under DOS.
-
- Disclaimer
- -=-=-=-=-=
-
- This program is guaranteed to perform as claimed, excluding any delays
- caused or enhanced by war, civil commotion, or rioting, whether declared,
- spontaneous, reprehensible, or justified; undue pressure to perform, from
- whatsoever source; mal de mer, mal de pays, mal de siecle, mal de code, mal
- de machine, or any force majeure not pretofore invoked.
-
- The program warranty is void in case of nuclear war, whether caused by the
- program or not.
-
- Trademarks
- -=-=-=-=-=
-
- Amiga is a tm of Commodore Business Machines.
- Archimedes is a tm of Acorn Computers.
- GIF is a tm of Compuserve Inc.
- IBM is a tm of International Business Machines Corp.
- Macintosh is a tm of Apple Computer Inc.
- MSDOS is a tm of Microsoft Inc.
- OS/2 is a tm of International Business Machines Corp.
- PKZIP is a tm of PKWare Inc.
- Prime and Primos are a tm's of Prime Computer Corp.
- QNX is a tm of <someone>.
- Rolemaster is a tm of Iron Crown Enterprises Inc.
- StuffIt is a tm of Raymond Lau and Aladdin Systems.
- UNIX is both a tm and a footnote of AT&T.
-
- "Good compression isn't a matter of life and death - it's far more important
- than that"