0
|
1 |
'\" t
|
|
2 |
.\" =========================================================================
|
|
3 |
.\" Copyright (c) 1990-1999 Info-ZIP. All rights reserved.
|
|
4 |
.\"
|
|
5 |
.\" See the accompanying file LICENSE, version 1999-Oct-05 or later
|
|
6 |
.\" (the contents of which are also included in zip.h) for terms of use.
|
|
7 |
.\" If, for some reason, both of these files are missing, the Info-ZIP license
|
|
8 |
.\" also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html
|
|
9 |
.\" ==========================================================================
|
|
10 |
.\"
|
|
11 |
.\" zip.1 by Mark Adler, Jean-loup Gailly and R. P. C. Rodgers
|
|
12 |
.\"
|
11
|
13 |
.\" ident "@(#)zip.1.sunman 1.5 10/03/16 SMI"
|
0
|
14 |
.\"
|
|
15 |
.\" modified to reference existing Solaris man pages, and to add note
|
|
16 |
.\" about source availability ([email protected])
|
|
17 |
.\"
|
|
18 |
.\"
|
|
19 |
.TH ZIP 1 "14 August 1999 (v2.3)" Info-ZIP
|
|
20 |
.SH NAME
|
|
21 |
zip, zipcloak, zipnote, zipsplit \- package and compress (archive) files
|
|
22 |
.SH SYNOPSIS
|
|
23 |
.B zip
|
|
24 |
.RB [ \-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$ ]
|
|
25 |
.RB [ \-b\ path ]
|
|
26 |
.RB [ \-n\ suffixes ]
|
|
27 |
.RB [ \-t\ mmddyyyy ]
|
|
28 |
.RB [ \-tt\ mmddyyyy ]
|
|
29 |
.I [ zipfile
|
|
30 |
.I [ file1
|
|
31 |
.IR file2 " .\|.\|." ]]
|
|
32 |
.RB [ \-xi\ list ]
|
|
33 |
.PP
|
|
34 |
.B zipcloak
|
|
35 |
.RB [ \-dhL ]
|
|
36 |
.RB [ \-b\ path ]
|
|
37 |
.I zipfile
|
|
38 |
.PP
|
|
39 |
.B zipnote
|
|
40 |
.RB [ \-hwL ]
|
|
41 |
.RB [ \-b\ path ]
|
|
42 |
.I zipfile
|
|
43 |
.PP
|
|
44 |
.B zipsplit
|
|
45 |
.RB [ \-hiLpst ]
|
|
46 |
.RB [ \-n\ size ]
|
|
47 |
.RB [ \-b\ path ]
|
|
48 |
.I zipfile
|
|
49 |
.SH DESCRIPTION
|
|
50 |
.I zip
|
|
51 |
is a compression and file packaging utility for Unix, VMS, MSDOS,
|
|
52 |
OS/2, Windows NT, Minix, Atari and Macintosh, Amiga and Acorn RISC OS.
|
|
53 |
.LP
|
|
54 |
It is analogous to a combination of the UNIX commands
|
|
55 |
.IR tar (1)
|
|
56 |
and
|
|
57 |
.IR compress (1)
|
|
58 |
and is compatible with PKZIP (Phil Katz's ZIP for MSDOS systems).
|
|
59 |
.LP
|
|
60 |
A companion program
|
|
61 |
.RI ( unzip (1)),
|
|
62 |
unpacks
|
|
63 |
.I zip
|
|
64 |
archives.
|
|
65 |
The
|
|
66 |
.I zip
|
|
67 |
and
|
|
68 |
.IR unzip (1)
|
|
69 |
programs can work with archives produced by PKZIP,
|
|
70 |
and PKZIP and PKUNZIP can work with archives produced by
|
|
71 |
.IR zip .
|
|
72 |
.I zip
|
|
73 |
version 2.3 is compatible with PKZIP 2.04.
|
|
74 |
Note that PKUNZIP 1.10 cannot extract files produced by PKZIP 2.04
|
|
75 |
or
|
|
76 |
.I zip
|
|
77 |
2.3. You must use PKUNZIP 2.04g or
|
|
78 |
.I unzip
|
|
79 |
5.0p1 (or later versions) to extract them.
|
|
80 |
.PP
|
|
81 |
For a brief help on
|
|
82 |
.I zip
|
|
83 |
and
|
|
84 |
.I unzip,
|
|
85 |
run each without specifying any parameters on the command line.
|
|
86 |
.PP
|
|
87 |
The program is useful for packaging a set of files for distribution;
|
|
88 |
for archiving files;
|
|
89 |
and for saving disk space by temporarily
|
|
90 |
compressing unused files or directories.
|
|
91 |
.LP
|
|
92 |
The
|
|
93 |
.I zip
|
|
94 |
program puts one or more compressed files into a single
|
|
95 |
.I zip
|
|
96 |
archive,
|
|
97 |
along with information about the files
|
|
98 |
(name, path, date, time of last modification, protection,
|
|
99 |
and check information to verify file integrity).
|
|
100 |
An entire directory structure can be packed into a
|
|
101 |
.I zip
|
|
102 |
archive with a single command.
|
|
103 |
Compression ratios of 2:1 to 3:1 are common for text files.
|
|
104 |
.I zip
|
|
105 |
has one compression method (deflation) and can also store files without
|
|
106 |
compression.
|
|
107 |
.I zip
|
|
108 |
automatically chooses the better of the two for each file to be compressed.
|
|
109 |
.LP
|
|
110 |
When given the name of an existing
|
|
111 |
.I zip
|
|
112 |
archive,
|
|
113 |
.I zip
|
|
114 |
will replace identically named entries in the
|
|
115 |
.I zip
|
|
116 |
archive or add entries for new names.
|
|
117 |
For example,
|
|
118 |
if
|
|
119 |
.I foo.zip
|
|
120 |
exists and contains
|
|
121 |
.I foo/file1
|
|
122 |
and
|
|
123 |
.IR foo/file2 ,
|
|
124 |
and the directory
|
|
125 |
.I foo
|
|
126 |
contains the files
|
|
127 |
.I foo/file1
|
|
128 |
and
|
|
129 |
.IR foo/file3 ,
|
|
130 |
then:
|
|
131 |
.IP
|
|
132 |
\fCzip -r foo foo\fP
|
|
133 |
.LP
|
|
134 |
will replace
|
|
135 |
.I foo/file1
|
|
136 |
in
|
|
137 |
.I foo.zip
|
|
138 |
and add
|
|
139 |
.I foo/file3
|
|
140 |
to
|
|
141 |
.IR foo.zip .
|
|
142 |
After this,
|
|
143 |
.I foo.zip
|
|
144 |
contains
|
|
145 |
.IR foo/file1 ,
|
|
146 |
.IR foo/file2 ,
|
|
147 |
and
|
|
148 |
.IR foo/file3 ,
|
|
149 |
with
|
|
150 |
.I foo/file2
|
|
151 |
unchanged from before.
|
|
152 |
.LP
|
|
153 |
If the file list is specified as
|
|
154 |
.BR \-@ ,
|
|
155 |
[Not on MacOS]
|
|
156 |
.I zip
|
|
157 |
takes the list of input files from standard input.
|
|
158 |
Under UNIX,
|
|
159 |
this option can be used to powerful effect in conjunction with the
|
|
160 |
.IR find (1)
|
|
161 |
command.
|
|
162 |
For example,
|
|
163 |
to archive all the C source files in the current directory and
|
|
164 |
its subdirectories:
|
|
165 |
.IP
|
|
166 |
\fCfind . -name "*.[ch]" -print | zip source -@\fP
|
|
167 |
.LP
|
|
168 |
(note that the pattern must be quoted to keep the shell from expanding it).
|
|
169 |
.I zip
|
|
170 |
will also accept a single dash ("-") as the zip file name, in which case it
|
|
171 |
will write the zip file to standard output, allowing the output to be piped
|
|
172 |
to another program. For example:
|
|
173 |
.IP
|
|
174 |
\fCzip -r - . | dd of=/dev/nrst0 obs=16k\fP
|
|
175 |
.LP
|
|
176 |
would write the zip output directly to a tape with the specified block size
|
|
177 |
for the purpose of backing up the current directory.
|
|
178 |
.LP
|
|
179 |
.I zip
|
|
180 |
also accepts a single dash ("-") as the name of a file to be compressed, in
|
|
181 |
which case it will read the file from standard input, allowing zip to take
|
|
182 |
input from another program. For example:
|
|
183 |
.IP
|
|
184 |
\fCtar cf - . | zip backup -\fP
|
|
185 |
.LP
|
|
186 |
would compress the output of the tar command for the purpose of backing up
|
|
187 |
the current directory. This generally produces better compression than
|
|
188 |
the previous example using the -r option, because
|
|
189 |
.I zip
|
|
190 |
can take advantage of redundancy between files. The backup can be restored
|
|
191 |
using the command
|
|
192 |
.IP
|
|
193 |
\fCunzip -p backup | tar xf -\fP
|
|
194 |
.LP
|
|
195 |
When no zip file name is given and stdout is not a terminal,
|
|
196 |
.I zip
|
|
197 |
acts as a filter, compressing standard input to standard output.
|
|
198 |
For example,
|
|
199 |
.IP
|
|
200 |
\fCtar cf - . | zip | dd of=/dev/nrst0 obs=16k\fP
|
|
201 |
.LP
|
|
202 |
is equivalent to
|
|
203 |
.IP
|
|
204 |
\fCtar cf - . | zip - - | dd of=/dev/nrst0 obs=16k\fP
|
|
205 |
.LP
|
|
206 |
.I zip
|
|
207 |
archives created in this manner can be extracted with the program
|
|
208 |
.I funzip
|
|
209 |
which is provided in the
|
|
210 |
.I unzip
|
|
211 |
package, or by
|
|
212 |
.I gunzip
|
|
213 |
which is provided in the
|
|
214 |
.I gzip
|
|
215 |
package. For example:
|
|
216 |
.LP
|
|
217 |
\fPdd if=/dev/nrst0 ibs=16k | funzip | tar xvf -\fC
|
|
218 |
.LP
|
|
219 |
When changing an existing
|
|
220 |
.I zip
|
|
221 |
archive,
|
|
222 |
.I zip
|
|
223 |
will write a temporary file with the new contents,
|
|
224 |
and only replace the old one when the process of creating the new version
|
|
225 |
has been completed without error.
|
|
226 |
.LP
|
|
227 |
If the name of the
|
|
228 |
.I zip
|
|
229 |
archive does not contain an extension, the extension
|
|
230 |
.IR .zip
|
|
231 |
is added. If the name already contains an extension other than
|
|
232 |
.IR .zip
|
|
233 |
the existing extension is kept unchanged.
|
|
234 |
.SH "OPTIONS"
|
|
235 |
.TP
|
|
236 |
.BI \-a
|
|
237 |
[Systems using EBCDIC] Translate file to ASCII format.
|
|
238 |
.TP
|
|
239 |
.BI \-A
|
|
240 |
Adjust self-extracting executable archive.
|
|
241 |
A self-extracting executable archive is created by prepending
|
|
242 |
the SFX stub to an existing archive. The
|
|
243 |
.B \-A
|
|
244 |
option tells
|
|
245 |
.I zip
|
|
246 |
to adjust the entry offsets stored
|
|
247 |
in the archive to take into account this "preamble" data.
|
|
248 |
.LP
|
|
249 |
Note: self-extracting archives for the Amiga are a special case.
|
|
250 |
At present, only the Amiga port of Zip is capable of adjusting
|
|
251 |
or updating these without corrupting them. -J can be used to remove
|
|
252 |
the SFX stub if other updates need to be made.
|
|
253 |
.TP
|
|
254 |
.BI \-B
|
|
255 |
[VM/CMS and MVS] force file to be read binary (default is text).
|
|
256 |
.TP
|
|
257 |
.BI \-Bn
|
|
258 |
[TANDEM] set Edit/Enscribe formatting options with n defined as
|
|
259 |
.RS
|
|
260 |
bit 0: Don't add delimiter (Edit/Enscribe)
|
|
261 |
.RE
|
|
262 |
.RS
|
|
263 |
bit 1: Use LF rather than CR/LF as delimiter (Edit/Enscribe)
|
|
264 |
.RE
|
|
265 |
.RS
|
|
266 |
bit 2: Space fill record to maximum record length (Enscribe)
|
|
267 |
.RE
|
|
268 |
.RS
|
|
269 |
bit 3: Trim trailing space (Enscribe)
|
|
270 |
.RE
|
|
271 |
.RS
|
|
272 |
bit 8: Force 30K (Expand) large read for unstructured files
|
|
273 |
.RE
|
|
274 |
.TP
|
|
275 |
.BI \-b\ path
|
|
276 |
Use the specified
|
|
277 |
.I path
|
|
278 |
for the temporary
|
|
279 |
.I zip
|
|
280 |
archive. For example:
|
|
281 |
.RS
|
|
282 |
.IP
|
|
283 |
\fCzip -b /tmp stuff *\fP
|
|
284 |
.RE
|
|
285 |
.IP
|
|
286 |
will put the temporary
|
|
287 |
.I zip
|
|
288 |
archive in the directory
|
|
289 |
.IR /tmp ,
|
|
290 |
copying over
|
|
291 |
.I stuff.zip
|
|
292 |
to the current directory when done. This option is only useful when
|
|
293 |
updating an existing archive, and the file system containing this
|
|
294 |
old archive does not have enough space to hold both old and new archives
|
|
295 |
at the same time.
|
|
296 |
.TP
|
|
297 |
.B \-c
|
|
298 |
Add one-line comments for each file.
|
|
299 |
File operations (adding, updating) are done first,
|
|
300 |
and the user is then prompted for a one-line comment for each file.
|
|
301 |
Enter the comment followed by return, or just return for no comment.
|
|
302 |
.TP
|
|
303 |
.B \-d
|
|
304 |
Remove (delete) entries from a
|
|
305 |
.I zip
|
|
306 |
archive.
|
|
307 |
For example:
|
|
308 |
.RS
|
|
309 |
.IP
|
|
310 |
\fCzip -d foo foo/tom/junk foo/harry/\\* \\*.o\fP
|
|
311 |
.RE
|
|
312 |
.IP
|
|
313 |
will remove the entry
|
|
314 |
.IR foo/tom/junk ,
|
|
315 |
all of the files that start with
|
|
316 |
.IR foo/harry/ ,
|
|
317 |
and all of the files that end with
|
|
318 |
.I \&.o
|
|
319 |
(in any path).
|
|
320 |
Note that shell pathname expansion has been inhibited with backslashes,
|
|
321 |
so that
|
|
322 |
.I zip
|
|
323 |
can see the asterisks,
|
|
324 |
enabling
|
|
325 |
.I zip
|
|
326 |
to match on the contents of the
|
|
327 |
.I zip
|
|
328 |
archive instead of the contents of the current directory.
|
|
329 |
.IP
|
|
330 |
Under MSDOS,
|
|
331 |
.B \-d
|
|
332 |
is case sensitive when it matches names in the
|
|
333 |
.I zip
|
|
334 |
archive.
|
|
335 |
This requires that file names be entered in upper case if they were
|
|
336 |
zipped by PKZIP on an MSDOS system.
|
|
337 |
.TP
|
|
338 |
.B \-df
|
|
339 |
[MacOS] Include only data-fork of files zipped into the archive.
|
|
340 |
Good for exporting files to foreign operating-systems.
|
|
341 |
Resource-forks will be ignored at all.
|
|
342 |
.TP
|
|
343 |
.B \-D
|
|
344 |
Do not create entries in the
|
|
345 |
.I zip
|
|
346 |
archive for directories. Directory entries are created by default so that
|
|
347 |
their attributes can be saved in the zip archive.
|
|
348 |
The environment variable ZIPOPT can be used to change the default options. For
|
|
349 |
example under Unix with sh:
|
|
350 |
.RS
|
|
351 |
.IP
|
|
352 |
ZIPOPT="-D"; export ZIPOPT
|
|
353 |
.RE
|
|
354 |
.IP
|
|
355 |
(The variable ZIPOPT can be used for any option except
|
|
356 |
.B \-i
|
|
357 |
and
|
|
358 |
.B \-x
|
|
359 |
and can include several options.) The option
|
|
360 |
.B \-D
|
|
361 |
is a shorthand
|
|
362 |
for
|
|
363 |
.B \-x
|
|
364 |
"*/" but the latter cannot be set as default in the ZIPOPT environment
|
|
365 |
variable.
|
|
366 |
.TP
|
|
367 |
.B \-e
|
|
368 |
Encrypt the contents of the
|
|
369 |
.I zip
|
|
370 |
archive using a password which is entered on the terminal in response
|
|
371 |
to a prompt
|
|
372 |
(this will not be echoed; if standard error is not a tty,
|
|
373 |
.I zip
|
|
374 |
will exit with an error).
|
|
375 |
The password prompt is repeated to save the user from typing errors.
|
|
376 |
.TP
|
|
377 |
.B \-E
|
|
378 |
[OS/2] Use the .LONGNAME Extended Attribute (if found) as filename.
|
|
379 |
.TP
|
|
380 |
.B \-f
|
|
381 |
Replace (freshen) an existing entry in the
|
|
382 |
.I zip
|
|
383 |
archive only if it has been modified more recently than the
|
|
384 |
version already in the
|
|
385 |
.I zip
|
|
386 |
archive;
|
|
387 |
unlike the update option
|
|
388 |
.RB ( \-u )
|
|
389 |
this will not add files that are not already in the
|
|
390 |
.I zip
|
|
391 |
archive.
|
|
392 |
For example:
|
|
393 |
.RS
|
|
394 |
.IP
|
|
395 |
\fCzip -f foo\fP
|
|
396 |
.RE
|
|
397 |
.IP
|
|
398 |
This command should be run from the same directory from which the original
|
|
399 |
.I zip
|
|
400 |
command was run,
|
|
401 |
since paths stored in
|
|
402 |
.I zip
|
|
403 |
archives are always relative.
|
|
404 |
.IP
|
|
405 |
Note that the timezone environment variable TZ should be set according to
|
|
406 |
the local timezone in order for the
|
|
407 |
.B -f
|
|
408 |
,
|
|
409 |
.B -u
|
|
410 |
and
|
|
411 |
.B -o
|
|
412 |
options to work correctly.
|
|
413 |
.IP
|
|
414 |
The reasons behind this are somewhat subtle but have to do with the differences
|
|
415 |
between the Unix-format file times (always in GMT) and most of the other
|
|
416 |
operating systems (always local time) and the necessity to compare the two.
|
|
417 |
A typical TZ value is ``MET-1MEST'' (Middle European time with automatic
|
|
418 |
adjustment for ``summertime'' or Daylight Savings Time).
|
|
419 |
.TP
|
|
420 |
.B \-F
|
|
421 |
Fix the
|
|
422 |
.I zip
|
|
423 |
archive. This option can be used if some portions of the archive
|
|
424 |
are missing. It is not guaranteed to work, so you MUST make a backup
|
|
425 |
of the original archive first.
|
|
426 |
.IP
|
|
427 |
When doubled as in
|
|
428 |
.B \-FF
|
|
429 |
the compressed sizes given inside the damaged archive are not trusted
|
|
430 |
and zip scans for special signatures to identify the limits between
|
|
431 |
the archive members. The single
|
|
432 |
.B \-F
|
|
433 |
is more reliable if the archive is not too much damaged, for example
|
|
434 |
if it has only been truncated, so try this option first.
|
|
435 |
.IP
|
|
436 |
Neither option will recover archives that have been incorrectly
|
|
437 |
transferred in ascii mode instead of binary. After the repair, the
|
|
438 |
.B \-t
|
|
439 |
option of
|
|
440 |
.I unzip
|
|
441 |
may show that some files have a bad CRC. Such files cannot be recovered;
|
|
442 |
you can remove them from the archive using the
|
|
443 |
.B \-d
|
|
444 |
option of
|
|
445 |
.I zip.
|
|
446 |
.TP
|
|
447 |
.B \-g
|
|
448 |
Grow (append to) the specified
|
|
449 |
.I zip
|
|
450 |
archive, instead of creating a new one. If this operation fails,
|
|
451 |
.I zip
|
|
452 |
attempts to restore the archive to its original state. If the restoration
|
|
453 |
fails, the archive might become corrupted. This option is ignored when
|
|
454 |
there's no existing archive or when at least one archive member must be
|
|
455 |
updated or deleted.
|
|
456 |
.TP
|
|
457 |
.B \-h
|
|
458 |
Display the
|
|
459 |
.I zip
|
|
460 |
help information (this also appears if
|
|
461 |
.I zip
|
|
462 |
is run with no arguments).
|
|
463 |
.TP
|
|
464 |
.BI \-i\ files
|
|
465 |
Include only the specified files, as in:
|
|
466 |
.RS
|
|
467 |
.IP
|
|
468 |
\fCzip -r foo . -i \\*.c\fP
|
|
469 |
.RE
|
|
470 |
.IP
|
|
471 |
which will include only the files that end in
|
|
472 |
.IR \& .c
|
|
473 |
in the current directory and its subdirectories. (Note for PKZIP
|
|
474 |
users: the equivalent command is
|
|
475 |
.RS
|
|
476 |
.IP
|
|
477 |
\fCpkzip -rP foo *.c\fP
|
|
478 |
.RE
|
|
479 |
.IP
|
|
480 |
PKZIP does not allow recursion in directories other than the current one.)
|
|
481 |
The backslash avoids the shell filename substitution, so that the
|
|
482 |
name matching is performed by
|
|
483 |
.I zip
|
|
484 |
at all directory levels.
|
|
485 |
.IP
|
|
486 |
Also possible:
|
|
487 |
.RS
|
|
488 |
.IP
|
|
489 |
\fCzip -r foo . [email protected]\fP
|
|
490 |
.RE
|
|
491 |
.IP
|
|
492 |
which will only include the files in the current directory and its
|
|
493 |
subdirectories that match the patterns in the file include.lst.
|
|
494 |
.TP
|
|
495 |
.B \-I
|
|
496 |
[Acorn RISC OS] Don't scan through Image files. When used, zip will not
|
|
497 |
consider Image files (eg. DOS partitions or Spark archives when SparkFS
|
|
498 |
is loaded) as directories but will store them as single files.
|
|
499 |
|
|
500 |
For example, if you have SparkFS loaded, zipping a Spark archive will result
|
|
501 |
in a zipfile containing a directory (and its content) while using the 'I'
|
|
502 |
option will result in a zipfile containing a Spark archive. Obviously this
|
|
503 |
second case will also be obtained (without the 'I' option) if SparkFS isn't
|
|
504 |
loaded.
|
|
505 |
.TP
|
|
506 |
.B \-j
|
|
507 |
Store just the name of a saved file (junk the path), and do not store
|
|
508 |
directory names. By default,
|
|
509 |
.I zip
|
|
510 |
will store the full path (relative to the current path).
|
|
511 |
.TP
|
|
512 |
.B \-jj
|
|
513 |
[MacOS] record Fullpath (+ Volname). The complete path including
|
|
514 |
volume will be stored. By default the relative path will be stored.
|
|
515 |
.TP
|
|
516 |
.B \-J
|
|
517 |
Strip any prepended data (e.g. a SFX stub) from the archive.
|
|
518 |
.TP
|
|
519 |
.B \-k
|
|
520 |
Attempt to convert the names and paths to conform to MSDOS,
|
|
521 |
store only the MSDOS attribute (just the user write attribute from UNIX),
|
|
522 |
and mark the entry as made under MSDOS (even though it was not);
|
|
523 |
for compatibility with PKUNZIP under MSDOS which cannot handle certain
|
|
524 |
names such as those with two dots.
|
|
525 |
.TP
|
|
526 |
.B \-l
|
|
527 |
Translate the Unix end-of-line character LF into the
|
|
528 |
MSDOS convention CR LF. This option should not be used on binary files.
|
|
529 |
This option can be used on Unix if the zip file is intended for PKUNZIP
|
|
530 |
under MSDOS. If the input files already contain CR LF, this option adds
|
|
531 |
an extra CR. This ensure that
|
|
532 |
.I unzip -a
|
|
533 |
on Unix will get back an exact copy of the original file,
|
|
534 |
to undo the effect of
|
|
535 |
.I zip -l.
|
|
536 |
.TP
|
|
537 |
.B \-ll
|
|
538 |
Translate the MSDOS end-of-line CR LF into Unix LF.
|
|
539 |
This option should not be used on binary files.
|
|
540 |
This option can be used on MSDOS if the zip file is intended for unzip
|
|
541 |
under Unix.
|
|
542 |
.TP
|
|
543 |
.B \-L
|
|
544 |
Display the
|
|
545 |
.I zip
|
|
546 |
license.
|
|
547 |
.TP
|
|
548 |
.B \-m
|
|
549 |
Move the specified files into the
|
|
550 |
.I zip
|
|
551 |
archive; actually,
|
|
552 |
this deletes the target directories/files after making the specified
|
|
553 |
.I zip
|
|
554 |
archive. If a directory becomes empty after removal of the files, the
|
|
555 |
directory is also removed. No deletions are done until
|
|
556 |
.I zip
|
|
557 |
has created the archive without error.
|
|
558 |
This is useful for conserving disk space,
|
|
559 |
but is potentially dangerous so it is recommended to use it in
|
|
560 |
combination with
|
|
561 |
.B \-T
|
|
562 |
to test the archive before removing all input files.
|
|
563 |
.TP
|
|
564 |
.BI \-n\ suffixes
|
|
565 |
Do not attempt to compress files named with the given
|
|
566 |
.I suffixes.
|
|
567 |
Such files are simply stored (0% compression) in the output zip file,
|
|
568 |
so that
|
|
569 |
.I zip
|
|
570 |
doesn't waste its time trying to compress them.
|
|
571 |
The suffixes are separated by
|
|
572 |
either colons or semicolons. For example:
|
|
573 |
.RS
|
|
574 |
.IP
|
|
575 |
\fCzip -rn .Z:.zip:.tiff:.gif:.snd foo foo\fP
|
|
576 |
.RE
|
|
577 |
.IP
|
|
578 |
will copy everything from
|
|
579 |
.I foo
|
|
580 |
into
|
|
581 |
.IR foo.zip ,
|
|
582 |
but will store any files that end in
|
|
583 |
.IR .Z ,
|
|
584 |
.IR .zip ,
|
|
585 |
.IR .tiff ,
|
|
586 |
.IR .gif ,
|
|
587 |
or
|
|
588 |
.I .snd
|
|
589 |
without trying to compress them
|
|
590 |
(image and sound files often have their own specialized compression methods).
|
|
591 |
By default,
|
|
592 |
.I zip
|
|
593 |
does not compress files with extensions in the list
|
|
594 |
.I .Z:.zip:.zoo:.arc:.lzh:.arj.
|
|
595 |
Such files are stored directly in the output archive.
|
|
596 |
The environment variable ZIPOPT can be used to change the default options. For
|
|
597 |
example under Unix with csh:
|
|
598 |
.RS
|
|
599 |
.IP
|
|
600 |
setenv ZIPOPT "-n .gif:.zip"
|
|
601 |
.RE
|
|
602 |
.IP
|
|
603 |
To attempt compression on all files, use:
|
|
604 |
.RS
|
|
605 |
.IP
|
|
606 |
zip -n : foo
|
|
607 |
.RE
|
|
608 |
.IP
|
|
609 |
The maximum compression option
|
|
610 |
.B \-9
|
|
611 |
also attempts compression on all files regardless of extension.
|
|
612 |
.IP
|
|
613 |
On Acorn RISC OS systems the suffixes are actually filetypes (3 hex digit
|
|
614 |
format). By default, zip does not compress files with filetypes in the list
|
|
615 |
DDC:D96:68E (i.e. Archives, CFS files and PackDir files).
|
|
616 |
.TP
|
|
617 |
.B \-N
|
|
618 |
[Amiga, MacOS] Save Amiga or MacOS filenotes as zipfile comments. They can be
|
|
619 |
restored by using the -N option of unzip. If -c is used also, you are prompted
|
|
620 |
for comments only for those files that do not have filenotes.
|
|
621 |
.TP
|
|
622 |
.B \-o
|
|
623 |
Set the "last modified" time of the
|
|
624 |
.I zip
|
|
625 |
archive to the latest (oldest) "last modified" time
|
|
626 |
found among the entries in the
|
|
627 |
.I zip
|
|
628 |
archive.
|
|
629 |
This can be used without any other operations, if desired.
|
|
630 |
For example:
|
|
631 |
.IP
|
|
632 |
\fCzip -o foo\fP
|
|
633 |
.IP
|
|
634 |
will change the last modified time of
|
|
635 |
.I foo.zip
|
|
636 |
to the latest time of the entries in
|
|
637 |
.IR foo.zip .
|
|
638 |
.TP
|
|
639 |
.B \-P \fIpassword\fP
|
|
640 |
use \fIpassword\fP to encrypt zipfile entries (if any). \fBTHIS IS
|
|
641 |
INSECURE!\fP Many multi-user operating systems provide ways for any user to
|
|
642 |
see the current command line of any other user; even on stand-alone systems
|
|
643 |
there is always the threat of over-the-shoulder peeking. Storing the plaintext
|
|
644 |
password as part of a command line in an automated script is even worse.
|
|
645 |
Whenever possible, use the non-echoing, interactive prompt to enter passwords.
|
|
646 |
(And where security is truly important, use strong encryption such as Pretty
|
|
647 |
Good Privacy instead of the relatively weak encryption provided by standard
|
|
648 |
zipfile utilities.)
|
|
649 |
.TP
|
|
650 |
.B \-q
|
|
651 |
Quiet mode;
|
|
652 |
eliminate informational messages and comment prompts.
|
|
653 |
(Useful, for example, in shell scripts and background tasks).
|
|
654 |
.TP
|
|
655 |
.BI \-Qn
|
|
656 |
[QDOS] store information about the file in the file header with n defined as
|
|
657 |
.RS
|
|
658 |
bit 0: Don't add headers for any file
|
|
659 |
.RE
|
|
660 |
.RS
|
|
661 |
bit 1: Add headers for all files
|
|
662 |
.RE
|
|
663 |
.RS
|
|
664 |
bit 2: Don't wait for interactive key press on exit
|
|
665 |
.RE
|
|
666 |
.TP
|
|
667 |
.B \-r
|
|
668 |
Travel the directory structure recursively;
|
|
669 |
for example:
|
|
670 |
.RS
|
|
671 |
.IP
|
|
672 |
\fCzip -r foo foo\fP
|
|
673 |
.RE
|
|
674 |
.IP
|
|
675 |
In this case, all the files and directories in
|
|
676 |
.I foo
|
|
677 |
are saved in a
|
|
678 |
.I zip
|
|
679 |
archive named
|
|
680 |
.IR foo.zip ,
|
|
681 |
including files with names starting with ".",
|
|
682 |
since the recursion does not use the shell's file-name substitution mechanism.
|
|
683 |
If you wish to include only a specific subset of the files in directory
|
|
684 |
.I foo
|
|
685 |
and its subdirectories, use the
|
|
686 |
.B \-i
|
|
687 |
option to specify the pattern of files to be included.
|
|
688 |
You should not use
|
|
689 |
.B \-r
|
|
690 |
with the name ".*",
|
|
691 |
since that matches ".."
|
|
692 |
which will attempt to zip up the parent directory
|
|
693 |
(probably not what was intended).
|
|
694 |
.TP
|
|
695 |
.B \-R
|
|
696 |
Travel the directory structure recursively starting at the
|
|
697 |
current directory;
|
|
698 |
for example:
|
|
699 |
.RS
|
|
700 |
.IP
|
|
701 |
\fCzip -R foo '*.c'\fP
|
|
702 |
.RE
|
|
703 |
.IP
|
|
704 |
In this case, all the files matching *.c in the tree starting at the
|
|
705 |
current directory are stored into a
|
|
706 |
.I zip
|
|
707 |
archive named
|
|
708 |
.IR foo.zip .
|
|
709 |
Note for PKZIP users: the equivalent command is
|
|
710 |
.RS
|
|
711 |
.IP
|
|
712 |
\fCpkzip -rP foo *.c\fP
|
|
713 |
.RE
|
|
714 |
.TP
|
|
715 |
.B \-S
|
|
716 |
[MSDOS, OS/2, WIN32 and ATARI] Include system and hidden files.
|
|
717 |
.RS
|
|
718 |
[MacOS] Includes finder invisible files, which are ignored otherwise.
|
|
719 |
.RE
|
|
720 |
.TP
|
|
721 |
.BI \-t\ mmddyyyy
|
|
722 |
Do not operate on files modified prior to the specified date,
|
|
723 |
where
|
|
724 |
.I mm
|
|
725 |
is the month (0-12),
|
|
726 |
.I dd
|
|
727 |
is the day of the month (1-31),
|
|
728 |
and
|
|
729 |
.I yyyy
|
|
730 |
is the year.
|
|
731 |
The
|
|
732 |
.I ISO 8601
|
|
733 |
date format
|
|
734 |
.I yyyy-mm-dd
|
|
735 |
is also accepted.
|
|
736 |
For example:
|
|
737 |
.RS
|
|
738 |
.IP
|
|
739 |
\fCzip -rt 12071991 infamy foo\fP
|
|
740 |
|
|
741 |
\fCzip -rt 1991-12-07 infamy foo\fP
|
|
742 |
.RE
|
|
743 |
.IP
|
|
744 |
will add all the files in
|
|
745 |
.I foo
|
|
746 |
and its subdirectories that were last modified on or after 7 December 1991,
|
|
747 |
to the
|
|
748 |
.I zip
|
|
749 |
archive
|
|
750 |
.IR infamy.zip .
|
|
751 |
.TP
|
|
752 |
.BI \-tt\ mmddyyyy
|
|
753 |
Do not operate on files modified after or at the specified date,
|
|
754 |
where
|
|
755 |
.I mm
|
|
756 |
is the month (0-12),
|
|
757 |
.I dd
|
|
758 |
is the day of the month (1-31),
|
|
759 |
and
|
|
760 |
.I yyyy
|
|
761 |
is the year.
|
|
762 |
The
|
|
763 |
.I ISO 8601
|
|
764 |
date format
|
|
765 |
.I yyyy-mm-dd
|
|
766 |
is also accepted.
|
|
767 |
For example:
|
|
768 |
.RS
|
|
769 |
.IP
|
|
770 |
\fCzip -rtt 11301995 infamy foo\fP
|
|
771 |
|
|
772 |
\fCzip -rtt 1995-11-30 infamy foo\fP
|
|
773 |
.RE
|
|
774 |
.IP
|
|
775 |
will add all the files in
|
|
776 |
.I foo
|
|
777 |
and its subdirectories that were last modified before the 30 November 1995,
|
|
778 |
to the
|
|
779 |
.I zip
|
|
780 |
archive
|
|
781 |
.IR infamy.zip .
|
|
782 |
.TP
|
|
783 |
.B \-T
|
|
784 |
Test the integrity of the new zip file. If the check fails, the old zip file
|
|
785 |
is unchanged and (with the
|
|
786 |
.B -m
|
|
787 |
option) no input files are removed.
|
|
788 |
.TP
|
|
789 |
.B \-u
|
|
790 |
Replace (update) an existing entry in the
|
|
791 |
.I zip
|
|
792 |
archive only if it has been modified more recently
|
|
793 |
than the version already in the
|
|
794 |
.I zip
|
|
795 |
archive.
|
|
796 |
For example:
|
|
797 |
.RS
|
|
798 |
.IP
|
|
799 |
\fCzip -u stuff *\fP
|
|
800 |
.RE
|
|
801 |
.IP
|
|
802 |
will add any new files in the current directory,
|
|
803 |
and update any files which have been modified since the
|
|
804 |
.I zip
|
|
805 |
archive
|
|
806 |
.I stuff.zip
|
|
807 |
was last created/modified (note that
|
|
808 |
.I zip
|
|
809 |
will not try to pack
|
|
810 |
.I stuff.zip
|
|
811 |
into itself when you do this).
|
|
812 |
.IP
|
|
813 |
Note that the
|
|
814 |
.B \-u
|
|
815 |
option with no arguments acts like the
|
|
816 |
.B \-f
|
|
817 |
(freshen) option.
|
|
818 |
.TP
|
|
819 |
.B \-v
|
|
820 |
Verbose mode or print diagnostic version info.
|
|
821 |
.IP
|
|
822 |
Normally, when applied to real operations, this option enables the display of a
|
|
823 |
progress indicator during compression and requests verbose diagnostic
|
|
824 |
info about zipfile structure oddities.
|
|
825 |
.IP
|
|
826 |
When
|
|
827 |
.B \-v
|
|
828 |
is the only command line argument, and stdout is not redirected to a file,
|
|
829 |
a diagnostic screen is printed. In addition to the help screen header
|
|
830 |
with program name, version, and release date, some pointers to the Info-ZIP
|
|
831 |
home and distribution sites are given. Then, it shows information about the
|
|
832 |
target environment (compiler type and version, OS version, compilation date
|
|
833 |
and the enabled optional features used to create the
|
|
834 |
.I zip
|
|
835 |
executable.
|
|
836 |
.TP
|
|
837 |
.B \-V
|
|
838 |
[VMS] Save VMS file attributes.
|
|
839 |
.I zip
|
|
840 |
archives created with this option will generally not be usable
|
|
841 |
on other systems.
|
|
842 |
.TP
|
|
843 |
.B \-w
|
|
844 |
[VMS] Append the version number of the files to the name,
|
|
845 |
including multiple versions of files. (default: use only
|
|
846 |
the most recent version of a specified file).
|
|
847 |
.TP
|
|
848 |
.BI \-x\ files
|
|
849 |
Explicitly exclude the specified files, as in:
|
|
850 |
.RS
|
|
851 |
.IP
|
|
852 |
\fCzip -r foo foo -x \\*.o\fP
|
|
853 |
.RE
|
|
854 |
.IP
|
|
855 |
which will include the contents of
|
|
856 |
.I foo
|
|
857 |
in
|
|
858 |
.I foo.zip
|
|
859 |
while excluding all the files that end in
|
|
860 |
.IR \& .o .
|
|
861 |
The backslash avoids the shell filename substitution, so that the
|
|
862 |
name matching is performed by
|
|
863 |
.I zip
|
|
864 |
at all directory levels.
|
|
865 |
.IP
|
|
866 |
Also possible:
|
|
867 |
.RS
|
|
868 |
.IP
|
|
869 |
\fCzip -r foo foo [email protected]\fP
|
|
870 |
.RE
|
|
871 |
.IP
|
|
872 |
which will include the contents of
|
|
873 |
.I foo
|
|
874 |
in
|
|
875 |
.I foo.zip
|
|
876 |
while excluding all the files that match the patterns in the file exclude.lst.
|
|
877 |
.TP
|
|
878 |
.B \-X
|
|
879 |
Do not save extra file attributes (Extended Attributes on OS/2, uid/gid
|
|
880 |
and file times on Unix).
|
|
881 |
.TP
|
|
882 |
.B \-y
|
|
883 |
Store symbolic links as such in the
|
|
884 |
.I zip
|
|
885 |
archive,
|
|
886 |
instead of compressing and storing the file referred to by the link
|
|
887 |
(UNIX only).
|
|
888 |
.TP
|
|
889 |
.B \-z
|
|
890 |
Prompt for a multi-line comment for the entire
|
|
891 |
.I zip
|
|
892 |
archive.
|
|
893 |
The comment is ended by a line containing just a period,
|
|
894 |
or an end of file condition (^D on UNIX, ^Z on MSDOS, OS/2, and VAX/VMS).
|
|
895 |
The comment can be taken from a file:
|
|
896 |
.RS
|
|
897 |
.IP
|
|
898 |
\fCzip -z foo < foowhat\fP
|
|
899 |
.RE
|
|
900 |
.TP
|
|
901 |
.BI \-#
|
|
902 |
Regulate the speed of compression using the specified digit
|
|
903 |
.IR # ,
|
|
904 |
where
|
|
905 |
.B \-0
|
|
906 |
indicates no compression (store all files),
|
|
907 |
.B \-1
|
|
908 |
indicates the fastest compression method (less compression)
|
|
909 |
and
|
|
910 |
.B \-9
|
|
911 |
indicates the slowest compression method (optimal compression, ignores
|
|
912 |
the suffix list). The default compression level is
|
|
913 |
.BR \-6.
|
|
914 |
.TP
|
|
915 |
.B \-!
|
|
916 |
[WIN32] Use priviliges (if granted) to obtain all aspects of WinNT security.
|
|
917 |
.TP
|
|
918 |
.B \-@
|
|
919 |
Take the list of input files from standard input. Only one filename per line.
|
|
920 |
.TP
|
|
921 |
.B \-$
|
|
922 |
[MSDOS, OS/2, WIN32] Include the volume label for the the drive holding
|
|
923 |
the first file to be compressed. If you want to include only the volume
|
|
924 |
label or to force a specific drive, use the drive name as first file name,
|
|
925 |
as in:
|
|
926 |
.RS
|
|
927 |
.IP
|
|
928 |
\fCzip -$ foo a: c:bar\fP
|
|
929 |
.RE
|
|
930 |
.IP
|
|
931 |
.SH "EXAMPLES"
|
|
932 |
The simplest example:
|
|
933 |
.IP
|
|
934 |
\fCzip stuff *\fP
|
|
935 |
.LP
|
|
936 |
creates the archive
|
|
937 |
.I stuff.zip
|
|
938 |
(assuming it does not exist)
|
|
939 |
and puts all the files in the current directory in it, in compressed form
|
|
940 |
(the
|
|
941 |
.I \&.zip
|
|
942 |
suffix is added automatically,
|
|
943 |
unless that archive name given contains a dot already;
|
|
944 |
this allows the explicit specification of other suffixes).
|
|
945 |
.LP
|
|
946 |
Because of the way the shell does filename substitution,
|
|
947 |
files starting with "." are not included;
|
|
948 |
to include these as well:
|
|
949 |
.IP
|
|
950 |
\fCzip stuff .* *\fP
|
|
951 |
.LP
|
|
952 |
Even this will not include any subdirectories from the current directory.
|
|
953 |
.LP
|
|
954 |
To zip up an entire directory, the command:
|
|
955 |
.IP
|
|
956 |
\fCzip -r foo foo\fP
|
|
957 |
.LP
|
|
958 |
creates the archive
|
|
959 |
.IR foo.zip ,
|
|
960 |
containing all the files and directories in the directory
|
|
961 |
.I foo
|
|
962 |
that is contained within the current directory.
|
|
963 |
.LP
|
|
964 |
You may want to make a
|
|
965 |
.I zip
|
|
966 |
archive that contains the files in
|
|
967 |
.IR foo ,
|
|
968 |
without recording the directory name,
|
|
969 |
.IR foo .
|
|
970 |
You can use the
|
|
971 |
.B \-j
|
|
972 |
option to leave off the paths,
|
|
973 |
as in:
|
|
974 |
.IP
|
|
975 |
\fCzip -j foo foo/*\fP
|
|
976 |
.LP
|
|
977 |
If you are short on disk space,
|
|
978 |
you might not have enough room to hold both the original directory
|
|
979 |
and the corresponding compressed
|
|
980 |
.I zip
|
|
981 |
archive.
|
|
982 |
In this case, you can create the archive in steps using the
|
|
983 |
.B \-m
|
|
984 |
option.
|
|
985 |
If
|
|
986 |
.I foo
|
|
987 |
contains the subdirectories
|
|
988 |
.IR tom ,
|
|
989 |
.IR dick ,
|
|
990 |
and
|
|
991 |
.IR harry ,
|
|
992 |
you can:
|
|
993 |
.IP
|
|
994 |
\fCzip -rm foo foo/tom\fP
|
|
995 |
.br
|
|
996 |
\fCzip -rm foo foo/dick\fP
|
|
997 |
.br
|
|
998 |
\fCzip -rm foo foo/harry\fP
|
|
999 |
.LP
|
|
1000 |
where the first command creates
|
|
1001 |
.IR foo.zip ,
|
|
1002 |
and the next two add to it.
|
|
1003 |
At the completion of each
|
|
1004 |
.I zip
|
|
1005 |
command,
|
|
1006 |
the last created archive is deleted,
|
|
1007 |
making room for the next
|
|
1008 |
.I zip
|
|
1009 |
command to function.
|
|
1010 |
.SH "PATTERN MATCHING"
|
|
1011 |
This section applies only to UNIX.
|
|
1012 |
Watch this space for details on MSDOS and VMS operation.
|
|
1013 |
.LP
|
|
1014 |
The UNIX shells
|
|
1015 |
.RI ( sh (1)
|
|
1016 |
and
|
|
1017 |
.IR csh (1))
|
|
1018 |
do filename substitution on command arguments.
|
|
1019 |
The special characters are:
|
|
1020 |
.TP
|
|
1021 |
.B ?
|
|
1022 |
match any single character
|
|
1023 |
.TP
|
|
1024 |
.B *
|
|
1025 |
match any number of characters (including none)
|
|
1026 |
.TP
|
|
1027 |
.B []
|
|
1028 |
match any character in the range indicated within the brackets
|
|
1029 |
(example: [a\-f], [0\-9]).
|
|
1030 |
.LP
|
|
1031 |
When these characters are encountered
|
|
1032 |
(without being escaped with a backslash or quotes),
|
|
1033 |
the shell will look for files relative to the current path
|
|
1034 |
that match the pattern,
|
|
1035 |
and replace the argument with a list of the names that matched.
|
|
1036 |
.LP
|
|
1037 |
The
|
|
1038 |
.I zip
|
|
1039 |
program can do the same matching on names that are in the
|
|
1040 |
.I zip
|
|
1041 |
archive being modified or,
|
|
1042 |
in the case of the
|
|
1043 |
.B \-x
|
|
1044 |
(exclude) or
|
|
1045 |
.B \-i
|
|
1046 |
(include) options, on the list of files to be operated on, by using
|
|
1047 |
backslashes or quotes to tell the shell not to do the name expansion.
|
|
1048 |
In general, when
|
|
1049 |
.I zip
|
|
1050 |
encounters a name in the list of files to do, it first looks for the name in
|
|
1051 |
the file system. If it finds it, it then adds it to the list of files to do.
|
|
1052 |
If it does not find it, it looks for the name in the
|
|
1053 |
.I zip
|
|
1054 |
archive being modified (if it exists), using the pattern matching characters
|
|
1055 |
described above, if present. For each match, it will add that name to the
|
|
1056 |
list of files to be processed, unless this name matches one given
|
|
1057 |
with the
|
|
1058 |
.B \-x
|
|
1059 |
option, or does not match any name given with the
|
|
1060 |
.B \-i
|
|
1061 |
option.
|
|
1062 |
.LP
|
|
1063 |
The pattern matching includes the path,
|
|
1064 |
and so patterns like \\*.o match names that end in ".o",
|
|
1065 |
no matter what the path prefix is.
|
|
1066 |
Note that the backslash must precede every special character (i.e. ?*[]),
|
|
1067 |
or the entire argument must be enclosed in double quotes ("").
|
|
1068 |
.LP
|
|
1069 |
In general, use backslash to make
|
|
1070 |
.I zip
|
|
1071 |
do the pattern matching with the
|
|
1072 |
.B \-f
|
|
1073 |
(freshen) and
|
|
1074 |
.B \-d
|
|
1075 |
(delete) options,
|
|
1076 |
and sometimes after the
|
|
1077 |
.B \-x
|
|
1078 |
(exclude) option when used with an appropriate operation (add,
|
|
1079 |
.BR \-u ,
|
|
1080 |
.BR \-f ,
|
|
1081 |
or
|
|
1082 |
.BR \-d ).
|
|
1083 |
.SH "ENVIRONMENT"
|
|
1084 |
.TP
|
|
1085 |
.B ZIPOPT
|
|
1086 |
contains default options that will be used when running
|
|
1087 |
.I zip
|
|
1088 |
.TP
|
|
1089 |
.B ZIP
|
|
1090 |
[Not on RISC OS and VMS] see ZIPOPT
|
|
1091 |
.TP
|
|
1092 |
.B Zip$Options
|
|
1093 |
[RISC OS] see ZIPOPT
|
|
1094 |
.TP
|
|
1095 |
.B Zip$Exts
|
|
1096 |
[RISC OS] contains extensions separated by a : that will cause
|
|
1097 |
native filenames with one of the specified extensions to
|
|
1098 |
be added to the zip file with basename and extension swapped.
|
|
1099 |
.I zip
|
|
1100 |
.TP
|
|
1101 |
.B ZIP_OPTS
|
|
1102 |
[VMS] see ZIPOPT
|
|
1103 |
.SH "SEE ALSO"
|
|
1104 |
compress(1),
|
|
1105 |
tar(1),
|
|
1106 |
unzip(1),
|
|
1107 |
gzip(1)
|
|
1108 |
.SH DIAGNOSTICS
|
|
1109 |
The exit status (or error level) approximates the exit codes defined by PKWARE
|
|
1110 |
and takes on the following values, except under VMS:
|
|
1111 |
.RS
|
|
1112 |
.IP 0
|
|
1113 |
normal; no errors or warnings detected.
|
|
1114 |
.IP 2
|
|
1115 |
unexpected end of zip file.
|
|
1116 |
.IP 3
|
|
1117 |
a generic error in the zipfile format was detected. Processing may have
|
|
1118 |
completed successfully anyway; some broken zipfiles created by other
|
|
1119 |
archivers have simple work-arounds.
|
|
1120 |
.IP 4
|
|
1121 |
\fIzip\fP was unable to allocate memory for one or more buffers during
|
|
1122 |
program initialization.
|
|
1123 |
.IP 5
|
|
1124 |
a severe error in the zipfile format was detected. Processing probably
|
|
1125 |
failed immediately.
|
|
1126 |
.IP 6
|
|
1127 |
entry too large to be split with \fIzipsplit\fP
|
|
1128 |
.IP 7
|
|
1129 |
invalid comment format
|
|
1130 |
.IP 8
|
|
1131 |
\fIzip\fP -T failed or out of memory
|
|
1132 |
.IP 9
|
|
1133 |
the user aborted \fIzip\fP prematurely with control-C (or similar)
|
|
1134 |
.IP 10
|
|
1135 |
\fIzip\fP encountered an error while using a temp file
|
|
1136 |
.IP 11
|
|
1137 |
read or seek error
|
|
1138 |
.IP 12
|
|
1139 |
\fIzip\fP has nothing to do
|
|
1140 |
.IP 13
|
|
1141 |
missing or empty zip file
|
|
1142 |
.IP 14
|
|
1143 |
error writing to a file
|
|
1144 |
.IP 15
|
|
1145 |
\fIzip\fP was unable to create a file to write to
|
|
1146 |
.IP 16
|
|
1147 |
bad command line parameters
|
|
1148 |
.IP 18
|
|
1149 |
\fIzip\fP could not open a specified file to read
|
|
1150 |
.RE
|
|
1151 |
.PP
|
|
1152 |
VMS interprets standard Unix (or PC) return values as other, scarier-looking
|
|
1153 |
things, so \fIzip\fP instead maps them into VMS-style status codes. The
|
|
1154 |
current mapping is as follows: 1 (success) for normal exit,
|
|
1155 |
and (0x7fff000? + 16*normal_zip_exit_status) for all errors, where the
|
|
1156 |
`?' is 0 (warning) for \fIzip\fP value 12, 2 (error) for the
|
|
1157 |
\fIzip\fP values 3, 6, 7, 9, 13, 16, 18,
|
|
1158 |
and 4 (fatal error) for the remaining ones.
|
|
1159 |
.PD
|
|
1160 |
.SH BUGS
|
|
1161 |
.I zip
|
|
1162 |
2.3 is not compatible with PKUNZIP 1.10. Use
|
|
1163 |
.I zip
|
|
1164 |
1.1 to produce
|
|
1165 |
.I zip
|
|
1166 |
files which can be extracted by PKUNZIP 1.10.
|
|
1167 |
.PP
|
|
1168 |
.I zip
|
|
1169 |
files produced by
|
|
1170 |
.I zip
|
|
1171 |
2.3 must not be
|
|
1172 |
.I updated
|
|
1173 |
by
|
|
1174 |
.I zip
|
|
1175 |
1.1 or PKZIP 1.10, if they contain
|
|
1176 |
encrypted members or if they have been produced in a pipe or on a non-seekable
|
|
1177 |
device. The old versions of
|
|
1178 |
.I zip
|
|
1179 |
or PKZIP would create an archive with an incorrect format.
|
|
1180 |
The old versions can list the contents of the zip file
|
|
1181 |
but cannot extract it anyway (because of the new compression algorithm).
|
|
1182 |
If you do not use encryption and use regular disk files, you do
|
|
1183 |
not have to care about this problem.
|
|
1184 |
.LP
|
|
1185 |
Under VMS,
|
|
1186 |
not all of the odd file formats are treated properly.
|
|
1187 |
Only stream-LF format
|
|
1188 |
.I zip
|
|
1189 |
files are expected to work with
|
|
1190 |
.IR zip .
|
|
1191 |
Others can be converted using Rahul Dhesi's BILF program.
|
|
1192 |
This version of
|
|
1193 |
.I zip
|
|
1194 |
handles some of the conversion internally.
|
|
1195 |
When using Kermit to transfer zip files from Vax to MSDOS, type "set
|
|
1196 |
file type block" on the Vax. When transfering from MSDOS to Vax, type
|
|
1197 |
"set file type fixed" on the Vax. In both cases, type "set file type
|
|
1198 |
binary" on MSDOS.
|
|
1199 |
.LP
|
|
1200 |
Under VMS, zip hangs for file specification that uses DECnet syntax
|
|
1201 |
.I foo::*.*.
|
|
1202 |
.LP
|
|
1203 |
On OS/2, zip cannot match some names, such as those including an
|
|
1204 |
exclamation mark or a hash sign. This is a bug in OS/2 itself: the
|
|
1205 |
32-bit DosFindFirst/Next don't find such names. Other programs such
|
|
1206 |
as GNU tar are also affected by this bug.
|
|
1207 |
.LP
|
|
1208 |
Under OS/2, the amount of Extended Attributes displayed by DIR is (for
|
|
1209 |
compatibility) the amount returned by the 16-bit version of
|
|
1210 |
DosQueryPathInfo(). Otherwise OS/2 1.3 and 2.0 would report different
|
|
1211 |
EA sizes when DIRing a file.
|
|
1212 |
However, the structure layout returned by the 32-bit DosQueryPathInfo()
|
|
1213 |
is a bit different, it uses extra padding bytes and link pointers (it's
|
|
1214 |
a linked list) to have all fields on 4-byte boundaries for portability
|
|
1215 |
to future RISC OS/2 versions. Therefore the value reported by
|
|
1216 |
.I zip
|
|
1217 |
(which uses this 32-bit-mode size) differs from that reported by DIR.
|
|
1218 |
.I zip
|
|
1219 |
stores the 32-bit format for portability, even the 16-bit
|
|
1220 |
MS-C-compiled version running on OS/2 1.3, so even this one shows the
|
|
1221 |
32-bit-mode size.
|
|
1222 |
.SH AUTHORS
|
|
1223 |
Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly,
|
|
1224 |
Onno van der Linden, Kai Uwe Rommel, Igor Mandrichenko, John Bush and
|
|
1225 |
Paul Kienitz.
|
|
1226 |
Permission is granted to any individual or institution to use, copy, or
|
|
1227 |
redistribute this software so long as all of the original files are included,
|
|
1228 |
that it is not sold for profit, and that this copyright notice
|
|
1229 |
is retained.
|
|
1230 |
.LP
|
|
1231 |
LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED UTILITIES ARE
|
|
1232 |
PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR
|
|
1233 |
IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES
|
|
1234 |
RESULTING FROM THE USE OF THIS SOFTWARE.
|
|
1235 |
.LP
|
|
1236 |
Please send bug reports and comments by email to:
|
|
1237 |
.IR zip\[email protected].
|
|
1238 |
For bug reports, please include the version of
|
|
1239 |
.IR zip
|
|
1240 |
(see
|
|
1241 |
.IR zip \-h
|
|
1242 |
),
|
|
1243 |
the make options used to compile it see
|
|
1244 |
.IR zip \-v
|
|
1245 |
),
|
|
1246 |
the machine and operating system in use,
|
|
1247 |
and as much additional information as possible.
|
|
1248 |
.SH ACKNOWLEDGEMENTS
|
|
1249 |
Thanks to R. P. Byrne for his
|
|
1250 |
.I Shrink.Pas
|
|
1251 |
program, which inspired this project,
|
|
1252 |
and from which the shrink algorithm was stolen;
|
|
1253 |
to Phil Katz for placing in the public domain the
|
|
1254 |
.I zip
|
|
1255 |
file format, compression format, and .ZIP filename extension, and for
|
|
1256 |
accepting minor changes to the file format; to Steve Burg for
|
|
1257 |
clarifications on the deflate format; to Haruhiko Okumura and Leonid
|
|
1258 |
Broukhis for providing some useful ideas for the compression
|
|
1259 |
algorithm; to Keith Petersen, Rich Wales, Hunter Goatley and Mark
|
|
1260 |
Adler for providing a mailing list and
|
|
1261 |
.I ftp
|
|
1262 |
site for the Info-ZIP group to use; and most importantly, to the
|
|
1263 |
Info-ZIP group itself (listed in the file
|
|
1264 |
.IR infozip.who )
|
|
1265 |
without whose tireless testing and bug-fixing efforts a portable
|
|
1266 |
.I zip
|
|
1267 |
would not have been possible.
|
|
1268 |
Finally we should thank (blame) the first Info-ZIP moderator,
|
|
1269 |
David Kirschbaum,
|
|
1270 |
for getting us into this mess in the first place.
|
|
1271 |
The manual page was rewritten for UNIX by R. P. C. Rodgers.
|
|
1272 |
.\" end of file
|
|
1273 |
.SH ATTRIBUTES
|
|
1274 |
See
|
|
1275 |
.BR attributes (5)
|
|
1276 |
for descriptions of the following attributes:
|
|
1277 |
.sp
|
|
1278 |
.TS
|
|
1279 |
box;
|
|
1280 |
cbp-1 | cbp-1
|
|
1281 |
l | l .
|
|
1282 |
ATTRIBUTE TYPE ATTRIBUTE VALUE
|
|
1283 |
=
|
11
|
1284 |
Availability compress/zip
|
0
|
1285 |
=
|
|
1286 |
Interface Stability Committed
|
|
1287 |
.TE
|
|
1288 |
.PP
|
|
1289 |
.SH NOTES
|
|
1290 |
Source for zip is available on http://opensolaris.org.
|