home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
packer
/
zip4
/
zip4.doc
< prev
next >
Wrap
Text File
|
1993-11-26
|
22KB
|
538 lines
ZIP4 Manual
November 14, 1993
Welcome to ZIP4 2.04a...
So many people work on more than one computer nowadays. Moving files between
them is common. One of the best programs for this task is PKZIP. Not only
does it compress files to a fraction of their original size, it is an
excellent archiver as well. The only problem for 4DOS users is that PKZIP
doesn't include file descriptions. ZIP4 automatically includes descriptions
in the PKZIP comment field. UNZIP4 automatically describes unzipped files.
UNZIP4 has an easy to use backup feature that protects unzipped files before
they are overwritten. There's a companion "difference" 4DOS batch file to
see differences between the backed up file and the one that overwrote it.
If you know how to use PKZIP then you know how to use ZIP4. ZIP4 is a command
line replacement for PKZIP. No learning curve! Just type ZIP4 instead of
PKZIP. Commands, syntax, switches, etc., are identical.
----------------------------------------------------------------------------
Contents
ZIP4.EXE Zips files and descriptions
UNZIP4.EXE Unzips files and descriptions zipped by ZIP4
ZIP4DESC.EXE Add DESCRIPT.BTM to a zip file
ZIP4.DOC This file
ZIP4R.BTM Recursive zip + hid, sys, r/o
UNZIP4D.BTM Unzips files, subdirs + hid, sys, r/o
DIFZIP4.BTM Shows differences between a file and its backup in %ZIP4BAK\
CFGZIP4A.BTM Toggles NORMAL and ALTERNATE configurations using aliases
CFGZIP4R.444 Toggles NORMAL and ALTERNATE configurations by renaming files
DESCRIPT.BTM A self deleting batch file to describe these files
This program is free but copyrighted. All rights reserved. You may freely
distribute these files for a reasonable fee. No fee may be charged for the
software. Please distribute all of the original, unmodified files in an
archive created by ZIP4, with DESCRIPT.BTM added by ZIP4DESC.
Other programs mentioned in this file are not free. This program requires the
use of some of those programs, and you are expected to pay for them.
The usual disclaimers apply. Use this program at your own risk. I cannot be
liable for any damage whatsoever this program may cause.
"4DOS" is a registered trademark of JP Software, Inc.
"PKZIP" and "PKUNZIP" are registered trademarks of PKWARE, Inc.
"WinZip" is a registered trademark of Nico Mak.
"4FILES" is Shareware by Larry T. Edwards, Copyright 1990-93
----------------------------------------------------------------------------
Manual
This manual will often refer to ZIP4 and UNZIP4 collectively as ZIP4. If the
context warrants they will be mentioned separately. The same is true for
PKZIP and PKUNZIP.
----------------------------------------------------------------------------
Installation
These files should be installed in a directory in your path. Use PKUNZIP
2.04g to unzip the files. If you are able to read this it is likely that
version 2.04g has been used to unzip these files. Type DESCRIPT to
automatically describe these files.
You must have PKZIP in your path. Your command processor must be 4DOS to run
the batch (.BTM) files. If you have 4DOS aliases for PKZIP you should create
similar ones for ZIP4.
----------------------------------------------------------------------------
ZIP4 Files
The names of all files in this package include the characters "ZIP4". This
should make it easier to use 4DOS commands like MOVE, COPY, etc. For example,
move *zip4*.* newdir
moves all files from this package to NEWDIR. Before updating to this version
you should delete all files from previous versions.
----------------------------------------------------------------------------
Syntax
Simply substitute "ZIP4" where you currently use "PKZIP". Substitute "UNZIP4"
where you currently use "PKUNZIP". The argument syntax, switches and
functionality are exactly the same. The only difference is that 4DOS
descriptions are managed transparently.
Even under 4DOS, PKZIP has a line length limit of 127 characters. Through
intelligent application of PKZIP and 4DOS resources, ZIP4 extends that limit
to 255 characters when used with 4DOS.
----------------------------------------------------------------------------
Usage
zip4 zipfile [PKZIP text]
"PKZIP text" is passed unchanged to PKZIP for interpretation. Please refer to
the PKZIP manual or PKZIP online help. To get PKZIP online help simply type
PKZIP or ZIP4. You may include any options that PKZIP supports. You may
specify files to include or exclude as PKZIP allows. ZIP4 expects to find
file descriptions in the same directory as the files. ZIP4 always excludes
DESCRIPT.ION from ZIPFILE.
unzip4 zipfile [PKUNZIP text]
"PKUNZIP text" is passed unchanged to PKUNZIP for interpretation. To get
PKUNZIP help simply type PKUNZIP or UNZIP4. You may include any options that
PKUNZIP supports. You may specify files to include or exclude as PKUNZIP
allows. Note: UNZIP4 always excludes DESCRIPT.BTM.
zip4desc zipfile
The file, DESCRIPT.BTM, is added to the already existing ZIPFILE.
DESCRIPT.BTM contains DESCRIBE statements for all files in the archive. It is
useful for distributing zip files to 4DOS users that don't yet have ZIP4.
DESCRIPT.BTM will not be unzipped by UNZIP4. You must use PKUNZIP to extract
it.
difzip4 filename [zipfile [fcarg1 fcarg2 ...]]
This command shows differences between the file FILENAME in the current
directory and FILENAME in zip file %ZIP4BAK\ZIPFILE. The second argument,
ZIPFILE, is optional. If not present DIFZIP4 will search all zip files in
%ZIP4BAK until it finds FILENAME. If present, either %ZIP4BAK\ZIPFILE or
ZIPFILE is acceptable. The remaining arguments, FCARGs, are passed to FC.EXE.
See "Automatic File Backup".
----------------------------------------------------------------------------
Automatic File Backup
UNZIP4 can automatically protect files from accidental overwrites when you
unzip. The files are saved in a compressed zip file in the directory of your
choice. In addition, there's a companion batch file, DIFZIP4, that displays
differences between the new file and the overwritten one. Over time, you will
appreciate the safety and convenience of these features.
If you unzip a file that already exists PKUNZIP will ask for verification
before overwriting the existing file. When you unzip with freshen (-f), newer
(-n), or overwrite (-o) switches PKUNZIP will overwrite files without asking.
UNZIP4's backup feature automatically protects these files.
In order to activate UNZIP4's backup feature you must create a directory to
store the backup zip files. By default, UNZIP4 will use the directory
"\ZIP4BAK" if it exists. If you would rather use a different directory you
must set the environment variable, ZIP4BAK, to the directory path. For
example,
set zip4bak=c:\trash
or
set zip4bak=\trash
or
set zip4bak=trash
If the backup directory defined by %ZIP4BAK or the default, "\ZIP4BAK",
doesn't exist then UNZIP4 will not create backup zip files.
If %ZIP4BAK specifies a drive and a directory path (e.g. c:\trash) then
backup zip files will go to that drive and path no matter what the
destination drive and directory are. If it specifies an absolute directory
path without a drive (e.g. \trash) then backup zip files will go to that
directory on the destination drive. If it specifies a relative directory
path (e.g. trash) then backup zip files will go to that subdirectory path off
of the destination directory. The destination directory is normally the
current directory where you entered the UNZIP4 command. PKUNZIP recognizes a
file name that ends in a "\" as the destination directory. See "Examples".
Files will be zipped in the %ZIP4BAK directory in a zip file using the same
name as the zip file being unzipped. Files are "updated" in that zip file.
That is, a file in the zip file will be replaced only if it's older than the
file about to be overwritten.
UNZIP4's backup feature creates two additional files in the %ZIP4BAK
directory. They use the same name as the zip file except that the extension
is ".UZ4" and ".OVW". The .UZ4 file is a list of all of the files that were
unzipped. The .OVW file is a list of all files that were overwritten. Often,
these files will be the same. You can simply check these files to see which
files were unzipped and overwritten. Or, you can use them as listfiles in
4DOS batch file programs (hint, hint).
The batch file, DIFZIP4.BTM, is included. This program finds the differences
between the file in the current directory and one with the same name in a zip
file in the %ZIP4BAK directory. This program is very useful if you work on
the same file on more than one machine. DIFZIP4 uses FC.EXE to compare files,
which is distributed with DOS 5 and perhaps other versions. FC can compare
either text or binary files. You have to supply a command line switch or
modify DIFZIP4 to compare binary files. It should be easy for someone
experienced in batch file programming to substitute their own favorite file
compare program for FC.
You will want to periodically clean up your "trash" directory. The following
alias is useful:
alias `purge=iff .%1==. then^select del (%zip4bak\*.*) ^else ^ del %zip4bak\%1`
See "Usage".
----------------------------------------------------------------------------
Examples
These examples show some typical uses of ZIP4 and UNZIP4. The examples could
be used with PKZIP and PKUNZIP as well. When you use ZIP4 and UNZIP4 your
4DOS descriptions are included automatically.
zip4 zipfile
This command zips up all of the files in the current directory into ZIPFILE.
unzip4 zipfile
This command unzips all of the files in ZIPFILE to the current directory. It
ignores paths stored in ZIPFILE, if any.
unzip4 zipfile d:dest\direct\
This command unzips all of the files in ZIPFILE to d:\dest\direct - not to
the current directory.
unzip4 zipfile -f
Only files from ZIPFILE that are newer than those in the current directory
will be unzipped. The files in the current directory will be overwritten. If
the directory %ZIP4BAK exists, UNZIP4's automatic backup feature will be
activated. The files will be zipped into %ZIP4BAK\ZIPFILE before they are
overwritten if \ZIP4BAK or %ZIP4BAK directories exist. The file,
%ZIP4BAK\ZIPFILE.UZ4 will contain a list of the files unzipped.
If "-n" is used instead of "-f", newer files and files that exist in ZIPFILE
but not in the current directory will be unzipped. Obviously, only files that
exist in the current directory can be backed up.
unzip4 zipfile d:\dest\direct\ -f
This is the same as the previous example, except that the destination
directory is D:\DEST\DIRECT rather than the current directory.
zip4 zipfile -rP -ex -Jhsr -whs
This command zips up all of the files including hidden, system, and read only
files in the current directory and subdirectories into ZIPFILE. File
attributes are stored in ZIPFILE. Maximum compression is used. This command
is useful for copying directories and subdirectories to floppies.
zip4r zipfile
ZIP4R is a batch file that calls ZIP4 with the switches from the previous
example. It is included for your convenience. Here's what it looks like:
call zip4 %& -rP -ex -Jhsr -whs
unzip4 -d -Jhsr zipfile
This command unzips all of the files and directories from ZIPFILE. If the
directories don't exist they are created. Unzipped file attributes are
preserved.
unzip4d zipfile
UNZIP4D is a batch file that calls UNZIP4 with the switches from the previous
example. It is included for your convenience. Basically, it unzips what was
zipped by ZIP4R. That is, it unzips files exactly as they were zipped. Here's
what it looks like:
call unzip4 %& -d -Jhsr
You might want to set the 4DOS's executable extension for .ZIP files to
UNZIP4D. Then all you have to do to unzip a file is type its name with or
without the .ZIP extension, switches, include or exclude files. Put this in
your AUTOEXEC.BAT:
set .zip=unzip4d
----------------------------------------------------------------------------
Multi-tasking
ZIP4 uses temporary files. These files are given unique names so that
multi-tasking in 4DOS shells under Windows is not a problem. However, you
should be careful not to start two or more ZIP4 processes in the same
directory at the same time. Doing so could cause loss of descriptions. Or,
ZIP4 may hang up waiting for a Ctrl-C or a Ctrl-Break to be typed.
The temporary files usually have an extension of ".AAA", ".AAB", etc. If ZIP4
fails to complete normally they may not be deleted. You will have to do so
manually.
----------------------------------------------------------------------------
Configuring ZIP4 for WinZip
WinZip is a popular Windows program for PKZIP files, as well as other
compression/archive file formats. PKZIP is a DOS program. Windows programs
must call DOS programs by starting a secondary command processor. In our case
this will be 4DOS. We need to configure WinZip to call ZIP4 instead of PKZIP.
WinZip runs the program listed in the WinZip menu "Options" dialog box
"WinZip Program Locations". The program locations we are interested in are
"PKZIP" and "PKUNZIP". Unfortunately, we cannot simply change these to "ZIP4"
and "UNZIP4". WinZip must have PKZIP or PKUNZIP as a filename. The extension,
however, doesn't have to be EXE. We could, for example, use put PKZIP.BTM in
the "PKZIP" entry field. And, since WinZip will use 4DOS to start PKZIP, we
can alias whatever we decide to put in the fields to ZIP4.
So we have two choices. Put batch file names in the PKZIP program locations.
Here's sample batch files for PKZIP.BTM and PKUNZIP.BTM:
PKZIP.BTM ==> call zip4r %&
PKUNZIP.BTM ==> call unzip4d %&
Or we can put PKZIP.EXE in the program locations and alias PKZIP.EXE and
PKUNZIP.EXE:
alias pkzip.exe=zip4r.btm
alias pkunzip.exe=unzip4d.btm
Note that I have used the batch files ZIP4R and UNZIP4D to allow
subdirectories and hidden, system, and readonly files (see the examples).
This is only a suggestion. You can tailor these for your own purpose.
One final step is required to complete the WinZip configuration. You must
configure WinZip to NOT use internal unzipping. In WinZip, choose
"Options|Configure". In the dialog box, make sure that "Use Internal Zipping
When Possible" is not X'ed.
Note that 4START.BTM, if it exists, will execute each time WinZip runs a zip
or an unzip. That is because it starts another copy of 4DOS. See your 4DOS
documentation.
----------------------------------------------------------------------------
Alternate Configurations
After installation, ZIP4 is in the "NORMAL" configuration. With 4DOS, you can
create aliases so that commands referencing PKZIP will run ZIP4 instead.
We'll call that the "ALIASED" configuration. CFGZIP4A.BTM, included in this
package, will toggle these aliases on or off. Run CFGZIP4A to switch between
the NORMAL and ALIASED configurations. This is a simple file that you may
want to personalize.
There are some programs that call PKZIP, such as ZIP4! In this case, aliases
do not work. Some of these programs allow you to specify the file name you
use to run PKZIP. If so, select ZIP4. Otherwise, there may be no other
solution than to rename PKZIP to another name, such as PKZIP4, and copy ZIP4
to PKZIP. The file, CFGZIP4R.444, a 4DOS batch file, does just that. It
is included here with the extension ".444". If you want to use it you will
have to rename it using the appropriate executable extension for this type of
file. This is sort of a computer literacy test. If you don't know how to do
it then you shouldn't be using CFGZIP4R! We will call this the "RENAMED"
configuration. In the RENAMED configuration files are renamed as follows:
PKZIP.EXE ==> PKZIP4.EXE
PKUNZIP.EXE ==> PKUNZIP4.EXE
Files are copied as follows:
ZIP4.EXE ==> PKZIP.EXE
UNZIP4.EXE ==> PKUNZIP.EXE
In the RENAMED configuration, typing PKZIP is equivalent to typing ZIP4.
Either name may be used. If you want to run PKZIP then you must type
PKZIP4.
You should make sure that PKZIP appears in your path only once. To be safe,
you should backup PKZIP and PKUNZIP before using CFGZIP4R for the first
time.
----------------------------------------------------------------------------
Caveats
PKZIP has the ability to select files to replace those in an already EXISTING
zip file based on date and time. Descriptions have no date or time. That is,
if you update the description of a file, the date of the file will not
change. Be careful when you zip with update, "-u", or freshen, "-f" switches.
Descriptions go into the file only if the FILE is newer than the one in the
zip file when you use these flags. ZIP4 has no way to tell if the file's
description is newer than the one in the zip file. You may want to write an
alias or batch file to change a file's date whenever it is DESCRIBEd. I use
an alias that I call COM (comment) which requires a popular program called
TOUCH. It goes like this:
alias `com=*describe %&^touch %&`
----------------------------------------------------------------------------
DESCRIPT.ION vs Zip File Comments
Q. Why does ZIP4 put descriptions in zip file comments rather than simply
include the hidden file DESCRIPT.ION?
A. If the target directory has a different set of files than the source
directory or different descriptions, there are problems maintaining the
integrity of the descriptions. If you zip some, but not all files from a
directory, the descriptions for _all_ files will be included in DESCRIPT.ION.
This DESCRIPT.ION file will overwrite the one in the target directory when
you unzip. You might not want to do that.
Similarly, when you unzip some, but not all files from the zip file you might
not unzip DESCRIPT.ION. The descriptions for the files you just unzipped
would be lost.
----------------------------------------------------------------------------
DESCRIPT.ION Hidden Attribute
UNZIP4 will create a hidden DESCRIPT.ION file if it does not already exist in
the destination directory. If it already does exist, its visible/hidden
attribute will not be altered. That is, if DESCRIPT.ION is visible, it will
remain visible. If hidden, it will remain hidden.
----------------------------------------------------------------------------
Trouble Shooting
UNZIP4 will say "Describing files:" even if there are no comments in the zip
file. When files with non-blank descriptions are unzipped UNZIP4 will print a
"." for each one. You will see a line like this:
Describing files:........................
If you unzip files and you don't get the proper descriptions you can view the
comments in the zip file directly like this:
pkzip zipfile -vbc
If all comments are blank then the problem lies with ZIP4, not UNZIP4. Please
not that PKZIP has a bug. Contrary to the PKZIP manual, it does _not_ allow
you to override settings made in the PKZIP.CFG file from the command line.
It's best to not use the view settings in PKZIP.CFG for that reason.
When ZIP4 prints "Writing descriptions:", it prints a "." for each file it
encounters whether it has a blank description or not.
----------------------------------------------------------------------------
Questions?
Send your questions to the CompuServe cMail if possible. My address is listed
in the ZIP4 banner. I will try to visit the JP Software forum on CompuServe
on a regular basis as well. You can also reach me on the Internet.
You are encouraged to comment, suggest, compliment, or what have you <grin>.
----------------------------------------------------------------------------
History
ZIP4 2.04b 11-27-93
Maintenance release.
ZIP4 2.04a 11-14-93
Fixed bug with PKZIP.CFG files. Actually, it was a PKZIP bug that causes
UNZIP4 to not recognize comments in the zip file.
Modified search algorithm. It bogged down when the number of files in the zip
file was very large (> 500). Was an UNZIP4 problem.
Program output can be redirected or piped.
Runs on 286 machines.
Numerous other tiny bugs fixed.
ZIP4 2.03 10-3-93
The first compiled "C" language version. 4DOS batch language is a great
prototype tool. But ZIP4 needs more speed.
Syntax, switches, etc. are exactly the same as PKZIP.
Fixed problem with insufficient memory in very large zips, e.g., hard disk
backups. Blank comments in the zip file clear descriptions of unzipped
files.
DESCRIPT.BTM is no longer added to the zip file automatically. A new program,
ZIP4DESC does that to an existing zip file.
ZIP4 Beta 2 9-12-93
Second beta version.
Syntax restrictions relaxed. Syntax is identical to PKZIP 2.04g (except for
PKUNZIP -e[...]).
Descriptions placed in PKZIP comment field to avoid problems with description
integrity.
ZIP4 Beta 1 9-2-93
First beta version.
Thank you beta testers. Especially Scott Abbott, Jim Morris, and Rick Patten.
----------------------------------------------------------------------------
Enjoy!
Mick Ghazey
CompuServe: 70550,1762
Internet: ghazey@gvg49.gvg.tek.com