home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
UTILITY
/
ZZAP62B.ZIP
/
ZZAP.DOC
< prev
next >
Wrap
Text File
|
1991-01-04
|
79KB
|
3,618 lines
█████████ █████████ ███ ███████
░░░░░██░░ ░░░░░██░░ ██░██░ ██░░░░██░
██░░ ██░░ ██░ ██░ ██░ ██░
██░░ ██░░ ██░ ██░ ██░ ██░░
██░░ ██░░ █████████░ ███████░░
██░░ ██░░ ██░░░░░██░ ██░░░░░░
██░░ ██░░ ██░ ██░ ██░
█████████ █████████ ██░ ██░ ██░
░░░░░░░░░ ░░░░░░░░░ ░░ ░░ ░░
Version 6.2
ZIP/ZOO/ARC/PAK Converter
(And More!)
Copyright (c) 1989
Ross Neilson Wentworth
All Rights Reserved
Contents
Chapter 1 License Agreement 1
Chapter 2 Summary of Features 3
Chapter 3 Running ZZAP 5
Chapter 4 Archive Programs Supported 7
Chapter 5 Configuration File 9
5.1 ARC= . . . . . . . . . . . . . . . . . . . . 9
5.2 UNARC= . . . . . . . . . . . . . . . . . . 10
5.3 DEFAULT= . . . . . . . . . . . . . . . . . 11
5.4 BADDIR= . . . . . . . . . . . . . . . . . . 12
5.5 SWITCH= . . . . . . . . . . . . . . . . . . 12
5.6 FIXER= . . . . . . . . . . . . . . . . . . 12
5.7 AGE= . . . . . . . . . . . . . . . . . . . 13
5.8 PRE= . . . . . . . . . . . . . . . . . . . 13
5.9 MID= . . . . . . . . . . . . . . . . . . . 14
5.10 POST= . . . . . . . . . . . . . . . . . . 14
5.11 SCANOPT= . . . . . . . . . . . . . . . . . 15
Chapter 6 Logging ZZAP Activity 17
Chapter 7 Executing Compsec 19
Chapter 8 Command Line Options 21
8.1 Flag Odd Attributes - /A . . . . . . . . . 21
8.2 Allow subdirectories - B . . . . . . . . . 22
8.3 Call Update Program - /C . . . . . . . . . 23
8.4 File Date Stamping - /D . . . . . . . . . . 23
8.5 Target Extension - /E . . . . . . . . . . . 23
8.6 File List - /F . . . . . . . . . . . . . . 24
8.7 Ignore File Age - /I . . . . . . . . . . . 24
8.8 Keeping The Original - /K . . . . . . . . . 25
8.9 Convert Nested - /N . . . . . . . . . . . . 25
8.10 Prevent Overwriting - /P . . . . . . . . . 25
8.11 Subdirectory Recursion - /R . . . . . . . 25
8.12 Strip Attributes - /S . . . . . . . . . . 26
8.13 Test Only - /T . . . . . . . . . . . . . . 26
8.14 Virus Scan - /V . . . . . . . . . . . . . 26
8.15 Expanded/Extended Memory - /X . . . . . . 27
8.16 Enable/Disable I/O Redirection - /Z . . . 27
Chapter 9 Locating The Configuration File 29
Chapter 10 Running ZZAP 31
i
Chapter 11 Nested Archives 33
Chapter 12 When Good Files Go Bad 35
Chapter 13 External Event Conversion 37
Appendix A Exit Codes 39
Appendix B Acknowledgments 41
Appendix C My Lawyer Made Me Do It 43
Appendix D Version History 45
Index 53
ii
Chapter One
License Agreement
In the past I have not requested money to use ZZAP unless it was
used in a commercial environment. However, due to its increased
popularity with the resultant increase in phone calls with
questions, I am forced to change my licensing policy. This new
policy supersedes all previous agreements for the licensing of
ZZAP.
You may use ZZAP on a trial basis for up to 30 days freely. You
may give it away to anyone you wish so long as you do not charge
for it or use it as an incentive to buy. If, after the 30 day
trial period, you wish to continue to use ZZAP, a registration
fee of $15 is required (plus $5.00 for a printed manual). Please
let me know what version you currently have so that I can be sure
to send you an update (when available).
Payment should be by check or money in U.S. funds drawn on a U.S.
bank. I can not be responsible for cash that is sent through the
mail. Printing the file "ORDER.FRM" will produce an order form
that you can use to register ZZAP. Send your registration and/or
inquiry to:
Ross Neilson Wentworth
1422 Elkgrove Circle, #3
Venice, CA 90291
(213)399-1244
The latest version of ZZAP can be found on West Los Angeles BBS,
(213)838-9229 or The Software Resource (1:102/330) at
(213)214-2018.
Even if you do not wish to register I would appreciate hearing
from you. A simple postcard listing your likes, dislikes,
suggestions, and the version number is all that I ask.
The terms "arc", "archive", "unarc", etc. are used throughout
this document. They are considered generic terms for all
archiving types and formats. Any declaration that any of these
terms are proprietary will be construed as a ridiculous statement
and be properly ignored.
Page 2 Chapter 1. License Agreement
Chapter Two
Summary of Features
o Automated conversion between the most common archive types
(ARC, DWC, ICE, LBR, LZH, MD, PAK, SDN, ZIP, and ZOO).
o Automatically converts nested archives including nested
archives of different types. A switch is provided to
disable this feature.
o Optionally convert archives in multiple subdirectories
(subdirectory recursion).
o Accepts wild-card designations and multiple file names on
the command line.
o Repack archives to same type.
o Renames or moves corrupted archive for later examination.
o User defined arcing and unarcing options.
o Deletes old archives by default, options to keep them.
o Optional logging of ZZAP activities to a text file.
o Optionally create a text file listing the archives
converted, suitable for use by filter programs to update
the file list as used by BBS programs.
o Flag archives containing files with Hidden, System, or
ReadOnly attributes as "bad" or optionally strip the funny
attributes.
o Can automatically check an archive for viruses using the
virus scanning program SCAN.EXE (version 39 or later) from
McAfee Associates.
o The standard input of programs that are executed can be
redirected from a file to allow the automatic addition of
an archive comment (currently this only works with ZIP
files, I think).
o Can take advantage of expanded memory (LIM 4.0 driver
required) or extended memory (XMS driver required) to
reduce the memory overhead while executing the archiving
programs.
o Processing can be skipped on archives that are more than a
configurable number of days old.
o External programs can be defined to be executed before
and/or after each archive is processed.
o Configurable for additional archiving programs.
Chapter 2. Summary of Features Page 3
Page 4 Chapter 2. Summary of Features
Chapter Three
Running ZZAP
The basic syntax of ZZAP is:
ZZAP [switches] filespec [filespec ...]
Where [options] is any of the optional command line switches and
filespec is a file name, wilcard specification, or the name of a
file indicating a list of files. A "list" file is signified by
preceding the file name with the '@' character, for example:
ZZAP @newfiles.lst
You can mix filespecs on the command line, giving a combination
of specific file names, wildcards, and list files; limited only
by the length of the command line (80 characters):
ZZAP AFILE.ZOO *.LZH @UPLOADS.LST
Every attempt has been made to supply a universally acceptable
configuration file (ZZAP.CFG). Everybody, of course, has
personal preferences so you may wish to modify it for your
special needs. Consult the chapter on the configuration file for
information on customizing ZZAP operations.
If you wish to log the activity of ZZAP you need to specify the
full path and file name of the log file. See the chapter Logging
ZZAP Activity for details.
Chapter 3. Running ZZAP Page 5
Page 6 Chapter 3. Running ZZAP
Chapter Four
Archive Programs Supported
Currently, there are a multitude of mostly incompatible archiving
utilities available. While a standard would be beneficial to the
BBS community, it's not likely to occur in the near future.
To help cope with the different formats and to make conversion
from one to another easy I wrote ZZAP. It allows conversion from
one format to another, quickly and painlessly. ZZAP doesn't
actually do any conversion on its own. Rather, it acts as a
shell around the archivers - automating the process.
The archive programs and version numbers tested under are:
DWC A4.95
ICE 1.14
LHARC 1.13
LUE 2.20 (extraction only)
MD (unknown version number - tested by user)
PAK 2.0
PKPAK/PKUNPAK 3.61 (a.k.a. PKARC/PKXARC)
PKZIP/PKUNZIP 1.10
ZOO 2.01
Other formats should work if properly configured but there is no
guarantee. If you run across an archiving program that does not
work under ZZAP I would like to hear about it so I can make the
necessary modifications.
Chapter 4. Archive Programs Supported Page 7
Page 8 Chapter 4. Archive Programs Supported
Chapter Five
Configuration File
ZZAP relies on a configuration file (ZZAP.CFG) to know how to arc
and unarc. There are a number commands allowed in the
configuration file, three of them are required (ARC=, UNARC=, and
DEFAULT=) and the rest are optional (BADDIR=, SWITCH=, FIXER=,
AGE=, PRE=, MID=, POST=, and SCANOPT=). The order of the
commands are unimportant.
Each command is on its own line. Placing multiple commands on a
single line will result in improper operation. A configuration
file is included with this package that may be uses "as-is" or
may be modified for your personal preferences.
5.1 ARC=
ARC= defines the command used to archive. This command can
appear as many times as required to define all of the various
archive types you may use. The syntax for this command is:
ARC=EXT PROGNAME OPTIONS
EXT represents the filename extension used by this particular
archiver, PKZIP, for example, uses ZIP. Do NOT include a leading
period.
PROGNAME is the name of the actual archiving program. If the
filename extension is not given the a search will be made for
both COM and EXE. Including the extension will improve the
performance of ZZAP.
OPTIONS is the command line options used to create an archive.
ZOO, for example, uses "-ADD" while PKPAK uses "-A". Since some
archiving programs use both upper and lower case letters to
represent different actions, this item's case is left intact.
OPTIONS also may include the "%1" to indicate where the archive
files name should be placed on the command line. In previous
version the archive name was appended to the end of the command
line if the %1 was omitted. This is no longer true, now you MUST
specify the %1 if you wish the archive name on the command line.
If you wish to redirect the standard input or output of the
archiving program then put the redirection command at the end of
OPTIONS. ZZAP allows three types of redirection: > redirects the
output, < redirects the input, and >> appends redirection to the
indicated file.
Chapter 5. Configuration File Page 9
The following are all legal ARC= commands:
ARC=ARC PKPAK -A %1 *.*
ARC=DWC DWC.EXE AZ %1 *.*
ARC=PAK PAK A %1 *.*
ARC=LZH LHARC.EXE a %1 *.*
ARC=ZIP PKZIP -A -EX
ARC=ZOO ZOO.EXE -ADD %1 * >NUL
ARC=ZIP PKZIP.EXE -a -z %1 *.* >NUL <HEADER.ANS
The last two examples have their display output redirected to the
NUL device, resulting in the normal output to not be displayed.
The last example has its standard input redirected from the file
"HEADER.ANS". THE -z option of PKZIP is the add archive comment
command. The contents of the file will be used as the archive
comment.
Note that if there is an error when attempting to open a file for
redirection a second attempt will be made to redirect using the
NUL device. This is so that PKZIP (and possibly other programs)
won't sit and wait for input from the keyboard.
See also COMSPEC.
5.2 UNARC=
The next command is UNARC=. This is the commands to unarc the
various types of archives. This command can appear as many times
as necessary to define all the archive types you may use. The
syntax for this command is:
UNARC=EXT PROGNAME OPTIONS
EXT is the extension used by this type of archive.
PROGNAME is the name of the program used to extract files in the
archive.
OPTIONS is the command line options used to extract files from
the archive. As with the ARC command, "%1" may also be included
to indicate the position of the archive file name.
If you wish the display output of the unarcing program to be
redirected you should list the redirection command last.
For unarcing to work with ZZAP it MUST extract all files in an
archive if a filename is not given after the archive name.
Page 10 Chapter 5. Configuration File
The following are all legal UNARC commands:
UNARC=ARC PKXARC.EXE
UNARC=DWC DWC E %1 *.*
UNARC=LZH LHARC.EXE e
UNARC=PAK PAK E %1 *.*
UNARC=ZIP PKUNZIP.EXE %1 >NUL
UNARC=ZOO ZOO -EXTRACT %1 >NUL
The last two examples have their display output redirected to the
NUL device.
Subdirectories
It is recommended that you turn on creation of subdirectories if
the archive format supports storing subdirectories along with
file names. This is to allow ZZAP to detect the subdirectories
and treat the archive as BAD. If the unarc program allows all
files to be placed in a single subdirectory a file name conflict
can arise, resulting in the unarc program stopping and waiting
for keyboard input to verify a file overwrite. This could
potentially stop your computer dead, leaving the BBS system off-
line until manually continued.
The unarc program MUST allow the subdirectories created to be
children of the temporary subdirectory.
UNARC=ZIP PKUNZIP.EXE -d %1 >NUL
This example causes PKUNZIP to create subdirectories if the
information is stored with the file names. ZZAP will detect the
creation of any subdirectories, log the error message, move the
archive to the BAD subdirectory, and clean up (remove all files
and subdirectories extracted from the archive).
If the unarc program creates the subdirectores anyplace besides
in the temporary subdirectory ZZAP will not be able to detect
them, the contents of the new archive will be incomplete, and the
subdirectories created will remain on your disk.
See also COMSPEC.
5.3 DEFAULT=
This is the default extension used to decide which archiving
format to convert to. The extension given must match one of the
extensions given with the ARC= command. If a match is not found
the program will halt with an error. The syntax for this command
is:
DEFAULT=ext
where ext is the file extension corresponding to an archive type.
Chapter 5. Configuration File Page 11
The following are legal DEFAULT commands:
DEFAULT=ZIP
DEFAULT=ZOO
DEFAULT=.ARC
Note that the preceding period is optional.
You can override DEFAULT= with the command line switch /E.
5.4 BADDIR=
Whenever an archive fails to unarc properly or fails the virus
check it will be renamed to so the second character of the
extension is "!", e.g. "Z!P". By default the file is kept in its
original subdirectory. If you wish bad archives to be placed in
a special subdirectory you may use the BADDIR= command. Simply
name the subdirectory you wish to use. This subdirectory must
already exist for this option to work properly. Example:
BADDIR=C:\BAD
The defined subdirectory can be on a different drive but if the
file move is unsuccessful the file will simply be renamed to have
the normal bad extension (the default mode).
5.5 SWITCH=
Use this to specify your default command line switches. For
example, if you always use the virus checking options you can
place this in your configuration file:
SWITCH=/V+
You can always override the options on the command line:
ZZAP /V- file.ext
The command line always takes precedence over the configuration
file.
5.6 FIXER=
Specify the name of your BBS download list fix-up program and
command line options with this command. For example, if you are
running a QuickBBS bulletin board system you can specify
FIXER=QFIX.EXE (included in this package).
Page 12 Chapter 5. Configuration File
Include any command line options needed immediately after the
fix-up program name. For example, to automatically update the
4DOS description file the proper syntax would be:
FIXER=QFIX.EXE DESCRIPT.ION
This command is only needed if you plan on using the /C command
line switch.
See also COMSPEC.
5.7 AGE=
If this command is used then only files that are within the
specified number of days old will be processed. For example,
setting the age to 1 (AGE=1) will result in only files that are
one day old (files with today's date ONLY) to be processed by
ZZAP.
Sysops who have an "event" at midnight will generally wish to set
AGE= to 2, allowing files from today and yesterday to be
processed. When using this feature you should use the /DO
command line switch (keep original dates of files). Assuming you
stamped the files with the date they are uploaded, this would
guarantee that only new archives are processed.
Omitting this command or setting AGE=0 results in the age of a
file to be completely ignored.
See also the /I command line switch.
5.8 PRE=
If you wish an external program executed to process an archive
before its files are extracted declare the program name and
command line options with this command.
PRE=GETCMTS.EXE %1
With the above example the hypothetical program GETCMTS.EXE will
be execute with the archive name passed as the command line
parameter. The specified program will be executed while in the
same subdirectory as the archive being processed (regardless of
the command line parameters).
This program, as well as programs defined by MID= and POST= will
be executed for nested archives as well. You should avoid
creating files in the temporary subdirectories ("Z.I_P" is
created as a child of the subdirectory holding the archive being
Chapter 5. Configuration File Page 13
processed) as these files will be added to the new archive
(unless that is what you wish done).
While testing ZZAP I often use a "PRE=MAPMEM.EXE >\MAP" to get a
memory map of the system while shelling to an external program.
This helps me to optimize memory usage so that the maximum amount
is available.
See also MID=, POST=, and COMSPEC.
5.9 MID=
If you wish an external program executed after files have been
extracted from the old archive but before the new archive has
been created declare the program name and command line options
with this command.
MID=DOTHIS.EXE
With the above example the hypothetical program DOTHIS.EXE will
be executed without any command line options. The specified
program will be executed while in the temporary subdirectory ZZAP
creates to hold the extracted files.
See also PRE=, POST=, and COMSPEC.
5.10 POST=
If you wish an external program executed to process the new
archive after it as been created (or repacked) declare the
program name and command line options with this command.
POST=PUTCMTS.EXE %1
With the above example the hypothetical program PUTCMTS.EXE will
be executed with the archive name (the new name) as the command
line parameter. The specified program will be executed while in
the same subdirectory as the archive being processed (regardless
of the command line parameters).
The main intent of the PRE= and POST= commands is to allow third
party programmers to create programs that extract archive
comments from the original archives and then put them into the
new archives. Since these are format specific I didn't want to
program these types of operations into ZZAP.
See also PRE=, MID=, and COMSPEC.
Page 14 Chapter 5. Configuration File
5.11 SCANOPT=
Place, after this command, any command line options you wish
passed on to SCAN.EXE when it is executed. The given options
will be added after the subdirectory to scan exactly as shown in
the configuration file. For example, if you have this in the
configuration file:
SCANOPT=/A /NOMEM
SCAN will be executed as:
SCAN pathname /A /NOMEM
Chapter 5. Configuration File Page 15
Page 16 Chapter 5. Configuration File
Chapter Six
Logging ZZAP Activity
If you wish ZZAP to run unattended (see EVENTS below) then you
may wish to log its activities. You must specify the drive full
path and file name of the log file in the environment with the
ZZAPLOG variable. In your AUTOEXEC.BAT file you should place
this (or something similar):
SET ZZAPLOG=C:\LOG\ZZAP.LOG
The actual file name will depend upon your system configuration.
The first time the log option is used the log file is created.
On subsequent runs new information is appended to the end of the
file.
The log file is a standard ASCII file that may be viewed, edited,
printed, etc.. It will contain information about archives
converted, virses detected, corrupted archives, and other error
messages, along with the times and dates when they occurred.
Chapter 6. Logging ZZAP Activity Page 17
Page 18 Chapter 6. Logging ZZAP Activity
Chapter Seven
Executing Compsec
Any time you declare, in the configuration file, a program to be
executed you have the option of using %COMSPEC% to indicate to
ZZAP to execute DOS (normally COMMAND.COM). With this feature
you can execute a batch file instead of a single program. For
example:
FIXER=%COMSPEC /C FIXUP %1
If FIXUP is a batch file it will be executed with the archive
name passed as the parameter. The /C option is to tell DOS to
return to the calling program (ZZAP) when execution has been
completed.
Caution! When you execute COMSPEC any error codes returned by
programs will be unseen by ZZAP.
See also PRE=, MID=, and POST=.
Chapter 7. Executing Compsec Page 19
Page 20 Chapter 7. Executing Compsec
Chapter Eight
Command Line Options
There are a number of command line options that allow you to
customize the behavior of ZZAP. These options can also be
declared in the configuration file using the SWITCH= statement.
Command line options override configuration file options.
With the exception of the /E and /D switches, each option is a
forward slash (/), a letter, and optionally followed by a plus
(+) or minus (-). If the option is given but the plus or minus
is omitted then plus is assumed, e.g. /A is equivalent to /A+.
Plus (+) turns the option on and minus (-) turns the option off.
/A Flag archives with HIDDEN, SYSTEM, or READ-
ONLY files (default ON).
/B Allow subdirectories.
/C Call the BBS file description updating
program.
/D File date stamping.
/E Extension of archive type to convert to.
/F Create a list of files that were converted
(default OFF).
/I Ignore age of files.
/K Keep the original archive (default OFF).
/N Convert archives nested within archives
(ON).
/P Prevent overwriting existing archives
(default OFF).
/R Recurse subdirectories (default OFF).
/S Strip HIDDEN, SYSTEM, and READ-ONLY
attributes (default OFF).
/T Test mode only - no repacking (default OFF).
/V Scan for viruses (default OFF).
/X Use expanded or extended memory when
shelling (default ON).
/Z Enable/disable I/O redirection.
8.1 Flag Odd Attributes - /A
If this option is ON any archive that contains a file with the
HIDDEN, SYSTEM, or READ-ONLY attribute will be treated as a
corrupt archive and be renamed to have a "!" as the second
character of the extension. Currently, only PKZIP, LHARC, and
ICE support attributes within the archive.
Chapter 8. Command Line Options Page 21
It is highly recommended that you have on either the /A or /S
command at all times since most archiving programs will
completely ignore hidden files, possibly resulting in lost files.
The /S (strip attributes) command will override this command.
8.2 Allow subdirectories - B
Some archive formats allow subdirectory information to be
imbedded into the archive. By default, ZZAP treats archives with
subdirectory information as BAD archives, leaving them for you to
manually examine and process.
If the archive format you are converting to supports
subdirectories you can have this information automatically
included in the conversion process by modifying the program
options for the ARC and UNARC programs and including the /B
option on the command line (or with the SWITCH= option).
It is assumed that subdirectories that are created by the UNARC
program will be child directories of ZZAP's temporary work
subdirectory ZZAP. If a subdirectory is created elsewhere it
will not be detected and the files contained therein will not be
added to the new archive. Nested archives that are placed in
created subdirectories will not be converted by ZZAP.
*** WARNING *** Do not use the /B switch unless you are sure
that the default archive configuration is properly configured to
allow subdirectory information. Improper configuration will
result in the failure of files to be included in the new
subdirectory. It is URGED that you manually test all possible
situations before trusting the /B switch in an unattended mode.
The following archive programs can NOT be used to extract
subdirectory information. This limitation is because the
programs insist on creating the original subdirectories instead
of creating the subdirectories as children of the current
directory:
DWC A495
PAK 2.10
This limitation may be removed in future versions of these
programs or the limitation could be removed by changing the
configuration of each of these programs in the ZZAP configuration
file.
This limitation does not exist for the creation of new archives,
however, it should be noted that because the entire path is
stored you may not have the subdirectory information that you
desire. *** REPEAT OF WARNING *** allow subdirectory creation
with extreme caution. It is highly recommended that you leave
Page 22 Chapter 8. Command Line Options
out the /B option and handle the subdirectories manual on a
case-by-case basis.
8.3 Call Update Program - /C
Turning this option on causes the fix-up program named in the
configuration file (see FIXER=) to be executed after all
conversions have been completed. This removes the necessity to
execute the program after running ZZAP.
Turning this option on also forces the /F option on as well.
This option is ignored when using the Test Only mode (/T).
8.4 File Date Stamping - /D
ZZAP provides three different options for setting the date and
time of the archives after they have been converted. Immediately
follow /D with one of three letters to indicate which stamping
method to use:
T Stamp with the current date and time
(Today).
L Stamp with the date and time of the most
recent file contained in the archive
(Latest).
O Keep the original date and time of the
archive (Original).
Sysops may wish to use the /DO (original date) option in
conjunction with the AGE= configuration file command. If your
daily maintenance event is at midnight you should set AGE=2.
After a file is successfully uploaded you should "TOUCH" the file
with the current date and time. When the daily event occurs,
only files that are one or two days old will be processed. Since
there shouldn't be any one day old files (assuming a midnight
event), only the files uploaded from the previous day will be
processed.
The default stamping method is /DL.
8.5 Target Extension - /E
Overrides the DEFAULT= option in the configuration file. Follow
immediately with a three letter extension, for example:
ZZAP /EZIP *.LZH
Chapter 8. Command Line Options Page 23
The above example will convert all LZH type archives in the
current directory to ZIP archives.
Unlike the DEFAULT= configuration file option, you must not
precede the extension with a period.
8.6 File List - /F
If the /F+ option is used the text file FILES.FIX will be created
that lists each of the files converted. Each line contains a
single entry, first is the full path and file name of the
original file, followed by a single space, and finally the new
file name (no path), for example:
C:\ARCHIVES\MYARC.LZH MYARC.ZIP
C:\ARCHIVES\ANOTHER.ZOO ANOTHER.ZIP
C:\NEWSTUFF\JUNK.ICE JUNK.ZIP
Files that are repacked to the same type (e.g. ZIP to ZIP) will
also be listed in this file. Under some BBS list formats the
file size, date, time, etc. are also stored along with the file
name and description. It is up to the programmer of the filter
to use or ignore unchanged file names as necessary.
This option is ignored when using the Test Only mode (/T).
This text file can be used by a filter program to modify any file
list as used by most BBS systems to reflect the change of file
names. Included with ZZAP is the program QFIX.EXE that modifies
the file list format used by QuickBBS and many other BBS systems
as well as the description file used by 4DOS. See the QFIX
document file for additional information.
A filter program for TBBS called DIRFIX has been written by Gary
W. Funk. This program is also included with ZZAP by permission.
I will be happy to provide some limited assistance in developing
filter programs for other BBS list formats. If you develop a
filter program that would be of interest to others, send a copy
to me so I can make it available to other sysops. Appropriate
acknowledgments will, of course, be given.
8.7 Ignore File Age - /I
If you use the AGE= option to ignore files that are more than a
specified number of days old you can override this with the /I
command. Enabling the /I option will result in all files
(matching the file specification) being processed, regardless of
their age.
Page 24 Chapter 8. Command Line Options
8.8 Keeping The Original - /K
By default the original archive is deleted after the new archive
is successfully created. To prevent the old archives from being
deleted you need to turn ON the /K (keep) option. For example:
ZZAP /K+ *.ARC
This switch can be used in combination with any other option:
ZZAP /K+ /R+ C:\*.ARC
8.9 Convert Nested - /N
If this option is on, any archives nested within an archive being
converted will also be converted. All nested archive types
supported will be converted to the default type. Nested archives
are left unchanged if this option is off.
8.10 Prevent Overwriting - /P
By default an existing archive can be overwritten when
converting. For example, if both TEST.ZIP and TEST.LZH exist and
you convert TEST.LZH to a ZIP file, the original TEST.ZIP will be
replaced by the new ZIP file (formerly TEST.LZH). If the /P
option is turned on it will prevent this from occurring, in fact,
any archive that would cause an overwrite would be completely
ignored, without any status message being displayed.
This option has no effect when using the Test Only mode (/T).
8.11 Subdirectory Recursion - /R
If you have multiple subdirectories with archives you need to
convert, you can either process each subdirectory individually or
use the recursion feature of ZZAP. Subdirectory recursion means
ZZAP will start at a given subdirectory and convert all archives
in it and all archives in any child subdirectories. This feature
is especially handy when you have a Bulletin Board System with a
large number of specialized file areas.
Subdirectory Recursion is invoked by the /R command line options.
The following are valid command lines:
ZZAP /R+ \FILES\T*.ZOO
ZZAP /R+ \*.ARC
ZZAP /R *.PAK
Chapter 8. Command Line Options Page 25
ZZAP /R+/V+ *.*
8.12 Strip Attributes - /S
The /S options will strip the HIDDEN, SYSTEM, and READ-ONLY
attributes from all files contained in the archive before adding
the files to the new archive. Note that most archiving programs
do not support unusual attributes and will simply ignore files
containing these three attributes. You should use either the /A
or /S command if there is any chance of any of these three
attributes being run across.
Turning this option on will cause the /A option to be turned off.
This option has no effect when using the Test Only mode (/T).
8.13 Test Only - /T
If you merely wish to test the integrity of an archive and
possibly run a virus check use the /T switch. All normal steps
will be executed with the exception of the creation of the new
archive.
The date/time stamp of a archives will not be changed during the
Test mode unless a /D command is explicitly stated, either in the
configuration file with the OPTIONS= command, or on the command
line.
This feature would be more useful with SDN archives if PAK would
return a nonzero exit code if the security envelope was missing.
Unfortunately, as of version 2.10 it returns a code of zero as
long as the archive is not corrupted (beyond the missing security
envelope).
8.14 Virus Scan - /V
The /V option will enable the virus scan option. You must have
version 39 or greater of McAfee Associates virus scanning program
SCAN.EXE placed on your execution PATH. If a virus is detected
the archive will be treated as corrupted and an error message
will be displayed and placed in the log file (if enabled).
See also the SCANOPT= configuration file command.
Page 26 Chapter 8. Command Line Options
8.15 Expanded/Extended Memory - /X
By default ZZAP will take advantage of expanded or extended
memory while shelling to an archive program. This makes more
memory available to the archiver and may mean the difference
between success or failure in a tight memory system. If you do
NOT wish expanded to be used include the /X- option on the
command line.
To use expanded memory a LIM 4.0 driver be installed as well as
sufficient EMS to store the bulk of the program and data.
To use extended memory an XMS driver such as HIMEM.SYS (available
free from Microsoft) must be installed as well as sufficient
extended memory to store the bulk of the program and data.
8.16 Enable/Disable I/O Redirection - /Z
Turning this option off disables all I/O redirection. ZZAP is
configured to redirect all the output of the external programs to
the NULL device to keep a clean screen. When you are having a
problem with program configuration it is often helpful to turn
off the redirection so you can see each phase of the conversion
process. Using this commmand line switch is much easier than
editing the configuration file to remove the redirection
commands.
This option is ON by default.
Chapter 8. Command Line Options Page 27
Page 28 Chapter 8. Command Line Options
Chapter Nine
Locating The Configuration File
ZZAP will try it's best to locate the configuration file. Upon
execution it searches for the configuration file in the following
order:
1. The current subdirectory.
2. The Subdirectory defined by the environment variable
ZZAP=, e.g. ZZAP=C:\BIN.
3. The subdirectory ZZAP.EXE resides in (DOS 3.x only).
4. Each subdirectory defined by PATH in the environment.
If you wish to keep the configuration file in a directory not on
the PATH and still be able to execute ZZAP from any subdirectory
you should set the environment variable:
SET ZZAP=C:\STUFF
If the configuration file can not be found ZZAP will halt with an
error.
Chapter 9. Locating The Configuration File Page 29
Page 30 Chapter 9. Locating The Configuration File
Chapter Ten
Running ZZAP
ZZAP is fully configured for the major archiving programs. The
only change in the configuration file you may need to make is the
EXT= command to set your preferred default archive type.
To run ZZAP, simply type ZZAP followed by the filename (wild-
cards allowed). The filename MUST have an extension. If the
extension is wild (*) then all archive types defined by UNARC=
commands will be converted to the new archive type as defined by
ARC=. The following are legal:
ZZAP *.ZOO
Converts all ZOO files in the default subdirectory to the new
archive type or repacks ZOO files if that is the default
extension.
ZZAP \UPLOADS\AFILE.ZIP
Converts AFILE.ZIP, located in the \UPLOADS subdirectory, to the
new archiving type.
ZZAP *.*
Converts all archive types that are not the default format, in
the current subdirectory, to the new archive type.
When using a wild-card for the extension archives with the
default extension will be ignored. To repack archives to the
same type, e.g. ZIP to ZIP, you must explicitly state the
extension.
ZZAP *.ZIP
If you wish to repack an archive to the same type you must
explicitly name the extension as the default archive type is
ignored when doing a wild card conversion (this is to avoid
repacking the same archives every time you run ZZAP).
If your default archive type is LZH simply give that as the
extension to convert:
ZZAP *.LZH
When repacking an archive, all archive and file comments are
lost.
Chapter 10. Running ZZAP Page 31
Note that the /P and /K options are ignored when doing a repack.
ZZAP can also accept multiple file names on the command line:
ZZAP /V *.ZIP *.*
Assuming a default archive type of ZIP, this example first
repacks all ZIP files (and does a virus check) then converts all
other types to ZIP format, also with a virus check. If the order
had been changed, "ZZAP /V *.* *.ZIP", all archives would be
converted to ZIP format then all ZIP files would be repacked,
clearly not the intention.
Page 32 Chapter 10. Running ZZAP
Chapter Eleven
Nested Archives
It is not uncommon to find archives nested inside an archive. A
program that includes source code may have the source code
archived and placed within the main archive. ZZAP will properly
handle this situation and convert the nested archives to the new
format. If fact, it will even convert nested archives of a
differing types. Theoretically, an unlimited amount of nesting
can be handled, only limited by available memory, but this has
only been tested one deep.
If you do not wish nested archives to be converted you should use
the /N- option on the command line or place it in the
configuration file using the SWITCH= command.
Chapter 11. Running ZZAP Page 33
Page 34 Chapter 11. Nested Archives
Chapter Twelve
When Good Files Go Bad
If a file is found to be corrupted further processing on that
file is halted and the archive is renamed to have a "!" as the
second character of the extension, for example, "Z!P". If the
corrupted archive is nested only the parent archive is renamed.
You will have to manually unarc the archive to find the actual
problem.
ZZAP assumes that a file is corrupted when the "EXIT CODE" for
the unarc program is nonzero.
PAK version 1.0 is known to not return a proper error code so
ZZAP will not work with it. I'm not sure which version they
fixed the bug in. I do know that it works properly with PAK
version 1.6.
Just because ZZAP says an archive is corrupted does not
necessarily mean it is true. When the archiving program returns
a nonzero exit code ZZAP has know way of knowing what the code
represents. Some of the reasons an archive might be flagged as
bad are:
o Archive is truly corrupted.
o Insufficient memory, there was enough memory to execute
the archiving program but not enough for the archiving
program to properly process the archive.
o Insufficient disk space. A very large archive can quickly
eat up disk space. Even a seemingly small archive can
suddenly expand into a big file. Font files, for example,
typically compress to only 5% of the original size. A 72
point font can take more than 1Meg of disk space while
requiring less than 100k when compressed. Keep in mind
that ZZAP requires enough disk space to hold the original
archive, the expanded files, and the new archive.
Therefore, a 100k archive that expands to 500k and
recompresses to 75k will temporarily require 675k of disk
space.
o Invalid archive version. When a new version of an archive
program is released it often includes improved
compresssion techniques that older versions of the program
can not handle. Upgrade your archive software.
Chapter 12. When Good Files Go Bad Page 35
o Command line options as defined in the configuration file
are incorrect. Double check each ARC= and UNARC= command
in the configuration file.
o Archive program is corrupted. Make sure that your
archiving programs are working properly.
o Disk error. If your disk has a bad sector it could result
in a unsuccessful archiving or unarchiving.
Page 36 Chapter 12. When Good Files Go Bad
Chapter Thirteen
External Event Conversion
Some bulletin board systems support timed "events". These events
are used to automate the operation of the board. Using an event
can make it possible for the bulletin board to automatically
handle the conversion of any archive type to the type supported
by the board. A BBS that automatically converts archive types
could allow the callers to upload archives of virtually any type.
Under FrontDoor, for example, you can use an external event for
this process. An external event causes FrontDoor to terminate
with a specified error level. The error level can then be
queried to decide what should be done.
Follows is a fragment from a possible batch file to do just this.
This example assumes all new uploads are placed in the
subdirectory "C:\UPLOADS".
IF ERRORLEVEL 87 GOTO do_this
IF ERRORLEVEL 86 GOTO arc_convert
IF ERRORLEVEL 85 GOTO do_that
REM convert all archive types to ZIP files
:arc_convert
zzap /f+ c:\uploads\*.*
GOTO run_fd
There is one problem with this type of system - what happens to
the descriptions? Some BBS programs automatically place the file
name and description in an ASCII file. If the file is then
converted the filename is changed and would no longer match the
name given with the description. The /F option and the QFIX
program (included) handle the conversion for QuickBBS format file
list.
See QFIX.DOC for further information. See also the description
of the /C options as well as the configuration file option FIXER=
and other related options.
Chapter 13. When Good Files Go Bad Page 37
Page 38 Chapter 13. External Event Conversion
Appendix A
Exit Codes
ZZAP will return exit codes upon termination. These exit codes
can be used by a batch file to decide what steps should be taken
after running ZZAP. The exit codes are
0 Normal termination - no errors, viruses, or
corrupted archives.
1 Virus detected.
2 Corrupted archive.
3 Configuration file not found.
4 Not configured for given extension.
5 Couldn't create temporary directory.
6 Other fatal error.
There is a possibility for both a corrupted archive and a virused
archive to have been detected (bad day!). In this case an exit
code of 1 (virus detected) will be returned, specifying the more
critical situation.
Appendix A. Exit Codes Page 39
Page 40 Appendix A. Exit Codes
Appendix B
Acknowledgments
Thanks to:
o Ken Doebler and Dan Geatons for their many suggestions.
o Randall Greylock (1:321/202.4) for pointing out an oddity
with ZOO and many fine suggestions which were implemented.
o Charles Falconer (1:141/488) for pointing out that I
didn't handle unusual file attributes (which LHARC and
PKZIP archives may retain) and other suggestions.
Appendix B. Acknowledgments Page 41
Page 42 Appendix B. Acknowledgments
Appendix C
My Lawyer Made Me Do It
- DWC is copyright (c)1986,87,88 Dean W. Cooper.
- LHARC and ICE are copyright (c)1988,89 Haruyasu
Yoshizaki-san.
- LUE is copyright (c)1985 Vernon D. Buerg.
- PAK is copyright (c)1988,89 NoGate Consulting
- GSARC is copyright (c)1988 NoGate Consulting
- PKARC/PKXARC and PKPAK/PKUNPAK are copyright (c)1986,87,88
PKWare, Inc.
- PKZIP/PKUNZIP are copyright (c)1989 PkWare, Inc.
- ZOO is copyright (c)1988 Rahul Dhesi
- FrontDoor is copyright (c)1988,89 Scandinavian PC Systems
and InterZone Software, Inc.
- DIRFIX is copyright (c)1990 Gary W. Funk.
Appendix C. My Lawyer Made Me Do It Page 43
Page 44 Appendix C. My Lawyer Made Me Do It
Appendix D
Version History
Version 6.2 Changes
===================
- The log file must now be specified in the environment.
This allows ZZAP to log errors before the configuration
file is read.
- Can now read a file containing a list of files to convert.
Version 6.1 Changes
===================
- Added the /B command line switch and support for
subdirectory information in archives.
- Slightly changed the way temporary files are handled to
improve support on networked multi-line BBS's.
Version 6.0 Changes
===================
- Added the PRE=, MID=, and POST= configuration file
commands.
- Added support for %COMSPEC% when declaring programs to
execute.
- Added support for >> type output redirection.
- Changed /T to /D.
- A new test mode has been added. Using /T now initiates a
test mode, no new archives are created.
- The date/time stamp is left unaltered when using the /T
command unless a /D option is explicitly stated.
- Instead of searching the path for all of the UNARC
programs at start-up, which can be a slow process if more
than a few are defined, ZZAP now only searches for the
programs when actually required. The full path, if found,
is saved so that subsequent searches are not required.
Appendix D. Version History Page 45
Version 5.9 Changes
===================
- Changed the way temporary files are handled, ZZAP can now
work with archive programs that insist on using a specific
extension.
Duplicate archives are not deleted until the new archive
has been successfully created.
- Added a few new error messages in the log file.
- When I added input redirection capabilities I also
introduced a bug that would could cause the wrong files to
be closed when turning off redirection after an execute.
This is now fixed.
Version 5.8 Changes
===================
- Removed the /O command line option and replaced it with
the more versatile /T option.
- Added the /I (ignore file age) command to the command line
switches.
- Added the AGE= command to the configuration file. ZZAP
can now be configured to skip processing of files that are
more than a specified number of days old.
- Added an index to the documents
- ZZAP is now DesqView aware.
Version 5.7 Changes
===================
- Added support for redirection of input for called
programs. This will allow you to automatically add
archives comments when converting to some archive formats.
- Deleted the FIXOPT= configuration file command. Now the
FIXER= command does double duty - defining the program
name and options.
Page 46 Appendix D. Version History
Version 5.6 Changes
===================
- Corrected a bug where a bad archive could not be
successfully moved to a "bad directory" as defined by the
BADDIR= configuration option.
- If an archive contains subdirectory information and you
have the unarc option set to create subdirectories, ZZAP
will now handle this in a graceful manner by deleting the
subdirectories that were created, treating the archive as
bad, and logging an appropriate message. Formerly, ZZAP
would crash when it was unable to remove its temporary
work subdirectory.
- When an archive nested inside another archive is found to
be corrupt, only the parent archive (containing the
corrupt child archive) will be moved to BADDIR instead of
both the parent and child archives.
- Stamped a new bug where a nested archive would be stored
with its temporary name (*.Z!Z) as well as the old
extension, resulting in larger archives.
Version 5.5 Changes
===================
- Due to a bug in my code the error code returned by
SCAN.EXE was not being processed correctly. This could
allow archives with infected programs to slip by.
- Cleaned up the display of error and warning messages.
- The log file is now only date/time stamped if something is
actually done.
- The number of files skipped due to the /P+ option is now
displayed with other status information.
Version 5.4 Changes
===================
- Added the /C command line option.
- Added the FIXER=, FIXOPT= and SCANOPT= configuration file
commands.
- Corrupted archives are renamed to have a "!" as the second
character of the extension instead of "BAD" being the
extension.
Appendix D. Version History Page 47
Version 5.3 Changes
===================
- Added support for "%1" to allow the archive file names to
be in any position on the command line.
- Corrected a bug where the /N command line switch was being
ignored.
- Bug corrected where the state of Keep (/K+) and/or
PreventOverwrite (/P+) could be lost if more than one file
is given on the command line.
- On the switch status line, "on" is displayed in high-
intensity.
- Completely changed the way the /F option works and added
the QFIX program.
- Conversion of all archive types by indicating the wild-
card extension (e.g. '*.*' was not working, corrected as
of 5.3b.
Version 5.2 Changes
===================
- Fixed a bug where the stack would overflow and trash some
internal data.
- Fixed a bug where if /X- was used it wouldn't properly
execute the external programs.
- Removed the ZZAPARC= environmental variable, it is not
longer needed with the addition of the /E command line
switch.
- Added the /N switch (convert nested archives). Default
ON.
Version 5.1 Changes
===================
- Added the SWITCH= configuration file option.
- Changed the way command line options are used.
Version 5.0 Changes
===================
- Completely rewrote most of the file searching routines.
- Now supports repacking any archive type, e.g. ZIP to ZIP.
- Added a switch to prevent overwriting of existing
archives.
Page 48 Appendix D. Version History
Version 4.8 Changes
===================
- Added support for output redirection.
- ZZAP always thought the bad archive directory (BADDIR=)
didn't exist - whether it did or not.
- Now supports moving a BAD archive to a different drive.
- If BADDIR is defined and the subdirectory exists the file
will be moved their and the extension will NOT be changed
to .BAD. The extension will be changed to .BAD if BADDIR
is not defined or does not exist.
Version 4.7 Changes
===================
- Added the DEFAULT= command in the configuration file.
- Changed the ZZAPARC environmental variable so that it only
requires the file extension.
- Changed the ARC= command in the configuration file so that
multiple archiving programs can be listed.
- Added the /S (strip attributes) command line option.
- Added support for extended memory during archive program
executing.
- The BBS list routine was not working properly if the
filenames in the list file were not uppercase.
Version 4.6 Changes
===================
- Added support for virus scanning using McAfee Associates
SCAN.EXE program.
- Added the BADDIR configuration option.
- Improved the error detection code.
Version 4.5 Changes
===================
- Added support for multiple file names on the command line.
- Removed bug where ZZAP returned an error message if no
file name was given on the command line.
Version 4.4 Changes
===================
- ZZAP wasn't properly reading the exit code of the unarcing
programs. This resulting in some bad archives slipping
by.
Version 4.3 Changes
===================
- Cosmetic changes and code optimization.
Appendix D. Version History Page 49
Version 4.2 Changes
===================
- Trivial B.S. hardly worth mentioning.
Version 4.1 Changes
===================
- Corrected a fatal bug introduced in 4.0 that would cause
ZZAP to lose files under PKARC/PKPAK.
- Removed a bug which resulted in the "home" path (DOS 3.x
only) not being located properly.
Version 4.0 Changes
===================
- Changed the "/I" option to "/A" - makes more sense.
Log more information about nonstandard file attributes in
the log file.
- Now supports expanded memory (LIM 4.0 only) when shelling,
thus making available more conventional memory when
running the archiving programs.
Version 3.6 Changes
===================
- Now properly handles files with attributes of READ-ONLY,
HIDDEN, or SYSTEM, which could cause ZZAP to crash.
- Added the /I option.
- Fixed a bug with the FIXLIST option (/F).
Version 3.5 Changes
===================
- Mostly cosmetic changes.
- A minor bug in path searching was fixed.
Version 3.4 Changes
===================
- Another minor bug fix, changes in version 3.3 resulted in
archive programs in the default directory not being found.
Version 3.3 Changes
===================
- Added the environment variable ZZAPARC= which overrides
the ARC= command in the configuration file.
- The code was cleaned up a bit, as well.
Page 50 Appendix D. Version History
Version 3.2 Changes
===================
- Fixed a minor bug related to the environment variable
ZZAP=.
- Now aborts if the archiving (ARC=) program can not be
found.
- Displays an error message if any of the unarcing programs
(UNARC=) can not be found.
Version 3.1 Changes
===================
- As of version 3.1 ZZAP will work with DWC. Prior to this
version DWC would not work because of the way DWC handled
paths. Most DOS programs support the "parent"
subdirectory path, "..\ARCHIVE.EXT". For some reason DWC
would not. The parent subdirectory is now converted to a
qualified filename, e.g. "C:\ARCHIVES\MYARC.DWC".
Appendix D. Version History Page 51
Page 52 Appendix D. Version History
Index
A I
AGE= 24 I/O redirection 21
Archive Programs Supported 6
Attributes 21 K
Flag funny 21, 26 Keep 21, 24
Strip 21, 22, 26
L
B License Agreement 1
BBS download list 12 List 21, 24
Locating The Configuration
C File 28
Command Line Options 20 Log 17
Command line options Logging ZZAP Activity 16
/A 21
/B 21, 22 N
/C 21, 23 Nested Archives 21, 33
/D 13, 21, 23 Nested archives 33
/E 21, 23
/F 21, 23, 24 P
/I 13, 21, 24 Path 29
/K 21, 24 POST= 14
/N 21, 25 PRE= 14
/P 21, 25 Prevent overwrite 21
/R 21, 25
/S 21, 26 Q
/T 21, 26 QuickBBS 12
/V 21, 26
/X 21, 26 R
/Z 21, 27 Redirection 9, 10, 11
Configuration File 8 Redirection error 10
Configuration File 29 Repack 31
Running ZZAP 4, 30
D
Default Extension 11, 21, 23 S
Description fix-up 21, 23 SCANV 15, 21, 26
DIRFIX 24 Subdirecties 21, 22
Subdirectories 11
E Subdirectory recursion 21
Environment 29 Summary of Features 2
Executing Compsec 18 Switches 12, 21
Expanded Memory 21, 27
Extended Memory 21, 27 T
External Event Conversion 37 Temporary subdirectory 13
Test mode 21, 23, 24, 25, 26
F
File date stamping 13, 21 V
Filter 24 Viruses 15, 21, 26
Fix-up program 12
Index Page 53
W Z
When Good Files Go Bad 34 ZZAPLOG= 17
Wild-cards 31
Page 54 Index