AIN - A file compression and archivation utility set Version 2.2 User's guide Copyright (c) 1993-94 Transas Marine (UK) Ltd. Saint-Petersburg, Russia - 2 - This document presents the detailed description of new software for IBM personal computers and compatibles, dealing with the file compression and archivation. The software includes a full-featured archiver AIN version 2.2, an extracting utility AINEXT and an EXE- files compressor AINEXE. The compression/decompression methods, used in AIN archiver, excels noticeably those used in any well-known archivers, such as ARJ, LHA and PKZIP, in both the compression degree and the performance. AINEXE utility is useful for saving the disk space, due to its ability to reduce the size of most large DOS executables 2 to 3 times, without detriment to their work. THIS SOFTWARE AND MANUAL ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. BECAUSE OF THE VARIOUS HARDWARE AND SOFTWARE ENVIRONMENTS INTO WHICH THIS PROGRAM MAY BE PUT, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED. GOOD DATA PROCESSING PROCEDURE DICTATES THAT ANY PROGRAM BE THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON IT. THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAM. ANY LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE. No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any other language or computer language in whole or in part, in any form or by any means, whether it be electronic, mechanical, magnetic, optical, manual or otherwise, without prior written consent of Transas Marine (UK) LTD. AIN is Shareware, and if you use AIN regularly we strongly encourage you to register it. As shareware, AIN was distributed freely in order to allow people to "test drive" it. The try-before-you-buy concept allows users to find out which programs are useful before purchasing them. If a is useful, please support it through registration. With registration you will receive the latest version of the software and update notices. Also the registered version do not display shareware banner screen. To register, print out the ORDER.TXT, and send a check or money order. The software is produced and distributed by Transas Marine (UK) Ltd. - 3 - CONTENTS 1. INTRODUCTION............................................4 1.1 Comparison with the analogs.........................4 1.2. Main features......................................7 1.3. Comparison with the prevoius versions..............9 2. AIN VERSION 2.2 ARCHIVER...............................10 2.1. Command line format...............................10 2.2. Commands of the archiver..........................12 2.2.1. A - add files to the archive................12 2.2.2. D - delete files from the archive...........13 2.2.3. E - extract files from the archive..........14 2.2.4. F - refresh obsolete files..................15 2.2.5. L - list the contents of the archive........15 2.2.6. M - move files to archive...................16 2.2.7. T - test the integrity of the archive.......16 2.2.8. U - update the archive......................17 2.2.9. V - list the contents the archive...........17 2.2.10. X - extract files using their pathnames....17 2.2.11. Y - rebuild the archive....................18 2.3. The switches of the archiver......................18 2.3.1. F - split the archive into fragments........19 2.3.2. H - display the help........................21 2.3.3. G - garble with password....................21 2.3.4. M - define the compression method...........23 2.3.5. O - specify the output directory............23 2.3.6. P - match file names use the full path......24 2.3.7. R - recurse the subdirectories..............24 2.3.8. S - set the date/time stamp of the archive..24 2.3.9. U - define the access speed.................25 2.3.10. W - specify the working directory..........26 2.3.11. X - exclude files from processing..........26 2.3.12. Y - reply Yes to the archiver's requests...26 2.4. The AIN_SW environment variable...................27 3. THE AINEXT UTILITY.....................................28 4. THE AINEXE UTILITY.....................................29 - 4 - 1. INTRODUCTION 1.1 Comparison with the analogs At present, there are about ten archivers for the IBM PC and compatibles. They differ one from another by both their features and the technical characteristics (i.e. the compression ratio and the performance). The leading place among them belongs, apparently, to ARJ version 2.41 and PKZIP version 2.04. ARJ version 2.41 excels all other archivers in the amount of the features, but its technical characteristics are not as good as those of PKZIP version 2.04. The main trait of PKZIP version 2.04 is the high performance. As to the compression ratio, this archiver is, at least, as good as ARJ 2.41. Transas Marine (UK) Ltd. proposes a new archiver, AIN version 2.2. The main advantage of this archiver is the highest compression degree. It becomes especially noticeable when an archive contains a set of files of the same type (e. g. the source texts of a program's modules, or the financial documents related to the different periods of the activity of a company). In such case, the results shown by AIN version 2.2 are 1.5 to 2 times better than those shown by all other archivers. In average, the advantage is as large as 10 to 20 percent. As to the performance, AIN version 2.2 excels ARJ version 2.41 as much as 1.5 to 2 times, and PKZIP version 2.04 as much as 10 to 20 percent. The technical characteristics of the best PC archivers are illustrated by the table 1 (that includes also the old AIN version 2.0 and the popular LHA version 2.13). In respect of its features, AIN version 2.2 is, in practice, is as powerful as ARJ version 2.41. Although some rarely used features of ARJ version 2.41 are not available with AIN version 2.2, there are some important opportunities, provided by AIN version 2.2, that ARJ version 2.41 does not support. For instance, AIN version 2.2 makes it possible for the user to transform an archive, while copying it from one disk to another, into a multi-volume archive (this can be useful when it is necessary to place an archive, stored in the hard disk, into a number of floppy disks). AIN version 2.2 uses an encryption method which is much more reliable than that used by ARJ version 2.41 (where the encryption only comes to the translation by a password- depending table). So, AIN version 2.2 is a quite competitive product. - 5 - Table 1. The best archivers for the IBM PC. Benchmarks were performed on a 33MHz AT-486. AIN........AIN version 2.2 ARJ........ARJ version 2.41 ZIP........PKZIP version 2.04c +----------------------------------------------------------+ | Data | Archiver | Compressed | Compression | Decompr.| | type | /method | size | time | time | |----------+----------+------------+-------------+---------| | | AIN /m1 | 62,382 | 6.2 | 13.1 | | | /m2 | 63,012 | 5.5 | 13.5 | | 75 files | /m3 | 80,470 | 4.7 | 13.9 | | |----------+------------+-------------+---------| | *.ASM | ARJ /jm | 96,783 | 15.6 | 17.0 | | | /m1 | 97,163 | 13.5 | 17.0 | | size | /m3 | 100,646 | 12.5 | 16.9 | | |----------+------------+-------------+---------| | 303,924 | ZIP /ex | 99,239 | 6.3 | 14.0 | | | /en | 99,902 | 6.0 | 14.0 | | | /es | 110,711 | 5.3 | 14.3 | |----------+----------+------------+-------------+---------| | | AIN /m1 | 328,023 | 26.6 | 53.5 | | | /m2 | 330,187 | 25.0 | 57.0 | | 279 files| /m3 | 418,560 | 20.6 | 55.6 | | |----------+------------+-------------+---------| | *.PAS | ARJ /jm | 454,249 | 63.1 | 70.2 | | | /m1 | 464,536 | 60.0 | 71.2 | | size | /m3 | 466,991 | 54.2 | 71.6 | | |----------+------------+-------------+---------| | 1,943,552| ZIP /ex | 462,849 | 34.4 | 54.4 | | | /en | 464,437 | 32.6 | 55.5 | | | /es | 530,389 | 29.1 | 56.3 | |----------+----------+------------+-------------+---------| | | AIN /m1 | 261,813 | 14.8 | 16.4 | | | /m2 | 262,772 | 11.8 | 16.3 | | 70 files | /m3 | 307,826 | 8.7 | 16.9 | | |----------+------------+-------------+---------| | *.XL* | ARJ /jm | 312,471 | 31.9 | 20.8 | | | /m1 | 312,511 | 26.0 | 20.9 | | size | /m3 | 329,194 | 20.5 | 20.8 | | |----------+------------+-------------+---------| | 892,540 | ZIP /ex | 314,166 | 14.4 | 16.1 | | | /en | 314,907 | 12.8 | 17.3 | | | /es | 346,874 | 9.3 | 18.0 | +----------------------------------------------------------+ - 6 - +----------------------------------------------------------+ | Data | Archiver | Compressed | Compression | Decompr.| | type | /method | size | time | time | |----------+----------+------------+-------------+---------| | | AIN /m1 | 459,520 | 16.8 | 8.8 | | | /m2 | 459,814 | 13.8 | 8.8 | | 15 files | /m3 | 490,421 | 9.6 | 9.4 | | |----------+------------+-------------+---------| | *.PCX | ARJ /jm | 459.999 | 25.4 | 13.0 | | | /m1 | 460,002 | 23.0 | 10.7 | | size | /m3 | 467,856 | 17.1 | 11.6 | | |----------+------------+-------------+---------| | 815,004 | ZIP /ex | 460,037 | 20.6 | 9.0 | | | /en | 460,623 | 16.2 | 8.3 | | | /es | 488,639 | 11.5 | 8.7 | |----------+----------+------------+-------------+---------| | | AIN /m1 | 164,833 | 6.9 | 5.0 | | | /m2 | 164,923 | 6.2 | 5.0 | | 11 files | /m3 | 180,565 | 5.1 | 5.2 | | |----------+------------+-------------+---------| | *.EXE | ARJ /jm | 173,016 | 10.3 | 5.8 | | | /m1 | 173,002 | 9.4 | 5.7 | | size | /m3 | 176,081 | 8.3 | 5.9 | | |----------+------------+-------------+---------| | 362,528 | ZIP /ex | 173,015 | 7.2 | 4.6 | | | /en | 173,065 | 6.2 | 4.5 | | | /es | 187,007 | 4.9 | 4.7 | |----------+----------+------------+-------------+---------| | | AIN /m1 | 155,384 | 10.5 | 6.3 | | | /m2 | 156,657 | 8.8 | 6.6 | | 10 files | /m3 | 183,671 | 6.6 | 7.9 | | |----------+------------+-------------+---------| | *.DBF | ARJ /jm | 160,041 | 36.4 | 7.3 | | | /m1 | 161,808 | 16.1 | 7.6 | | size | /m3 | 173,438 | 10.5 | 7.1 | | |----------+------------+-------------+---------| | 703,914 | ZIP /ex | 157,296 | 14.1 | 5.3 | | | /en | 160,650 | 9.3 | 5.3 | | | /es | 186,543 | 6.1 | 5.5 | |----------+----------+------------+-------------+---------| | | AIN /m1 | 203,088 | 9.3 | 3.8 | | | /m2 | 204,541 | 8.1 | 3.7 | | 1 file | /m3 | 250,541 | 5.8 | 4.4 | | |----------+------------+-------------+---------| | *.DOC | ARJ /jm | 206,720 | 16.7 | 5.0 | | | /m1 | 206,804 | 15.0 | 4.6 | | size | /m3 | 223,074 | 9.6 | 4.8 | | |----------+------------+-------------+---------| | 603,909 | ZIP /ex | 203,164 | 14.9 | 3.9 | | | /en | 205,807 | 10.4 | 4.1 | | | /es | 253,969 | 7.0 | 4.6 | +----------------------------------------------------------+ - 7 - +----------------------------------------------------------+ | Data | Archiver | Compressed | Compression | Decompr.| | type | /method | size | time | time | |----------+----------+------------+-------------+---------| | | AIN /m1 | 74,184 | 19.6 | 6.1 | | | /m2 | 77,375 | 7.6 | 6.4 | | 20 files | /m3 | 93,221 | 5.4 | 6.7 | | |----------+------------+-------------+---------| | *.BMP | ARJ /jm | 74,366 | 45.0 | 7.0 | | | /m1 | 75,533 | 17.0 | 6.8 | | size | /m3 | 80,486 | 9.0 | 6.9 | | |----------+------------+-------------+---------| | 393,352 | ZIP /ex | 75,381 | 21.3 | 5.5 | | | /en | 77,361 | 11.5 | 5.7 | | | /es | 92,270 | 4.8 | 5.6 | +----------------------------------------------------------+ 1.2. Main features The AIN version 2.2 archiver requires Microsoft DOS version 2.0 or newer and provides the following functions: * Archivation of separate files, directories and entire subtrees of the MS DOS file system. The names, or the name templates, of the files to archivate, can be submitted both from the command line and a file. * Replacing, deleting and adding new files to existing archives. The refreshment of an archive can be made automatically. * Extraction of separate files, directories and entire subtrees of the MS DOS file system into a given directory. The archiver can take (or not take) into account the full paths stored in the archive's table of contents. The names, or the name templates, of the files to extract, can be submitted both from the command line and a file. Files extracted from an archive have the same DOS attributes and the date/time stamp as the original files had at the moment they were archivated. The directories needed to reproduce the paths of files are created automatically. * Choosing between four methods of compression providing different ratio and performance. There are also three additional modes for choosing between the compression ratio and the quickness of the access to the files stored in the archive, so that archives intended to be used mainly as a whole can be compressed both better and quicker. * Creating multi-volume archives, i. e. such that are made up of several files, named volumes, or fragments. Different fragments of the same archive can have different size and be placed on different diskettes (e. g., you may create an archive with fragments placed, if necessary, on both diskettes of different capacity and the hard disk). An archive fragment can be - 8 - considered as both a separate archive and a part of the larger archive. * Changing the properties of existing archives, such as the used compression method, fragmentation etc. The resulting archive can either replace the old one, or be stored in another drive or directory (in this case, the source archive is left unchanged). * Getting the list of contents of an archive. The list can include either basic, or full path names of the archive members. * Checking the integrity of archives. This is the reliable way to detect both accidental (caused by either physical defects of magnetic media or hardware faults) and intentional errors in the archive structure. * Archive encryption. The contents of an encrypted archive is accessible only after entering the correct encryption password. This is the reliable way to protect data from the unauthorized access. The mnemonic and sense of the commands provided by AIN version 2.2 are generally the same as in other modern archivers, so that it is easy for the user to get started with AIN version 2.2. Like other archivers, AIN version 2.2 keeps the console report about the process, that includes the name of the file being processed and the progress indicator. But, unlike other archivers, AIN version 2.2 provides also the total progress indicator reflecting the completeness of the whole job. For looking through archives and extracting files, it is convenient to use the AINEXT utility, which is duplicates the correspondent functions of the archiver. AINEXT should be used, instead of AIN version 2.2, to pass archives to other organizations that might not have AIN version 2.2. This allows both to save the disk space (since AINEXT.EXE is smaller than AIN.EXE) and to avoid violation of Transas Marine (UK) Ltd. copyright. The AIN package includes also an EXE-files compressing utility, AINEXE version 2.2. Using of this utility allows to reduce 2 through 3 times the size of large DOS executables (100K and more bytes). The effect is less noticeable for small EXE-files. The compressed executable can be run the same way as the original. But EXE-files that use overlays cannot be executed after compression, and the utility warns about such the situations. The AINEXE version 2.2 utility is very effective when applied to EXE- files obtained with the aid of such software development packages as Clipper etc. The useful side effect from using this utility is that the compressed form of an executable is protected from direct modification of its contents, so it becomes very difficult both to change the text of a program message and to break a dynamic protection mechanism (if any). - 9 - Attempts to change the EXE-file contents will make it most likely unable to be executed. From the other hand, it is a very difficult task, to restore the original form of the executeble. Note that AIN.EXE and AINEXE.EXE are already compressed. 1.3. Comparison with the prevoius versions The commands and options of AIN version 2.2 do not differ from those of AIN versions 2.1 and 2.0. AIN version 2.2 excels previous version in the performance (see Table 1). AIN version 2.2 archive format is incompatible with that of AIN version 2.0. - 10 - 2. AIN VERSION 2.2 ARCHIVER 2.1. Command line format The MS DOS command line to invoke AIN version 2.2 has the following format: AIN [{/|-}...] [.AIN] [\] [@ ! ...] where the traditional meta-symbols are used, so brackets '[]' indicate optional items, braces '{}' indicate an obligatory choice, vertical line '|' means "or", ellipsis '...' indicate optional repetition of the previous syntactic item. Letters in upper and lower cases are equivalent; the only exception is the value of the /G switch. The command line begins with the name of the program (AIN), followed by a letter which defines the function requested (e. g., A - add files to an archive, D - delete etc.). All commands are described in the subsequent sections of this manual. Switches define the modes of processing. A is spelled as one of the characters of '/' (slash) or '-' (minus) followed by one or two identifying characters. Some of the switches can be followed by a value, e. g.: AIN A /R /GBobby ARCHIVE where the 'R' switch has no value, and the 'G' switch has the value 'Bobby'. The command can contain any number of switches (including none). The switches are described in the subsequent sections of this manual. Any correct DOS file name can be used as the , but if the file with that name already exists, it must be an AIN version 2.2 archive. If the file name extension is omitted, then it is assumed that the extension is '.AIN'. So, the command in the last example refers to the ARCHIVE.AIN archive. To specify that the file name has no extension, attach the period '.' at the end of the file name. E. g.: AIN M ARCHIVE. *.C refers to a file with the name 'ARCHIVE.' (with no extension). The is the directory, from which files to add to the archive are taken, or to which files extracted from the archive are placed. E. g., the command - 11 - AIN A ARCHIVE \PROJECT\SOURCE\ *.C *.ASM puts into the archive all files with the extensions '.C' and '.ASM' being found in the directory '\PROJECT\SOURCE', and the command AIN E ARCHIVE C: extracts all the files from the archive and puts them into the current directory of the drive 'C:' The must end with either '\' or ':' character, otherwise it will be understood as the first of the . When the is omitted, the current directory (of the current drive) is assumed. The refer to the files to process. In conformity with MS DOS traditions, they can contain such wildcard characters as '*' (asterisk) and '?' (question sign) to define a set of file names. E. g., the command AIN A ARCHIVE D*.PAS *.A?? stores in the archive only files whose names either begin with the letter 'D' and have the '.PAS' extension, or have the extensions made up exactly of three characters, the first of which is 'A'. The sequence of file names and templates can include references to files, containing lists of file names or templates. Such the references are preceded with '@' (at) character. E. g., the command AIN D ARCHIVE PROG.EXE @LIST provided that the file LIST contain the line: PACK.COM *.BAT is equivalent to the command: AIN D ARCHIVE PROG.EXE PACK.COM *.BAT The list file should consist of one or several lines containing any number of file names or templates, separated with blanks. Characters '/' (slash) and '-' (minus), used as the switch tag, can be (but is not obliged to be) separated, with an arbitrary number of blanks, from the preceding element of the command. Swiches can occur in any position, e. g.: AIN/R U -S/GSTAR ARCHIVE -WC: *.C-M3 One switch tag can be followed by several switch letters, but, in this case, only the last switch of the sequence can have a value. So, the command can be spelled as follows: AIN U -RSGSTAR ARCHIVE -WC: *.C-M3 - 12 - Since the minus character has the special meaning, it is impossible to use, as command parameters, file names containing this character. The execution of the archiver can be stopped at any moment by pressing Ctrl-Break keys. If the modification of an archive is interrupted, the modification is canceled and the archive is left in the original state. 2.2. Commands of the archiver The AIN version 2.2 archiver allows the following commands: A - add new files to the archive and replace those existing; D - delete files from the archive; E - extract files from the archive; F - refresh obsolete files; L - display the list of contents of the archive; M - move files to the archive; T - test the integrity of the archive; U - refresh obsolete files and add new files; V - display the verbose list of contents of the archive; X - extract files from the archive, using the full path; Y - change the characteristics of the archive. See below for the detailed description of these commands. 2.2.1. A - add files to the archive The command "A" copies files to the archive. E. g., the command AIN A ARCHIVE \SOURCE\ *.PAS *.DOC copies, from \SOURCE base directory to the archive ARCHIVE.AIN, all files which names have the extensions ".PAS" and ".DOC". If there is no archive with the name specified by the command, it is created. This is the usual way of the creating of archives. If the base directory is omitted, the current directory is used to get to the files. If there are no file names in the command, all files (of the base or current directory) are added. So, the command AIN A ARCHIVE copies all files of the current directory. Note that although the archive itself is in the current directory, it is not included in the process. Such the bahaviour is characteristic of all the archiver's commands. - 13 - If the command contains the /R switch, then all requested files of the given directory and its subdirectories are copied to the archive. E. g., the command AIN A /R ARCHIVE \PROJECT\ *.C *.H copies all files with the ".C" and ".H" names' extensions, contained in the \PROJECT\ directory, all its subdirectories (including subdirectories of the subdirectories etc.). The "A" command makes the archive to remember all the information about the file path available directly from the command. E. g., the command AIN A ARCHIVE C:DIR\ TEXT\FILE.DOC uses and stores the path constructed as C:DIR\TEXT\FILE.DOC; this name will be displayed by "V" command. If a file with the same name turns to be already existing in the archive, it is replaced. For the identification be correct, it is recommended to replace files when being in the same current disk and directory. For example, after the following command sequence will be executed: C: AIN A ARCHIVE TEXT.DOC D: AIN A ARCHIVE C:TEXT.DOC the archive will contain two copies of the same file, because the first call of the archiver leaves no information about the disk where the file is taken from. When identifying, the archiver builds the full path name of the file, proceeding from both the stored part of the path name and the current DOS state. Then it compares the resulting string with the full path name of the file being added. Therefore, files stored with their full names are always identified correctly. It is recommended, however, act in accordance with to the rule mentioned above. 2.2.2. D - delete files from the archive The "D" command deletes files from the archive. E. g., the command AIN D ARCHIVE *.PAS *.DOC deletes from the archive all files with ".PAS" and ".DOC" name extensions. The base directory, if specified, is ignored. The aforesaid command deletes all files with the given extensions, with no attention to their path names (as they are stored in the - 14 - archive). Use the /P switch to make the archiver to take the paths in account: AIN D /P ARCHIVE C:\SOURCE\PROG\*.PAS This command deletes all ".PAS" files stored with the path "C:\SOURCE\PROG". If the value of the switch /P is 1: AIN D /P1 ARCHIVE \S*.PAS the command deletes files whose paths meet the given string template. So, the files \SOURCE\TAX.PAS and \SRC\PROG\DISCO.PAS are deleted, but the file DISCO.PAS is not. The archive size is decreased after deletion. 2.2.3. E - extract files from the archive The "E" command extracts files from the archive and writes them to the base (if specified) or current directory, e. g.: AIN E ARCHIVE A:\SOURCE\ *.PAS *.DOC. All files are placed in the same directory with no regard to paths stored in the archive. If the base directory does not exist, it is created automatically. Files extracted from the archive have the same DOS attributes and the date/time stamp as the original files had at the moment they were archivated. The set of files involved in the process is determined as described in 2.2.2, but if no file name or template is specified in the command, all files are extracted. E. g., the command AIN E ARCHIVE copies all files of the archive to the current directory. Files are not deleted from the archive, so the archive does not change. If the file already exists in the target directory, the user is warned and then has to select one of the options: to overwrite the old file, to cancel the extraction of the file, to place the file to another directory and to stop the extraction. The conversation starts with the following message: already exists Date/time: file , archive Overwrite? [Y/N/AY/AN/Q] _ The user should enter "Y" (yes) or "AY" (always yes) to overwrite the old file and "Q" to stop the extraction. Having answered "N" (no) or "AN" (always no), the user is requested again: Create the file in another directory? [Y/N/AY/AN/Q] _ - 15 - Here, "N" and "AN" mean that the user do not wish the file to be extracted. Entering "Y" or "AY", the user will be requested to specify a directory. The user can edit the string using the "Backspace" or "Arrow left" keys. The user the editing of the directory name is finished, when the "Enter" key is pressed. The path name of the directory can start with a drive letter (like in "A:\UNPACK"). If the directory specified does not exist, it is created automatically. The answers "always yes" and "always no" mean that if the situation will repeat, the answers "yes" or "no" will be assumed with no request, respectively. So, if the user wishes not to extract files that exist already, he should reply "AN" twice. 2.2.4. F - refresh obsolete files The "F" command refreshes old files stored in the archive, i. e. replaced them with their newer copies, if any. E. g., the command: AIN F ARCHIVE \SOURCE\ *.PAS *.DOC overwrites those files "*.PAS" and "*.DOC" of the archive, that have an earlier date/time stamp in comparison with corresponding files found outside, i. e. files that have changed since they were previously copied to the archive. If the base directory is not specified, the current directory is assumed, as usual. If no file name or template is specified, all files are checked. Note that if the /R switch was used when files were added to the archive, it most likely should be used again when refreshing. So, the archive created with the command AIN A /R ARCHIVE \PROJECT\ should be refreshed with the command AIN F /R ARCHIVE \PROJECT\ If the /R switch is omitted, only those files of the archives will be refreshed, that correspond to files of the \PROJECT directory (without the subdirectories). The identification of files is the same as when files are replaced by A command. 2.2.5. L - list the contents of the archive The "L" command displays the information about the archive contents. E. g., the command AIN L ARCHIVE *.PAS *.DOC - 16 - displays the information about all files of the archive, whose names have the extensions ".PAS" or ".DOC". The information includes: the name (without the path), the size, the date and the time of the last modification. The asterisk '*' appended to the file name indicates that there is only the first part of the file in this fragment of the archive, and only the size of the part is displayed. A number following the file name indicates that there is only a continuation of the file in this fragment, starting from the offset equal to that number. The set of files involved in the process is determined as described in 2.2.3, so, if no file name or template is specified in the command, the information about all files is displayed. After all the screen lines are filled with the information, the archiver suspends the output and requests: Continue? [Y/AY/Q] _ When the user replies "Y" or "AY", the output resumes until the next portion of data fills the screen, "Q" stops the process. You may press "Enter" instead of "Y". The user can redirect the standard output to put the information into a file, e. g.: AIN L ARCHIVE > ARCHIVE.LST This command creates ARCHIVE.LST file containing the information about the archive contents. 2.2.6. M - move files to archive The effect of the "M" command is the same as of the "A" command, except that moving includes deletion of the files after adding to the archive. Files are deleted only after updating of the whole archive is finished, so any possibility of the loss of data would be eliminated. This command is suitable for saving the space on a disk, e. g., the command AIN M /R \PROJECT\ARC \PROJECT\ moves to the archive all files of the \PROJECT directory and its subdirectories. Later, the files can be restored with the following command: AIN X \PROJECT\ARC \PROJECT\ 2.2.7. T - test the integrity of the archive The "T" command checks the integrity of an archive (i. e. the correctness of its structure), e. g.: - 17 - AIN T ARCHIVE Only the command letter and the name of an archive should be specified in the command line; other arguments, if any, are ignored. Using of this command is the reliable way to detect both accidental (caused by either physical defects of magnetic media or hardware faults) and intentional errors in the archive structure. The user is informed about errors detected while checking paticular files of the archive. Any attempt to extract such files from the archive will fail. They can only be deleted with the "D" command. 2.2.8. U - update the archive The effect of the "U" command is the same as of the "A" command, except that only those files can be replaced, that have an earlier date/time stamp in comparison with corresponding files found outside, i. e. files that have changed since they were previously copied to the archive. E. g., the command AIN U ARCHIVE replaces obsolete files of the archive and adds new files from the current directory. 2.2.9. V - list the contents the archive The effect of the "V" command is similar to that of the "L" command, except that the "V" command displays the file names with the paths. E. g., if an archive was created with the following command: AIN M /R ARCHIVE C:\PROJECT\ then, the command AIN V ARCHIVE displays the list of the full names of all the files of the \PROJECT directory and its subdirectories. Note, that the archive keeps, as a file name, only the part of the path that was available in the command line when the file was added to the archive (see the "A" command description). 2.2.10. X - extract files using their pathnames The "X" command extracts, like the "E" command, files from the archive. The difference is that the "X" command restores the paths to the files extracted. E. g., if a file was copied to the archive with the following command: - 18 - AIN M ARCHIVE C:\A\B\FILE.TXT then the command: AIN X ARCHIVE FILE.TXT extracts the file and puts it into the C:\A\B directory. If the directory needed does not exist, it is created automatically. The path to an extracted file is built as follows: If no base directory is specified in the command line, the path stored in the archive is used as is. Otherwise, the letter of a disk (if stored with the path) is discarded and the rest of the string is appended to the name of the base directory. E. g., continuing the example, the command AIN X ARCHIVE A:DIR\ FILE.TXT puts the extracted file into the A:DIR\A\B directory (having created it first, if necessary). 2.2.11. Y - rebuild the archive The "Y" command changes the characteristics of an archive (but not its contents), that was previously defined with the archiver's switches. E. g., the following command AIN Y ARCHIVE /M1 /GBobby rebuilds the archive using the maximal compression (/M1 switch) and encrypts its contents with the password "Bobby" (supposed that the archive was not encrypted earlier). The /O switch allows to specify a new name for the rebuilt archive and, thereby, preserve its original state associated with the old name. E. g., the command AIN Y C:ARCHIVE /OA: /F360 copies the archive from the C drive to the A drive, splitting it into fragments corresponding to the 360K diskettes capacity. The source archive does not change. 2.3. The switches of the archiver The mode of operation of the archiver is controlled with the following switches: F - split the archive into fragments; H - display an information about the archiver usage; G - encrypt the archive with a password; - 19 - M - define the compression method; O - specify the output directory; P - use full pathnames; R - recurse subdirectories; S - set the date/time stamp of the archive; U - define the access speed; W - specify the working directory; X - exclude files from processing; Y - assume Yes reply to the archiver's request. See below for the detailed description of these switches. 2.3.1. F - split the archive into fragments The "F" switch is used to control the size of the archive's fragments. The AIN archives can be made up of one or more files, generally called fragments. When an archive is created, the name of the first archive fragment (that can be the whole archive) is specified in the command line. As a rule, the extension of the archive's name is ".AIN". The names of the subsequent fragments (if any) automatically receive the extentions ".001", ".002" etc. E. g., the command AIN A /F100 ARCHIVE creates fragments ARCHIVE.AIN, ARCHIVE.001, ARCHIVE.002 etc. The size of these fragments does not exceed 100K. The possible values of the "F" switch can be described as follows: F{[K|M]|A]} where specifies the (maximum) size of the fragment, in kilobytes or megabytes depending on the letter that follows the ("K" or "M"). The "K" letter can be omitted, so, the switches /F50 or /F50K define the fragment size equal to 50 kilobytes, and the switch /F1.5M defines the size equal to 1 and a half megabytes. Values less than 10K are not allowed. If the value of the switch is "A", the fragment size is limited only to the free space of the disk. This is the default value of the switch. E. g., the command AIN A A:ARCHIVE creates an archive on the drive A with fragments filling all the free space of (each next) diskette. - 20 - If the value specified is greater than the free space of the disk, the fragment will use all the space; the archiver rejects disks having less than 10K of free space. If the value corresponds to one of the standard capacities of the formatted floppy disk (e. g. 360K), the fragment size will not exceed the maximal amount of the free space of such a disk (i. e. 352K, for instance). E. g., fragments created with the command AIN A /F720 ARCHIVE have their size gauged to go into standard 720K diskettes (i. e. equal to 713K), and those created with the command AIN A /F1.2 ARCHIVE will fit into 1.2M diskettes (the size is 1,185K). The full list of the special sizes is the following: 160K, 180K, 320K, 360K, 720K, 800K, 1.2M, 1.44M, 2.88M. To specify one of these sizes in its literal meaning, use the leading zero, e. g.: AIN A /F0360 ARCHIVE The archiver informs the user about having built a fragment, and then requests: Create next fragment in directory ? [Y/N/AY/Q] _ where is the path to the directory in which the preceding fragment was created. At this moment, the user can replace the disk (if necessary) and press "Y" or "AY" to continue. Pressing "Q" stops the process. To change the drive or directory, the user should press "N" and specify the drive and the directory for building the next fragment. So, if there are no more floppy disks to normally proceed with the archiving, the user can place the remaining part of the archive on the hard disk. It is possible, in the future, to transfer that part onto diskettes, changing the fragment size, if necessary: AIN Y /OA: /FA C:ARCHIVE.003 The request about possible changing the output directory will appear despite the user having previously replied "AY", if the free space on the disk is exhausted. The user can, with the /YF switch, prevent the fragmentation requests, so that all the fragments would be created automatically (as far as possible). Fragmentation can arise both when the user creates new archives and when he modifies old ones, e. g., the command - 21 - AIN F /F360 ARCHIVE freshens the obsolete files and splits the archive into fragments. The user can work with an archive fragment the same way as it were a complete archive. E. g., the command AIN E ARCHIVE.002 *.PAS *.DOC extracts files from the third fragment of the archive. However, the archiver allows, when executing a command that does not modify the archive, to process the fragments in succession. For instance, to extract the contents of all the fragments of an archive to the hard disk, the user can insert the first diskette for the A drive, enter the command: AIN X A:ARCHIVE C: and then reply to the consequent requests (having the next diskette inserted) that are exactly the same as those at the next fragment creation. When executing commands that modify the archive, the archiver processes only the fragment specified. E. g., the command: AIN F ARCHIVE.001 freshens the files of only the ARCHIVE.001 fragment. Only the last fragment of an archive can be splitted. 2.3.2. H - display the help The effect of calling the archiver with the /H switch specified is displaying the detailed information about this program. The information includes a description of all the archiver's commands and switches as well as several examples of their usage. The traditional /? switch is also available and has the same meaning. Other switches and the command letter, if any, are ignored. After all the screen lines are filled with the information, the archiver suspends the output and requests the same way as when executing the "E" command. Pressing "Enter" is the most common way to proceed. The archiver will also help with its usage if it fails to understand the command specified. 2.3.3. G - garble with password The "G" switch allows to have all the data stored in an archive encrypted with a password. This switch can be specified along with any - 22 - archive-modifying command (A, D, F, M, U, Y). So, the encryption can take place both when an archive is being created and when an existing archive is being modified, e. g., the command AIN D /GBobby ARCHIVE FILE.TXT deletes the file specified and encrypts the rest with the "Bobby" password. Any time, when an encrypted archive is accessed, the password must be specified having exactly the same form (taking into account the difference between the two letter cases) it had when the archive was encrypted, e. g., the command AIN L /GBobby ARCHIVE displays the list the contents of the encrypted archive. If the "?" character is specified as the /G switch value, the password is requested later and it is not displayed when entered (all characters are shown as quotes). The "Backspace" or "Arrow left" keys can be used to edit the password. The user must press the "Enter" key to finish editing. If the archive is encrypted but the /G switch is not specified or its value is wrong, the password will be requested the same way. To change the password, or to cancel the encryption, specify the switch value as follows: G{|?}=[|?] E. g., the command AIN Y /GBobby=hacker ARCHIVE changes existing password "Bobby" to "hacker", and the command AIN Y /Ghacker= ARCHIVE turns the archive into the uncrypted one. Note, that although the password is not stored in the archive (hence, if you have forgotten the password, you may regard the information as lost), a checksum, obtained from the password, is kept. This checksum is used (and actually can only be used) by the archiver to reject an incorrect password and not to attempt to decrypt the archive, that would otherwise lead to errors. The encryption algorithm is based on a random numbers generator having the period equal to 2.8e14. The problem of an unauthorized decryption, therefore, is connected with the examination of that huge number of variants and hardly can be solved (even with the aid of a computer) for a reasonable time. Thus, the encryption available with AIN version - 23 - 2.2 is the reliable way to protect your confidential information from an unauthorized access. 2.3.4. M - define the compression method The "M" switch allows to select one of the compression methods listed below: 1 - maximal compression ratio, low performance; 2 - normal compression (the default method); 3 - fast compression, smaller ratio; 4 - no compression. This switch can be specified along with any archive-modifying command (A, D, F, M, U, Y). E. g., the command AIN A /M3 ARCHIVE creates the archive using the fast method. The value of the /M switch is stored in the archive to be used as the default the next time the archive is modified. So, the command AIN F ARCHIVE freshens the archive (created with the preceding comand) using the same (fast) method, and the command AIN Y /M1 ARCHIVE recompresses the whole archive using the method of the maximum compression. 2.3.5. O - specify the output directory The "O" switch allows to specify the output directory, i. e. the directory used for storing the archive modified by the command. This switch can be specified along with any archive-modifying command (A, D, F, M, U, Y). E. g., the command AIN Y /OA:\ /F360 C:ARCHIVE copies the archive from the C disk to a number of floppy disks. If the /O switch is not specified, the old archive is replaced by the modified version. When creating an archive, the switch is ignored. The /O switch is most convenient for copying an archive to diskettes and possibly having it splitted into fragments. - 24 - 2.3.6. P - match file names use the full path The "P" switch informs the archiver that the file names and the templates specified in the command should be understood as containing the path indication. The switch is used with the commands that manipulate files in the archive (D, E, L, V, X). E. g., the command: AIN D /P ARCHIVE *.PAS deletes from the archive only those of the ".PAS" files, that are stored in the archive without path, as it is specified by the command. If the /P switch were omitted from this command, all files having the ".PAS" extension would be deleted. The /P switch is implied if the command contains an explicit path indication. Thus, the command AIN V /P ARCHIVE \SOURCE\*.PAS displays the information about the ".PAS" files stored as having the "\SOURCE\" path and is equivalent to that having the /P switch omitted. If the value "1" is specified with the /P switch, e. g, in AIN D /P1 ARCHIVE \S*.PAS the special characters used in a file name template spread over the whole template string, including the path. So, the template specified in the example matches to \SOURCE\TAX.PAS, \SRC\PROG\DISCO.PAS and not matches to DISCO.PAS. 2.3.7. R - recurse the subdirectories The "R" switch indicates that the files to add to the archive should be looked for in all the subdirectories of the base (or current) directory. E. g ., the command AIN A /R ARCHIVE \PROJECT\ *.PAS copies to the archive all the files, with the extension ".PAS", containing in the \PROJECT directory as well as in all its subdirectories. If the /R switch were omitted from the command, only the files of the base directory would be copied. The switch is used with the commands A, F, M, U. 2.3.8. S - set the date/time stamp of the archive The "S" switch changes the date/time stamp of the archive so that it would be the same as that of the newest file stored in this archive. E. g., the command - 25 - AIN F /S ARCHIVE puts the archive's date/time stamp in dependence of that of the newest file the archive contains. Omitting the /S switch results in the archive having its date and time referred to the last moment it was modified. The /S switch is used with any archive-modifying command (A, D, F, M, U, Y). 2.3.9. U - define the access speed The "U" switch allows to select one of the values of the speed of the access to the files stored in the archive: 1 - slow access (default); 2 - normal speed; 3 - fast access. The archive access speed is the quickness of execution of the commands that replace (A, D, F, M, U) or extract (E, X) files of the archive. The actual access speed depends not only on the value selected, but also on the relative size of the file being accessed as well as on its position within the archive (an access to a small file can require much time). However, by requesting the slower access, the user allows the archiver to enhance the compression provided by the method selected with the /M switch (see 2.3.4). The /U switch can be used with any archive-modifying command (A, D, F, M, U, Y). E. g., the command AIN A /U3 ARCHIVE creates an archive that can be updated fast. The value of the /U switch is stored in the archive to be used as the default the next time the archive is modified. E. g., the command AIN F ARCHIVE applied to the archive created by the preceding command, rapidly freshens (some of the files of) the archive, and the command: AIN Y /U1 ARCHIVE turns it to be updated for a longer time (but, may be, better compressed). The enhancement of the compression quality at the expense of the access speed is especially noticeable when a large number of files of the same type are stored in an archive. From the other hand, if the files have essentially different types, the compression quality can fall. - 26 - 2.3.10. W - specify the working directory The "W" switch allows to specify a directory for temporary files allocation. E. g., when executing the command AIN F /WC: A:ARCHIVE the archiver will use the C: drive's current directory for allocation of the temporary copy of the archive being modified, keeping the original archive unchanged until the work is complete (to preserve data from being destroyed due to a hardware fault). If the "W" switch is omitted, the same directory (of the same disk) is used for the temorary files allocation as that containing the source archive. This requires the sufficient space on the disk, otherwise the archiver will stop (having the archive left in its original state, of course). Hence, it is recommended to assign the working directory always to the hard disk (or, at any rate, to another drive) when modifying archives stored on floppy disks. 2.3.11. X - exclude files from processing The "X" switch excludes the files specified from the processing. E. g., AIN A ARCHIVE *.EXE /XNC*.* /XFC*.* copies into the archive all the ".EXE" files of the current directory, except those that have their names starting with either "NC" or "FC". The "X" switch can occur several times with any command that uses file specifications (A, D, E, F, L, M, U, V, X). The "P" switch (see 2.3.6) can affect understanding of the file path/name templates. Thus, the command AIN V /X\PROJECT\*.PAS ARCHIVE displays an information about \PROJECT\SOURCE\DISCO.PAS, and the command AIN V /P1 /X\PROJECT\*.PAS ARCHIVE does not, because, in this case, the file name falls under the /X switch's influence. 2.3.12. Y - reply Yes to the archiver's requests The "Y" switch allows to automatically reply "Yes" to all or the certain requests by the archiver. The value associated with the switch specifies the particular request type: F - the request about moving on to the next fragment; O - the request to overwrite a file. - 27 - If no value is specified, all the types of requests are implied. For example: AIN A /F360 /YF ARCHIVE writes all the archive fragments onto the same disk with no requests to the user to insert the next diskette. 2.4. The AIN_SW environment variable The AIN version 2.2 archiver takes the switches both from the command line and the special variable of the DOS environment. The last allows the user to redefine the defaults related to the switches. Thus, having the following line added to the AUTOEXEC.BAT file: SET AIN_SW=/M3/U3/WC: the user forces the archiver to use the specified values as the defaults. Then, if some of these switches will be omitted from a command, the switch value will be taken from the AIN_SW variable. E. g., the command AIN A /U2 /R ARCHIVE is executed with the following switches: /U2 /R /M3 /WC:. In order to avoid failures due to the disk overflow when modifying archives stored on diskettes, it is recommended to have the AIN_SW variable keeping at least the /W switch that would be specifying a hard disk directory to contain temporary files (like that in the example above). - 28 - 3. THE AINEXT UTILITY The AINEXT utility allows to view and extract the contents of an archive created with AIN version 2.2. It is simply a version of the archiver having the reduced command set to support only displaying of the information about an archive and extracting files (E, L, V, X). The command line format is the same: AINEXT [{/|-}...] [.AIN] [\] [@!...] Only /G, /H, /P, /X and /Y switches can be used. Unlike AIN version 2.2, the AINEXT utility ignores the AIN_SW environment variable. The AINEXT utility supports fragmented archives. Examples: AINEXT E ARCHIVE extracts all files from the archive to the current directory; AINEXT X /X*.EXE /GBobby ARCHIVE A: P*.* extracts, with the paths, from the password-protected archive, all files whose names begin with "P" and extensions are not ".EXE", and puts them into the A: drive's current directory; AINEXT V ARCHIVE > ARCHIVE.LST lists the archive's contents to the ARCHIVE.LST file. The AINEXT utility should be used, instead of AIN version 2.2, to pass archives to other organizations that might not have AIN version 2.2. This allows both to save the disk space (since AINEXE.EXE is smaller than AIN.EXE) and to avoid violation of Transas Marine (UK) Ltd. copyright. - 29 - 4. THE AINEXE UTILITY The AINEXE utility is an EXE-file compressor. It is useful for saving the disk space, due to its ability to reduce the size of most large (100K and more bytes) DOS executables 2 to 3 times, without detriment to their work. The effect is less noticeable for small EXE-files. The command line format is the following: AINEXE [.EXE] The original file is saved under the ".OLD" extension (the utility terminates if such file already exists); you may delete it after the packed EXE-file is tested. The AINEXE version 2.2 utility is very effective when applied to EXE- files obtained with the aid of such software development packages as Clipper etc. The useful side effect from using this utility is that the compressed form of an executable is protected from direct modification of its contents, so it becomes very difficult both to change the text of a program message and to break a dynamic protection mechanism (if any). Attempts to change the EXE-file contents will make it most likely unable to be executed. From the other hand, it is a very difficult task, to restore the original form of the executeble. Note that AIN.EXE and AINEXE.EXE are already compressed. The compressed executable can be run the same way as the original. But EXE-files that use overlays cannot be executed after compression, and the utility warns about such the situation. Generally, if the EXE-file contains an information attached to its loadable part, the utility puts a warning message and then requests: 1 - cancel the compression 2 - attach the information to the compressed file 3 - discard the information If "1" is chosen, the utility terminates leaving the EXE-file in its original state; "2" forces the utility to simply attach the information at the end of the compressed part; "3" allows to discard the information. The most probable types of an additional information are: * symbol tables used by debuggers; this information most likely can be discarded, if no further debugging is intended; * a program's read-only data; this must be, at least, attached to the compressed EXE; * overlaying codes and data; the user should give up the idea to compress such a file. Being called with either /H or /? switch, the AINEXE utility only displays a help.