home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The California Collection
/
TheCaliforniaCollection.cdr
/
his008
/
pak210.exe
/
pak
/
PAK.DOC
< prev
next >
Wrap
Text File
|
1989-08-10
|
56KB
|
1,626 lines
PAK
The File Compression Utility
Version 2.10
Copyright 1988, 1989
by
NoGate Consulting
P.O. Box 88115
Grand Rapids, MI 49518-0115
(616)455-6270
BBS: (616)455-5179 (1200-9600+ baud)
ALL RIGHTS RESERVED
_______
____|__ | (Tm)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
Introduction...............................................1
Purpose of PAK.........................................1
Archive Files..........................................1
A Note on the Interface................................1
The Shareware Concept..................................1
Registration and Benefits..............................2
Limitations............................................2
Other NoGate Products..................................2
List of Files..........................................3
The Security Envelope......................................3
Creating An Archive........................................3
The Add Command........................................3
The Move Command.......................................4
The Update Command.....................................4
The Freshen Command....................................5
Archiving Subdirectories...............................5
Extracting Files From An Archive...........................5
The Extract Command....................................5
The Extract and Remove Command.........................6
Extracting Files to the Screen or Printer..............6
Extracting files to their original paths...............7
Managing Archives..........................................7
Listing Files..........................................7
Deleting Files.........................................8
Testing files..........................................8
Adding Remarks to Archives.................................9
The /R (remark) option.................................9
The /H (header remark) option..........................9
The Revise command....................................10
The Header command....................................10
Converting Archives from ARC and PKARC or PAK 1.x.........10
Self-Extracting Archives..................................11
Creating self-extracting archives.....................11
Using self-extracting archives........................11
Converting to self-extracting archives................11
Options...................................................12
Crunch, Squash, and Crush (/C, /S, and /CR)...........12
Encrypting Files (/G).................................12
Duplicate Files (/D)..................................13
Make EXE file (/EXE)..................................13
Print in Hex format (/HEX)............................13
Including subdirectories (/I).........................13
Use last date (/L)....................................14
Moving Files (/M).....................................14
Pause after each page (/MORE).........................14
Using the original path (/PATH).......................14
Use Remarks (/R and /H)...............................15
Rename archives on convert (/REN).....................15
Sorting Files (/S)....................................15
Pack Archives (/P)....................................16
Check security envelope (/SEC)........................16
The Temporary Path (/T)...............................16
Replacing Existing Files (/W).........................17
General Syntax............................................17
Summary of Standard PAK Commands......................18
PAKINST (PAK install program).............................18
Text Configuration Files..............................19
Comments..............................................19
Command Definitions...................................19
Option Definitions....................................21
Configuring a default temporary path..................21
Configuring a standard archive title..................21
Appendices................................................22
Release History.......................................22
PAK's Advanced Compression............................23
Technical Notes.......................................24
File Formats......................................24
Error Codes.......................................25
Credits...............................................25
Order Form............................................26
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 1
Introduction
Purpose of PAK
PAK is a utility to create and maintain file archives in
compressed form. There are several advantages to compressing files.
On a hard disk, most files are accessed infrequently. Reducing
the size of these files allows more of them to remain on the hard
disk, where they are more accessible than on a floppy in a file
cabinet, and frees disk space for other use.
Backup is simpler, faster, and cheaper, since the files are
smaller and organized into related groups.
Most importantly, compressed files take less time to transmit via
modem, and time is money when the transmission is long distance, or to
a service such as CompuServe. Even on local computer bulletin boards,
reduced transmission time is an advantage.
PAK is intended as a replacement for ARC by System Enhancement
Associates and PKARC by Philip Katz. While PAK is faster than ARC,
speed is not the emphasis, and PAK does not attempt to compete with
PKARC in this respect. However, PAK produces archive files that are
consistently 50% to 90% of the size produced by either ARC or PKARC,
and supports files created by either program. Also, the full screen
version is much easier to use than ARC or PKARC.
Archive Files
PAK creates and modifies archive files, which have the .PAK or
.ARC extension. An archive file may contain one, two, or any number
of compressed files. Files in an archive retain all of the
information they had in the directory, such as name, size, and date.
In addition, each file in an archive has a calculated CRC number,
which assures the detection of damage after events such as file
transmission via modem.
A Note on the Interface
This manual describes PAK's commands as they are initially
configured. Using PAKINST and the provided example files STDCFG.TXT
and ALTCFG.TXT, you can easily add, change, or delete the commands and
options which PAK understands. For example, if the 'A' command is too
cryptic for your taste, you can change it to 'Add' or 'Compress'.
The section on PAKINST describes how to change the interface.
The Shareware Concept
PAK is distributed as shareware.
Shareware is commercial software distributed in an unconventional
manner. Microcomputers copy information very easily. Instead of
trying to frustrate this through copy protection, shareware takes
advantage of it to reach as many users as possible at the lowest cost.
Anyone may copy a shareware program and distribute it to whomever they
desire, provided they do not charge a fee or alter it.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 2
Shareware isn't free. Serious shareware is as polished as any
conventional commercial product, and represents just as much
programming effort. If you use it regularly, the authors expect
compensation.
However, unlike conventional distribution, shareware allows you
to evaluate the product before you decide to purchase it. The price
is often lower, as well, because there are no advertising, packaging,
or distribution costs.
But it can only work with your support. If you are still using a
shareware product after a couple of weeks, then it is obviously worth
something to you, and you should register it.
Registration and Benefits
There are three versions of the compression routines in PAK
available. The first is the command line version, included in the
evaluation package (of which this file is a part) distributed as
shareware. Registration of this version is $15, and entitles you to a
disk with a copy of PAK registered in your name.
The second is the full screen version, also known as PAKF. PAKF
is a fully windowed program which displays archive contents and file
directories, and allows easy tagging of files to be compressed or
extracted. Registration of this version is $30, and entitles you to a
disk with both the full screen and command line versions.
The third, for programmers, is a library of data compression
routines suitable for inclusion in your own programs. This toolkit
can be used in practically any application, since all compression is
done on buffers in memory, not on disk. Registration of this version
is $75, and entitles you to a disk with object files suitable for use
with Turbo Pascal, C, or assembler, and the other two versions of PAK,
as well as example programs in Pascal and C.
Registered users of earlier releases of PAK and PAKF may update
for the cost of shipping and handling - see UPDATE.FRM. Toolkit users
may update to release 2.10 of the toolkit for $25.
NoGate Consulting maintains a bulletin board for benefit of PAK
users at (616)455-5179 / 1200-9600 baud / 24 hours a day.
To register your copy of PAK, send in a completed copy of the
enclosed order form, call the NoGate BBS to order via questionnaire,
or call NoGate Consulting at (616)455-6270.
Limitations
PAK can handle at most 16,000 files at once, though this may also
be limited by available memory.
Other NoGate Products
TRI_D, a programming toolkit for three dimensional graphics, with
support for wireframes and hidden surface removal. Reasonably fast
and very easy to use. Includes a TPU for Turbo Pascal (5.5) and OBJ
files for Turbo C. TRI_D is $30.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 3
CONTOUR, a utility for creating contour maps from empirical data.
Quickly and accurately approximates the entire surface from relatively
few data points, and then draws lines at each elevation change. Also
creates AutoCad .DXF files. Primarily intended for surveyors, taking
a few minutes for a process that normally takes weeks, but useful to
anyone who wishes to plot three dimensional data. CONTOUR is $150.
NoGate consulting also provides custom solutions in a wide
variety of fields including databases, networking, simulations, and
telecommunications. Inquire for further information.
List of Files
Your copy of PAK210 should contain:
PAK.EXE - PAK version 2.10
PAK.DOC - This documentation file.
PAKINST.EXE - PAK installation program.
ORDER.FRM - Order form for registration.
UPDATE.FRM - Form for updates and upgrades.
SITE.FRM - Form for site licenses.
STDCFG.TXT - Text file for standard configuration.
ALTCFG.TXT - Text file for alternate configuration.
The Security Envelope
PAK 2.10 is the official archive program for distributing files
through SDNet/works!, the Shareware Distribution Network. Shareware
authors send archives to the SDNet/works!, where they append a special
encrypted Security Envelope to the archive before releasing the file
to the network.
By including the /SEC option with any command, you can verify the
integrity of any archive with this special envelope. If the archive
has been altered in any way, PAK will alert you. If the archive is
untouched, PAK will display a page of information about the author.
The central node of SDNet/works! is (203)634-0370 (The SDN
Project).
Creating An Archive
The Add Command
To create an archive, type
PAK a <archive name> <file name or file names>
A is the Add command, and adding files to an archive will create
it if it doesn't exist. If the extension is omitted, PAK will look
first for a file with the extension PAK and then for ARC.
For example, if to add the file "FOO.DAT" to an archive named
"BAR.PAK" (which need not already exist), type
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 4
PAK a bar foo.dat
The wildcard characters ? and * are also permissible, as are
multiple file specifications. For example, to add all of the files
ending in ".DAT" to the same archive, and all of the files named
"TURBO" with any extension, type
PAK a bar *.dat turbo.*
Specifying a subdirectory will add all of the files in that
subdirectory. For example,
PAK a bak \c\lib
would add all of the files in the "\c\lib" directory to the
archive "BAK.PAK", provided that "\c\lib" was a subdirectory. Of
course, if "\c\lib" were simply a file, it would be added like any
other file.
If you omit the file name, PAK assumes you mean "*.*", or all of
the files in the directory.
The Move Command
The Add command copies files to an archive, and leaves the
originals intact. The Move command also copies files to an archive,
but deletes the originals when the operation is successfully
completed. Using the Move command is very similar to the Add command.
To move a file or files, type
PAK m <archive name> <file name or names>
The Update Command
If a file specified in an Add or Move command has the same name
as a file already in the archive, PAK will ask if you wish to replace
the old file. The Update command behaves much as the Add command
does, except that it replaces existing archived files automatically if
they have an older date, and does not replace newer files. To update
a file or files, type
PAK u <archive name> <file name or names>
For example, suppose NEW1.DAT and NEW2.DAT existed in the archive
"SAVE.PAK", that the copy of NEW1.DAT in the archive was older than
the one on the disk, and that NEW3.DAT existed on the disk but not in
the archive. Then
PAK u save new1.dat new2.dat new3.dat
would add "NEW1.DAT" and "NEW3.DAT" to "SAVE.PAK".
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 5
The Freshen Command
The Freshen command is very similar to the Update command, except
that it only checks files which already exist in the archive. To
freshen files in an archive, type
PAK f <archive name> <file name or names>
For example,
PAK f total *.*
would check every file in the archive "TOTAL.PAK" and freshen any
which were older than those on the disk. Note that the "*.*" in the
above example is optional; if you omit the file list, PAK assumes you
intended all files in the directory.
Archiving Subdirectories
By including the /I (include subdirectories) option with any of
the above commands (Add, Move, Update, or Freshen), you can add files
from several directories at once.
For example, if you had these directories -
\DOCUMENT
\DOCUMENT\BUSINESS
\DOCUMENT\BUSINESS\LETTERS
the command:
PAK a save \document\g*.* /I
would add all files which began with the letter G in each of the
three directories. Similarly,
PAK a image a:\ /I
would archive every file from drive A.
Extracting Files From An Archive
The Extract Command
To copy files from an existing archive to the disk, type
PAK e <archive name> <file name or names>
For example, to unpack all of the files from the archive
"GAME.PAK", type
PAK e game
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 6
Again, PAK assumes that you mean all of the files in the archive
if you omit the file names to be extracted. If one of the files to be
extracted already exists, PAK will stop and ask if you intend to
replace the existing file.
When using any command which does involve compression (i.e., the
Add, Move, Update and Freshen commands), you can use wildcards in
specifying the archive name. For example,
PAK e ch* *.doc
would extract all of the files with the extension .DOC from all
of the archives starting with the letters CH. As usual, PAK will
provide .PAK and .ARC if you omit the extension.
Extracting files to one or more remote subdirectories is much
like adding them from other subdirectories. For example,
PAK e project \c\objects\*.obj \c\source\*.c
would extract all of the files with the extension .OBJ to the
\C\OBJECTS directory, and all the files with the extension .C to the
\C\SOURCE directory.
The Extract and Remove Command
Sometimes you may wish to move files out of an archive rather
than simply copying them. To do this, type
PAK x <archive name> <file name or names>
The X command is like the Extract command in all ways except that
it deletes the files from the archive after unpacking them. If this
removes all of the files from the archive, leaving it empty, it also
deletes the archive.
Extracting Files to the Screen or Printer
You can also extract files to the standard output, which is
normally the screen. To do so, type
PAK p <archive name> <file name or names>
If you add the /MORE option to this command, PAK will pause after
each screen of information.
Anything sent to the standard output can be re-directed to a
file, some other programs, or to the printer. For example,
PAK p docs >prn:
would extract all of the files from the archive DOCS and send
them to the printer.
For other uses of redirection, consult your DOS manual.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 7
Extracting files to their original paths
PAK 2.10 saves complete path information for each file in your
archives. By adding the /PATH option to the extract command, you can
tell PAK to restore your files to their original directories. For
example, if you saved a directory and its subdirectories with the Add
command, like so:
PAK a saved \test /I
then you could restore every file from the archive to its
original location by typing
PAK e saved /path
PAK will create any needed directories if they do not already
exist.
Managing Archives
Listing Files
Both the L and V commands display a list of files, the original
sizes, and the file dates, in much the same format as the MSDOS DIR
command. In addition, they display the type of compression,
compression ratio, the compressed size, time, and CRC checksum. If
you add the /MORE option to the list command, PAK will pause after
each screen of information.
There is no difference between the two commands. Both L and V
are provided for the convenience of those used to PAK 1.0.
There are 8 compression types, created variously by ARC, PKARC,
and PAK. PAK can extract files compressed with any of these, and
compress new files with the Crunched, Squashed, Crushed, or Distilled
types.
-- No compression. Used by ARC, PKARC, PAK.
Packed Repeated byte values replaced by codes. Used by ARC.
Squeezed Huffman encoding, used by ARC 5.20 and earlier.
crunched Lempel-Zev compression, used by ARC 4.5 and earlier.
Crunched Lempel-Zev compression, used by ARC 5.0 and later.
Squashed Lempel-Zev compression, used by PKARC.
Crushed Lempel-Zev compression, used by PAK.
Distill Huffman/Sliding Window, used by PAK 2.10.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 8
PAK uses the CRC checksum to verify that the file is intact.
Deleting Files
Sometimes you may wish to remove files from an archive, either
because they were added accidently or because they are no longer
useful. To delete files from an archive, type
PAK d <archive name> <file name or names>
For example,
PAK d junk *.tmp
would delete all the files ending in the ".TMP" extension from
the archive "JUNK.PAK".
PAK can ask for confirmation before deleting each file. To
enable this option, type
PAK d /WP <archive name> <file name or names>
Testing files
Sometimes the integrity of an archive (or any other file) is
suspect, such as after transmission by modem or after physical disk
damage. The Test command checks all the specified files to insure
that they are intact.
For example, to test the archive "POKER.PAK" which you have just
downloaded from a BBS, type
PAK t poker
PAK can also test multiple archives this way:
PAK t *.pak
would test all of the archives ending in the .PAK extension.
If, for some reason, you wish to test only some of the files, you
may specify a list of files, much as you can for any other command.
For example,
PAK t *.pak *.doc
will test only files ending in the .DOC extension.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 9
Adding Remarks to Archives
PAK supports variable length remarks for each file in an archive,
and for the archive as a whole. PAK 2.10 also supports extended
comments, such as multiline remarks or remarks with ANSI graphics. To
add these special remarks to a file, type @[filename] when asked for a
remark instead of a normal line of text.
For example, at this prompt:
Archive remark?
You could type
Demonstration (C) 1989 Special Software
Or you could type
@banner.txt
where banner.txt is a file with the logo you wish to display.
Note: PAK automatically removes the ANSI sequence for keyboard
remapping from remarks.
The /R (remark) option
Adding the /R option to any other command (such as Add or List)
will enable remarks. For example,
PAK a /r saved *.pas
will add all the files with the extension .PAS to the archive
SAVED, and ask for the remark for each new file.
PAK l /r saved
would then include those remarks with the list of files in the
archive.
The /H (header remark) option
Adding the /H option to any other command will enable the remark
at the head of an archive. In all other ways it is like the /R
option.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 10
The Revise command
Sometimes you may wish to change the remarks in an archive.
Typing
PAK r saved *.doc
will first display the archive remark, and then display the files
with the extension .DOC one at a time, and ask for the new remark for
each. If you wish to keep the existing remark, simply press <enter>.
The Header command
The H (header) command is just like Revise, except that it only
changes the remark at the head of the archive, and not the remarks for
the files in the archive.
Converting Archives from ARC and PKARC or PAK 1.x
PAK can read archives created by ARC, PKARC, and PAK 1.x
directly. To save space, however, you may wish to convert archives to
the PAK 2.10 format. The C command extracts files from the archive
and recompresses them.
Example:
To convert all the files in BONZO.ARC, type:
PAK c bonzo
If you add the /REN (rename) option, PAK will automatically
rename any converted archives to .PAK. For example, if you had a
directory full of ARC format files which you wished to convert, you
could type
PAK c *.ARC /ren
and all of the files would be changed to .PAK.
It is also possible to convert files created with PAK so that
they will be compatible with ARC, PKARC or PAK 1.x, by adding the C,
S, or CR compression type modifier:
PAK c /c bonzo
converts bonzo (created with PAK, PKARC, or PAK) to compression
types compatible with ARC, PKARC, and PAK 1.x.
PAK c /s bonzo
converts bonzo to compression types compatible with PKARC or
PAK 1.x.
PAK c /cr bonzo
converts bonzo to compression types compatible with PAK 1.x.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 11
Self-Extracting Archives
PAK can create special EXE files which contain archived files and
can extract them without PAK. PAK treats these files like any other
archive, and any and all PAK commands will work on them. There is an
additional overhead of approximately 8.5K for these files.
There is no royalty required to distribute self-extracting
archives, and several vendors use them as a method of delivering
software in a compressed form.
Creating self-extracting archives
To create a self-extracting archive from scratch, simply use the
A (Add) command as you would to create a normal archive, and include
the /EXE option.
For example,
PAK a demo /exe
will create a new archive DEMO.EXE which contains all the files
in the current directory.
Using self-extracting archives
To extract files from a self-extracting archive, simply type the
name of the EXE file, like so:
DEMO
Self-extracting archives can take two parameters (in any order).
By specifying a path, you can determine a destination for the
extracted files. For example,
DEMO c:\project
will deliver the files in the C:\PROJECT directory.
Self-extracting archives created by PAK normally ask before
writing over a file if the file with the same name exists. You can
disable this by adding the /W (write-over) option:
DEMO /w
Converting to self-extracting archives
You can convert existing archives to a self-extracting format
with the C (Convert) command, like so:
PAK c sales /exe
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 12
You can also convert self-extracting files to conventional
archives with the Convert command. For example,
PAK c sales.exe /ren
will remove the self-extracting code from sales, and the /REN
option will rename it to SALES.PAK.
Self-extracting archives created by EXEMAKE (which was
distributed with PAK 1.0 to 1.61) which contain remarks will generate
errors when read by PAK 2.10. These errors will not damage the files,
however, just the remarks.
Options
In addition to the commands, PAK supports a variety of options.
We've already mentioned a few in passing.
These options aren't necessary for the day-to-day use of PAK, but
occasionally you may wish to use them. Normally, these options appear
immediately after the command, separated by slashes (/) or dashes (-).
For example:
PAK a /opt1 /opt2 archive
While this is the normal ordering, it's not required, and the
options can appear anywhere on the line, provided each starts with the
slash character or dash character. For example,
PAK a archive /opt1 file /opt2
is also acceptable.
Options may no longer be jammed together as they were in PAK 1.0.
This format was hard to read, and precluded certain combinations of
option names.
Crunch, Squash, and Crush (/C, /S, and /CR)
Using the /C, /S or /CR option will force PAK to use Crunching,
Squashing, or Crushing when compressing files. They are of primary
use with the Convert command, but they can also be used with Add,
Move, Update, and Freshen.
Encrypting Files (/G)
Occasionally you may wish to encrypt your archives with a
password. Files can still be listed in such archives, but they will
appear damaged unless extracted with the same password.
To encrypt files, type
PAK a /g=<password> <archive name> <file name or names>
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 13
The 'g' option stands for Garble. Passwords used with the Garble
command are converted to all uppercase. For example, to encrypt the
file "SECRET.EXE" in the archive "DARK.PAK" with the password "DEEP",
type
PAK a /g=DEEP dark secret.exe
To extract it later, type
PAK e /g=DEEP dark secret.exe
While these are the most common uses of Garble, Garble can also
be used with any of the other commands. For example, testing the
example encrypted archive requires the use of the Garble command:
PAK t /g=DEEP dark
Duplicate Files (/D)
The /D (duplicate) option selects only those files which are both
inside the archive and outside the archive. For example,
PAK e /d saved *.doc
would only extract those files with the .DOC extension which
matched existing files on the disk. The Freshen command is another
example of the /D option - it only adds those files which already
exist in the archive.
While of most use with the Add and Extract commands, the
Duplicate option can be used with other commands, such as List.
Make EXE file (/EXE)
Including the /EXE option with the Convert command or any
compression command (such as Add or Update) will create a self-
extracting archive. See the section on self-extracting archives.
Print in Hex format (/HEX)
Adding the /HEX option to the Print command will display the file
in a hexadecimal format.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 14
Including subdirectories (/I)
The /I option causes PAK to search subdirectories when adding
files to an archive. For example, if you had these directories -
\DOCUMENT
\DOCUMENT\BUSINESS
\DOCUMENT\BUSINESS\LETTERS
the command:
PAK a save \document\g*.* /I
would add all files which began with the letter G in each of the
three directories. Similarly,
PAK a image a:\ /I
would archive every file from drive A.
The /I command automatically includes the /PATH command so that
adding files to an existing archive will take the paths of the
original files into account. You can change this by altering the
configuration file (STDCFG.TXT) and installing your new configuration
with PAKINST. See the section on PAKINST.
Use last date (/L)
Normally, the date of an archive is the last date it was altered
in any way. If you add the /L option to any command which changes an
archive, the archive date will be set to that of the most recent file
in the archive.
Moving Files (/M)
The Move option will delete files after compressing them or
extracting them. The M (move) and X (extract + delete) commands are
actually the Add and Extract commands with the Move option.
This option is primarily of use in combination with Update or
Freshen, which do not have matching Move commands.
Pause after each page (/MORE)
The /MORE option causes the List or Print commands to pause after
each page of text displayed.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 15
Using the original path (/PATH)
PAK stores the full path of each file compressed except for the
drive. By including the /PATH option with most commands, you can take
this information into account.
The List command displays the path of the archived files if you
include the /PATH option.
Compression commands (such as Add or Update) normally only
consider the names of files when comparing old files in the archive to
new files to be added. For example, if there is a file in the archive
named READ.ME, adding a new file named READ.ME will replace the old
one.
With the /PATH option, compression commands also consider the
path. In the previous example, if the first READ.ME was archived from
the \123 directory, and the second was archived from the \TP5
directory, they would be considered different files with the /PATH
option.
Use Remarks (/R and /H)
Adding the /R option to any other command (such as Add or List)
will enable remarks. For example,
PAK a /r saved *.pas
will add all the files with the extension .PAS to the archive
SAVED, and ask for the remark for each new file.
PAK l /r saved
would then include those remarks with the list of files in the
archive.
The /H option is similar, except that it only enables the remark
at the head of an archive.
Rename archives on convert (/REN)
Adding this option to the Convert command will change the
extensions of the converted archives to .PAK.
Sorting Files (/S)
PAK supports sorting of archives by filename + extension (the
normal method, used in release 1.0), extension + filename, time, size,
or no sort at all. To enable a sorting method, include one of these
options:
/SN for filename + extension
/SE for extension + filename
/ST for time
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 16
/SS for size
/S- for no sort
For example,
PAK a /ST newmail mail*.*
will add the all files starting with MAIL to the archive NEWMAIL
in the order of the date and time of the files. On the other hand,
PAK l /SS saved
would list all of the files in an archive in the order of their
fully-expanded size, regardless of the actual order in SAVED.
Note that adding any file to an archive will result in PAK
sorting the archive. In the first example above, all of the files in
the archive NEWMAIL would be sorted by time, even if they were
previously sorted by some other method.
The standard sort for the compression commands (Add, Move,
Update, Freshen) is by filename + extension. For other commands, the
standard is no sorting.
Pack Archives (/P)
Archives rarely compress, so normally PAK does not attempt to do
so, which saves time. Adding this option will force PAK to try and
compress archive files.
Check security envelope (/SEC)
Adding the /SEC option to any command will check the security
envelope for the archive before any other action.
The Temporary Path (/T)
You can specify a path for temporary files, like so:
PAK c /t=C: doodle
Whenever PAK makes any change (adding or deleting a file) to an
archive, PAK must create a temporary file for the changed archive. If
you are working on floppy disks, this limits the maximum size of an
archive to half the volume of the disk, since the old copy and the new
copy must exist at the same time. If you use this option to specify a
temporary path (such as C:), and you are working on drive A: or B:,
PAK will create this temporary file in the Temporary Path and copy it
over the old file when everything is done. This allows archives up to
the full size of a floppy.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 17
PAK also needs a temporary file if you Print or Convert a file
which is larger than what PAK can hold in memory (this is always
limited to 64K, even if you have more). PAK will always try to use
the Temporary Path to create this file.
The temporary path can also be specified in the configuration
information. See the section on PAKINST (page 21).
If the Temporary Path is invalid, PAK will use the directory of
the archive instead.
Replacing Existing Files (/W)
Normally, PAK asks before replacing an existing file, either in
an archive or on your disk. You can change this by adding one of
these options:
/WA Always replace existing files.
/WP Prompt before replacing existing files (normal).
/WO Replace older files.
/WN Never replace existing files.
The /WP option simply means 'Prompt' when used with the Delete
command.
The Update and Freshen commands automatically include the /WO
option.
General Syntax
The command format for PAK is:
PAK <command> [/opt, /opt...] <arcname> [<filename>, <filename> ...]
[@<filename>]
<command> is a command.
[/opt] is zero or more options.
<arcname> is the name of the archive to operate on, which may
include the "wildcard" characters * or ?, provided <command> is not
one of the compression commands (Add, Move, Update, or Freshen).
<filename> is one or more file names. Filenames may include the
"wildcard" characters * and ?. If you specify a directory or a disk
drive, PAK will use all files in that directory. If you don't list
any files or directories, PAK assumes you mean all the files in the
current directory.
@<filename> is a response file. A response file is a text file
with commands, options, and file names, just as they would appear on
the command line.
Simply typing PAK will print a short list of commands.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 18
Summary of Standard PAK Commands
Commands:
A Add files to archive M Move files to archive
U Update archive files F Update duplicate files
E Extract files from archive X Move files from archive
D Delete files L List files
V List files P Display files
T Test files C Convert files
R Revise remarks
Options:
/sec = check security envelope (if present)
/m = move files
/c = make ARC compatible files (Crunched).
/s = make PKARC compatible files (Squashed).
/cr = make PAK 1.x compatible files (Crushed).
/g = encrypt the file with a password.
/t = use temporary path
/d = use only duplicate files.
/wa = always replace existing files
/wp = prompt before replacing existing files (normal)
/wo = replace older files
/wn = never replace existing files
/r = use remarks
/sn = filename + extension order
/se = extension + filename order
/st = time order
/ss = size order
/s- = no order
/p = pack archives
/l = use last date in archive to stamp archive
/hex = display using hexadecimal format
/more = pause after every page
/ren = rename archive extension to PAK when converting
/path = use path to compress, extract, or display.
/i = include subdirectories
/exe = create self-extracting file
PAKINST (PAK install program)
PAKINST can alter the interface for PAK to suit your needs.
Also, if you are using a version of MSDOS or PCDOS earlier than 3.0,
you will need to use PAKINST to install PAK.EXE in a specific
directory.
The configuration information for PAK is stored in the EXE file.
However, you can convert this information to a text file with PAKINST,
or convert a properly formatted text file to new configuration
information. Included with PAK 2.10 are two example text-format
configuration files, STDCFG.TXT and ALTCFG.TXT. By creating your own
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 19
configuration files with a word processor, or by altering the provided
examples, you can customize PAK's commands.
PAKINST must always be run in the same directory with PAK. To
run PAKINST, simply type
PAKINST
PAKINST provides four choices:
set [D]irectory for pak.exe (required only for DOS 2.xx)
configure [P]AK from text file
create [T]ext file from PAK.EXE configuration
[Q]uit
To set the directory for PAK, select D. If you are using DOS
version 3.0 or later, this option is unnecessary.
To configure PAK from a properly-formatted text file, select P.
To create a text file from the current configuration of PAK,
select T.
Text Configuration Files
If you examine STDCFG.TXT, or create a new text file with PAKINST
from the configuration information in PAK, you will notice that there
are four basic sections: the header comment, the command definitions,
the option definitions, and the default temporary path.
These sections may be arranged in any order, but for clarity they
are grouped together.
Comments
Text configuration files may include comments. PAKINST will
ignore anything contained in curly braces {} or Pascal comment symbols
(* *). For example,
{ This is a comment. }
(* So is this. *)
Comments may appear anywhere on a line.
Command Definitions
A command definition in a text-format file looks like this:
<command> = <PAK command> [+ <PAK options>], "<help definition>"
The <command> is the command as it will be used with PAK, i.e.
'A' or 'Add'. Commands must start with a letter, and may contain no
spaces, but may be may be any length.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 20
<PAK command> Standard command Alternate command (ALTCFG.TXT)
ADD A Add
CONVERT C Convert
DELETE D Del
EXTRACT E Ext
LIST L or V List
REVISE R Revise
VIEW P View
TEST T Test
The command may also include one or more <PAK options>, separated
by the plus (+) symbol.
<PAK option> Standard option Alternate option (ALTCFG.TXT)
ALWAYS_REPLACE WA Always
ARCHIVE_REMARK H Title
ASCII (not used) (not used)
CRUNCH C Crunch
CRUSH CR Crush
DISTILL (not used) Distill
DUPLICATE D Dup
EXT_SORT SE SExt
HEX HEX Hex
INCLUDE_DIRS I Include
LAST_DATE L Last
MOVE M Move
NAME_SORT SN SName
NEVER_REPLACE WN Never
NO_SORT S- SNone
PACK_ARCHIVES P Pack
PASSWORD G Pass
PAUSE MORE More
PROMPT_REPLACE WP Prompt
REMARK R Rem
RENAME REN Rename
REPLACE_OLDER WO Older
SELF_EXTRACT EXE EXE
SIZE_SORT SS SSize
SQUASH S Squash
TEMP_PATH T Temp
TEST_ENVELOPE SEC Security
TIME_SORT ST STime
USE_PATH PATH Path
Finally, separated from the commands and options by a comma and
enclosed in quotation marks is the help definition for this command.
The PAK help screen, obtained by typing PAK by itself, will display
the text within these quotation marks after the command.
For example, the Freshen command (F) in the STDCFG.TXT file looks
like this:
F = Add + Duplicate + Replace_Older + Name_Sort,
"Update duplicate files"
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 21
Reading this literally, PAKINST takes this as 'F means add files
to the archive, selecting only duplicate files, replacing older files,
and sorting by name. When asked for help, display F followed by the
text "Update duplicate files".'
Notice that this does not all have to be on the same line.
Option Definitions
An option definition looks like this:
/<option> = <PAK option> [+ <PAK options>], "<help definition>"
This is much like a command definition, only it begins with a
slash (/) to indicate it is an option. Options, of course, may not
include PAK commands.
For example,
/MORE = PAUSE, "Pause after each page"
indicates that the /MORE option means that PAK should PAUSE.
If you have a set of options that you often use together, it may
be worthwhile to create a new option or change an existing one. For
example,
/MAIL = NO_SORT + ALWAYS_REPLACE + LAST_DATE + INCLUDE_DIRS
+ USE_PATH, "Mail packet option"
Configuring a default temporary path
To specify a default temporary path, include a line in the text
configuration file in this format:
$TPATH = "<path>"
For example,
$TPATH = "C:"
Will set the temporary path to drive C.
Configuring a standard archive title
To specify a standard title to include in all of the archives
which you create, include a line in the text configuration file in
this format:
$STD_TITLE = "<remark>"
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 22
For example,
$STD_TITLE = "Joe's BBS"
Will include the remark "Joe's BBS" in every archive you create
with the /H option. Like any other remark, the standard title can be
the name of a file instead, like so:
$STD_TITLE = "@Title.txt"
Appendices
Release History
Release 2.10 (August 10th, 1989):
Fixed bug with deleting files from multiple archives.
Fixed bug which required required excessive memory.
Fixed another minor bug in Distill.
Fixed bug with Garble and Distill.
Added path-matching on compression.
Added default archive title to configuration.
Changed Revise command so as to preserve the security envelope.
Release 2.01 (July 31st, 1989):
Fixed minor bug in Distill.
Release 2.0 (July 26th, 1989):
Added Distill compression.
Added security envelope.
Added path support and subdirectory inclusion.
Added ability to use all commands on self-extracting archives.
Moved creation of self-extracting archives from EXEMAKE to PAK.
Added write-over option for self-extracting archives.
Added pause feature.
Added response file.
Added option to rename converted archives to .PAK.
Added summary for multiple archive conversion.
Added default temp path to configuration information.
Added filter to eliminate ANSI keyboard definition codes from
remarks.
Increased speed of Print option.
Eliminated PAK.CNF.
Eliminated need to install PAK for DOS version 3.0 and later.
Eliminated restriction on foreign characters in file names.
Eliminated difficulties with read-only files.
Changed command syntax slightly to allow more flexibility in
choice of command and option names.
Allows use of '-' for options as well as '/'.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 23
Release 1.6 (January 24th, 1989):
Fixed several small bugs.
Added separate support for archive remarks.
Added optional prompting on deletion.
Changed Convert command to preserve archive date.
Added optional date stamping using last date in archive.
Fixed incorrect stack size in EXEMAKE which caused erratic
failures.
Added support for remarks in self-extracting archives. Overhead
increased to 6744 bytes.
Release 1.51 (January 15th, 1989):
Fixed bug which left junk bytes at the end of archives when using
a simple Store on large files. (Rare, usually only with already
compressed files).
Fixed bug in EXEMAKE with extraction of files over 64K.
EXEMAKE fixes increase self-extraction overhead to 6674 bytes.
Release 1.5 (January 12th, 1989):
Added remarks.
Added support for wildcards in specifying archives.
Added extraction to standard output.
Added sorting options.
Added temporary path.
Added configurable interface.
Added target directory parameter to self-extracting archives.
Improved error reporting.
Reduced size overhead for self-extracting archives to 6662 bytes.
Fixed bug in the Move command.
Fixed problem with handling large numbers of files.
Fixed bug with EXEMAKE forcing the name of the output .EXE to
that of the input archive.
PAK Release 1.0 (October 17th, 1988):
Initial release as PAK.
GSARC Release 1.0 (October 13th, 1988):
Limited release.
Technical Notes
File Formats
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 24
In the interest of simplifying the creation of utilities by
third-party developers, this section provides a short description of
the file format for archives created with PAK.
In the basic format for archives, each archived file has a header
which looks like this:
Marker (1 byte) - always 26 (^Z, the eof mark for text files).
Version (1 byte) - type of compression used.
Name (13 bytes) - an ASCIIZ string.
Size (4 bytes) - a long integer giving the current file size.
Date (2 bytes) - packed date. bits 0-4 = day 5-8 = month
9-15 = year - 1980.
Time (2 bytes) - packed time. bits 0-4 = second / 2 5-10 = minute
11-15 = hour.
CRC (2 bytes) - the CRC checksum for the expanded file.
Length (4 bytes) - original length of file.
The version field currently has the following values:
0 End of file. File header is only 2 bytes long (26 and 0).
1 No compression. File header lacks the Length field.
2 No compression.
3 Run-length encoding (RLE).
4 Huffman squeezing.
5 Fixed-length 12 bit LZW compression.
6 As above, with RLE.
7 As above, but with a different hashing scheme.
8 Variable-length 9-12 bit LZW compression with RLE.
9 Variable-length 9-13 bit LZW compression without RLE.
10 Crushing.
11 Distilling.
Basic archives end with a short header, containing just the
marker (26) and the end of file value (0). PAK release 1.5 extended
this format by adding information after this end of file marker. Each
extended record has the following header:
Marker (1 byte) - always 254
type (1 byte) - type of record
File (2 bytes) - # of file in archive to which this record refers,
or 0 for the entire archive.
length (4 bytes) - size of record
Type Meaning
0 End of file
1 Remark
2 Path
3 Security envelope
4 Error correction codes (not implemented in PAK 2.0)
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 25
Error Codes
On exiting, PAK sets the DOS error level two one of four values:
0 No Error
1 CRC error in file or file missing
2 Out of memory
7 Disk error
Credits
ARC is a registered trademark of System Enhancement Associates.
NoGate Consulting is not associated in any way with System Enhancement
Associates or PKWare.
We would like to thank several people:
The various authors of the public-domain De-Arc'ing utility, for
providing insights into the (sometimes very strange) internal workings
of ARC:
Roy Collins, David W. Carroll, Richard P. Byrne, Robert D. Tolz,
and Jim North.
We must also credit Terry A. Welch, whose article "A Technique
for High Performance Data Compression", IEEE Computer Vol 17 No 6
(June 1984) seems to have started all the research on Lempel-Zev
coding.
Spencer W. Thomas, Jim McKie, Steve Davies, Ken Turkowski, James
A. Woods, and Joe Orost, who are the authors of the UNIX compress
utility.
Ray Kaliss of SDNet/works!, who proposed the Security Envelope
concept.
And all of the people whose suggestions we added to PAK, such as
the temporary path, sorting, wildcards for archives, path support, and
remarks.
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 26
PAK version 2.10 Order Form
-----------------------------------------------------------------
Make checks payable to:
NoGate Consulting
P.O. Box 88115
Grand Rapids, MI 49518-0115
-----------------------------------------------------------------
Qty
___ Command line version of PAK @ $15 each $______
___ Full screen version of PAK (PAKF) @ $30 each $______
___ Programmer's version of PAK @ $75 each $______
Subtotal $______
Michigan residents please add 4% sales tax. $______
Shipping and handling - inside the United States $3.50
- or -
- overseas $5.00
Credit Card orders add 3% surcharge $______
Total $______
Diskette type (check or circle one): [ ] 5.25" [ ] 3.5"
Payment: (check or circle one):
[ ] Check [ ] Money Order [ ] Visa [ ] MasterCard [ ] AmEx
Credit Card #__________________________________________________
Expiration Date _______ Signature ____________________________
Credit Card Orders may be made by phone - (616)455-6270
or via the NoGate BBS - (616)455-5179
Checks and Money Orders must be drawn on U.S. banks in U.S. funds
-----------------------------------------------------------------
Name_______________________________________________________
Company_______________________________________________________
Address_______________________________________________________
______________________________________________________
Phone_________________________ Bus.________________________
Where did you obtain PAK?
_______________________________________________________
Comments_______________________________________________________
_______________________________________________________
PAK (C) 1988, 1989 NoGate Consulting August 10th 1989 Page 27
_______________________________________________________
-----------------------------------------------------------------