1.!
2.!  File:       UNZIP_DEF.RNH
3.!
4.!  Author:     Hunter Goatley
5.!
6.!  Date:       October 23, 1991
7.!
8.!  Description:
9.!
10.!      RUNOFF source file for VMS on-line help for portable UnZip.
11.!      Adapted from UNZIP.MAN (now UNZIP.TXT).
12.!
13.!      To build:       $ REN UNZIP_DEF.RNH UNZIP.RNH
14.!                      $ RUNOFF UNZIP.RNH
15.!                      $ LIBR/HELP/INSERT libr UNZIP
16.!
17.!  Modification history:
18.!
19.!      01-001          Hunter Goatley          23-OCT-1991 09:21
20.!              Genesis.
21.!      01-002          Cave Newt               16-MAR-1992 22:37
22.!              Updated for UnZip 4.2.
23.!      01-003          Igor Mandrichenko       23-MAY-1992 22:14
24.!              Added -X option to command syntax.
25.!      01-004          Cave Newt               24-MAY-1992 13:30
26.!              Added UNZIP_OPTS environment variable help.
27.!      01-005          Igor Mandrichenko       14-DEC-1993 18:55
28.!              Modified for UnZip V5.1
29.!      01-006          Cave Newt               21-DEC-1993 12:38
30.!              Added -x option and cleaned up.
31.!      01-007          Cave Newt               14-JUL-1994 09:45
32.!              Added -Z, -C and -L options, removed -U, minor clean-up.
33.!      01-008          Cave Newt               28-JUL-1994 08:57
34.!              Removed semi-colons from comments.
35.!      02-001          Christian Spieler       09-DEC-1995 02:25
36.!              Modified for UnZip 5.2.
37.!      02-002          Christian Spieler       06-FEB-1996 02:25
38.!              Added -h "help" option.
39.!      02-003          Christian Spieler       04-MAR-1997 20:25
40.!              Added -P "command line password" option.
41.!      02-004          Christian Spieler       26-JUL-1997 00:05
42.!              Added Exit_Codes subtopic, explaining UnZip's VMS return codes.
43.!      02-005          Christian Spieler       28-APR-2000 03:22
44.!              Changed references to plaintext UnZip documentation file
45.!              into "UNZIP.TXT".
46.!      02-006          Christian Spieler       15-APR-2001 22:29
47.!              Added description for extended functionality of -b option.
48.!      02-007          Christian Spieler       10-DEC-2001 13:58
49.!              Added description for new -: traverse dirs option.
50.!      02-008          Christian Spieler       29-JAN-2005 01:50
51.!              Added description for the -T "set archive timestamp" option.
52.!      02-009          Christian Spieler       04-MAR-2007 14:37
53.!              Added description for the -S "Stream-LF text files" option;
54.!              updated the documentation of the VMS exit codes.
55.!      02-010          S. Schweda, C. Spieler  28-Dec-2007 21:28
56.!              Added description for the -D "timestamp restoration" option.
57.!
58.noflags
59.lm4 .rm72
60.indent -4
611 UNZIP
62.br
63UnZip is used to extract files compressed and packaged by Zip (see HELP ZIP
64for information on ZIP).
65.sk
66For a brief help on Zip and Unzip, run each without specifying any
67parameters on the command line, or specify the -h flag (but not in UnZip's
68Zipinfo mode).
69.sk
70UNZIP will list, test, or extract from a ZIP archive.  ZIP archives are commonly
71found on MS-DOS systems; a VMS version of ZIP can also be found here.
72.sk
73Archive member extraction is implied by the absence of the -c, -p, -t, -l, -v or
74-z options.  All archive members are processed unless a filespec is provided to
75specify a subset of the archive members.
76Format:
77.sk;.lm+1;.literal
78UNZIP [-cfhlptTuvxz[ajnoqCDLMSVXY:2]] file[.zip] [list] [-x xlist] [-d out_dir]
79.end literal;.lm-1
80.!------------------------------------------------------------------------------
81.indent -4
822 Parameters
83.sk;.indent -4
84file[.zip]
85.sk
86File specification for the ZIP archive(s) with optional wildcards. UnZip will
87perform actions specified for every zipfile matching the specification.
88Default file specification is SYS$DISK:[].ZIP.
89Note that self-extracting ZIP files are supported; just specify the .EXE
90suffix yourself.
91.sk;.indent -4
92[list]
93.sk
94An optional list of archive members to be processed; if no list is given, all
95archive members are processed.  Expressions may be
96used to match multiple members.  Expressions should be enclosed in double-quotes
97to prevent interpretation by DCL.  Multiple filenames should be separated by
98blanks.  Each file specification is similar to a Unix egrep expression and may
99contain:
100.sk
101.literal
102     *       matches a sequence of 0 or more characters
103     ?       matches exactly 1 character
104     [...]   matches any single character found inside the brackets;
105             ranges are specified by a beginning character, a hyphen,
106             and an ending character.  If a '!' or '^' immediately
107             follows the left bracket, then any character not in the
108             given range is matched.
109             Hint: To specify a verbatim left bracket '[', the
110                   three-character sequence "[[]" has to be used.
111.end literal
112.sk
113.sk;.indent -4
114[-x xlist]
115.sk
116An optional list of archive members to be excluded from processing.  The xlist
117overrides any files included in the normal list.
118.sk;.indent -4
119[-d out_dir]
120.sk
121Optional directory specification to be used as target root directory
122for files to be extracted.  Directory should be specified in "[.foo]"
123format rather than "foo.dir" or "foo/" format.
124.!------------------------------------------------------------------------------
125.indent -4
1262 Options
127.br
128The default action of UnZip is to extract all zipfile entries.  The following
129options and modifiers can be provided:
130.sk;.literal
131   -Z   ZipInfo mode
132   -c   extract files to SYS$OUTPUT (terminal)
133   -f   freshen existing files (replace if newer); create none
134   -h   show brief help screen and exit quietly
135   -l   list archive files (short format)
136   -p   extract files to SYS$OUTPUT; no informational messages
137   -t   test archive files
138   -T   set zipfile timestamps to that of each archive's newest entry
139   -u   update existing files; create new ones if needed
140   -v   list archive files (verbose format)
141   -z   display only the archive comment
142.end literal;.sk;.literal
143 MODIFIERS
144   -a   extract text files in standard VMS text file format
145   -aa  extract all files as text
146   -b   auto-extract only binary files in fixed 512-byte record format
147   -bb  extract all files as binary in fixed 512-byte record format
148   -j   junk paths (don't recreate archive's directory structure)
149   -n   never overwrite or make a new version of an existing file
150   -o   always make a new version (-oo: overwrite orig) existing file
151   -q   perform operations quietly (-qq => even quieter)
152   -C   match filenames case-insensitively
153   -D   do not restore any timestamps (--D restore them even for dirs)
154   -L   convert filenames to lowercase if created under DOS, VMS, etc.
155   -M   feed screen output through built-in "more" pager
156   -P<password> supply decryption password on the cmd line (insecure!)
157   -S   use Stream_LF record format to extract text files (with -a[a])
158   -V   retain (VMS) file version numbers
159   -X   restore owner/ACL protection info (may require privileges)
160   -Y   treat ".nnn" suffix as version number ("a.b.3" -> "a.b;3")
161   -:   allow "../" path components to traverse across top extract dir
162   -2   force creation of ODS2-compatible file names
163.end literal;.sk
164Note that uppercase options (-C, -D, -L, -M, -P, -S, -T, -V, -X, -Y, and
165-Z) must be specified in quotes (unless SET PROC/PARSE=EXTEND is set).
166For example:
167.sk;.literal
168    unzip "-VX" -a zipfile
169.end literal;.sk
170When extracting to SYS$OUTPUT (-c or -p options) redirected to a file,
171you may want to override the default text file conversion by specifying
172the -b option. A single "-b" option switches to "binary piping" mode
173for Zip entries marked as non-text, only. To force "binary piping" mode
174even for Zip file entries marked as text, the "-bb" option should be used.
175(Please note that a later "-a" cancels any -b option, see below.)
176.sk
177The output conversion options -b and -a may be combined to perform
178binary conversions on binary files and text conversion on text files.
179But note: For compatibility with implementation on other systems, -b cancels
180any -a option; to get the intended result, -a must be specified AFTER -b.
181And, in combination, "text" recognition takes precedence; this means
182that -bba (-bb -a) has the same effect as -ba (-b -a), and -aa overrides
183binary conversion for ALL files.
184.sk
185The conversion option -S is only effective when used together with
186-a or -aa. When specified, "text" files are written in Stream-LF record
187format instead of the VMS default of Variable-Length record format.
188(When no conversion options are specified, all non-VMS entries are always
189written as Stream-LF files.)
190.sk
191Please note that using the "-P<password>" option is higly insecure, the
192plaintext password may be seen by others. For this reason (and because of
193lack of space), the "-P<password>" option is not advertised on UnZip's
194online help screen.
195.!------------------------------------------------------------------------------
196.indent -4
1972 Exit_Status
198.br
199On VMS, UnZip's UNIX-style exit values are mapped into VMS-style status
200codes with facility code 1954 = %x7A2, and with the inhibit-message
201(%x10000000) and facility-specific (%x00008000) bits set:
202.sk
203.literal
204   %x17A28001                        normal exit
205   %x17A28000 + 16*UnZip_error_code  warnings
206   %x17A28002 + 16*UnZip_error_code  normal errors
207   %x17A28004 + 16*UnZip_error_code  fatal errors
208.end literal
209.sk
210Note that multiplying the UNIX-style UnZip error code by 16 places it
211conveniently in the hexadecimal representation of the VMS exit code,
212"__" in %x17A28__s, where "s" is the severity code.  For example, a
213missing archive might cause UnZip error code 9, which would be
214transformed into the VMS exit status %X17A28092.
215.sk
216The UnZip VMS exit codes include severity values which approximate those
217defined by PKWARE, as shown in the following table:
218.literal
219
220    VMS     UnZip err
221  severity    code     Error description
222 ----------+---------+----------------------------------------------
223  Success       0      Normal.  No errors or warnings detected.
224  Warning       1      One or more warnings  were  encountered, but
225                       processing  completed  successfully  anyway.
226                       This  includes  archives  where  one or more
227                       (but not all)  files were skipped because of
228                       unsupported compress or encrypt methods,  or
229                       bad passwords.
230  Error         2      Error in the archive format.  Processing may
231                       have completed  successfully  anyway.   Some
232                       defects in archives (made by other programs)
233                       can be repaired transparently.
234  Fatal         3      Severe error in the archive format. Process-
235                       ing probably failed immediately.
236  Fatal         4      Memory allocation failed in program initial-
237                       ization.
238  Fatal         5      Memory  allocation  failed  in password pro-
239                       cessing.
240  Fatal         6      Memory allocation failed while decompressing
241                       to disk.
242  Fatal         7      Memory allocation failed while decompressing
243                       in memory.
244  Fatal         8      Memory  allocation  failed    (reserved  for
245                       future use).
246  Error         9      Specified archive files were not found.
247  Error        10      Invalid command-line options or parameters.
248  Error        11      No files matched selection criteria.
249  Fatal        50      Disk full.
250  Fatal        51      Unexpected  end-of-file  while  reading  the
251                       archive.
252  Error        80      User interrupt (Ctrl/C).
253  Error        81      No files were processed,  because  of unsup-
254                       ported compress or encrypt methods.
255  Error        82      No  files  were  processed,  because  of bad
256                       password(s).
257  Fatal        83      Large-file archive could not be processed by
258                       this small-file program.
259.end literal
260.!------------------------------------------------------------------------------
261.indent -4
2622 Logical_Names
263.br
264UnZip allows to modify its default behaviour by specifying option defaults
265via the UNZIP_OPTS logical name.
266For example, the following will cause UnZip to restore owner/protection
267information and perform all operations at quiet-level 1 by default:
268.sk;.literal
269    define UNZIP_OPTS "-qX"
270.end literal;.sk
271Note that the quotation marks here are required to preserve lowercase options
272(opposite of the command-line behavior).
273To negate a default option on the command line, add one or more minus
274signs before the option letter, in addition to the leading switch character
275`-':
276.sk;.literal
277    unzip --ql zipfile
278.end literal
279or
280.literal
281    unzip -l-q zipfile
282.end literal;.sk
283At present it is not possible to decrement an option below zero--that is,
284more than a few minuses have no effect.
285.sk
286UNZIP_OPTS may be defined as a symbol rather than a logical name, but if
287both are defined, the logical name takes precedence.
288.!-----------------------------------------------------------------------------
289.indent -4
2902 Authors
291.br
292Info-ZIP; currently maintained by Christian Spieler.  VMS support maintained
293by Christian Spieler and Hunter Goatley.  Originally based on a program
294by Samuel H. Smith.
295.sk
296VMS on-line help ported from UNZIP.TXT by Hunter Goatley.
297