*************************************************************************** An effective use of DIET version 1.20 ------ by Teddy Matsumoto --------- *************************************************************************** 1. Let's try DIET! ================= DIET.EXE is an executable file compressor as well as a file utility to compress DATA files. DIET can compress executable files and can execute them from compressed as LZEXE or PKLITE. You can save a great deal of your storage space. What's REALLY NEW in this program is DIET compresses DATA files, too. Do we have to decompress the data file when we use them? Yes, you have to, when you use DIET as a non-TSR program. NO, when you let DIET stay as a TSR program. DIET automatically decompresses data files for you! DIET recompresses the files to the original if you wish! Let us try some examples first. 2. DIET is simple and is effective DIET. ======================================== A rough classification of files of DOS may be in two categories, namely executables and data files. The executables activate Data files, in general. The number of files on your disk of the later category is greater in most of the cases than the former. DIET can compress both categories of files, but these two categories behave differently. Executable files are compressed with some self- extracting header and decompressed on the memory to the original format. Naturally there are executable files with overlays or files which overwrite itself. Data files on the other hand, have to be restored to the original form when they are referred from the executable files. The process is carried out manually or by batch mode ordinarily. The revolutionary idea of DIET is that the program takes care of expanding and compressing automatically while you are not conscious of what's really going on! If you are reading this file with DOS command MORE.COM, then stop it and try DIET MORE.COM -------MORE.COM is compressed. DIET DIET120.DOC -----this document is compressed. DIET -Z ----------let diet stay on memory. If you have EMM.SYS, then you will see diet uses 1 page of EMS. MORE . Check the file if it is compressed by diet, and checks CRC for the integrity. Displays: |Compressed File Size with CRC. |Original File Size and Type. |If -K option is specified, report K option. [File Validation, -! option.] DIET -! -----------displays its own validation. DIET.EXE is original file! Usage 5. Copy, -C option. ========================== Copy DIETED files may cause extra time. Since COMMAND.COM will decompress the file first and copy to the directory and TSR DIET will recompress the file again. You can use -C option to copy files as compressed as they are. If DIET finds newer file(s) with same name(s), then DIET will skip the files(s). (1) DIET -C When you store compressed files of Floppy disks, and use them on a RAMDISK, you may use this method to restore files compressed. To copy all the files on the current directory c:\ to Floppy Disk A: DIET -CA:\ C:\*.* ~~~~~~~~~~~~~~~~~~~ (2) DIET -RA -C . When you keep files compressed on floppies and use them on a RAMDISK in decompressed shape. You may copy file(s) with restoring to the original size(s). To copy compressed files on Floppy disk in drive A:, to a RAMDRIVE C:\ in the original size for faster execution. DIET -RA -CC:\ A:\*.* ~~~~~~~~~~~~~~~~~~~~~~~ [Backup Files, Output Directories, -O option.] By default, DIET overwrites files by compressed equivalent with the same name. So if you want to back up the files before you apply DIET with -O option. . You are not on DRIVE A: and you want the compressed file of alpha.dat on A: with the same name on your current directory: DIET -O A:alpha.dat. . Compress the file alpha.dat on the current directory compressed, and record it on the directory C:\TEMP: DIET -OC:\temp\ alpha.dat ^ ^ Please note the positions of the spaces and back slashes. . beta.dat has been compressed by DIET on the current directory. Decompress this file and record it on the root directory with the name alpha.dat: DIET -R -O\alpha.dat beta.dat [Specify Directory for temporary files, -T option.] By default, DIET makes temporary files on the current directory. It is recommended to specify the directory on which temporary files to be made with the TSR mode. DIET makes temporary files very frequently in TSR mode, consequently, if DIET could use High Speed Memory Devices, DIET runs smooth and easy. In case of nonresident mode, DIET compress and decompress on memory, in principle, so you need not use this option. DIET -Z -TD:\temp\ , where d: is supposed to be a RAMDISK. DO NOT FORGET THE LAST "\" in this option. ~~~ [Bytes Counts -B option.] DIET says success in file compression if a cluster in the storage supposes is saved. If you specify this option, you can get Bytes Comparison for the success or fail of compression. Since DIET overwrites files within clusters, this option is useful when you are to store files in an archive like LHA with no compress option. [Overlay mode -V option.] DIET compresses executable files with headers for self-extraction. However you may compress an executable file without this header by decompressing it as a temporary file and let resident DIET to activate its execution if you have DIET resident in your memory. You can execute a huge file in overlay mode by this option, say a file of size more than 400KB. This mode has a side-effect in the size of compressed executables hence the header is missing. [Device Drivers compression -D option.] From this version on, you can compress device drivers, too. Device driver is a file with '.SYS' extensions usually, and is used with a line 'device=?????.sys' in your config.sys file. DIET checks whether a file is a device driver by the leading FF FF block of the file. There are some device driver without this block. You have to use -I option together with -D option. [Ignore warning -I option.] DIET ordinarily stops compression for the files with overlays when the size of the file in EXEHDR information is not the same, with the message 'may be overlay files'. Since DIET can take care of overlay files in the TSR mode, DIET may ignore warnings and continue compression with '-I' option. Those who use DIET only in nonresident mode should refrain from using this option. There are EXE files which are loaded in high memory. DIET warns you with the same message as overlays, but you can't expect to have a smooth action with such executables. [Enable Automated re-compress option -P.] Automated recompression is off by default. In order to get your file compressed automatically to the compressed size, you have to set this option. [No message option -M.] If your screen is mixed up with the messages from DIET activated as a child process from your editor etc., use this switch to make DIET silent. [Japanese Messages Outputs: DIET -J] I am sorry that some witty succinct Japanese messages are not imbedded in English messages. However, if you have JDOS4.0 from IBM Japan, you may listen to the advice of DR.Matsumoto on the present shape of your disk health status. [Read Only Attribute option, -A.] This is only for the sake of safety. This will make all the data files to have attribute read-only. If you are using DIET in resident mode, your editors invoke diet to decompress a compressed file, if not your data files are not compressed. In case your editor opened a compressed file, when you don't have DIET resident, your editor may not be able to quit from editing compressed binary file. A rare possibility, it might be. This switch makes all the compressed file to be read-only. You can not edit a file without changing its attribute. Please note, if you copy a file from the original position, then its file size will normally be restored to its original size. [Kill temporary Files when you quit -K option] Resident part of DIET opens a temporary file whenever a compressed file is opened in read-mode. The temporary file is erased whenever the program closes the file. However, there are programs which open and close a file frequently, e.g. a Help Message file, creating and erasing temporarily. This type of file is very much time consuming for TSR DIET. The option -K should be used when you compress a file with DIET. This is a new option, from this version DIET ver.1.20. You must remember you need a fairy large amount of space for your temporary file. The temporary file will be erased when the program terminates. You can check whether your file is compressed with -K option or not with -H option. 4. Environmental Variables. =========================== DIET from version 1.02x refers to the following environmental strings. DIETOFF File_names for which DIET is disabled to act in resident mode. DIETSIZE File_names which returns the real size of compressed files when referenced. TMP Specify directory to generate temporary files. ** NOTE reference to environmental string is possible only in MS-DOS ver3.xx or after. [DIETOFF] DIET in its resident mode has a powerful control over files. In return, we have to be careful for its adversary actions. For an example, when you copy compressed files: COPY HIMEM.SYS you will know HIMEM.SYS has the original uncompressed file size. Of course you can type: DIET -ZD COPY HIMEM.SYS to produce an exact copy of compressed size, yet it is better to SET DIETOFF=COMMAND.COM;FC.COM;DUMP.EXE;XCOPY.EXE to the effect typing, dumping and copying without re- producing files to original sizes. Register names of program to DIETOFF to disable reproduction of the uncompressed files. You don't have to specify full path names. DIET just ignores them and is concerned with program names only. [DIETSIZE] There are programs which read in data files only to the size obtained by the Function Call AH=4Eh/4F/h. In earlier versions of DIET, it fails to read the data properly for such programs. This string refers to such programs. SET DIETSIZE=**.COM;***.EXE will enable **.COM and ***.EXE to read compressed MSG or HLP files, and will disable them to return "Wrong file" messages. Unfortunately, there are many files including SK.COM, which checks data files with other methods for different versions. [TMP] You may set this environmental string in your autoexec.bat file as 'set TMP=d:\'. Command line -T option like 'DIET -TD:\TEMP' overrides the setting. 5. Concluding Remarks. ====================== [You can't use DIET for Norton's SD] The resident part of DIET can take file handlers swapped from the compressed original. If a program does not use a file-handle and works directly on FAT table or FCB, then it is not activated by resident DIET. Please type DIET -ZD when you use programs with names like HDD Optimizer, Speed Disk, DOG or Harddisk manager. [File Open Error message.] When DIET is resident in your memory, you may see a message "Can't find abc.exe" even if the file exists. This is often with the case when DIET cannot find enough space on your temporary directory. Because some programs say "can't find" when it fails to create a file. Please check your space if you see this message. From version 1.10 on, DIET will beeps at you when DIET fails to decompress a file. [Executable Files with extension not COM/EXE.] There are some executable files without the extensions EXE/COM. DIET tries to differentiate such files from DATA files. If you specify either -I or -V option to compress these files as overlays or self-executables. Executable files are to have EB, E9, E8, 0E, 1E, 06, BC, FA, FB, FC, or FD as leading bytes. Naturally, there are DATA files with one of these as the starting bytes. [Temporary File Names.] Using DIET in resident mode, you will often see files with names such as __DIET__.*. You will get these files when you reset system or stop execution by Ctrl-Break. These are the temporary files generated by DIET. You may or may not erase those files, since they are under constant transactions. Acknowledgements. ================= To all users, the version has been well tested by many 'brave' people who were not afraid of uncountable backups, collisions with other TSR's or RESETings. However, I am sure, yet, of unexpected bad timings with other resident programs or devices. Please be warned against the use of this software with other resident programs especially in its resident mode. The author can not be liable for the damages caused by the use of this program. Backup your files before testing every time you use with a new program. To Haruyasu Yoshizaki who found the vital bug which I could not find up to the last moment, to K.Okubo who introduced this software outside Japan, and to my friends in Fgal/Flabo forums on Nifty Serve who dared to hang on the earlier versions in spite of the hang overs from so many Hang Up's. Our Distribution Policy. ======================== The program together with the other packaged documents is copyrighted by Teddy Matsumoto. Package consists of DIET.exe, DIET120.DOC,& update.doc. You may copy, distribute and use this program free of charge under the conditions. You must not charge for copying or distributions, you use this for your personal purposes, you are to follow up versions if you distribute, and you must copy or distribute the entire package. How to contact the Author. ========================== Email to Teddy Matsumoto at GBG00230 on Nifty Serve. Overseas Users may contact K.Okubo at one of the following: 74100,2565 Compuserve, K.Okubo Genie, okubok@tansei.cc.u-tokyo.ac.jp ===== REVISION HISTORY ===== Version 1.00x Beta Test version. Version 1.01a (02/01/91) The first TSR version. Version 1.01b (02/16/91) New routine added to detect the use of EMS. Some improvement for software hooked on disk I/O routine by function call int21h. Version 1.02a (02/27/91) Use of EMS to minimize the resident part. Environment Variable DIETOFF is introduced. Any program registered in DIETOFF will disable DIET. Namely, copy, an interior command of COMMAND.COM, if registered as DIETOFF, will disable DIET while copying files. That is, you can copy files as compressed as they are. EX. set DIETOFF=COMMAND.COM;DIET.EXE;DUMP.EXE Another Environment Variable DIETSIZE now takes care of the files which load only a portion of the program as is indicated by size obtained from intAH 4Eh/4Fh. New routine is supplied to distinguish character devices. Version 1.02b (03/04/91) Environmental String "COMSPEC" had to be at the top of Environment Area, when COMMAND.COM is specified to DIETOFF. A bug fixed for the resident mode in which temporary file was not correctly generated to the directory specified by -T option. Version 1.10a (4/1/91) Automated compression supported. -P option. -Z option does not toggle -ZR option added. -B option -V option added. New environmental strings DIETOPT and TMP. BEEP when DIET fails to create file. Function call AH=4B03 is taken into account. Can compress files with size more than 1MB. A bug fixed for -O option. Version 1.10 (5/12/91) Warn against the coexitent DIET versions. Temporary file remaining when the file is opened with file sharing mode. This bug is fixed. Check against executables without COM/EXE extension. DIET auto-checks -! option. (8/20/91) ==================End of Diet120.doc=============================