PAK File Archive Utility for OS9 Version 02.02 (c) Copyright 1987 by G.B. Janssen ALL RIGHTS RESERVED Table of Contents Introduction .................................................... 1 Using PAK ....................................................... 3 PAK commands .................................................... 4 Adding files ................................................ 4 Moving files ................................................ 4 Updating files .............................................. 4 Extracting files ............................................ 5 Removing files .............................................. 5 Printing files .............................................. 5 Testing an PAK .............................................. 5 Directory Listing ........................................... 6 Backup retention ............................................ 7 Suppress compression ......................................... 7 INTRODUCTION PAK is the copyrighted property of G.B. Janssen and is not public domain software. You may distribute it, upload it, download it, use it, etc, etc, as long as it is FREE. It may NOT be used as part of any commerical ventures, nor as a sales aid without the expressed written consent of th author. PAK Page 0001 PAK is used to create and maintain files in groups. Such groups are usually called an archive (in this document it is called a PAK). PAK automatically compresses the files being archived, so that the resulting PAK takes up a minimum amount of space. When PAK is used to add a file to an PAK it analyzes the file to determine which of four storage methods will result in the greatest savings. These four methods are: 1) Huffman squeezing; the file is compressed into variable length bit strings, similar to the method used by SQ programs found on IBM PC's. 2) No compression; the file is stored as is. NOTE.. That since this methods involves no compression at all, the PAK entry will be larger than the original file do to overhead. 3) Run-length character compression; repeated sequences of the same byte value are collapsed into a three-byte code sequence. 4) Lempel-Zev compression; the file is stored as variable size bit codes which represents character strings. PAK was developed on a Tandy COCO3 OS9 Level II system using Tandy's "C" compiler. ***** Will run on Level I and II. ***** Some notes: 1. Bugs.mge was downloaded from Delphi COCO graphics database. This is a COMPRESSED graphics picture of Bugs Bunny that is input to COLORMAX (input size=21248). Using it as a test for PAK a saving of 50% in disk storage space was obtained (output size=10575). 2. A 1,000,206 byte text file (many "C" and ASM sources merged) resulted in a 532318 byte output file, a saving of 467888 bytes (46%). 3. Using PAK to distribute text, source, binary, graphics, fonts, etc. eliminates the need for multiple transmissions. It also solves the long discussed problem of needing special protocols and programs to eliminate characters added by XMODEM. PAK ignores any chararcter added to the end-of-the-file. 4. Due to work/backup copies, the largest PAK can only be approx. 1/2 the capacity of media being used. If using a 40 track DSDD disk drive (40trk * 18 sec/trk * 256 byte/sec * 2 no. of sides = 368640 bytes) (360KB) then the maximum PAK would be about 179KB or 183296 bytes. 5. PAK uses OS9 command "rename". It must be available in the current execution directory or loaded in memory prior to executing the PAK command. When using PAK with large files or files on multiple diskettes, preload both programs ("load pak rename"), change diskettes then issue PAK command. 6. MAXIMUM input file size is 1,048,575 or $FFFFF. PAK Page 0002 USING PAK If PAK is invoked with no arguments then a brief command summary is displayed. OS9 Pak Version 02.02 (c) 1987 G.B. Janssen =============================================================================== Usage: pak -{amuexrpdltb} archive [filelist] where: a = Add files to a PAK. m = Move files to a PAK. u = Update files in a PAK. e,x = EXtract from a PAK. r = Remove files from a PAK. p = Print files from a PAK to stdout. d,l = Directory (List) of files in a PAK. t = Test integrity of files in a PAK. alter how a command works: b = retain Backup copy of PAK. s = Suppress all compression. NOTE The "B" option may be added to Add, Move, Update, Extract or Remove. The "S" option may be added to Add, Move or Update. Archive is the name of the PAK to use or build. Filelist is a list of up to 40 file names to Add, Move, Update, Extract or Remove. Commands may be in UPPER or lower case. PAK Page 0003 PAK COMMANDS This section describes each of the commands. PAK will only accept one command at a time. ADDING FILES NOTE.. Files added to the PAK retain date-last-modified for use in Update command. ...NOT DATE ADDED TO PAK... Files are added to an PAK using the "A" (Add), "M" (Move), or "U" (Update) commands. Add always adds the file. Move deletes the source file once it has been added to the PAK. Update adds the file to the PAK if not present. If present, date last modified is use to determine older of the two, which is kept in the PAK. To add the file named "JUNK.DOC" to an PAK named "TEST.PAK", you would use the command: pak a test junk.doc To move the file named "JUNK.DOC" to an PAK named "TEST.PAK", you would use the command: pak m test junk.doc To update the file named "JUNK.DOC" in an PAK named "TEST.PAK", you would use the command: pak u test junk.doc You may also add, move or update a file which is in a directory other than your current directory. pak a test /d1/mystuff/junk.doc The above commands add, move and update will accept more then one filename from the command line. pak a test junk.asm junk.doc /d0/cmds/junk PAK does not save the path name. In other words, if you specify a path when adding a file, only the actual file name is stored in the PAK. In the above example junk.asm, junk.doc and junk are the file names stored. Duplicate names may not be added to a PAK. The following example will result in an error. pak a test junk /d0/cmds/junk PAK Page 0004 EXTRACTING FILES PAK entries are extracted with the "E" (Extract) and "X" (eXtract) commands. For example, if you had an PAK named "TEST.PAK", and you wanted the file in it named "JUNK". pak e test junk OR pak x test junk If you wanted to extract all of the files in an PAK named "TEST.PAK". pak x test OR pak e test Whatever method of file compression was used in storing the files is reversed, and uncompressed copies are created in the CURRENT DIRECTORY (not in directory they were originally from). REMOVING FILES PAK entries are removed with the "R" (Remove) command. For example, if you had an PAK named "TEST.PAK", and you wished to delete an entry in it with a filename "JUNK". pak r test junk PRINTING A FILE PAK entries may printed with the "P" (Print) command. This works the same as extract except the file is written to stdout, which in turn may be redirected '>' or piped '|' as required. pak p test junk OR pak p test junk >/p OR pak p test | sort NOTE... Files are printed regardless of type (text, binary or graphics). So be careful. Also no headings/total are printed to stderr. TESTING AN PAK The integrity of an PAK may be tested by use of the "T" (Test) command. This checks to make sure that all of the entries within a PAK are in good shape. This can be very helpful for critical PAKs, where data integrity must be assured. All of the entries in the PAK are unpaked (without saving them) and the CRC value is recalculated and compared with the CRC value saved at the time the file was stored. Example, if you just downloaded an PAK named "TEST.PAK" from your favorite bulletin board, and you want to make sure that you received it properly, enter the command: pak t test PAK ...
Amiga7878