.!
.!  File:       ZIP.RNH
.!
.!  Author:     Hunter Goatley
.!
.!  Date:       October 22, 1991
.!
.!  Description:
.!
.!      RUNOFF source file for portable ZIP on-line help for VMS.
.!      Adapted from MANUAL, distributed with ZIP.
.!
.!      To build:       $ RUNOFF ZIP.RNH
.!                      $ LIBR/HELP/INSERT libr ZIP
.!
.!  Modification history:
.!
.!      Hunter Goatley          22-OCT-1991 20:45
.!              Genesis.
.!      Jean-loup Gailly        25 March 92
.!              Adaptation to zip 1.6.
.!      Igor Mandrichenko       9-JUN-1992
.!              Added explanation of -V option.
.!      Jean-loup Gailly        14 June 92
.!              Adaptation to zip 1.8.
.!      Jean-loup Gailly        20 Aug 92
.!              Adaptation to zip 1.9.
.!      Jean-loup Gailly        31 Aug 93
.!              Adaptation to zip 2.0.
.!      Christian Spieler       20 Sep 93
.!              Adaptation to zip 2.0 and OpenVMS completed.
.!      Christian Spieler       05 Dec 95
.!              Adaptation to zip 2.1, new options.
.!      Christian Spieler       20 Jan 96
.!              Changed -L and -v descriptions.
.!      Christian Spieler       11 Feb 96
.!              Added -X option.
.!      Onno van der Linden,
.!      Christian Spieler       13 Mar 96
.!              Removed -ee option.
.!      Christian Spieler       09 Feb 96
.!              Updated copyright notice, Zip version.
.!      Christian Spieler       21 Jul 97
.!              Added -P, -R, -i@, -x@ and -tt options, modified for Zip 2.2.
.!      Christian Spieler       14 Oct 97
.!              unified spelling of "Info-ZIP", final cleanups for 2.2.
.!      Steven Schweda          10 May 2007
.!              General update for version 3.0.
.!      Ed Gordon               12 May 2007
.!              Minor updates for version 3.0.
.!
.noflags
.lm4 .rm72
.indent -4
1 ZIP
.br
Zip is a compression and file packaging utility for several operating
systems, including UNIX, VMS,  MSDOS, OS/2, Windows 9x/NT/XP, Minix, Atari,
Macintosh, Amiga, and Acorn RISC OS.  It is analogous to a combination of
tar and compress and is compatible with PKZIP (Phil Katz's ZIP) for
MSDOS systems.
.sk
Zip is useful for packaging a set of files for distribution, for
archiving files, and for saving disk space by temporarily compressing
unused files or directories.  A companion program, UnZip, unpacks Zip
archives.
.sk
For brief help on Zip or UnZip, run the program without specifying any
parameters on the command line.
.sk
This description covers the Zip program which uses a UNIX-style command
line.  A separate program is available which provides a VMS-style CLI
command line, and it has its own documentation.  Refer to the Zip
installation instructions for details.
.sk
Format
.sk;.lm+2;.literal
ZIP [-options] archive inpath inpath ...
.end literal;.lm-2
.!------------------------------------------------------------------------------
.indent -4
2 Basic_Usage
.br
Format
.sk;.lm+2;.literal
ZIP [-options] archive inpath inpath ...
.end literal;.lm-2
.sk
The default action of Zip is to add or replace entries in "archive" from
the list of "inpath" file specifications, which can include directories
and file names with VMS-style wildcards, or the special name -@ to read
file specifications from SYS$INPUT (stdin).
.sk
With SET PROCESS /PARSE_STYLE = EXTENDED (available on recent non-VAX
systems), Zip preserves the case of the command line.  Otherwise, mixed-
or upper-case options and arguments must be quoted.  For example,
"-V".  Examples in this document generally do not show this quotation,
so VAX and /PARSE_STYLE = TRADITIONAL users (that is, troglodytes) will
need to add quotation where needed when working with these examples.
.sk
General
.sk
Zip reads one or more files, compresses the data (normally), and stores
the compressed information into a single Zip archive file, along with
information about each file (name, path, date and time of last
modification, protection, and check information to verify file
integrity).  On a VMS system, Zip can also save VMS/RMS file attributes,
allowing UnZip to restore the files without loss of important file
attributes.  Zip can pack an entire directory structure into a Zip
archive with a single command.
.sk
Compression
.sk
Compression ratios of 2:1 to 3:1 are common for text files.  Zip has one
standard compression method ("deflate") and can also store files without
compression.  Zip (and UnZip) may be built with optional support for the
bzip2 compression method.  Then, the user may select bzip2 compression
instead of the default "deflate" method.  Zip automatically chooses
simple storage over compression for a file, if the specified compression
method does not actually compress the data in that file.
.sk
Compatibility
.sk
Zip and UnZip can work with archives produced by PKZIP (supporting most
PKZIP features up to PKZIP version 4.6), and PKZIP and PKUNZIP can work
with archives produced by Zip (with some exceptions, notably streamed
archives, but recent changes in the .ZIP file standard may facilitate
better compatibility).  Zip version 3.0 is compatible with PKZIP 2.04
and also supports the Zip64 extensions of PKZIP 4.5 which allows
archives as well as files to exceed the previous 2 GB limit (4 GB in
some cases).  Zip also supports bzip2 compression if the bzip2 library
is included when Zip is built.  Note that PKUNZIP 1.10 cannot extract
files produced by PKZIP 2.04 or Zip 3.0.  You must use PKUNZIP 2.04g or
UnZip 5.0p1 (or later versions) to extract them.
.sk
Large Archives and Zip64
.sk
Where the operating system and C run-time support allow, Zip 3.0 and
UnZip 6.0 (and later versions) support large files (input and archive),
using the Zip64 extensions to the original .ZIP file format.  On VMS,
this genarally means non-VAX systems with VMS V7.2 or later (perhaps
requiring a C RTL ECO before VMS V7.3-2).
.sk
Zip automatically uses the Zip64 extensions when a file larger than 2 GB
is added to an archive, an archive containing a Zip64 entry is updated
(if the resulting archive still needs Zip64), the size of the archive
will exceed 4 GB, or when the number of entries in the archive will
exceed about 64K.  Zip64 is also used for archives streamed to a
non-seekable output device.  You must use a 4.5 compatible UnZip to
extract files using the Zip64 extensions such as UnZip 6.0 or later.
.sk
In addition, streamed archives, entries encrypted with standard
encryption, or split archives created with the pause option may not be
compatible with PKZIP as data descriptors are used, and PKZIP at the 
time of this writing does not support data descriptors (but recent
changes in the PKWare published .ZIP file standard now include some
support for the data descriptor format Zip uses).
.!------------------------------------------------------------------------------
.indent -4
2 More_Usage
.br
Here is a very simple example of Zip use:
.sk;.indent 10;
$ zip stuff.zip *.*
.sk
This will create the Zip archive "stuff.zip" (assuming it does not
already exist) and put all the (non-directory) files (";0") from the
current default directory into "stuff.zip" in a compressed form.  The
archive is opened using a default file specification of
"SYS$DISK:[].zip", so specifying "stuff" as the archive name would also
create (or use an existing) "stuff.zip", but specifying "stuff.other"
would give you that name.  In general, Zip doesn't care about the type
in the file specification, but for split archives (archives split over
multiple files), the user should normally specify a type-less name,
because Zip will normally generate sequentially numbered types ".z01",
".z02", and so on for the early splits, and then the required ".zip" for
the last split.  These file types are required by the Zip standard for
split archives.
.sk
Standard VMS wildcard expansion ($SEARCH) is used to interpret the
"inpath" file and directory specifications, like the "*.*" in this
example.
.sk
On VMS, the most natural way to archive an entire directory tree is to
use a directory-depth wildcard ("[...]").  For example:
.sk;.indent 10
zip foo [...]*.*
.sk
This will create the file "foo.zip" containing all the files (";0") and
directories in and below the current default directory.  A more
UNIX-like way to do this would be to use the -r (--recurse-paths)
option:
.sk;.indent 10
$ zip -r foo *.*
.sk
Zip avoids including its own output files when selecting files to
include in the archive, so it should be safe, as in this case, to create
the archive in the same drectory as the input files.
.sk
One or more specific files, directories, or subdirectories may also be
specified:
.lm +10;.literal
zip foo.zip readme.txt [www...]*.* [.ftp...]*.* -
 [.src]*.h [.src]*.c
.end literal;.lm -10
.sk
For security reasons, paths in Zip archives are always stored as
relative paths, so some care is needed when creating an archive so that
it will create the intended directory structure when UnZip is used to
unpack it.
.sk
To use -r with a specific directory, the name of the directory file
itself must be specified:
.sk;.indent 10
zip -r foo.zip [000000]www.dir ftp.dir
.sk
You may want to make an archive that contains the files in [.foo], but not
record the directory name, "foo".  You can use the -j (junk path) option
to leave off the path:
.sk;.indent 10
$ zip -j foo [.foo]*.*
.sk
If you are short on disk space, you might not have enough room to hold
both the original directory and the corresponding compressed Zip
archive.  In this case, you can create the archive in steps, and use the
-m option.  For example, if [.foo] contains the subdirectories [.tom],
[.dick], and [.harry], you could:
.sk
.lm +10;.literal
zip -m foo [.foo.tom...]*.*
zip -m foo [.foo.dick...]*.*
zip -m foo [.foo.harry...]*.*
.end literal;.lm -10
.sk
The first command would create foo.zip, and the next two would add to
it.  The -m option means "move", and it will cause Zip to delete all
files added to the archive after making or updating foo.zip.  No
deletions will be done until the Zip operation has completed with no
errors.  This option is obviously dangerous and should be used with
care, but it does reduce the need for free disk space.  When -m is
used, the -T option is recommended and will test the resulting archive
before deleting the input files.
.sk
If a file specification list is too long to fit conveniently on the Zip
command line, the -@ option can be used to cause Zip to read a list of
file specifications from SYS$INPUT (stdin).  If a DCL command procedure
is used, the names can be specified in the procedure:
.sk;
.lm +10;.literal
$ zip foo -@
$ deck
file_spec_1
file_spec_2
file_spec_3
$ eod
.end literal;.lm -10
.sk
The file specifications can also be put into a separate file, and fed
into Zip by explicitly defining SYS$INPUT, or by using PIPE.  For
example, with the list in foo.zfl:
.sk;
.lm +10;.literal
$ define /user_mode sys$input foo.zfl
$ zip foo -@
.end literal;.lm -10;
or:
.lm +10;.literal
$ pipe type foo.zfl | zip foo -@
.end literal;.lm -10
.sk
If Zip is not able to read a file, it issues a warning but continues.
See the -MM option for more on how Zip handles patterns that are not
matched and files that are not readable.  If some files were skipped, a
warning is issued at the end of the Zip operation noting how many files
were read and how many skipped.
.!------------------------------------------------------------------------------
.indent -4
2 Comments
.br
One-line comments may be included in the archive for each file added,
using the -c (--entry-comments) option.  File operations (adding,
updating) are done first, and the user is then prompted for a one-line
comment for each file added or updated.  Enter the comment followed by
<Return>, or just <Return> for no comment.
.sk
A single multi-line comment may be included for the archive as a whole,
using the -z (--archive-comment) option.  UnZip (including UnZip SFX)
will display this comment when it expands the archive.  The comment is
read from SYS$INPUT (stdin), and is terminated by the usual end-of-file
character, CTRL/Z.  As usual, in a DCL command procedure, these data can
be included in-line in the procedure, or a user may DEFINE SYS$INPUT to
a file to get the comment from that file.  Where supported, the DCL PIPE
command can also be used to redirect SYS$INPUT from a file.
.sk
Note that -z (--archive-comment) and -@ (read file specifications from
SYS$INPUT (stdin)) can't be used together (successfully).
.!------------------------------------------------------------------------------
.indent -4
2 Compression
.br
Zip can archive files with or without compression.  The standard
compression method ("deflate") is compatible with all UnZip versions
(except really old ones that only understand the "store" method). 
Current Zip and UnZip versions may be built with optional support for
the bzip2 compression method.  (The bzip2 method can compress better,
especially when compressing smaller files, but uses more CPU time, and
requires an UnZip which includes the optional bzip2 support.  See the
installation instructions for details on adding bzip2 compression
support at build time.)
.sk
Numeric compression level options control the effort put into data
compression, with -1 being the fastest, and -9 giving the most
compression.
.sk
Compression control options:
.sk;.lm +10;.literal
-Z mthd                      use compress method "mthd",
--compression-method mthd    "bzip2" or "deflate" (default)

-0  (--store)                no compression
-1  (--compress-1)           compression level 1
-2  (--compress-2)           compression level 2
-3  (--compress-3)           compression level 3
-4  (--compress-4)           compression level 4
-5  (--compress-5)           compression level 5
-6  (--compress-6)           compression level 6
-7  (--compress-7)           compression level 7
-8  (--compress-8)           compression level 8
-9  (--compress-9)           compression level 9
.end literal;.lm -10
.sk
Normally, a file which is already compressed will not be compressed much 
further (if at all) by Zip, and trying to do it can waste considerable
CPU time.  Zip can suppress compression on files with particular types,
specified as a colon- or semi-colon-separated list of file types:
.sk;.indent 10
-n type1[:type2[...]]  (--suffixes type1[:type2[...]])
.sk
For example:
.sk;.indent 10
zip -n .bz2:.gz:.jpeg:.jpg:.mp3:.zip foo [.foo]*.*
.sk
will put everything (";0") from [.foo] into foo.zip, but will store any
files that end in .bz2, .gz, .jpeg, .jpg, .mp3, or .zip, without trying
to compress them.
.sk
The default type list is .Z:.zip:.zoo:.arc:.lzh:.arj, and the comparison
is case-insensitive.
.sk
-9 (--compress-9) will override -n (--suffixes), causing compression to
be attempted for all files.
.!------------------------------------------------------------------------------
.indent -4
2 Encryption
.br
Zip offers optional encryption, using a method which by modern standards
is generally considered to be weak.
.sk;.literal
-e  --encrypt
.end literal;.br
Encrypt new or updated archive entries using a password which is
supplied by the user interactively on the terminal in response to a
prompt.  (The password will not be echoed.)  If SYS$COMMAND is not a
terminal, Zip will exit with an error.  The password is verified before
being accepted.
.sk;.literal
-P password  --password password
.end literal;.br
Use "password" to encrypt new or updated archive entries (if any). 
USING -P IS INSECURE!   Many multi-user operating systems provide ways
for any user (or a privileged user) to see the current command line of
any other user.  Even on more secure systems, there is always the threat
of over-the-shoulder peeking.  Storing the plaintext password as part of 
a command line in a command procedure is even less secure.  Whenever
possible, use the non-echoing, interactive password entry method.
.sk
Because standard Zip encryption is weak, where security is truly
important, use a strong encryption program, such as Pretty Good Privacy
(PGP) or GNU Privacy Guard (GnuPG), on an archive instead of standard
Zip encryption.  A stronger encryption method, such as AES, is planned
for Zip 3.1.
.!------------------------------------------------------------------------------
.indent -4
2 Exit_Status
.br
On VMS, Zip's UNIX-style exit values are mapped into VMS-style status
codes with facility code 1955 = %x7A3, and with the inhibit-message
(%x10000000) and facility-specific (%x00008000) bits set:
.sk
.literal
   %x17A38001                        normal exit
   %x17A38000+ 16* Zip_error_code    warnings
   %x17A38002+ 16* Zip_error_code    normal errors
   %x17A38004+ 16* Zip_error_code    fatal errors
.end literal
.sk
Note that multiplying the UNIX-style Zip error code by 16 places it
conveniently in the hexadecimal representation of the VMS exit code,
"__" in %x17A38__s, where "s" is the severity code.  For example, a
truncated archive might cause Zip error code 2, which would be
transformed into the VMS exit status %x17A38024.
.sk
The Zip VMS exit codes include severity values which approximate those
defined by PKWARE, as shown in the following table:
.literal

    VMS      Zip err
  severity    code     Error description
 ----------+---------+----------------------------------------------
  Success       0      Normal; no errors or warnings detected.
  Fatal         2      Unexpected end of archive.
  Error         3      A generic error in the  archive  format  was
                       detected.   Processing  may  have  completed
                       successfully anyway;  some  broken  archives
                       created by other archivers have simple work-
                       arounds.
  Fatal         4      Zip was unable to allocate memory for one or
                       more  buffers during program initialization.
  Fatal         5      A severe error in  the  archive  format  was
                       detected.   Processing probably failed imme-
                       diately.
  Error         6      Entry too large to be split with zipsplit.
  Error         7      Invalid comment format.
  Fatal         8      Zip -T failed or out of memory.
  Error         9      The user aborted zip prematurely  with  con-
                       trol-C (or equivalent).
  Fatal        10      Zip  encountered an error while using a temp
                       file.
  Fatal        11      Read or seek error.
  Warning      12      Zip has nothing to do.
  Error        13      Missing or empty zip file.
  Fatal        14      Error writing to a file.
  Fatal        15      Zip was unable to create a file to write to.
  Error        16      Bad command line parameters.
  Error        18      Zip could not open a specified file to read.
  Fatal        19      Zip was built with options not supported  on
                       this system
  Fatal        20      Attempt to read unsupported Zip64 archive
.end literal
.!------------------------------------------------------------------------------
.indent -4
2 Extra_Fields
.br
The .ZIP file format allows some extra data to be stored with a file in
the archive.  For example, where local time zone information is
available, Zip can store UTC date-time data for files.  (Look for
USE_EF_UT_TIME in a "zip -v" report.)  On VMS, with -V or -VV, Zip will
also store VMS-specific file attributes.  These data are packaged as
"extra fields" in the archive.  Some extra fields are specific to a
particular operating system (like VMS file attributes).  Large files
(bigger than 4GB) on any OS require an extra field to hold their 64-bit
size data.  Depending on the capabilities of the UnZip program used to
expand the archive, these extra fields may be used or ignored when files
are extracted from the archive.
.sk
Some extra fields, like UTC date-times or VMS file attributes, are
optional.  Others, like the Zip64 extra field which holds 64-bit sizes
for a large file, are required.
.sk
The -X (--strip-extra) option suppresses the saving of any optional
extra fields in the archive.  (Thus, -X conflicts with -V or -VV.)
.!------------------------------------------------------------------------------
.indent -4
2 Environment
.br
A user can specify default command-line options and arguments by
defining an "environment variable" (that is, a logical name or DCL
symbol), "ZIP_OPTS" or "ZIPOPT", to specify them.  If both "ZIP_OPTS" and
"ZIPOPT" are specified, the definition of "ZIPOPT" prevails.
.sk
The C RTL function getenv() is used to sense these variables, so its
behavior determines what happens if both a logical name and a symbol are
defined.  As of VMS V7.3, a logical name supercedes a symbol.
.sk
The "zip -v" report should show the perceived settings of these
variables.
.!------------------------------------------------------------------------------
.indent -4
2 File_Names
.br
Zip deals with file names in the system file system and with file names
in Zip archives.  File names in a Zip archive are stored in a UNIX-like
path-name format.  For example, a VMS file specification like this:
.sk;.indent 10
[.zip30.vms]descrip.mms
.sk
could appear in a Zip archive as:
.sk;.indent 10
zip30/vms/descrip.mms
.sk
For security reasons, paths in Zip archives are always stored as
relative paths, so an absolute VMS directory specification will be
transformed to a relative path in the archive (that is, no leading "/"). 
For example, the following absolute directory specification would give
the same archive path as the previous (relative) example:
.sk;.indent 10
[zip30.vms]descrip.mms
.sk
Also, device names are dropped, so the following file specification
would also give the same archive path:
.sk;.indent 10
sys$sysdevice:[zip30.vms]descrip.mms
.sk
If an archive is intended for use with PKUNZIP under MSDOS, then the -k
(for "Katz", --DOS-names) option should be used to attempt to adjust the
names and paths to conform to MSDOS character-set and length
limitations, to store only the MSDOS file attributes (just the
owner:write attribute from VMS), and to mark the entry as made under
MSDOS (even though it wasn't).
.sk
Note that file specifications in the file system must be specified using
VMS notation, but file names in an archive must be specified using the
UNIX-like notation used in the archive.  For example, where a BACKUP
command might look like this:
.sk.indent 10
$ back [.zip30...]*.* /excl = [...vms]*.c stuff.bck /save
.sk
a corresponding Zip command might look like this:
.sk;.indent 10;
$ zip stuff.zip [.zip30...]*.* -x */vms/*.c
.sk
because the files to be added to the Zip archive are specified using VMS
file specifications, but the -x (--exclude) option excludes names based
on their archive path/file names.  Options dealing with archive names
include -R (--recurse-patterns), -d (--delete), -i (--include), -x
(--exclude), and -U (--copy-entries).
.sk
Note: By default, on VMS, archive name pattern matching (-R, -d, -i, -x,
and -U) is case sensitive, even when the file system is not case
sensitive (or even case preserving).  This allows accurate matching of
mixed-case names in an archive which may have been created on a system
with a case sensitive file system, but it can involve extra effort on
VMS, where it may be necessary to use unnatural case names (or the same
names in multiple cases, like "*.obj *.OBJ") for this kind of pattern
matching to give the desired behavior.  If completely case-blind pattern
matching behavior is desired, specify the -ic (--ignore-case) option.
.!------------------------------------------------------------------------------
.indent -4
3 Case
.br
For better compatibility with UNIX-like systems, Zip, by default,
down-cases ODS2 file names.  For example, the following file on an ODS2
file system:
.sk;.indent 10
[.ZIP30.VMS]DESCRIP.MMS
.sk
would appear in an archive as:
.sk;.indent 10
zip30/vms/descrip.mms
.sk
Zip versions before 3.0 down-cased all VMS file names.  Now, various
options give the user control over these conversions:
.sk
.lm +10;.literal
-C    preserve case of all file names
-C-   down-case all file names
-C2   preserve case of ODS2 names
-C2-  down-case ODS2 file names (default)
-C5   preserve case of ODS5 names (default)
-C5-  down-case ODS5 file names
.end literal;.lm -10
.sk
Case is handled differently for archive member names, which the user
specifies with the -R, -d, -i, -x, and -U options.  By default, on VMS,
archive name pattern matching is case sensitive, even when the file
system is not case sensitive (or even case preserving).  This allows
accurate matching of mixed-case names in an archive which may have been
created on a system with a case sensitive file system, but it can
involve extra effort on VMS, where it may be necessary to use unnatural
case names (or the same names in multiple cases, like "*.obj *.OBJ") for
this kind of pattern matching to give the desired behavior.  If
completely case-blind pattern matching behavior is desired, specify the
-ic (--ignore-case) option.
.!------------------------------------------------------------------------------
.indent -4
2 Fixing_Damage
.br
Two options can be used to fix a damaged Zip archive.
.sk;.literal
-F  --fix
-FF  --fixfix
.end literal;.sk
The -F (--fix) option can be used if some portions of the archive are
missing, but it requires a reasonably intact central directory.  The
input archive is scanned as usual, but zip will ignore some problems. 
The resulting archive should  be valid, but any inconsistent entries
will be left out.
.sk
If the archive is too damaged or the end (where the central directory is
situated) has been truncated, you must use -FF (--fixfix).  This is a
change from zip 2.32, where the -F option is able to read a truncated
archive.  The -F option now more reliably fixes archives with minor 
damage, and the -FF option is needed to fix archives where -F and -FF
was used before.
.sk
With -FF, the archive is scanned from the beginning and Zip scans for
special signatures to identify the limits between the archive members.
The -F option is more reliable if the archive is not too much damaged,
so try this option first.
.sk
Neither option will recover archives that have been incorrectly
transferred, such as by FTP in ASCII mode instead of binary.  After the
repair, the -t option of UnZip may show that some files have a bad CRC.
Such files cannot be recovered; you can remove them from the archive
using the -d option of Zip.
.sk
Because of the uncertainty of the "fixing" process, it's required
to specify an output archive, rather than risking further damage to the
original damaged archive.  For example, to fix the damaged archive
foo.zip,
.sk;.indent 10
zip -F foo --out foo_fix
.sk
tries to read the entries normally, copying good entries to the new 
archive foo_fix.zip.  If this doesn't work, as when the archive is
truncated, or if some entries are missed because of bad central
directory entries, try -FF:
.sk;.indent 10
zip -FF foo --out foo_fixfix
.sk
and compare the resulting archive to the archive created using -F. The
-FF option may create an inconsistent archive.  Depending on what is
damaged, you can then use the -F option to fix that archive.
.sk
A split archive with missing split files can be fixed using -F if you
have the last split of the archive (the ".zip" file).  If this file is
missing, you must use -FF to fix the archive, which will prompt you for
the splits you have.
.sk
Currently, the fix options can't recover an entry which has a bad
checksum or is otherwise damaged.
.!------------------------------------------------------------------------------
.indent -4
2 Log_File
.br
Zip normally sends messages to the user's terminal, but these may be
also directed to a log file.
.sk;.literal
-la  --log-append
.end literal;.br
Append to an existing log file.  Default is to create a new version.
.sk;.literal
-lf logfilepath  --logfile-path logfilepath
.end literal;.br
Open a logfile at the given path.  By default, a new version will be
created, but with the -la option an existing file will be opened and the
new log information appended to any existing information.  Only
warnings and errors are written to the log unless the -li option is also
given, then all information messages are also written to the log.
.sk;.literal
-li  --log-info
.end literal;.br
Include information messages, such as file names being zipped, in the
log.  The default is to include only the command line, any warnings
and errors, and the final status.
.!------------------------------------------------------------------------------
.indent -4
2 Modes_of_Operation
.br
Zip supports two distinct types of command modes, external and 
internal.  The external modes (update, grow, and freshen) read files
from the file system (as well as from an existing archive) while the
internal modes (delete and copy) operate exclusively on entries in an
existing archive.
.sk;.literal
-u  --update
.end literal;.br
Update existing entries and add new files.  If the archive does not
exist, create it.  This is the default mode, so -u is optional.
.sk;.literal
-g  --grow
.end literal;.br
Grow (append to) the specified Zip archive, instead of creating a new
one.  If this operation fails, Zip attempts to restore the archive to
its original state.  If the restoration fails, the archive might become 
corrupted.  This option is ignored when there's no existing archive or
when at least one archive member must be updated or deleted.
.sk;.literal
-f  --freshen
.end literal;.br
Update existing entries in an existing archive.  Does not add new files
to the archive.
.sk;.literal
-d  --delete
.end literal;.br
Delete entries from an existing archive.
.sk;.literal
-DF  --difference-archive
.end literal;.br
Create an incremental backup-style archive, where the resulting archive 
will contain all new and changed files since the original archive was
created.  For this to work, the input file list and current directory 
must be the same as during the original Zip operation.
.sk
For example, if the existing archive was created using
.sk;.indent 10
zip foo_full.zip [.foo...]*.*
.sk
from just above the foo directory, then the command (also from just
above the foo directory):
.sk;.indent 10
zip foo_full.zip [.foo...]*.* -DF -O foo_incr.zip
.sk
creates the archive foo_incr.zip with just the files not in foo_full.zip
and the files where the size or date-time of the files does not match
that in foo_full.zip.  Note that in the "zip -DF" operation, the
original full archive is specified as the input archive, and the -O
(--output-file) option is used to specify the new (incremental) output
archive.
.sk;.literal
-FS  --filesync
.end literal;.br
Delete entries in the archive that do not match files on the OS.
Normally when an archive is updated, new files are added and changed
files are updated but files that no longer exist on the OS are not
deleted from the archive.  This option enables deleting of entries that
are not matched on the OS.  Enabling this option should create archives
that are the same as new archives, but since existing entries are copied
instead of compressed, updating an existing archive with -FS can be much
faster than creating a new archive.  If few files are being copied from
the old archive, it may be faster to create a new archive instead.
.sk
This option deletes files from the archive.  If you need to preserve the
original archive, make a copy of the archive first, or use the  -O
(--output) option to output the new archive to a new file.  Even though
it's slower, creating a new archive with a new archive name is safer, 
avoids mismatches between archive and OS paths, and is preferred.
.sk;.literal
-U  --copy-entries
.end literal;.br
Select entries in an existing archive and copy them to a new archive. 
Copy mode is like update mode, but entries in the existing archive are
selected by command line patterns rather than files from the file system
and it uses the -O (--output-file) option to write the resulting archive
to a new file rather than updating the existing archive, leaving the
original archive unchanged.
.sk
Normally, when updating an archive using relative file specifications
("[]", "[.xxx]", and so on), it helps to have the same default directory
as when the archive was created, but this is not a strict requirement.
.sk
Date-time information in a Zip archive may be influenced by time zone.
.!------------------------------------------------------------------------------
.indent -4
3 Examples
.br
When given the name of an existing archive, Zip will replace identically
named entries in the archive or add entries for new names.  For example,
if foo.zip exists and contains foo/file1 and foo/file2, and the
directory [.foo] contains the files file1 and file3, then:
.sk;.indent 10
$ zip foo [.foo...]*.*
.sk
will replace foo/file1 in foo.zip and add foo/file3 to foo.zip.  After
this, foo.zip contains foo/file1, foo/file2, and foo/file3, with foo/file2
unchanged from before.  This is the default mode -u (update).
.sk
Update will add new entries to the archive and will replace
existing entries only if the modified date of the file is more recent than
the date recorded for that name in the archive.  For example:
.sk;.indent 10
$ zip -u stuff *.*
.sk
will add any new files in the current directory, and update any changed
files in the archive stuff.zip.  Note that Zip will not try to pack
stuff.zip into itself when you do this.  Zip avoids including its own
output files when selecting files to include in the archive, so it
should be safe, as in this case, to have the archive included in the
list of input files.
.sk
A second mode, -f (freshen), like update will only
replace entries with newer files.  Unlike update, however, it will not
add files that are not already in the archive.  For example:
.sk;.indent 10
$ zip -f foo
.sk
Note that the -f option with no arguments freshens all the entries in the
archive.  The same is true of -u, so "zip -u foo" and "zip -f foo" do
the same thing.
.sk
When these options are used, Zip should be run from the same directory
as when the original Zip command was run, so that the path names in the
archive will continue to agree with the path names in the file system. 
Normally, it's also a good idea to keep the other options the same (-V,
-w, and the like), to keep the archive contents consistent.
.sk
The -t (--from-date) and -tt (--before-date) options can also be used
with adding, updating, or freshening to restrict further the files to be
included in the archive.  For example:
.sk;.indent 10
$ zip -rt 12071991 infamy [.FOO]*.*
.sk
will add all the files in [.FOO] and its subdirectories that were last
modified on December 7, 1991, or later to the achive infamy.zip.  Dates
can be in format mmddyyyy or yyyy-mm-dd.
.sk
Also, files can be explicitly excluded using the -x option:
.sk;.indent 10
$ zip -r foo [.FOO] -x *.obj
.sk
which will zip up the contents of [.FOO] into foo.zip but exclude all the
files that end in ".obj".
.sk
The -d (delete) mode will remove entries from an
archive.  An example might be:
.sk;.indent 10
$ zip -d foo foo/harry/*.* *.obj
.sk
which will remove all of the files that start with "foo/harry/" and all of
the files that end with ".obj" (in any path).
.sk
The last mode, -U (--copy-entries), selects entries from an existing
archive and copies them to a new archive.
.sk;.indent 10
$ zip -U foo *.obj --out fooobj
.sk
will copy all .obj entries from foo.zip and put them in the new archive
fooobj.zip.
.sk
Note: By default, on VMS, archive name pattern matching (-R, -d, -i, -x,
and -U) is case sensitive, even when the file system is not case
sensitive (or even case preserving).  This allows accurate matching of
mixed-case names in an archive which may have been created on a system
with a case sensitive file system, but it can involve extra effort on
VMS, where it may be necessary to use unnatural case names (or the same
names in multiple cases, like "*.obj *.OBJ") for this kind of pattern
matching to give the desired behavior.  If completely case-blind pattern
matching behavior is desired, specify the -ic (--ignore-case) option.
.!------------------------------------------------------------------------------
.indent -4
2 Options_List
.br
"zip -h" provides a concise list of common command-line options.  "zip
-h2" provides more details.  "zip -so" provides a list of all available
options.  "zip -v" shows the program version and available features. 
(The list below was derived from a "zip -so" listing.)
.sk
Short-form options begin with a single hyphen ("-").  Long-form option
begin with a double hyphen ("--"), and may be abbreviated to any
unambiguous shorter string.  For example:
.lm +10;.literal
-v
--verbose
--verb
.end literal;.lm -10
.sk
To avoid confusion, if a negatable option contains an embedded hyphen
("-"), then avoid abbreviating it at the hyphen if you plan to negate
it.  For example, if an option like --some-option were abbreviated to
--some-, the parser would consider that trailing hyphen to be part of
the option name, rather than as a negating trailing hyphen.  This
behavior may change in the future, to interpret the trailing hyphen in
--some- to be negating.  (So don't do it.)
.sk
Some options may be negated (or modified) by appending a "-":
.lm +10;.literal
-la-
--show-files-
.end literal;.lm -10
.sk
Some options take a value, which may immediately follow the option, or
be separated by a space or "=".  For example:
.lm +10;.literal
-ttmmddyyyy
-tt mmddyyyy
-tt=mmddyyyy
.end literal;.lm -10
.sk
.lm -4;.literal
 Sh  Long                Description
----+-------------------+--------------------------------------------------
 0   store               store (instead of compress)
 1   compress-1          compress faster (-2, -3, -4, ...)
 9   compress-9          compress better
 ?                       show the Zip help screen
 @   names-stdin         read input file patterns from SYS$INPUT (1/line)
 A   adjust-sfx          adjust self-extracting executable
 b   temp-path  path     use "path" directory for temporary files
 C   preserve-case       preserve case of all file names added to archive
 C-  preserve-case-      down-case all file names added to archive
 C2  preserve-case-2     preserve case of ODS2 names added to archive
 C2- preserve-case-2-    down-case ODS2 file added to archive (default)
 C5  preserve-case-5     preserve case of ODS5 names added to archive (dflt)
 C5- preserve-case-5-    down-case ODS5 names added to archive
 c   entry-comments      add a comment for each entry added to archive
 D   no-dir-entries      do not add archive entries for directories
 DF  difference-archive  difference archive: add only changed or new files
 d   delete              delete entries in archive
 db  display-bytes       display running byte counts
 dc  display-counts      display running file counts
 dd  display-dots        display progress dots for files (dflt size = 10MB)
 dg  display-globaldots  display progress dots for archive, not each file
 ds  dot-size   size     set progress dot interval to "size" (MB)
 du  display-usize       display original uncompressed size for entries
 dv  display-volume      display volume (disk) number as in_disk>out_disk
 e   encrypt             encrypt entries, ask for password
 F   fix                 fix mostly intact archive (try F before FF)
 FF  fixfix              salvage what can be salvaged (not as reliable)
 FS  filesync            remove archive entries unmatched in file system
 f   freshen             update existing entries (only changed files)
 fd  force-descriptors   force data descriptors as if streaming
 fz  force-zip64         force use of Zip64 format
 g   grow                grow existing archive (unless updating or deleting)
 H                       show the Zip help screen
 h   help                show the Zip help screen
 h2  more-help           show extended Zip help
 i   include  pat1 [pat2 [...]]  include only names matching the patterns
 ic  ignore-case         ignore case (case-blind archive entry name matching)
 J   junk-sfx            junk (remove) archive preamble (unzipsfx)
 j   junk-paths          junk (don't store) directory names, only file names
 k   DOS-names           simulate PKZIP-made archive (DOS 8.3 names)
 L   license             show software license
 l   to-crlf             translate end-of-lines (LF -> CRLF)
 la  log-append          append to existing log file
 lf  logfile-path  lfile  log to log file at lfile (default: new version)
 li  log-info            include informational messages in log
 ll  from-crlf           translate end-of-lines (CRLF -> LF)
 MM  must-match          input file spec must exist (wildcards must match)
 m   move                delete files added to archive
 n   suffixes  sfx1[:sfx2[...]]  don't compress files with these suffixes
 nw  no-wild             no wildcards during add or update
 O   output-file  ozf  use "ozf" as the output archive (dflt = inp archive)
 o   latest-time         set archive date-time to match oldest entry
 P   password  password  encrypt with supplied "password" string
 q   quiet               quiet operation (no info messages)
 R   recurse-patterns    recurse into subdirs from cur dir, match names only
 r   recurse-paths       recurse into directories from specified path pats
 s   split-size  size    split archive at "size" (K/MB)  (0: don't split)
 sb  split-bell          ring terminal bell at pause for split medium change
 sc  show-command        show command line
 sd  show-debug          show debug messages
 sf  show-files          show files to process (only)
 so  show-options        show list of all command-line options
 sp  split-pause         pause to select split destination(s)
 sv  split-verbose       be verbose about creating splits
 T   test                test archive integrity (runs UnZip -T)
 t   from-date  mmddyyyy  only do files since (at or after) "mmddyyyy"
 tt  before-date  mmddyyyy  only do files before "mmddyyyy"
 u   update              update changed files, add new files (default mode)
 V   VMS-portable        save VMS file attributes
 VV  VMS-specific        save VMS file attributes and all allocated blocks
 v   verbose             verbose messages (print version info if only arg)
 w   VMS-versions        save VMS version numbers in archive
 ww  VMS-dot-versions    save VMS version numbers as ".nnn", not ";nnn"
 X   strip-extra         strip all but critical extra fields
 X-  strip-extra-        keep all extra fields
 x   exclude  pat1 [pat2 [...]]  exclude all names matching the patterns
 Z   compression-method mthd  use compress method "mthd" (bzip2 or deflate)
 z   archive-comment     ask for archive comment
.end literal;.lm +4
.!------------------------------------------------------------------------------
.indent -4
2 Miscellaneous_Options
.sk;.literal
-D  --no-dir-entries
.end literal;.br
Do not create entries in the archive for directories.  By default,
directory entries are added to an archive, so that their attributes can
be saved in the archive.  When an archive is created using -D, UnZip
will still create directories as needed (subject to user control), but
they will get the default attributes (date-time, permissions, ...) on
the destination system, rather than their original atributes.
.sk;.literal
-MM  --must-match
.end literal;.br
All input patterns must match at least one file and all input files 
found must be readable.  Normally when an input pattern does not match
a file the "name not matched" warning is issued and when an input
file has been found but later is missing or not readable a "missing or
not readable" warning is issued.  In either case Zip continues
creating the archive, with missing or unreadable new files being skipped 
and files already in the archive remaining unchanged.  After the
archive is created, if any files were not readable zip returns the OPEN
error code (18 on most systems) instead of the normal success return (0
on most systems).  With -MM, Zip exits as soon as an input pattern
is not matched (whenever the "name not matched" warning would be issued)
or when an input file is not readable. In either case Zip exits with
an OPEN error and no archive is created.
.sk
This option is useful when a known list of files is to be zipped so any
missing or unreadable files should result in an error.  It may be less
useful when used with wildcards, but Zip will still exit with an error
if any input pattern doesn't match at least  one file or if any
matched files are unreadable.  If you want to create the archive anyway
and only need to know if files were skipped, then don't use -MM and just
check the exit status.  Also, a log file (see -lf (--logfile-path))
could be useful.
.sk;.literal
-O out_file  --output-file out_file
.end literal;.br
Process the archive changes as usual, but instead of updating the
existing archive, send the output to a new archive, "out_file".  The
output archive specified must be a different file from the input
archive.
.sk
This option can be used to create updated split archives.  It can
also be used with -U to copy entries from an existing archive to
a new archive.  See the EXAMPLES section below.
.sk
Another use is converting zip files from one split size to
another.  For instance, to convert an archive with 700MB CD splits
to one with 2GB DVD splits, can use:
.sk;.indent 10
zip -s 2g cd-split.zip --out dvd-split.zip
.sk
which uses copy mode.  See -U below.  Also:
.sk;.indent 10
zip -s 0 split.zip --out unsplit.zip
.sk
will convert a split archive to a single-file archive.
.sk
Copy mode will convert stream entries (using data descriptors and which
may be incompatible with some unzip programs) to normal entries (which
should be compatible with all unzip programs), except if standard
encryption was  used.  For archives with encrypted entries, zipcloak
will decrypt the entries and convert them to normal entries.
.sk;.literal
-o  --latest-time
.end literal;.br
Set the modification date-time of the Zip archive file to the latest
(newest) modification date-time found among the entries in the zip
archive.  This can be used without any other operations, if
desired.  For example:
.sk;.indent 10
zip -o foo
.sk
will change the modification date-time of foo.zip to the latest time of
the entries in foo.zip.
.sk;.literal
-q  --quiet
.end literal;.br
Quiet mode.  Eliminates informational messages and comment prompts. 
This mode may be useful in command procedures, or if the Zip operation
is being performed as a background task ("$ spawn/nowait zip -q foo
*.c").
.sk
.sk;.literal
-T  --test
.end literal;.br
Test the integrity of a zip archive (the new one, if -O (--output-file)
is specified).  If the check fails, the old zip file is unchanged  and
(with the -m option) no input files are removed.
.sk
Implementation
.br
"zip -T" actually runs an "unzip -t" command to do the testing, so UnZip
must be installed properly for this to work.
.sk;.literal
-TT unzip_cmd  --unzip-command unzip_cmd
.end literal;.br
Specify the actual UnZip command, "unzip_cmd" (normally a DCL symbol) to
use for "zip -T".  This can be useful if multiple versions of UnZip are
installed on a system, and the default DCL symbol "UNZIP" would run the
wrong one (or the logical name DCL$PATH would lead to the wrong one).
.sk
In "unzip_cmd", the string "{}" is replaced by the temporary name of the
archive to be tested, otherwise the name of the archive is appended
to the end of the command.  The exit status is checked for success severity.
.sk;.literal
-v  --verbose
.end literal;.br
Verbose mode or print diagnostic version info.
.sk
Normally, when applied to real operations, this option enables the 
display of a progress indicator during compression (see -dd for more on
dots) and requests verbose diagnostic info about archive structure
oddities.
.sk
When -v is the only command line argument, a diagnostic report is
displayed, showing:
.lm +3;.br;.indent -2
o Copyright and other legal notices
.br;.indent -2
o Program name, version, and release date
.br;.indent -2
o Pointers to Info-ZIP FTP and Web sites
.br;.indent -2
o Program build information (compiler type and version, OS version, and
the compilation date
.br;.indent -2
o Optional features enabled at compile-time
.br;.indent -2
o Environment variable definitions (ZIP_OPTS, ZIPOPT)
.lm -3;.br
.sk
This information should be included in bug reports.
.sk;.literal
-y  --symlinks
.end literal;.br
Store symbolic links as such in the Zip archive, instead of compressing
and storing the file referred to by the link.  A symbolic link normally
requires less storage than the actual file, both in the archive, and on
the destination file system.
.sk
On VMS, symbolic links are supported on ODS5 disks where the C RTL
supports symbolic links.  Full support for symbolic links seems to
require VMS V8.3, but a Zip program supporting symbolic links may be
built on VMS V7.3-2.
.!------------------------------------------------------------------------------
.indent -4
2 Progress_Display
.br
Various options control the display of progress messages during Zip
operation.
.sk;.literal
-db  --display-bytes
.end literal;.br
Display running byte counts showing the bytes processed and the bytes to
go.
.sk;.literal
-dc  --display-counts
.end literal;.br
Display running count of entries processed and entries to go.
.sk;.literal
-dd  --display-dots
.end literal;.br
Display dots while each entry is processed (except on ports that have 
their own progress indicator).  See -ds below for setting dot size.  The
default is a dot every 10 MB of input file processed.  The -v
(--verbose) option also displays dots and used to at a higher rate than
this (at the same rate as in previous versions of Zip) but this rate has
been changed to the new 10 MB default, and is also controlled by -ds.
.sk;.literal
-dg  --display-globaldots
.end literal;.br
Display progress dots for the archive instead of for each file.  The
command
.sk;.indent 10
zip -qdgds 10m
.sk
will turn off most output except dots every 10 MB.
.sk;.literal
-ds size  --dot-size size
.end literal;.br
Set amount of input file processed for each dot displayed.  See -dd to
enable displaying dots.  Setting this option implies -dd.  "size" is in
the format "nm" where n is a number and m is a multiplier.  Currently
"m" can be k (KB), m (MB), g (GB), or t (TB), so if "n" is 100 and "m"
is k, "size" would be 100k which is 100KB.  The default is 10MB.
.sk
The -v (--verbose) option also displays dots and used to default to a
higher rate than this (at the same rate as in previous versions of Zip)
but now the default is 10 MB and the -v dots are also controlled by this
option.  A "size" of 0 turns dots off.
.sk
This option does not control the dots from the "Scanning files" message 
as Zip scans for input files.  The dot size for that is fixed at 2
seconds or a fixed number of entries, whichever is longer.
.sk;.literal
-du  --display-usize
.end literal;.br
Display the uncompressed size of each entry.
.sk;.literal
-dv  --display-volume
.end literal;.br
Display the volume (disk) number each entry is being written to.
.!------------------------------------------------------------------------------
.indent -4
2 Self_Extracting_Archives
.br
A self-extracting archive (SFX) comprises a normal Zip archive appended
to a special UnZip program (such as UNZIPSFX.EXE) for the intended
target system.
.sk
The UnZip distribution includes a VMS command procedure,
[,vms]makesfx.com, which can be used directly or adapted to create an
SFX archive from a normal Zip archive.
.sk
The .ZIP file format includes offsets to data structures in the archive,
and these offsets are measured from the start of the archive file. 
Appending an archive to an UnZip SFX executable effectively moves the
start of the archive file.  That makes the original offsets wrong, and
that will cause the UnZip SFX program to emit warning messages when it
tries to unpack the archive.  Zip -A can be used to adjust these offsets
in a self-extracting archive.  For example, to adjust the offsets in
foo.sfx_exe:
.sk;.indent 10
zip -A foo.sfx_exe
.sk
Similarly, the UnZip SFX program can be removed from a self-extracting
archive (and the offsets in the archive restored) using the -J
(--junk-sfx) option.  For example:
.sk;.indent 10
zip -J foo.sfx_exe
.sk
Note that a self-extracting archive contains a normal Zip archive, and a
normal UnZip program can be used to expand it in the normal way.  You
may get a warning about extra bytes at the beginning of the archive (the
UnZip SFX program), but UnZip should work properly after that.  This
allows data in a self-extracting archive to be accessed on any system,
not just the target system where its embedded UnZip SFX program runs.
.!------------------------------------------------------------------------------
.indent -4
2 Split_Archives
.br
Beginning with version 3.0, Zip supports split archives.  A split
archive is one which is divided into multiple files, usually to allow it
to be stored on multiple storage media (floppy diskettes, CD-ROMs, or
the like) when a single medium would be too small to contain the whole
archive.  (Note that split archives are not just unitary archives split
into pieces, as the .ZIP file format includes offsets to data structures
in the archive, and for a split archive these are based on the start of
each split, not on the start of the whole archive.  Concatenating the
pieces will invalidate these offsets, but UnZip can usually deal with
it.  Zip will usually refuse to process such a spliced archive unless
the -FF fix option is used to fix the offsets.)
.sk
For a split archive with, say, 20 split files, the files are typically
named ARCHIVE.z01, ARCHIVE.z02, ..., ARCHIVE.z19, ARCHIVE.zip, where
"ARCHIVE" is the archive name specified by the user on the Zip command
line.  Note that the last split file is the ".zip" file.  In contrast,
"spanned" archives are the original multi-disk archive generally
requiring floppy disks and using volume labels to store disk numbers. 
Zip supports split archives but not spanned archives, though a procedure
exists for converting split archives of the right size to spanned
archives.  The reverse is also true, where each file of a spanned
archive can be copied in order to files with the above names to create a
split archive.
.!------------------------------------------------------------------------------
.indent -4
3 Options
.br
Use "-s size" to create a split archive (and to set the split size). 
The size is given as a number followed optionally by a multiplier suffix
of k (KB), m (MB, the default if no suffix is specified), g (GB), or t
(TB).  (All are powers of 1024, not 1000).  64K is the minimum split
size.  For example, the following command could be used to create a
split archive called "foo" from the contents of the "bar" directory with
splits of 670MB, which might be useful for burning on CDs:
.sk;.indent 10
zip -s 670m foo [.bar...]*.*
.sk
Using -s without -sp as above creates all the splits in the directory
specified by "foo", in this case the current default directory.  This 
split mode updates the splits as the archive is being created, requiring
all splits to remain writable, but creates split archives that are
readable by any UnZip that supports split archives.  See -sp below for
enabling split pause mode which allows splits to be written directly to
removable media.
.sk
The -sv option can be used to enable verbose splitting and display
details of how the splitting is being done.  The -sb option can be used
to ring the terminal bell when Zip pauses for the next split
destination.
.sk
The -sp option can be used to pause Zip between splits to allow 
changing removable media, for example, but read the descriptions and
warnings for both -s and -sp below.
.sk
Though Zip does not update split archives, Zip provides the option
-O (--output-file) to allow split archives to be updated and saved in a
new archive.  For example:
.sk;.indent 10
zip inarchive.zip foo.c bar.c -O outarchive.zip
.sk
reads archive inarchive.zip, even if split, adds the files foo.c and
bar.c, and writes the resulting archive to outarchive.zip.  If
inarchive.zip is split, then outarchive.zip defaults to the same split
size.  Be aware that outarchive.zip and any split files that are created
with it are always overwritten without warning.  This may be changed in 
the future.
.!------------------------------------------------------------------------------
.indent -4
2 Temporary_Files
.br
When creating a new archive or normally when changing an existing
archive, Zip will write a temporary file in the archive destination
directory ("ZIxxxxxxxx", where "xxxxxxxx" is the hexadecimal process ID)
with the new contents.  Then, if and when the Zip job has completed with
no errors, it will rename the temporary file to the specified archive
name (replacing the old archive, if any).
.sk
You can use the -b (--temp-path) option to specify a different path
(device and/or directory) for the temporary file, but specifying a
different device will force Zip to copy the temporary file to its final
destination instead of simply renaming it, and that copying will take
more time than renaming, especially for a large archive.  For example:
.sk;.indent 10
$ zip -b disk$scratch:[tmp] stuff *
.sk
will cause Zip to put its temporary files in the directory
"disk$scratch:[tmp]", copying the temporary file back to the current
directory as stuff.zip when it's complete.
.!------------------------------------------------------------------------------
.indent -4
2 Text_Files
.br
Zip offers some options to help deal with line endings in text files. 
These may have limited utility on VMS.
.sk;.literal
-l  --to-crlf
.end literal;.br
Translate the UNIX end-of-line character LF (CR on MAC) into the MSDOS
convention CR-LF.  This option should not be used on binary files.  This
option can be used on UNIX if the Zip file is intended for PKUNZIP under
MSDOS.  If the input files already contain CR-LF, this option adds an
extra CR.  This ensure that "unzip -a" on Unix will get back an exact
copy of the original file, to undo the effect of "zip -l".  See -ll
below for the binary checks.
.sk;.literal
-ll  --from-crlf
.end literal;.br
Translate the MSDOS end-of-line CR LF into UNIX LF (CR on MAC).  This
option should not be used on binary files.  This option can be used on
MSDOS if the Zip archive is intended for UnZip under UNIX.
.sk
For both -l and -ll, if the file is converted and the file is later
determined to be binary, a warning is issued and the file is probably
corrupted.  If Zip with -l or -ll detects binary (non-text) in the first
buffer read from a file, it issues a warning and skips line-ending
conversion on the file, avoiding corruption.  This check seems to catch
all binary files tested, but the original check remains and if a
converted file is later determined to be binary, that warning is still
issued.  The algorithm now being used for binary detection should allow
line-ending conversion of text files in UTF-8 and similar encodings.
.!------------------------------------------------------------------------------
.indent -4
2 VMS_Specifics
.br
VMS File Attributes
.sk;.literal
-V  --VMS-portable
-VV --VMS-specific
.end literal;.br
The -V and -VV options cause Zip to store VMS file atributes (such as
file organization, record format, carriage control, and so on) in
VMS-specific "extra fields" in an archive along with the usual data. 
These extra fields are ignored on non-VMS systems, but on a VMS system,
they allow UnZip to restore the files with their VMS attributes intact.
.sk
With -V, Zip ignores any data in the file after the end-of-file (EOF)
point (defined by FAT$L_EFBLK and FAT$W_FFBYTE), which works well for
well-formed files (that is, those with no valid data beyond EOF). 
Portable-format files (Stream_LF, fixed-512) archived with -V should be
extracted properly on a non-VMS system.  Files with more complex
structures, such as indexed files and files with embedded byte counts
or other such data may be of limited use on other systems.  (UnZip on
non-VMS systems may be able to extract various VMS-format text files,
however.)
.sk
With -VV, Zip processes all allocated blocks for the file (including
those beyond EOF).  When extracted on a VMS system, the original file
should be reproduced with as much fidelity as possible, but on a non-VMS
system, most files will be seen as corrupt because of the data from
beyond EOF.
.sk
VMS File Version Numbers
.sk;.literal
-w  --VMS-versions
-ww  --VMS-dot-versions
.end literal;.br
By default, for compatibility with non-VMS systems, Zip strips VMS file
version numbers from the names stored in an archive.  The -w
(--VMS-versions) option causes Zip to retain file version numbers on
names in an archive. Without -w, a version number wildcard (";*") can
cause errors when multiple versions of a single file are treated as
multiple files with the same name.
.sk
For better compatibility with non-VMS systems where semi-colons are less
popular in file names, the -ww (--VMS-dot-versions) option stores the
file version numbers with a dot (".nnn") instead of a semi-colon
(";nnn").
.!------------------------------------------------------------------------------
.indent -4
2 Copyright_and_License
.br
Zip has an option to display its copyright and license.
.sk;.literal
-L  --license
.end literal;.br
The license is reproduced below.
.sk.lm +3
This is version 2007-Mar-4 of the Info-ZIP license. The definitive
version of this document should be available at
ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely and a copy
at http://www.info-zip.org/pub/infozip/license.html.
.lm -3;.sk
--------------------------------------------------------
.sk
Copyright (c) 1990-2007 Info-ZIP.  All rights reserved.
.sk
For the purposes of this copyright and license, "Info-ZIP" is defined as
the following set of individuals:
.sk;.lm +3
     Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
     Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth,
     Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
     David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
     Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
     Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda,
     Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren,
     Rich Wales, Mike White.
.lm -3;.sk
This software is provided "as is," without warranty of any kind, express
or implied.  In no event shall Info-ZIP or its contributors be held
liable for any direct, indirect, incidental, special or consequential
damages arising out of the use of or inability to use this software.
.sk
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the above disclaimer and the following restrictions:
.sk;.lm +7;.indent -4
    1. Redistributions of source code (in whole or in part) must retain
       the above copyright notice, definition, disclaimer, and this list
       of conditions.
.sk;.indent -4
    2. Redistributions in binary form (compiled executables and libraries)
       must reproduce the above copyright notice, definition, disclaimer,
       and this list of conditions in documentation and/or other materials
       provided with the distribution.  The sole exception to this condition
       is redistribution of a standard UnZipSFX binary (including SFXWiz) as
       part of a self-extracting archive; that is permitted without inclusion
       of this license, as long as the normal SFX banner has not been removed
       from the binary or disabled.
.sk;.indent -4
    3. Altered versions -- including, but not limited to, ports to new operating
       systems, existing ports with new graphical interfaces, versions with
       modified or added functionality, and dynamic, shared, or static library
       versions not from Info-ZIP -- must be plainly marked as such and must not
       be misrepresented as being the original source or, if binaries,
       compiled from the original source.  Such altered versions also must not
       be misrepresented as being Info-ZIP releases -- including, but not
       limited to, labeling of the altered versions with the names "Info-ZIP"
       (or any variation thereof, including, but not limited to, different
       capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the
       explicit permission of Info-ZIP.  Such altered versions are further
       prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP
       e-mail addresses or the Info-ZIP URL(s), such as to imply Info-ZIP
       will provide support for the altered versions.
.sk;.indent -4
       4. Info-ZIP retains the right to use the names "Info-ZIP", "Zip",
       "UnZip", "UnZipSFX", "WiZ", "Pocket UnZip", "Pocket Zip", and
       "MacZip" for its own source and binary releases.
.lm -7;.sk
.!------------------------------------------------------------------------------
.indent -4
2 Acknowledgements
.br
       Thanks to R. P. Byrne for his Shrink.Pas program, which
       inspired this project, and from which the shrink algorithm
       was stolen; to Phil Katz for placing in the public domain
       the zip file format, compression format, and .ZIP filename
       extension, and for accepting minor changes to the file
       format; to Steve Burg for clarifications on the deflate
       format; to Haruhiko Okumura and Leonid Broukhis for providing
        some useful ideas for the compression algorithm; to
       Keith Petersen, Rich Wales, Hunter Goatley and Mark Adler
       for providing a mailing list and ftp site for the Info-ZIP
       group to use; and most importantly, to the Info-ZIP group
       itself (listed in the file infozip.who) without whose
       tireless testing and bug-fixing efforts a portable zip
       would not have been possible.  Finally we should thank
       (blame) the first Info-ZIP moderator, David Kirschbaum,
       for getting us into this mess in the first place.
.!------------------------------------------------------------------------------
.indent -4
2 Bugs
.br
All bug reports, patches, or suggestions should go to zip-bugs via the
web site contact form at http://www.Info-ZIP.org.  Patches should be
sent as unified or context diffs only (diff -u or diff -c).
.sk
Any bug report should include the Zip version, any special compilation
options (see "zip -v" report), the host system type and operating system
version, and any other relevant information (compiler version, lunar
phase, ...).  
.!------------------------------------------------------------------------------
