USER'S MANUAL FOR THE JAR ARCHIVER PROGRAM November 1996 TOPICS COVERED IN THIS DOCUMENT ------------------------------- MAJOR FEATURES OF JAR ARCHIVER BENCHMARKING INSTALLATION QUICK START TO USING JAR CONVERTING OTHER ARCHIVE FILES TO JAR FORMAT HOW TO USE JAR IMPORTANT NOTES USING JAR AS A BACKUP PROGRAM JAR ERROR SITUATIONS HOW JAR USES AVAILABLE MEMORY JAR USER ACTION PROMPTS JAR COMMAND LINE SYNTAX JAR COMMANDS JAR SWITCH OPTIONS CONFIGURATION FILE CONFIGURATION FILE KEYWORDS IMPORTANT DIFFERENCES BETWEEN JAR AND ARJ JAR LIMITATIONS JAR ARCHIVE FLAGS JAR ERROR LEVELS FINAL COMMENTS MAJOR FEATURES OF JAR: JAR comes as a 16-bit executable (JAR16.EXE) for DOS and a 32-bit executable (JAR32.EXE) for Windows 95 and Windows NT. The latter takes full advantage of 32-bit instructions and the "flat" memory model. Sometimes this 32-bit executable is referred to as the "Win32 JAR version". Currently, JAR ranks as one of the best in compression in terms of size reduction of the currently available archivers. JAR compresses significantly better than such popular archivers as PKZIP 2.04, UC2 rev 3, RAR 1.55, RAR 2, and LHA. JAR uses a modified form of SOLID archive technology to provide excellent compression, fast updates and fast extraction. The ability to process and archive more than 50,000 files at one time. JAR provides the CHAPTERS concept which allows one to store multiple backups in the same archive using incremental compression. Archive individual file or chapter comments with the option of inputting comments from a file. Support of ANSI style comments. JAR has MS-DOS international language support for the proper casing of filenames. The ability to put the entire JAR command line in a response type file as in "JAR @command.rsp". Supports nested response files. 32 bit CRC file integrity check. Total percentage milestone display for the entire archive build. Option to test new archive before overwriting the original archive including the option to do a byte for byte file compare during a build. Archives that can span diskettes. This allows the user to backup a full hard disk drive to multiple floppies. Recovery of individual files is convenient because the JAR archive header keeps information about the disk location of each file. Built-in facility to recover files from broken archives. Also, the capability to add recovery records to important archives which allow one to repair damaged archives. Internal integrity check in JAR to resist hacking or virus attacks. Archive security envelope "seal" feature to resist tampering with secured archives. This feature disallows ANY changes to a secured archive. Archive and chapters locking feature. Password option to protect archived files both using authentication or encryption. Specification of the files to be added to or exclude from an archive via one or more list files. In addition, JAR can generate a list file. Specification of files to be excluded from processing by JAR. Special command to test JAR reliability. "testjar.bat" is a ready-to-use batch file for testing on specified drive. Optional long filenames translation into short names when extracting files in DOS. Configuration file which allows the customization of default JAR behavior. Includes a set of default options for each command. Breaks 640K DOS barrier using EMS and/or XMS. Query option when wildcard selection is not suitable. Files sorting in list commands. 32-bit JAR version allows the use or storage of both long and/or short filenames. It uses filenames compatible with DOS OEM encoding. ARCHIVER BENCHMARKING: Benchmarking results are very dependent upon the data used for the tests. We compared JAR with some of the leading commercial archivers: PKZIP 2.04g, UltraCompressor II Version 3, RAR 2.00 BETA_3 for Win32, and RAR 2.00 for DOS. LHA 2.X and ARJ 2.X are not included. Their compression size numbers are very similar to those of PKZIP 2.04g. COMPUTER: Pentium-100, 24MB memory, no external cache OPERATING SYSTEM: Windows 95 CONFIG.SYS: device=c:\win95\himem.sys dos=high files=40 devicehigh=c:\dos\power.exe JAR.CFG: 32MemoryLimit=10240 CheckAvailableMemory=No The only exception is JAR16.EXE which was tested in DOS 6.22 with 16M of EMS memory. This was due to the slow Windows 95 EMS implementation which decreases JAR's performance relative to the amount of EMS used (up to 1.5 times). We recommend the use of JAR32.EXE in Windows 95 and Windows NT. FILE SET: The Calgary Corpus (18 files totaling 3,251,493 bytes, popular file set used to compression rates). Archiver Method Compression time Compressed size JAR32 Maximum 31s 903,863 (100%) JAR32 Default 21s 910,676 (101%) JAR16 under DOS 6.22 Maximum 41s 935,675 (104%) with 16MB EMS JAR16 under DOS 6.22 Default 29s 945,690 (105%) with 16MB EMS RAR 2.00 beta 3 -m5 -mde -s 261s 951,992 (105%) RAR 2.00 beta 3 Default solid 48s 997,418 (110%) RAR 2.00 beta 3 Default 41s 1,008,455 (112%) RAR 2.00 for DOS Default solid 25s 1,030,894 (114%) UC2 rev 3 Default 30s 1,051,516 (116%) PKZIP 2.04 Default 17s 1.074,550 (119%) FILE SET: Microsoft Visual C++ 1.52 (462 files and directories totaling 18,806,153 bytes, mix of executables, text, DLLs, and object files). Archiver Method Compression time Compressed size JAR32 Maximum 264s 5,984,311 (100%) JAR16 under DOS 6.22 Maximum 341s 6,279,415 (105%) with 16MB EMS RAR 2.00 beta 3 -m5 -mde -s 1004s 6,351,777 (106%) JAR32 Default 173s 7,050,008 (118%) JAR16 under DOS 6.22 Default 250s 7,267,567 (121%) with 16MB EMS RAR 2.00 beta 3 Default solid 273s 7,856,362 (131%) RAR 2.00 for DOS Default solid 151s 8,314,078 (139%) UC2 rev 3 Default 190s 8,556,558 (143%) PKZIP 2.04 -ex 140s 8,906,367 (149%) PKZIP 2.04 Default 96s 8,945,476 (149%) JAR16/JAR32 shows its best compression with large directories of files. INSTALLATION: This assumes that you have already executed the self-extracting distribution archive and extracted its archived files into a directory. To install the JAR software, simply copy JAR16.EXE, JAR32.EXE, JAR.CFG, REARJ.EXE, REARJ.CFG and optionally JAR_C.COM, JAR_C.DLL (available in non-export version only) to one of the directories named in your DOS PATH statement found in your AUTOEXEC.BAT. On many PCs, this directory may be C:\DOS or C:\BIN. In addition, for a DOS machine or for a DOS environment one MB of available XMS strongly recommended. Four MB of EMS preferred for outstanding compression. More memory is better. Detailed information about memory usage is available in section "HOW JAR USES AVAILABLE MEMORY". QUICK START TO USING JAR: See the document INTRO.DOC. CONVERTING OTHER ARCHIVE FILES TO JAR FORMAT: Included with this software is the program REARJ. This program can be used to individually or collectively convert archive files from other formats to the JAR format. Read REARJ.DOC for more details. HOW TO USE JAR: If you type JAR16 [return], you will see a simple help screen. If you type JAR16 -? [return], you will see more detailed help information. Please note that unless specifically indicated, references to JAR16 also include JAR32.EXE. IMPORTANT NOTES: When using the "-w" working directory switch, JAR does not check on space availability before overwriting the original archive if it exists. Be sure that you have enough disk space for the new archive before using the "-w" switch. If JAR aborts in this situation because of disk space, JAR will keep the temporary archive. Like ARJ and PKZIP, JAR requires extra disk space to UPDATE an archive file. JAR will backup the original archive while it creates the new archive, so enough room must be available for both archives at the same time. Also JAR requires additional space for a swap file which is used to store the archive header and a list of files to add during processing. By default during an add command, JAR will ALSO add to the archive all directories scanned while searching for matching filenames. Even if NO files were found, JAR will build an archive if any directories were scanned during the operation. See the "-hb" option for more information. Currently, JAR will not extract overwriting a readonly file unless the "-ha" option is specified. JAR uses a configuration file to store global user settings. By default the configuration file is named "JAR.CFG" and must be placed into the same directory as the JAR16.EXE and JAR32.EXE directory. USING JAR AS A BACKUP PROGRAM: JAR can be used as a substitute for a backup program. The following partial command lines illustrate a full backup command, an incremental backup command, and a restore command. The only parts missing are the names of the files to backup/restore. JAR16 a backup1 -jt -r -m4 -b0 JAR16 a backup2 -hba1 -b0 -jt -r -m4 JAR16 x backup2 You may then copy archive into diskettes: JAR16 y backup -oa:backup -vvas -hk Or you may create backup directly on diskettes: JAR16 a a:backup -jt -r -m4 -b0 -hk -wc:\ -vvas You should familiarize yourself with the above switches so that you can modify the above command lines as needed. Another possibility for incremental backups is to use chapter archives: JAR16 ac chapters -ht1 -r -js1 -hl -hz To restore the last chapter use: JAR16 x chapters To restore any other chapter (in our example #5) use: JAR16 x chapters -jb5 It may be useful to review chapter comments: JAR16 lc chapters We also recommend you test JAR reliability with your computer and software using the JAR "test" command. See TESTJAR.BAT. JAR ERROR SITUATIONS: ADD: If a user specified file is not found during an add, JAR will continue processing. Note that files specified within an JAR listfile that are not found during an add will NOT trigger an error unless the "-hl" option is also specified. In a disk full condition or any other file i/o error, JAR will promptly terminate with an error condition and delete the temporary archive. MOVE: JAR will only delete files after all them have been successfully added to the archive. EXTRACT: In a disk full condition or any other file i/o error, JAR will promptly terminate with an error condition and delete the current output file. CRC ERRORS OR BAD FILE DATA: In the case where an JAR archive has been corrupted, JAR will report a CRC error or a Bad file data error. These corruptions can be the result of an unreliable diskette, a computer memory problem, a file transfer glitch, or incompatible CACHING software or memory manager. Most of these errors are the result of file transfer glitches and bad diskettes. CRITICAL ERROR HANDLER: JAR sets up an interactive critical error handler to handle DOS critical errors like "sector not found" and "drive not ready". When a critical error occurs, JAR will prompt the user with the message "Retry Y/N?". The user may retry the failed operation by pressing "Y". Pressing "N" will fail the operation. The user can press Control BREAK to abort to DOS. There is an option to disable the critical error handler in the JAR configuration file. JAR32.EXE doesn't have an interactive hardware error handler. HOW JAR USES AVAILABLE MEMORY: One of JAR's advantages is its ability to use additional memory for better compression. Unlike most other archivers the JAR DOS version can use EMS or XMS to improve compression. JAR DOS version JAR uses a fixed amount of XMS memory to cache its overlay code (about 300K) and requires an additional 500K of XMS memory for better performance. When JAR compresses data it first looks at available EMS memory. If there are more than about 640 Kbytes EMS and the compression method is -m2..-m4 then JAR allocates EMS and uses it to improve compression. You may specify that JAR use up to 16384 Kbytes of this memory. The more EMS - the better compression achieved, but JAR will work slower. If there is not enough EMS then JAR uses XMS instead. But "XMS based" compression is significantly worse. JAR compression rate and speed does not depend significantly on the XMS amount used. The optimal value is less than 4 Mbytes. The JAR XMS engine consumes about 60K more DOS conventional memory compared to the EMS engine. When extracting, JAR uses available XMS or EMS for faster decompression. The recommended value for data that has been compressed using the "-m2" and "-m3" method is 1.5 Mbytes of free EMS and/or XMS, for the "-m4" method, use at least 3 Mbytes of free EMS/XMS. With less memory JAR may use a swap file instead (this results in worse performance). When both EMS and XMS are available JAR itself chooses the optimal memory amount and type for the selected command. The JAR DOS version requires EMS 4.0+ and XMS 2.0+ versions. Although the JAR DOS version achieves significantly better compression and uses less memory with EMS available, special care is required to ensure that the EMS driver (such as EMM386.EXE) is configured and works properly. The EMS driver works in a more "complex" way than XMS. It searches for a "hole" in DOS address space for the page frame. Usually it also works with 386+ memory paging enabled. As result some older DOS software or hardware may conflict with the EMS driver. Refer to your memory manager documentation for details. We strongly recommend that you ensure that DOS JAR works reliably with EMS enabled using the "test" command. If you detected problems then you must disable EMS usage using "EmsLimit=0" in the JAR configuration file. When running JAR in Windows 3.X or OS/2 be sure the PIF file/DOS session settings allow JAR to use EMS and XMS. By default XMS and EMS usage may be limited to 1 Mbyte. We recommend increasing these settings to 4 Mbytes or more. JAR Win32 version JAR for Win32 requires about 1 Mbyte of memory for executable and data. The compression engine may use additional free memory for better compression since more available memory allows the JAR compression engine to match strings at larger offset distances. Very good compression is achieved when JAR uses 3-4 Mbytes of memory. 8-10 Mbytes gives the best compression. JAR may use less memory (0.5-3 Mbytes) for good compression, too. The JAR Win32 version works significantly faster and compresses better than the DOS version. So in Windows NT and Windows 95, you should use the Win32 JAR version. In DOS, Windows 3.X and OS/2 - use the DOS JAR version. Both versions The simplest way to tune JAR memory usage is to set "CheckAvailableMemory=Yes" in the configuration file. Then JAR detects the free physical memory currently available and uses it. Note that JAR never uses more memory than the limits that are set in the configuration file ("XmsLimit", "EmsLimit", "32MemoryLimit") even if there is actually more free memory. If "CheckAvailableMemory=Yes" you may use very large limit settings (e.g., 8192 Kbytes each). Experienced users may set "CheckAvailableMemory=No" and then specify the "real" memory amounts in "XmsLimit", "EmsLimit", "32MemoryLimit". Be sure that the memory specified is really available; otherwise, in operating systems as Windows 95, Windows NT, OS/2, intensive memory swapping may occur which will decrease overall system performance. "CheckAvailableMemory=No" is also recommended for batch processing. But again SPECIFY MEMORY AMOUNTS that ARE REALLY AVAILABLE. It is better to specify a smaller memory amount than wait for hours due to swapping. The EMS implementation in Windows NT is slow. So for good compression do not use the JAR DOS version. Use the JAR Win32 version instead. JAR USER ACTION PROMPTS: JAR prompts the user for action at certain times. There are several types of prompts. One is for yes/no permission, another is for a new filename, another is for archive comments. The JAR yes/no user prompts provide a lot of flexibility. In addition to the normal yes and no responses, JAR also accepts the following responses: quit, always, skip, global, and command. "Global" sets JAR to inhibit all subsequent user prompts by assuming YES for all queries as if "-y" were specified. "Always" sets JAR to assume YES for subsequent queries of the same class. For example, answering ALWAYS to the overwrite query will assume YES for ALL subsequent overwrite queries. "Skip" sets JAR to assume NO for ALL subsequent queries of the same class. "Command" prompts for one DOS command and then executes it. JAR then returns to expect an answer to the current yes/no query. Do not install a TSR program using this command prompt as JAR may not have enough memory left to continue execution. Abbreviated responses such as "y", "n", "g", "a", "s", "c" are allowed. JAR COMMAND LINE SYNTAX: JAR{16|32} [...] [.j] [...] ::= | | | | ::= {'/'|'-'}['-'|