home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Fest 1993
/
gamefest1993stgcomputerslimited1993.iso
/
soft
/
more3
/
pro7
/
diet120.doc
< prev
next >
Wrap
Text File
|
1991-08-29
|
31KB
|
653 lines
***************************************************************************
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 <DIET102.DOC --- to read the compressed file with compressed
COM file, a pager.
How do you like it? Do not forget to type finally,
DIET -ZR
to let TSR part detached from your memory. If you're a man of curiosity,
try MEM.exe twice, when DIET is on the memory and off the memory to know
the size of TSR part of DIET.
When DIET is stay resident on your memory, you can do your normal work
as if none of your file is compressed by diet. There were many files
with overlays which could not be compressed by LZEXE, PKLITE or by
earlier version of DIET. The TSR mode DIET will handle these files
easily without letting you be conscious of them being in compressed
form.
DIET in TSR mode has a very strong power and control over the programs.
If you are anxious of any kind for the TSR mode, please start using
DIET with non-TSR mode, till you could get a full understanding of
its actions in TSR mode. DIET is worth using in non-TSR mode.
3.Use of DIET, non-TSR mode.
============================
Type DIET to see all available options.
There are only 3 commands you have to remember in the non-TSR mode.
-L,-R and -RA are the all you need to know now.
Let us move to my directory c:\bin and type
DIET -l
to get the following list of files.
TAIL.EXE UUDECODE.EXE UUENCODE.EXE EMACS.EXE EMACS.HLP
BDIFF.EXE BDIFF.DOC BUPDATE.EXE CSH.COM LHA.EXE
LOG.EXE SETUPE.EXE CFREQ.EXE REV.EXE SORT.MAN
After I typed
DIET *.* ---------compress all the files!
DIET -R *.* ---------restore non-executable files!
The same command line I type to see what happened.
DIET -L --------- list dieted and undieted files!
In the following list, filenames headed with an asterisk *, show
their names in reverse color.
*TAIL.EXE *UUDECODE.EXE *UUENCODE.EXE *EMACS.EXE EMACS.HLP
*BDIFF.EXE BDIFF.DOC *BUPDATE.EXE *CSH.COM LHA.EXE
*LOG.EXE SETUPE.EXE CFREQ.EXE REV.EXE SORT.MAN
DATA files in the above list are BDIFF.DOC EMACS.HLP and SORT.MAN.
The amount of space saved by compressing data files were:
Compress 'BDIFF.DOC' ....Success! (15799 to 6659 bytes)
Compress 'SORT.MAN' .. Success! (6139 to 2487 bytes)
Compress 'EMACS.HLP' ... Success! (8561 to 3663 bytes.
You should know the amount of space you could save if you can
compress all of data files, 'doc','man' or 'hlp' extensions.
However, DATA files must be in uncompressed form when they are called
from PROGRAM. Consequently you have to save DATA files in the original
size when you are in non-TSR mode. Remember compress every thing and
restore DATA files, or compress only executables with '.EXE' and '.COM'
extensions.
The command -RA restores all the DIETed files including executables.
There were many questions about how to backup programs, or where is
-b switch of DIET. DIET never failed to restore original programs
except when your computer is off in the process of compressing or
recompressing. In such cases please look for files with __DIET__.???
temporary files. Your programs may be found among them.
4.DIET in TSR mode.
===================
To compress DATA files after using them, you type
DIET -Z -P
to get the information
|Stayed on memory! (use EMS 1 page)
| auto recompress : on (with messages)
| temp. directory : D:\
You may disable the action of DIET by
DIET -ZD,
and activate it again with
DIET -ZA.
|TSR function is activated!
| auto recompress : on (with messages)
| temp. directory : D:\
DIET has a new feature from this version on to compress device drivers.
Suppose you have lines in your config.sys:
|DEVICE=C:\DOS\SETVER.EXE
|DEVICE=C:\DOS\HIMEM.SYS
|DOS=HIGH
You may compress your device driver by -D switch.
DIET highmem.sys
|Compress 'HIMEM.SYS' (as device driver) ...
|Success! (11552 to 7043 bytes)
and still you can boot your system. This new ability of DIET was designed
primarily for large device drivers of Japanese language Front-End Process-
ors.
EDIT.COM is not compressed because it is too small.
You may now try the auto-recompress feature of DIET.
Compress packing.lst with DIET and edit it with EDIT.COM.
Say add a single line. Then save the file and exit. You see a message,
|Compress 'C:\DOS\PACKING.LST',
|Success! (2608 to 1278 bytes).
The situation is different when you use other editors. You will get a
backup file 'packing.bak' and new 'packing.lst' where backup file
remains in the compressed file and the newly edited file is expanded.
There are two kinds of DATA files opened with mode read-open and with
read-write mode. DIET generate a temporary file for the read-open file
and erase it when program terminates. For read-write files, DIET tries
to recompress the edited file. Some editors copy the original and works
with buffers, and erase the original when program terminates. You must
find out whether your editor will recompress with TSR DIET or not.
EDIT.COM of MSDOS ver. 5.00 recompress under DIET. EDLIN.EXE will not
work for editing compressed file.
In earlier version of DIET, ver.1.0x, we did not supply automated
compression. From ver.1.00, you may activate this function with
-P command. Resident part of DIET will try to compress the edited
file when Program terminates and frees its memory area.
3.Basic Functions of DIET.
==========================
There are 5 basic functions of DIET.exe,i.e.
To COMPRESS files: -I,-D,-V,-B -P options;
To DECOMPRESS compressed files: -R -RA options;
To make DIET terminate and stay resident: -Z,-ZA,-ZD, -ZR options; and
To list files or to test for compressed: -L -H -! options.
To copy files with compressed or decompressing: -c option.
Usage: DIET [options] [file_names].
Options: -L,-R,-RA,-Z,-ZA,-ZD,-P,-M,-B,-V, -D, -C, -O, -T, -I, -J, -H,
-A, -! and -K.
You may use '-' of '/' as the switch-character as you prefer.
To specify multiple of tion, please insert a space between them,
like
DIET -Z -P -M.
If you do not specify option, then the function is to compress.
Or if you don't specify any option nor file name, then diet
will display the help screen.
You may specify options -B, -V, -I, -J, and -A under the
environmental string DIETOPT. By typeing in these options
later on your command line, you may toggle their functions.
File_Names: You can't omit file name input except for -L option.
You can use wild cards and multiple filenames on the command
line.
Usage 1.
========
File Compression:
If none of the options -L,-R,-RA,-Z,-ZA,-ZD,-C,-H or -!
is specified, Diet compresses specified file(s).
COM/EXE files.
Files with extensions '.EXE' or '.COM' will be compressed with
a small header file added. The header will let the program extract
itself and let it execute. When -V option is specified, header will
not be attached. See the Overlay mode.
Executable files without COM/EXE extension.
There are files with extension not '.COM' nor '.EXE' but seems
to be executable files. DIET will skip compressing them without
-V or -I option. But with these options, DIET compresses them as
executables.
Device Drivers.
When a file starts with FF FF block, DIET will skip compressing.
These files can be compressed with -D option. If you use -D -I
options together, files starting not with FF FF can be compressed
as device drivers
Any other files.
DIET compresses files not described above as DATA files. DIET can
access these files when DIET stays resident on memory.
Different headers will be attached to compressed files
according to the extensions COM, EXE or SYS respectively.
DIET will skip any files already compressed by DIET. DIET skips
files with extension '.LZH'. DIET will skip small files less
than a cluster unless you specify -B option.
IMPORTANT NOTE. DIET will overwrite on the original files except
with -O or -C option. To save storage space DIET makes no backups
in principle. If you are not sure of the result, please take a
backup of the file(s). You will be assured of safety using DIET for
certain period, however.
Specifically, when you use other TSR programs, we strongly
recommend to take backup of files.
The dynamic Lempel-Ziv method adopted in the software may fail
to compress files compressed by other tools. The success or
failure in compression is determined by the number of clusters
a file needs for storage. If you use -B option, then success
depends on byte-count.
Usage 2. File Decompression.
============================
With -R or -RA option, DIET decompresses files
it had compressed. With '-R' option files with extensions
EXE/COM/SYS remain compressed and other files are restored.
Namely, this is to restore all the data files to the original.
With '-RA' option, you could restore all.
Usage 3. TSR On/Off.
====================
Option. '-Z' to load -ZR to remove from memory.
DIET -Z or -ZR
will announce either "stayed on memory' or "removed from memory".
When you compressed COMMAND.COM or when you compressed some
overlay files, you need DIET to be resident on, memory.
I recommend you to write a line "DIET -Z" in your autoexec.bat
file, when you use DIET frequently.
DIET uses 1 page from EMS (Lotus-Microsoft) if it finds one.
The size of the resident part is reduced by the EMM.sys utility.
After you type;
DIET -Z -P
you get the announce:
|Stayed on memory! (use EMS 1 page)
| auto recompress : on (with messages)
| temp. directory : D:\
DIET -ZR ---------------- remove resident part of DIET from memory.
IMPORTANT NOTE. This is not only for DIET.
If you use multiple TSR programs, be careful to unload
following the reverse order they were loaded.
Temporarily Enable/Disable TSR part of DIET.
DIET -ZD disables resident part of DIET without unloading.
DIET -ZA enables resident part of DIET without reloading.
The second command restores the resident DIET when an
interrupt was received from keyboard or from any other device's.
Remember this switch, when you pressed Ctrl-C or Ctrl-Break
while DIET had been acting.
Automated re-Compress Facilities.
DIET -P-------------enable automated recompress.
DIET -P -M ---------enable automated recompress without message.
DIET -TD:\ ---------temporary files generated on D:\.
You may specify the same by
"set TMP=D:\"
in your autoexec.bat.
Files retrieved by the DIET's resident part,
files opened by Write-Open or RW-open modes and
files overwritten on the old file by file-creation
can be re-compressed. You may need to know by making tests.
This function is activated when dos-call INT4C is called.
This is when the program terminates. I don't want to interrupt
any program for the compression, nor I don't want to make the
resident part of DIET larger than the present. These are the
reasons for the limited facility of the present design.
Usage 4 -L-H,-! Options.
=======================
[LIST files compressed with DIET,-L option.]
DIET -L
will list files compressed with DIET. You may skip wild card
for the option.
[Check Files Compressed by DIET,-H option.]
DIET -H <file_name >.
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<destination> <filenames>
When you store compressed files of Floppy disks, and use them
on a RAMDISK, you may use this method to restore files compressed.
<Example 1.> To copy all the files on the current directory c:\
to Floppy Disk A:
DIET -CA:\ C:\*.*
~~~~~~~~~~~~~~~~~~~
(2) DIET -RA -C<destination> <filenames>.
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).
<Example 2.> 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.
<Example 1>. 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.
<Example 2>. 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.
<Example 3>. 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=============================