-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathVMS_ZIP.RNH
1467 lines (1465 loc) · 65.3 KB
/
VMS_ZIP.RNH
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.!
.! 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