VMS_ZIP.RNH 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467
  1. .!
  2. .! File: ZIP.RNH
  3. .!
  4. .! Author: Hunter Goatley
  5. .!
  6. .! Date: October 22, 1991
  7. .!
  8. .! Description:
  9. .!
  10. .! RUNOFF source file for portable ZIP on-line help for VMS.
  11. .! Adapted from MANUAL, distributed with ZIP.
  12. .!
  13. .! To build: $ RUNOFF ZIP.RNH
  14. .! $ LIBR/HELP/INSERT libr ZIP
  15. .!
  16. .! Modification history:
  17. .!
  18. .! Hunter Goatley 22-OCT-1991 20:45
  19. .! Genesis.
  20. .! Jean-loup Gailly 25 March 92
  21. .! Adaptation to zip 1.6.
  22. .! Igor Mandrichenko 9-JUN-1992
  23. .! Added explanation of -V option.
  24. .! Jean-loup Gailly 14 June 92
  25. .! Adaptation to zip 1.8.
  26. .! Jean-loup Gailly 20 Aug 92
  27. .! Adaptation to zip 1.9.
  28. .! Jean-loup Gailly 31 Aug 93
  29. .! Adaptation to zip 2.0.
  30. .! Christian Spieler 20 Sep 93
  31. .! Adaptation to zip 2.0 and OpenVMS completed.
  32. .! Christian Spieler 05 Dec 95
  33. .! Adaptation to zip 2.1, new options.
  34. .! Christian Spieler 20 Jan 96
  35. .! Changed -L and -v descriptions.
  36. .! Christian Spieler 11 Feb 96
  37. .! Added -X option.
  38. .! Onno van der Linden,
  39. .! Christian Spieler 13 Mar 96
  40. .! Removed -ee option.
  41. .! Christian Spieler 09 Feb 96
  42. .! Updated copyright notice, Zip version.
  43. .! Christian Spieler 21 Jul 97
  44. .! Added -P, -R, -i@, -x@ and -tt options, modified for Zip 2.2.
  45. .! Christian Spieler 14 Oct 97
  46. .! unified spelling of "Info-ZIP", final cleanups for 2.2.
  47. .! Steven Schweda 10 May 2007
  48. .! General update for version 3.0.
  49. .! Ed Gordon 12 May 2007
  50. .! Minor updates for version 3.0.
  51. .!
  52. .noflags
  53. .lm4 .rm72
  54. .indent -4
  55. 1 ZIP
  56. .br
  57. Zip is a compression and file packaging utility for several operating
  58. systems, including UNIX, VMS, MSDOS, OS/2, Windows 9x/NT/XP, Minix, Atari,
  59. Macintosh, Amiga, and Acorn RISC OS. It is analogous to a combination of
  60. tar and compress and is compatible with PKZIP (Phil Katz's ZIP) for
  61. MSDOS systems.
  62. .sk
  63. Zip is useful for packaging a set of files for distribution, for
  64. archiving files, and for saving disk space by temporarily compressing
  65. unused files or directories. A companion program, UnZip, unpacks Zip
  66. archives.
  67. .sk
  68. For brief help on Zip or UnZip, run the program without specifying any
  69. parameters on the command line.
  70. .sk
  71. This description covers the Zip program which uses a UNIX-style command
  72. line. A separate program is available which provides a VMS-style CLI
  73. command line, and it has its own documentation. Refer to the Zip
  74. installation instructions for details.
  75. .sk
  76. Format
  77. .sk;.lm+2;.literal
  78. ZIP [-options] archive inpath inpath ...
  79. .end literal;.lm-2
  80. .!------------------------------------------------------------------------------
  81. .indent -4
  82. 2 Basic_Usage
  83. .br
  84. Format
  85. .sk;.lm+2;.literal
  86. ZIP [-options] archive inpath inpath ...
  87. .end literal;.lm-2
  88. .sk
  89. The default action of Zip is to add or replace entries in "archive" from
  90. the list of "inpath" file specifications, which can include directories
  91. and file names with VMS-style wildcards, or the special name -@ to read
  92. file specifications from SYS$INPUT (stdin).
  93. .sk
  94. With SET PROCESS /PARSE_STYLE = EXTENDED (available on recent non-VAX
  95. systems), Zip preserves the case of the command line. Otherwise, mixed-
  96. or upper-case options and arguments must be quoted. For example,
  97. "-V". Examples in this document generally do not show this quotation,
  98. so VAX and /PARSE_STYLE = TRADITIONAL users (that is, troglodytes) will
  99. need to add quotation where needed when working with these examples.
  100. .sk
  101. General
  102. .sk
  103. Zip reads one or more files, compresses the data (normally), and stores
  104. the compressed information into a single Zip archive file, along with
  105. information about each file (name, path, date and time of last
  106. modification, protection, and check information to verify file
  107. integrity). On a VMS system, Zip can also save VMS/RMS file attributes,
  108. allowing UnZip to restore the files without loss of important file
  109. attributes. Zip can pack an entire directory structure into a Zip
  110. archive with a single command.
  111. .sk
  112. Compression
  113. .sk
  114. Compression ratios of 2:1 to 3:1 are common for text files. Zip has one
  115. standard compression method ("deflate") and can also store files without
  116. compression. Zip (and UnZip) may be built with optional support for the
  117. bzip2 compression method. Then, the user may select bzip2 compression
  118. instead of the default "deflate" method. Zip automatically chooses
  119. simple storage over compression for a file, if the specified compression
  120. method does not actually compress the data in that file.
  121. .sk
  122. Compatibility
  123. .sk
  124. Zip and UnZip can work with archives produced by PKZIP (supporting most
  125. PKZIP features up to PKZIP version 4.6), and PKZIP and PKUNZIP can work
  126. with archives produced by Zip (with some exceptions, notably streamed
  127. archives, but recent changes in the .ZIP file standard may facilitate
  128. better compatibility). Zip version 3.0 is compatible with PKZIP 2.04
  129. and also supports the Zip64 extensions of PKZIP 4.5 which allows
  130. archives as well as files to exceed the previous 2 GB limit (4 GB in
  131. some cases). Zip also supports bzip2 compression if the bzip2 library
  132. is included when Zip is built. Note that PKUNZIP 1.10 cannot extract
  133. files produced by PKZIP 2.04 or Zip 3.0. You must use PKUNZIP 2.04g or
  134. UnZip 5.0p1 (or later versions) to extract them.
  135. .sk
  136. Large Archives and Zip64
  137. .sk
  138. Where the operating system and C run-time support allow, Zip 3.0 and
  139. UnZip 6.0 (and later versions) support large files (input and archive),
  140. using the Zip64 extensions to the original .ZIP file format. On VMS,
  141. this genarally means non-VAX systems with VMS V7.2 or later (perhaps
  142. requiring a C RTL ECO before VMS V7.3-2).
  143. .sk
  144. Zip automatically uses the Zip64 extensions when a file larger than 2 GB
  145. is added to an archive, an archive containing a Zip64 entry is updated
  146. (if the resulting archive still needs Zip64), the size of the archive
  147. will exceed 4 GB, or when the number of entries in the archive will
  148. exceed about 64K. Zip64 is also used for archives streamed to a
  149. non-seekable output device. You must use a 4.5 compatible UnZip to
  150. extract files using the Zip64 extensions such as UnZip 6.0 or later.
  151. .sk
  152. In addition, streamed archives, entries encrypted with standard
  153. encryption, or split archives created with the pause option may not be
  154. compatible with PKZIP as data descriptors are used, and PKZIP at the
  155. time of this writing does not support data descriptors (but recent
  156. changes in the PKWare published .ZIP file standard now include some
  157. support for the data descriptor format Zip uses).
  158. .!------------------------------------------------------------------------------
  159. .indent -4
  160. 2 More_Usage
  161. .br
  162. Here is a very simple example of Zip use:
  163. .sk;.indent 10;
  164. $ zip stuff.zip *.*
  165. .sk
  166. This will create the Zip archive "stuff.zip" (assuming it does not
  167. already exist) and put all the (non-directory) files (";0") from the
  168. current default directory into "stuff.zip" in a compressed form. The
  169. archive is opened using a default file specification of
  170. "SYS$DISK:[].zip", so specifying "stuff" as the archive name would also
  171. create (or use an existing) "stuff.zip", but specifying "stuff.other"
  172. would give you that name. In general, Zip doesn't care about the type
  173. in the file specification, but for split archives (archives split over
  174. multiple files), the user should normally specify a type-less name,
  175. because Zip will normally generate sequentially numbered types ".z01",
  176. ".z02", and so on for the early splits, and then the required ".zip" for
  177. the last split. These file types are required by the Zip standard for
  178. split archives.
  179. .sk
  180. Standard VMS wildcard expansion ($SEARCH) is used to interpret the
  181. "inpath" file and directory specifications, like the "*.*" in this
  182. example.
  183. .sk
  184. On VMS, the most natural way to archive an entire directory tree is to
  185. use a directory-depth wildcard ("[...]"). For example:
  186. .sk;.indent 10
  187. zip foo [...]*.*
  188. .sk
  189. This will create the file "foo.zip" containing all the files (";0") and
  190. directories in and below the current default directory. A more
  191. UNIX-like way to do this would be to use the -r (--recurse-paths)
  192. option:
  193. .sk;.indent 10
  194. $ zip -r foo *.*
  195. .sk
  196. Zip avoids including its own output files when selecting files to
  197. include in the archive, so it should be safe, as in this case, to create
  198. the archive in the same drectory as the input files.
  199. .sk
  200. One or more specific files, directories, or subdirectories may also be
  201. specified:
  202. .lm +10;.literal
  203. zip foo.zip readme.txt [www...]*.* [.ftp...]*.* -
  204. [.src]*.h [.src]*.c
  205. .end literal;.lm -10
  206. .sk
  207. For security reasons, paths in Zip archives are always stored as
  208. relative paths, so some care is needed when creating an archive so that
  209. it will create the intended directory structure when UnZip is used to
  210. unpack it.
  211. .sk
  212. To use -r with a specific directory, the name of the directory file
  213. itself must be specified:
  214. .sk;.indent 10
  215. zip -r foo.zip [000000]www.dir ftp.dir
  216. .sk
  217. You may want to make an archive that contains the files in [.foo], but not
  218. record the directory name, "foo". You can use the -j (junk path) option
  219. to leave off the path:
  220. .sk;.indent 10
  221. $ zip -j foo [.foo]*.*
  222. .sk
  223. If you are short on disk space, you might not have enough room to hold
  224. both the original directory and the corresponding compressed Zip
  225. archive. In this case, you can create the archive in steps, and use the
  226. -m option. For example, if [.foo] contains the subdirectories [.tom],
  227. [.dick], and [.harry], you could:
  228. .sk
  229. .lm +10;.literal
  230. zip -m foo [.foo.tom...]*.*
  231. zip -m foo [.foo.dick...]*.*
  232. zip -m foo [.foo.harry...]*.*
  233. .end literal;.lm -10
  234. .sk
  235. The first command would create foo.zip, and the next two would add to
  236. it. The -m option means "move", and it will cause Zip to delete all
  237. files added to the archive after making or updating foo.zip. No
  238. deletions will be done until the Zip operation has completed with no
  239. errors. This option is obviously dangerous and should be used with
  240. care, but it does reduce the need for free disk space. When -m is
  241. used, the -T option is recommended and will test the resulting archive
  242. before deleting the input files.
  243. .sk
  244. If a file specification list is too long to fit conveniently on the Zip
  245. command line, the -@ option can be used to cause Zip to read a list of
  246. file specifications from SYS$INPUT (stdin). If a DCL command procedure
  247. is used, the names can be specified in the procedure:
  248. .sk;
  249. .lm +10;.literal
  250. $ zip foo -@
  251. $ deck
  252. file_spec_1
  253. file_spec_2
  254. file_spec_3
  255. $ eod
  256. .end literal;.lm -10
  257. .sk
  258. The file specifications can also be put into a separate file, and fed
  259. into Zip by explicitly defining SYS$INPUT, or by using PIPE. For
  260. example, with the list in foo.zfl:
  261. .sk;
  262. .lm +10;.literal
  263. $ define /user_mode sys$input foo.zfl
  264. $ zip foo -@
  265. .end literal;.lm -10;
  266. or:
  267. .lm +10;.literal
  268. $ pipe type foo.zfl | zip foo -@
  269. .end literal;.lm -10
  270. .sk
  271. If Zip is not able to read a file, it issues a warning but continues.
  272. See the -MM option for more on how Zip handles patterns that are not
  273. matched and files that are not readable. If some files were skipped, a
  274. warning is issued at the end of the Zip operation noting how many files
  275. were read and how many skipped.
  276. .!------------------------------------------------------------------------------
  277. .indent -4
  278. 2 Comments
  279. .br
  280. One-line comments may be included in the archive for each file added,
  281. using the -c (--entry-comments) option. File operations (adding,
  282. updating) are done first, and the user is then prompted for a one-line
  283. comment for each file added or updated. Enter the comment followed by
  284. <Return>, or just <Return> for no comment.
  285. .sk
  286. A single multi-line comment may be included for the archive as a whole,
  287. using the -z (--archive-comment) option. UnZip (including UnZip SFX)
  288. will display this comment when it expands the archive. The comment is
  289. read from SYS$INPUT (stdin), and is terminated by the usual end-of-file
  290. character, CTRL/Z. As usual, in a DCL command procedure, these data can
  291. be included in-line in the procedure, or a user may DEFINE SYS$INPUT to
  292. a file to get the comment from that file. Where supported, the DCL PIPE
  293. command can also be used to redirect SYS$INPUT from a file.
  294. .sk
  295. Note that -z (--archive-comment) and -@ (read file specifications from
  296. SYS$INPUT (stdin)) can't be used together (successfully).
  297. .!------------------------------------------------------------------------------
  298. .indent -4
  299. 2 Compression
  300. .br
  301. Zip can archive files with or without compression. The standard
  302. compression method ("deflate") is compatible with all UnZip versions
  303. (except really old ones that only understand the "store" method).
  304. Current Zip and UnZip versions may be built with optional support for
  305. the bzip2 compression method. (The bzip2 method can compress better,
  306. especially when compressing smaller files, but uses more CPU time, and
  307. requires an UnZip which includes the optional bzip2 support. See the
  308. installation instructions for details on adding bzip2 compression
  309. support at build time.)
  310. .sk
  311. Numeric compression level options control the effort put into data
  312. compression, with -1 being the fastest, and -9 giving the most
  313. compression.
  314. .sk
  315. Compression control options:
  316. .sk;.lm +10;.literal
  317. -Z mthd use compress method "mthd",
  318. --compression-method mthd "bzip2" or "deflate" (default)
  319. -0 (--store) no compression
  320. -1 (--compress-1) compression level 1
  321. -2 (--compress-2) compression level 2
  322. -3 (--compress-3) compression level 3
  323. -4 (--compress-4) compression level 4
  324. -5 (--compress-5) compression level 5
  325. -6 (--compress-6) compression level 6
  326. -7 (--compress-7) compression level 7
  327. -8 (--compress-8) compression level 8
  328. -9 (--compress-9) compression level 9
  329. .end literal;.lm -10
  330. .sk
  331. Normally, a file which is already compressed will not be compressed much
  332. further (if at all) by Zip, and trying to do it can waste considerable
  333. CPU time. Zip can suppress compression on files with particular types,
  334. specified as a colon- or semi-colon-separated list of file types:
  335. .sk;.indent 10
  336. -n type1[:type2[...]] (--suffixes type1[:type2[...]])
  337. .sk
  338. For example:
  339. .sk;.indent 10
  340. zip -n .bz2:.gz:.jpeg:.jpg:.mp3:.zip foo [.foo]*.*
  341. .sk
  342. will put everything (";0") from [.foo] into foo.zip, but will store any
  343. files that end in .bz2, .gz, .jpeg, .jpg, .mp3, or .zip, without trying
  344. to compress them.
  345. .sk
  346. The default type list is .Z:.zip:.zoo:.arc:.lzh:.arj, and the comparison
  347. is case-insensitive.
  348. .sk
  349. -9 (--compress-9) will override -n (--suffixes), causing compression to
  350. be attempted for all files.
  351. .!------------------------------------------------------------------------------
  352. .indent -4
  353. 2 Encryption
  354. .br
  355. Zip offers optional encryption, using a method which by modern standards
  356. is generally considered to be weak.
  357. .sk;.literal
  358. -e --encrypt
  359. .end literal;.br
  360. Encrypt new or updated archive entries using a password which is
  361. supplied by the user interactively on the terminal in response to a
  362. prompt. (The password will not be echoed.) If SYS$COMMAND is not a
  363. terminal, Zip will exit with an error. The password is verified before
  364. being accepted.
  365. .sk;.literal
  366. -P password --password password
  367. .end literal;.br
  368. Use "password" to encrypt new or updated archive entries (if any).
  369. USING -P IS INSECURE! Many multi-user operating systems provide ways
  370. for any user (or a privileged user) to see the current command line of
  371. any other user. Even on more secure systems, there is always the threat
  372. of over-the-shoulder peeking. Storing the plaintext password as part of
  373. a command line in a command procedure is even less secure. Whenever
  374. possible, use the non-echoing, interactive password entry method.
  375. .sk
  376. Because standard Zip encryption is weak, where security is truly
  377. important, use a strong encryption program, such as Pretty Good Privacy
  378. (PGP) or GNU Privacy Guard (GnuPG), on an archive instead of standard
  379. Zip encryption. A stronger encryption method, such as AES, is planned
  380. for Zip 3.1.
  381. .!------------------------------------------------------------------------------
  382. .indent -4
  383. 2 Exit_Status
  384. .br
  385. On VMS, Zip's UNIX-style exit values are mapped into VMS-style status
  386. codes with facility code 1955 = %x7A3, and with the inhibit-message
  387. (%x10000000) and facility-specific (%x00008000) bits set:
  388. .sk
  389. .literal
  390. %x17A38001 normal exit
  391. %x17A38000+ 16* Zip_error_code warnings
  392. %x17A38002+ 16* Zip_error_code normal errors
  393. %x17A38004+ 16* Zip_error_code fatal errors
  394. .end literal
  395. .sk
  396. Note that multiplying the UNIX-style Zip error code by 16 places it
  397. conveniently in the hexadecimal representation of the VMS exit code,
  398. "__" in %x17A38__s, where "s" is the severity code. For example, a
  399. truncated archive might cause Zip error code 2, which would be
  400. transformed into the VMS exit status %x17A38024.
  401. .sk
  402. The Zip VMS exit codes include severity values which approximate those
  403. defined by PKWARE, as shown in the following table:
  404. .literal
  405. VMS Zip err
  406. severity code Error description
  407. ----------+---------+----------------------------------------------
  408. Success 0 Normal; no errors or warnings detected.
  409. Fatal 2 Unexpected end of archive.
  410. Error 3 A generic error in the archive format was
  411. detected. Processing may have completed
  412. successfully anyway; some broken archives
  413. created by other archivers have simple work-
  414. arounds.
  415. Fatal 4 Zip was unable to allocate memory for one or
  416. more buffers during program initialization.
  417. Fatal 5 A severe error in the archive format was
  418. detected. Processing probably failed imme-
  419. diately.
  420. Error 6 Entry too large to be split with zipsplit.
  421. Error 7 Invalid comment format.
  422. Fatal 8 Zip -T failed or out of memory.
  423. Error 9 The user aborted zip prematurely with con-
  424. trol-C (or equivalent).
  425. Fatal 10 Zip encountered an error while using a temp
  426. file.
  427. Fatal 11 Read or seek error.
  428. Warning 12 Zip has nothing to do.
  429. Error 13 Missing or empty zip file.
  430. Fatal 14 Error writing to a file.
  431. Fatal 15 Zip was unable to create a file to write to.
  432. Error 16 Bad command line parameters.
  433. Error 18 Zip could not open a specified file to read.
  434. Fatal 19 Zip was built with options not supported on
  435. this system
  436. Fatal 20 Attempt to read unsupported Zip64 archive
  437. .end literal
  438. .!------------------------------------------------------------------------------
  439. .indent -4
  440. 2 Extra_Fields
  441. .br
  442. The .ZIP file format allows some extra data to be stored with a file in
  443. the archive. For example, where local time zone information is
  444. available, Zip can store UTC date-time data for files. (Look for
  445. USE_EF_UT_TIME in a "zip -v" report.) On VMS, with -V or -VV, Zip will
  446. also store VMS-specific file attributes. These data are packaged as
  447. "extra fields" in the archive. Some extra fields are specific to a
  448. particular operating system (like VMS file attributes). Large files
  449. (bigger than 4GB) on any OS require an extra field to hold their 64-bit
  450. size data. Depending on the capabilities of the UnZip program used to
  451. expand the archive, these extra fields may be used or ignored when files
  452. are extracted from the archive.
  453. .sk
  454. Some extra fields, like UTC date-times or VMS file attributes, are
  455. optional. Others, like the Zip64 extra field which holds 64-bit sizes
  456. for a large file, are required.
  457. .sk
  458. The -X (--strip-extra) option suppresses the saving of any optional
  459. extra fields in the archive. (Thus, -X conflicts with -V or -VV.)
  460. .!------------------------------------------------------------------------------
  461. .indent -4
  462. 2 Environment
  463. .br
  464. A user can specify default command-line options and arguments by
  465. defining an "environment variable" (that is, a logical name or DCL
  466. symbol), "ZIP_OPTS" or "ZIPOPT", to specify them. If both "ZIP_OPTS" and
  467. "ZIPOPT" are specified, the definition of "ZIPOPT" prevails.
  468. .sk
  469. The C RTL function getenv() is used to sense these variables, so its
  470. behavior determines what happens if both a logical name and a symbol are
  471. defined. As of VMS V7.3, a logical name supercedes a symbol.
  472. .sk
  473. The "zip -v" report should show the perceived settings of these
  474. variables.
  475. .!------------------------------------------------------------------------------
  476. .indent -4
  477. 2 File_Names
  478. .br
  479. Zip deals with file names in the system file system and with file names
  480. in Zip archives. File names in a Zip archive are stored in a UNIX-like
  481. path-name format. For example, a VMS file specification like this:
  482. .sk;.indent 10
  483. [.zip30.vms]descrip.mms
  484. .sk
  485. could appear in a Zip archive as:
  486. .sk;.indent 10
  487. zip30/vms/descrip.mms
  488. .sk
  489. For security reasons, paths in Zip archives are always stored as
  490. relative paths, so an absolute VMS directory specification will be
  491. transformed to a relative path in the archive (that is, no leading "/").
  492. For example, the following absolute directory specification would give
  493. the same archive path as the previous (relative) example:
  494. .sk;.indent 10
  495. [zip30.vms]descrip.mms
  496. .sk
  497. Also, device names are dropped, so the following file specification
  498. would also give the same archive path:
  499. .sk;.indent 10
  500. sys$sysdevice:[zip30.vms]descrip.mms
  501. .sk
  502. If an archive is intended for use with PKUNZIP under MSDOS, then the -k
  503. (for "Katz", --DOS-names) option should be used to attempt to adjust the
  504. names and paths to conform to MSDOS character-set and length
  505. limitations, to store only the MSDOS file attributes (just the
  506. owner:write attribute from VMS), and to mark the entry as made under
  507. MSDOS (even though it wasn't).
  508. .sk
  509. Note that file specifications in the file system must be specified using
  510. VMS notation, but file names in an archive must be specified using the
  511. UNIX-like notation used in the archive. For example, where a BACKUP
  512. command might look like this:
  513. .sk.indent 10
  514. $ back [.zip30...]*.* /excl = [...vms]*.c stuff.bck /save
  515. .sk
  516. a corresponding Zip command might look like this:
  517. .sk;.indent 10;
  518. $ zip stuff.zip [.zip30...]*.* -x */vms/*.c
  519. .sk
  520. because the files to be added to the Zip archive are specified using VMS
  521. file specifications, but the -x (--exclude) option excludes names based
  522. on their archive path/file names. Options dealing with archive names
  523. include -R (--recurse-patterns), -d (--delete), -i (--include), -x
  524. (--exclude), and -U (--copy-entries).
  525. .sk
  526. Note: By default, on VMS, archive name pattern matching (-R, -d, -i, -x,
  527. and -U) is case sensitive, even when the file system is not case
  528. sensitive (or even case preserving). This allows accurate matching of
  529. mixed-case names in an archive which may have been created on a system
  530. with a case sensitive file system, but it can involve extra effort on
  531. VMS, where it may be necessary to use unnatural case names (or the same
  532. names in multiple cases, like "*.obj *.OBJ") for this kind of pattern
  533. matching to give the desired behavior. If completely case-blind pattern
  534. matching behavior is desired, specify the -ic (--ignore-case) option.
  535. .!------------------------------------------------------------------------------
  536. .indent -4
  537. 3 Case
  538. .br
  539. For better compatibility with UNIX-like systems, Zip, by default,
  540. down-cases ODS2 file names. For example, the following file on an ODS2
  541. file system:
  542. .sk;.indent 10
  543. [.ZIP30.VMS]DESCRIP.MMS
  544. .sk
  545. would appear in an archive as:
  546. .sk;.indent 10
  547. zip30/vms/descrip.mms
  548. .sk
  549. Zip versions before 3.0 down-cased all VMS file names. Now, various
  550. options give the user control over these conversions:
  551. .sk
  552. .lm +10;.literal
  553. -C preserve case of all file names
  554. -C- down-case all file names
  555. -C2 preserve case of ODS2 names
  556. -C2- down-case ODS2 file names (default)
  557. -C5 preserve case of ODS5 names (default)
  558. -C5- down-case ODS5 file names
  559. .end literal;.lm -10
  560. .sk
  561. Case is handled differently for archive member names, which the user
  562. specifies with the -R, -d, -i, -x, and -U options. By default, on VMS,
  563. archive name pattern matching is case sensitive, even when the file
  564. system is not case sensitive (or even case preserving). This allows
  565. accurate matching of mixed-case names in an archive which may have been
  566. created on a system with a case sensitive file system, but it can
  567. involve extra effort on VMS, where it may be necessary to use unnatural
  568. case names (or the same names in multiple cases, like "*.obj *.OBJ") for
  569. this kind of pattern matching to give the desired behavior. If
  570. completely case-blind pattern matching behavior is desired, specify the
  571. -ic (--ignore-case) option.
  572. .!------------------------------------------------------------------------------
  573. .indent -4
  574. 2 Fixing_Damage
  575. .br
  576. Two options can be used to fix a damaged Zip archive.
  577. .sk;.literal
  578. -F --fix
  579. -FF --fixfix
  580. .end literal;.sk
  581. The -F (--fix) option can be used if some portions of the archive are
  582. missing, but it requires a reasonably intact central directory. The
  583. input archive is scanned as usual, but zip will ignore some problems.
  584. The resulting archive should be valid, but any inconsistent entries
  585. will be left out.
  586. .sk
  587. If the archive is too damaged or the end (where the central directory is
  588. situated) has been truncated, you must use -FF (--fixfix). This is a
  589. change from zip 2.32, where the -F option is able to read a truncated
  590. archive. The -F option now more reliably fixes archives with minor
  591. damage, and the -FF option is needed to fix archives where -F and -FF
  592. was used before.
  593. .sk
  594. With -FF, the archive is scanned from the beginning and Zip scans for
  595. special signatures to identify the limits between the archive members.
  596. The -F option is more reliable if the archive is not too much damaged,
  597. so try this option first.
  598. .sk
  599. Neither option will recover archives that have been incorrectly
  600. transferred, such as by FTP in ASCII mode instead of binary. After the
  601. repair, the -t option of UnZip may show that some files have a bad CRC.
  602. Such files cannot be recovered; you can remove them from the archive
  603. using the -d option of Zip.
  604. .sk
  605. Because of the uncertainty of the "fixing" process, it's required
  606. to specify an output archive, rather than risking further damage to the
  607. original damaged archive. For example, to fix the damaged archive
  608. foo.zip,
  609. .sk;.indent 10
  610. zip -F foo --out foo_fix
  611. .sk
  612. tries to read the entries normally, copying good entries to the new
  613. archive foo_fix.zip. If this doesn't work, as when the archive is
  614. truncated, or if some entries are missed because of bad central
  615. directory entries, try -FF:
  616. .sk;.indent 10
  617. zip -FF foo --out foo_fixfix
  618. .sk
  619. and compare the resulting archive to the archive created using -F. The
  620. -FF option may create an inconsistent archive. Depending on what is
  621. damaged, you can then use the -F option to fix that archive.
  622. .sk
  623. A split archive with missing split files can be fixed using -F if you
  624. have the last split of the archive (the ".zip" file). If this file is
  625. missing, you must use -FF to fix the archive, which will prompt you for
  626. the splits you have.
  627. .sk
  628. Currently, the fix options can't recover an entry which has a bad
  629. checksum or is otherwise damaged.
  630. .!------------------------------------------------------------------------------
  631. .indent -4
  632. 2 Log_File
  633. .br
  634. Zip normally sends messages to the user's terminal, but these may be
  635. also directed to a log file.
  636. .sk;.literal
  637. -la --log-append
  638. .end literal;.br
  639. Append to an existing log file. Default is to create a new version.
  640. .sk;.literal
  641. -lf logfilepath --logfile-path logfilepath
  642. .end literal;.br
  643. Open a logfile at the given path. By default, a new version will be
  644. created, but with the -la option an existing file will be opened and the
  645. new log information appended to any existing information. Only
  646. warnings and errors are written to the log unless the -li option is also
  647. given, then all information messages are also written to the log.
  648. .sk;.literal
  649. -li --log-info
  650. .end literal;.br
  651. Include information messages, such as file names being zipped, in the
  652. log. The default is to include only the command line, any warnings
  653. and errors, and the final status.
  654. .!------------------------------------------------------------------------------
  655. .indent -4
  656. 2 Modes_of_Operation
  657. .br
  658. Zip supports two distinct types of command modes, external and
  659. internal. The external modes (update, grow, and freshen) read files
  660. from the file system (as well as from an existing archive) while the
  661. internal modes (delete and copy) operate exclusively on entries in an
  662. existing archive.
  663. .sk;.literal
  664. -u --update
  665. .end literal;.br
  666. Update existing entries and add new files. If the archive does not
  667. exist, create it. This is the default mode, so -u is optional.
  668. .sk;.literal
  669. -g --grow
  670. .end literal;.br
  671. Grow (append to) the specified Zip archive, instead of creating a new
  672. one. If this operation fails, Zip attempts to restore the archive to
  673. its original state. If the restoration fails, the archive might become
  674. corrupted. This option is ignored when there's no existing archive or
  675. when at least one archive member must be updated or deleted.
  676. .sk;.literal
  677. -f --freshen
  678. .end literal;.br
  679. Update existing entries in an existing archive. Does not add new files
  680. to the archive.
  681. .sk;.literal
  682. -d --delete
  683. .end literal;.br
  684. Delete entries from an existing archive.
  685. .sk;.literal
  686. -DF --difference-archive
  687. .end literal;.br
  688. Create an incremental backup-style archive, where the resulting archive
  689. will contain all new and changed files since the original archive was
  690. created. For this to work, the input file list and current directory
  691. must be the same as during the original Zip operation.
  692. .sk
  693. For example, if the existing archive was created using
  694. .sk;.indent 10
  695. zip foo_full.zip [.foo...]*.*
  696. .sk
  697. from just above the foo directory, then the command (also from just
  698. above the foo directory):
  699. .sk;.indent 10
  700. zip foo_full.zip [.foo...]*.* -DF -O foo_incr.zip
  701. .sk
  702. creates the archive foo_incr.zip with just the files not in foo_full.zip
  703. and the files where the size or date-time of the files does not match
  704. that in foo_full.zip. Note that in the "zip -DF" operation, the
  705. original full archive is specified as the input archive, and the -O
  706. (--output-file) option is used to specify the new (incremental) output
  707. archive.
  708. .sk;.literal
  709. -FS --filesync
  710. .end literal;.br
  711. Delete entries in the archive that do not match files on the OS.
  712. Normally when an archive is updated, new files are added and changed
  713. files are updated but files that no longer exist on the OS are not
  714. deleted from the archive. This option enables deleting of entries that
  715. are not matched on the OS. Enabling this option should create archives
  716. that are the same as new archives, but since existing entries are copied
  717. instead of compressed, updating an existing archive with -FS can be much
  718. faster than creating a new archive. If few files are being copied from
  719. the old archive, it may be faster to create a new archive instead.
  720. .sk
  721. This option deletes files from the archive. If you need to preserve the
  722. original archive, make a copy of the archive first, or use the -O
  723. (--output) option to output the new archive to a new file. Even though
  724. it's slower, creating a new archive with a new archive name is safer,
  725. avoids mismatches between archive and OS paths, and is preferred.
  726. .sk;.literal
  727. -U --copy-entries
  728. .end literal;.br
  729. Select entries in an existing archive and copy them to a new archive.
  730. Copy mode is like update mode, but entries in the existing archive are
  731. selected by command line patterns rather than files from the file system
  732. and it uses the -O (--output-file) option to write the resulting archive
  733. to a new file rather than updating the existing archive, leaving the
  734. original archive unchanged.
  735. .sk
  736. Normally, when updating an archive using relative file specifications
  737. ("[]", "[.xxx]", and so on), it helps to have the same default directory
  738. as when the archive was created, but this is not a strict requirement.
  739. .sk
  740. Date-time information in a Zip archive may be influenced by time zone.
  741. .!------------------------------------------------------------------------------
  742. .indent -4
  743. 3 Examples
  744. .br
  745. When given the name of an existing archive, Zip will replace identically
  746. named entries in the archive or add entries for new names. For example,
  747. if foo.zip exists and contains foo/file1 and foo/file2, and the
  748. directory [.foo] contains the files file1 and file3, then:
  749. .sk;.indent 10
  750. $ zip foo [.foo...]*.*
  751. .sk
  752. will replace foo/file1 in foo.zip and add foo/file3 to foo.zip. After
  753. this, foo.zip contains foo/file1, foo/file2, and foo/file3, with foo/file2
  754. unchanged from before. This is the default mode -u (update).
  755. .sk
  756. Update will add new entries to the archive and will replace
  757. existing entries only if the modified date of the file is more recent than
  758. the date recorded for that name in the archive. For example:
  759. .sk;.indent 10
  760. $ zip -u stuff *.*
  761. .sk
  762. will add any new files in the current directory, and update any changed
  763. files in the archive stuff.zip. Note that Zip will not try to pack
  764. stuff.zip into itself when you do this. Zip avoids including its own
  765. output files when selecting files to include in the archive, so it
  766. should be safe, as in this case, to have the archive included in the
  767. list of input files.
  768. .sk
  769. A second mode, -f (freshen), like update will only
  770. replace entries with newer files. Unlike update, however, it will not
  771. add files that are not already in the archive. For example:
  772. .sk;.indent 10
  773. $ zip -f foo
  774. .sk
  775. Note that the -f option with no arguments freshens all the entries in the
  776. archive. The same is true of -u, so "zip -u foo" and "zip -f foo" do
  777. the same thing.
  778. .sk
  779. When these options are used, Zip should be run from the same directory
  780. as when the original Zip command was run, so that the path names in the
  781. archive will continue to agree with the path names in the file system.
  782. Normally, it's also a good idea to keep the other options the same (-V,
  783. -w, and the like), to keep the archive contents consistent.
  784. .sk
  785. The -t (--from-date) and -tt (--before-date) options can also be used
  786. with adding, updating, or freshening to restrict further the files to be
  787. included in the archive. For example:
  788. .sk;.indent 10
  789. $ zip -rt 12071991 infamy [.FOO]*.*
  790. .sk
  791. will add all the files in [.FOO] and its subdirectories that were last
  792. modified on December 7, 1991, or later to the achive infamy.zip. Dates
  793. can be in format mmddyyyy or yyyy-mm-dd.
  794. .sk
  795. Also, files can be explicitly excluded using the -x option:
  796. .sk;.indent 10
  797. $ zip -r foo [.FOO] -x *.obj
  798. .sk
  799. which will zip up the contents of [.FOO] into foo.zip but exclude all the
  800. files that end in ".obj".
  801. .sk
  802. The -d (delete) mode will remove entries from an
  803. archive. An example might be:
  804. .sk;.indent 10
  805. $ zip -d foo foo/harry/*.* *.obj
  806. .sk
  807. which will remove all of the files that start with "foo/harry/" and all of
  808. the files that end with ".obj" (in any path).
  809. .sk
  810. The last mode, -U (--copy-entries), selects entries from an existing
  811. archive and copies them to a new archive.
  812. .sk;.indent 10
  813. $ zip -U foo *.obj --out fooobj
  814. .sk
  815. will copy all .obj entries from foo.zip and put them in the new archive
  816. fooobj.zip.
  817. .sk
  818. Note: By default, on VMS, archive name pattern matching (-R, -d, -i, -x,
  819. and -U) is case sensitive, even when the file system is not case
  820. sensitive (or even case preserving). This allows accurate matching of
  821. mixed-case names in an archive which may have been created on a system
  822. with a case sensitive file system, but it can involve extra effort on
  823. VMS, where it may be necessary to use unnatural case names (or the same
  824. names in multiple cases, like "*.obj *.OBJ") for this kind of pattern
  825. matching to give the desired behavior. If completely case-blind pattern
  826. matching behavior is desired, specify the -ic (--ignore-case) option.
  827. .!------------------------------------------------------------------------------
  828. .indent -4
  829. 2 Options_List
  830. .br
  831. "zip -h" provides a concise list of common command-line options. "zip
  832. -h2" provides more details. "zip -so" provides a list of all available
  833. options. "zip -v" shows the program version and available features.
  834. (The list below was derived from a "zip -so" listing.)
  835. .sk
  836. Short-form options begin with a single hyphen ("-"). Long-form option
  837. begin with a double hyphen ("--"), and may be abbreviated to any
  838. unambiguous shorter string. For example:
  839. .lm +10;.literal
  840. -v
  841. --verbose
  842. --verb
  843. .end literal;.lm -10
  844. .sk
  845. To avoid confusion, if a negatable option contains an embedded hyphen
  846. ("-"), then avoid abbreviating it at the hyphen if you plan to negate
  847. it. For example, if an option like --some-option were abbreviated to
  848. --some-, the parser would consider that trailing hyphen to be part of
  849. the option name, rather than as a negating trailing hyphen. This
  850. behavior may change in the future, to interpret the trailing hyphen in
  851. --some- to be negating. (So don't do it.)
  852. .sk
  853. Some options may be negated (or modified) by appending a "-":
  854. .lm +10;.literal
  855. -la-
  856. --show-files-
  857. .end literal;.lm -10
  858. .sk
  859. Some options take a value, which may immediately follow the option, or
  860. be separated by a space or "=". For example:
  861. .lm +10;.literal
  862. -ttmmddyyyy
  863. -tt mmddyyyy
  864. -tt=mmddyyyy
  865. .end literal;.lm -10
  866. .sk
  867. .lm -4;.literal
  868. Sh Long Description
  869. ----+-------------------+--------------------------------------------------
  870. 0 store store (instead of compress)
  871. 1 compress-1 compress faster (-2, -3, -4, ...)
  872. 9 compress-9 compress better
  873. ? show the Zip help screen
  874. @ names-stdin read input file patterns from SYS$INPUT (1/line)
  875. A adjust-sfx adjust self-extracting executable
  876. b temp-path path use "path" directory for temporary files
  877. C preserve-case preserve case of all file names added to archive
  878. C- preserve-case- down-case all file names added to archive
  879. C2 preserve-case-2 preserve case of ODS2 names added to archive
  880. C2- preserve-case-2- down-case ODS2 file added to archive (default)
  881. C5 preserve-case-5 preserve case of ODS5 names added to archive (dflt)
  882. C5- preserve-case-5- down-case ODS5 names added to archive
  883. c entry-comments add a comment for each entry added to archive
  884. D no-dir-entries do not add archive entries for directories
  885. DF difference-archive difference archive: add only changed or new files
  886. d delete delete entries in archive
  887. db display-bytes display running byte counts
  888. dc display-counts display running file counts
  889. dd display-dots display progress dots for files (dflt size = 10MB)
  890. dg display-globaldots display progress dots for archive, not each file
  891. ds dot-size size set progress dot interval to "size" (MB)
  892. du display-usize display original uncompressed size for entries
  893. dv display-volume display volume (disk) number as in_disk>out_disk
  894. e encrypt encrypt entries, ask for password
  895. F fix fix mostly intact archive (try F before FF)
  896. FF fixfix salvage what can be salvaged (not as reliable)
  897. FS filesync remove archive entries unmatched in file system
  898. f freshen update existing entries (only changed files)
  899. fd force-descriptors force data descriptors as if streaming
  900. fz force-zip64 force use of Zip64 format
  901. g grow grow existing archive (unless updating or deleting)
  902. H show the Zip help screen
  903. h help show the Zip help screen
  904. h2 more-help show extended Zip help
  905. i include pat1 [pat2 [...]] include only names matching the patterns
  906. ic ignore-case ignore case (case-blind archive entry name matching)
  907. J junk-sfx junk (remove) archive preamble (unzipsfx)
  908. j junk-paths junk (don't store) directory names, only file names
  909. k DOS-names simulate PKZIP-made archive (DOS 8.3 names)
  910. L license show software license
  911. l to-crlf translate end-of-lines (LF -> CRLF)
  912. la log-append append to existing log file
  913. lf logfile-path lfile log to log file at lfile (default: new version)
  914. li log-info include informational messages in log
  915. ll from-crlf translate end-of-lines (CRLF -> LF)
  916. MM must-match input file spec must exist (wildcards must match)
  917. m move delete files added to archive
  918. n suffixes sfx1[:sfx2[...]] don't compress files with these suffixes
  919. nw no-wild no wildcards during add or update
  920. O output-file ozf use "ozf" as the output archive (dflt = inp archive)
  921. o latest-time set archive date-time to match oldest entry
  922. P password password encrypt with supplied "password" string
  923. q quiet quiet operation (no info messages)
  924. R recurse-patterns recurse into subdirs from cur dir, match names only
  925. r recurse-paths recurse into directories from specified path pats
  926. s split-size size split archive at "size" (K/MB) (0: don't split)
  927. sb split-bell ring terminal bell at pause for split medium change
  928. sc show-command show command line
  929. sd show-debug show debug messages
  930. sf show-files show files to process (only)
  931. so show-options show list of all command-line options
  932. sp split-pause pause to select split destination(s)
  933. sv split-verbose be verbose about creating splits
  934. T test test archive integrity (runs UnZip -T)
  935. t from-date mmddyyyy only do files since (at or after) "mmddyyyy"
  936. tt before-date mmddyyyy only do files before "mmddyyyy"
  937. u update update changed files, add new files (default mode)
  938. V VMS-portable save VMS file attributes
  939. VV VMS-specific save VMS file attributes and all allocated blocks
  940. v verbose verbose messages (print version info if only arg)
  941. w VMS-versions save VMS version numbers in archive
  942. ww VMS-dot-versions save VMS version numbers as ".nnn", not ";nnn"
  943. X strip-extra strip all but critical extra fields
  944. X- strip-extra- keep all extra fields
  945. x exclude pat1 [pat2 [...]] exclude all names matching the patterns
  946. Z compression-method mthd use compress method "mthd" (bzip2 or deflate)
  947. z archive-comment ask for archive comment
  948. .end literal;.lm +4
  949. .!------------------------------------------------------------------------------
  950. .indent -4
  951. 2 Miscellaneous_Options
  952. .sk;.literal
  953. -D --no-dir-entries
  954. .end literal;.br
  955. Do not create entries in the archive for directories. By default,
  956. directory entries are added to an archive, so that their attributes can
  957. be saved in the archive. When an archive is created using -D, UnZip
  958. will still create directories as needed (subject to user control), but
  959. they will get the default attributes (date-time, permissions, ...) on
  960. the destination system, rather than their original atributes.
  961. .sk;.literal
  962. -MM --must-match
  963. .end literal;.br
  964. All input patterns must match at least one file and all input files
  965. found must be readable. Normally when an input pattern does not match
  966. a file the "name not matched" warning is issued and when an input
  967. file has been found but later is missing or not readable a "missing or
  968. not readable" warning is issued. In either case Zip continues
  969. creating the archive, with missing or unreadable new files being skipped
  970. and files already in the archive remaining unchanged. After the
  971. archive is created, if any files were not readable zip returns the OPEN
  972. error code (18 on most systems) instead of the normal success return (0
  973. on most systems). With -MM, Zip exits as soon as an input pattern
  974. is not matched (whenever the "name not matched" warning would be issued)
  975. or when an input file is not readable. In either case Zip exits with
  976. an OPEN error and no archive is created.
  977. .sk
  978. This option is useful when a known list of files is to be zipped so any
  979. missing or unreadable files should result in an error. It may be less
  980. useful when used with wildcards, but Zip will still exit with an error
  981. if any input pattern doesn't match at least one file or if any
  982. matched files are unreadable. If you want to create the archive anyway
  983. and only need to know if files were skipped, then don't use -MM and just
  984. check the exit status. Also, a log file (see -lf (--logfile-path))
  985. could be useful.
  986. .sk;.literal
  987. -O out_file --output-file out_file
  988. .end literal;.br
  989. Process the archive changes as usual, but instead of updating the
  990. existing archive, send the output to a new archive, "out_file". The
  991. output archive specified must be a different file from the input
  992. archive.
  993. .sk
  994. This option can be used to create updated split archives. It can
  995. also be used with -U to copy entries from an existing archive to
  996. a new archive. See the EXAMPLES section below.
  997. .sk
  998. Another use is converting zip files from one split size to
  999. another. For instance, to convert an archive with 700MB CD splits
  1000. to one with 2GB DVD splits, can use:
  1001. .sk;.indent 10
  1002. zip -s 2g cd-split.zip --out dvd-split.zip
  1003. .sk
  1004. which uses copy mode. See -U below. Also:
  1005. .sk;.indent 10
  1006. zip -s 0 split.zip --out unsplit.zip
  1007. .sk
  1008. will convert a split archive to a single-file archive.
  1009. .sk
  1010. Copy mode will convert stream entries (using data descriptors and which
  1011. may be incompatible with some unzip programs) to normal entries (which
  1012. should be compatible with all unzip programs), except if standard
  1013. encryption was used. For archives with encrypted entries, zipcloak
  1014. will decrypt the entries and convert them to normal entries.
  1015. .sk;.literal
  1016. -o --latest-time
  1017. .end literal;.br
  1018. Set the modification date-time of the Zip archive file to the latest
  1019. (newest) modification date-time found among the entries in the zip
  1020. archive. This can be used without any other operations, if
  1021. desired. For example:
  1022. .sk;.indent 10
  1023. zip -o foo
  1024. .sk
  1025. will change the modification date-time of foo.zip to the latest time of
  1026. the entries in foo.zip.
  1027. .sk;.literal
  1028. -q --quiet
  1029. .end literal;.br
  1030. Quiet mode. Eliminates informational messages and comment prompts.
  1031. This mode may be useful in command procedures, or if the Zip operation
  1032. is being performed as a background task ("$ spawn/nowait zip -q foo
  1033. *.c").
  1034. .sk
  1035. .sk;.literal
  1036. -T --test
  1037. .end literal;.br
  1038. Test the integrity of a zip archive (the new one, if -O (--output-file)
  1039. is specified). If the check fails, the old zip file is unchanged and
  1040. (with the -m option) no input files are removed.
  1041. .sk
  1042. Implementation
  1043. .br
  1044. "zip -T" actually runs an "unzip -t" command to do the testing, so UnZip
  1045. must be installed properly for this to work.
  1046. .sk;.literal
  1047. -TT unzip_cmd --unzip-command unzip_cmd
  1048. .end literal;.br
  1049. Specify the actual UnZip command, "unzip_cmd" (normally a DCL symbol) to
  1050. use for "zip -T". This can be useful if multiple versions of UnZip are
  1051. installed on a system, and the default DCL symbol "UNZIP" would run the
  1052. wrong one (or the logical name DCL$PATH would lead to the wrong one).
  1053. .sk
  1054. In "unzip_cmd", the string "{}" is replaced by the temporary name of the
  1055. archive to be tested, otherwise the name of the archive is appended
  1056. to the end of the command. The exit status is checked for success severity.
  1057. .sk;.literal
  1058. -v --verbose
  1059. .end literal;.br
  1060. Verbose mode or print diagnostic version info.
  1061. .sk
  1062. Normally, when applied to real operations, this option enables the
  1063. display of a progress indicator during compression (see -dd for more on
  1064. dots) and requests verbose diagnostic info about archive structure
  1065. oddities.
  1066. .sk
  1067. When -v is the only command line argument, a diagnostic report is
  1068. displayed, showing:
  1069. .lm +3;.br;.indent -2
  1070. o Copyright and other legal notices
  1071. .br;.indent -2
  1072. o Program name, version, and release date
  1073. .br;.indent -2
  1074. o Pointers to Info-ZIP FTP and Web sites
  1075. .br;.indent -2
  1076. o Program build information (compiler type and version, OS version, and
  1077. the compilation date
  1078. .br;.indent -2
  1079. o Optional features enabled at compile-time
  1080. .br;.indent -2
  1081. o Environment variable definitions (ZIP_OPTS, ZIPOPT)
  1082. .lm -3;.br
  1083. .sk
  1084. This information should be included in bug reports.
  1085. .sk;.literal
  1086. -y --symlinks
  1087. .end literal;.br
  1088. Store symbolic links as such in the Zip archive, instead of compressing
  1089. and storing the file referred to by the link. A symbolic link normally
  1090. requires less storage than the actual file, both in the archive, and on
  1091. the destination file system.
  1092. .sk
  1093. On VMS, symbolic links are supported on ODS5 disks where the C RTL
  1094. supports symbolic links. Full support for symbolic links seems to
  1095. require VMS V8.3, but a Zip program supporting symbolic links may be
  1096. built on VMS V7.3-2.
  1097. .!------------------------------------------------------------------------------
  1098. .indent -4
  1099. 2 Progress_Display
  1100. .br
  1101. Various options control the display of progress messages during Zip
  1102. operation.
  1103. .sk;.literal
  1104. -db --display-bytes
  1105. .end literal;.br
  1106. Display running byte counts showing the bytes processed and the bytes to
  1107. go.
  1108. .sk;.literal
  1109. -dc --display-counts
  1110. .end literal;.br
  1111. Display running count of entries processed and entries to go.
  1112. .sk;.literal
  1113. -dd --display-dots
  1114. .end literal;.br
  1115. Display dots while each entry is processed (except on ports that have
  1116. their own progress indicator). See -ds below for setting dot size. The
  1117. default is a dot every 10 MB of input file processed. The -v
  1118. (--verbose) option also displays dots and used to at a higher rate than
  1119. this (at the same rate as in previous versions of Zip) but this rate has
  1120. been changed to the new 10 MB default, and is also controlled by -ds.
  1121. .sk;.literal
  1122. -dg --display-globaldots
  1123. .end literal;.br
  1124. Display progress dots for the archive instead of for each file. The
  1125. command
  1126. .sk;.indent 10
  1127. zip -qdgds 10m
  1128. .sk
  1129. will turn off most output except dots every 10 MB.
  1130. .sk;.literal
  1131. -ds size --dot-size size
  1132. .end literal;.br
  1133. Set amount of input file processed for each dot displayed. See -dd to
  1134. enable displaying dots. Setting this option implies -dd. "size" is in
  1135. the format "nm" where n is a number and m is a multiplier. Currently
  1136. "m" can be k (KB), m (MB), g (GB), or t (TB), so if "n" is 100 and "m"
  1137. is k, "size" would be 100k which is 100KB. The default is 10MB.
  1138. .sk
  1139. The -v (--verbose) option also displays dots and used to default to a
  1140. higher rate than this (at the same rate as in previous versions of Zip)
  1141. but now the default is 10 MB and the -v dots are also controlled by this
  1142. option. A "size" of 0 turns dots off.
  1143. .sk
  1144. This option does not control the dots from the "Scanning files" message
  1145. as Zip scans for input files. The dot size for that is fixed at 2
  1146. seconds or a fixed number of entries, whichever is longer.
  1147. .sk;.literal
  1148. -du --display-usize
  1149. .end literal;.br
  1150. Display the uncompressed size of each entry.
  1151. .sk;.literal
  1152. -dv --display-volume
  1153. .end literal;.br
  1154. Display the volume (disk) number each entry is being written to.
  1155. .!------------------------------------------------------------------------------
  1156. .indent -4
  1157. 2 Self_Extracting_Archives
  1158. .br
  1159. A self-extracting archive (SFX) comprises a normal Zip archive appended
  1160. to a special UnZip program (such as UNZIPSFX.EXE) for the intended
  1161. target system.
  1162. .sk
  1163. The UnZip distribution includes a VMS command procedure,
  1164. [,vms]makesfx.com, which can be used directly or adapted to create an
  1165. SFX archive from a normal Zip archive.
  1166. .sk
  1167. The .ZIP file format includes offsets to data structures in the archive,
  1168. and these offsets are measured from the start of the archive file.
  1169. Appending an archive to an UnZip SFX executable effectively moves the
  1170. start of the archive file. That makes the original offsets wrong, and
  1171. that will cause the UnZip SFX program to emit warning messages when it
  1172. tries to unpack the archive. Zip -A can be used to adjust these offsets
  1173. in a self-extracting archive. For example, to adjust the offsets in
  1174. foo.sfx_exe:
  1175. .sk;.indent 10
  1176. zip -A foo.sfx_exe
  1177. .sk
  1178. Similarly, the UnZip SFX program can be removed from a self-extracting
  1179. archive (and the offsets in the archive restored) using the -J
  1180. (--junk-sfx) option. For example:
  1181. .sk;.indent 10
  1182. zip -J foo.sfx_exe
  1183. .sk
  1184. Note that a self-extracting archive contains a normal Zip archive, and a
  1185. normal UnZip program can be used to expand it in the normal way. You
  1186. may get a warning about extra bytes at the beginning of the archive (the
  1187. UnZip SFX program), but UnZip should work properly after that. This
  1188. allows data in a self-extracting archive to be accessed on any system,
  1189. not just the target system where its embedded UnZip SFX program runs.
  1190. .!------------------------------------------------------------------------------
  1191. .indent -4
  1192. 2 Split_Archives
  1193. .br
  1194. Beginning with version 3.0, Zip supports split archives. A split
  1195. archive is one which is divided into multiple files, usually to allow it
  1196. to be stored on multiple storage media (floppy diskettes, CD-ROMs, or
  1197. the like) when a single medium would be too small to contain the whole
  1198. archive. (Note that split archives are not just unitary archives split
  1199. into pieces, as the .ZIP file format includes offsets to data structures
  1200. in the archive, and for a split archive these are based on the start of
  1201. each split, not on the start of the whole archive. Concatenating the
  1202. pieces will invalidate these offsets, but UnZip can usually deal with
  1203. it. Zip will usually refuse to process such a spliced archive unless
  1204. the -FF fix option is used to fix the offsets.)
  1205. .sk
  1206. For a split archive with, say, 20 split files, the files are typically
  1207. named ARCHIVE.z01, ARCHIVE.z02, ..., ARCHIVE.z19, ARCHIVE.zip, where
  1208. "ARCHIVE" is the archive name specified by the user on the Zip command
  1209. line. Note that the last split file is the ".zip" file. In contrast,
  1210. "spanned" archives are the original multi-disk archive generally
  1211. requiring floppy disks and using volume labels to store disk numbers.
  1212. Zip supports split archives but not spanned archives, though a procedure
  1213. exists for converting split archives of the right size to spanned
  1214. archives. The reverse is also true, where each file of a spanned
  1215. archive can be copied in order to files with the above names to create a
  1216. split archive.
  1217. .!------------------------------------------------------------------------------
  1218. .indent -4
  1219. 3 Options
  1220. .br
  1221. Use "-s size" to create a split archive (and to set the split size).
  1222. The size is given as a number followed optionally by a multiplier suffix
  1223. of k (KB), m (MB, the default if no suffix is specified), g (GB), or t
  1224. (TB). (All are powers of 1024, not 1000). 64K is the minimum split
  1225. size. For example, the following command could be used to create a
  1226. split archive called "foo" from the contents of the "bar" directory with
  1227. splits of 670MB, which might be useful for burning on CDs:
  1228. .sk;.indent 10
  1229. zip -s 670m foo [.bar...]*.*
  1230. .sk
  1231. Using -s without -sp as above creates all the splits in the directory
  1232. specified by "foo", in this case the current default directory. This
  1233. split mode updates the splits as the archive is being created, requiring
  1234. all splits to remain writable, but creates split archives that are
  1235. readable by any UnZip that supports split archives. See -sp below for
  1236. enabling split pause mode which allows splits to be written directly to
  1237. removable media.
  1238. .sk
  1239. The -sv option can be used to enable verbose splitting and display
  1240. details of how the splitting is being done. The -sb option can be used
  1241. to ring the terminal bell when Zip pauses for the next split
  1242. destination.
  1243. .sk
  1244. The -sp option can be used to pause Zip between splits to allow
  1245. changing removable media, for example, but read the descriptions and
  1246. warnings for both -s and -sp below.
  1247. .sk
  1248. Though Zip does not update split archives, Zip provides the option
  1249. -O (--output-file) to allow split archives to be updated and saved in a
  1250. new archive. For example:
  1251. .sk;.indent 10
  1252. zip inarchive.zip foo.c bar.c -O outarchive.zip
  1253. .sk
  1254. reads archive inarchive.zip, even if split, adds the files foo.c and
  1255. bar.c, and writes the resulting archive to outarchive.zip. If
  1256. inarchive.zip is split, then outarchive.zip defaults to the same split
  1257. size. Be aware that outarchive.zip and any split files that are created
  1258. with it are always overwritten without warning. This may be changed in
  1259. the future.
  1260. .!------------------------------------------------------------------------------
  1261. .indent -4
  1262. 2 Temporary_Files
  1263. .br
  1264. When creating a new archive or normally when changing an existing
  1265. archive, Zip will write a temporary file in the archive destination
  1266. directory ("ZIxxxxxxxx", where "xxxxxxxx" is the hexadecimal process ID)
  1267. with the new contents. Then, if and when the Zip job has completed with
  1268. no errors, it will rename the temporary file to the specified archive
  1269. name (replacing the old archive, if any).
  1270. .sk
  1271. You can use the -b (--temp-path) option to specify a different path
  1272. (device and/or directory) for the temporary file, but specifying a
  1273. different device will force Zip to copy the temporary file to its final
  1274. destination instead of simply renaming it, and that copying will take
  1275. more time than renaming, especially for a large archive. For example:
  1276. .sk;.indent 10
  1277. $ zip -b disk$scratch:[tmp] stuff *
  1278. .sk
  1279. will cause Zip to put its temporary files in the directory
  1280. "disk$scratch:[tmp]", copying the temporary file back to the current
  1281. directory as stuff.zip when it's complete.
  1282. .!------------------------------------------------------------------------------
  1283. .indent -4
  1284. 2 Text_Files
  1285. .br
  1286. Zip offers some options to help deal with line endings in text files.
  1287. These may have limited utility on VMS.
  1288. .sk;.literal
  1289. -l --to-crlf
  1290. .end literal;.br
  1291. Translate the UNIX end-of-line character LF (CR on MAC) into the MSDOS
  1292. convention CR-LF. This option should not be used on binary files. This
  1293. option can be used on UNIX if the Zip file is intended for PKUNZIP under
  1294. MSDOS. If the input files already contain CR-LF, this option adds an
  1295. extra CR. This ensure that "unzip -a" on Unix will get back an exact
  1296. copy of the original file, to undo the effect of "zip -l". See -ll
  1297. below for the binary checks.
  1298. .sk;.literal
  1299. -ll --from-crlf
  1300. .end literal;.br
  1301. Translate the MSDOS end-of-line CR LF into UNIX LF (CR on MAC). This
  1302. option should not be used on binary files. This option can be used on
  1303. MSDOS if the Zip archive is intended for UnZip under UNIX.
  1304. .sk
  1305. For both -l and -ll, if the file is converted and the file is later
  1306. determined to be binary, a warning is issued and the file is probably
  1307. corrupted. If Zip with -l or -ll detects binary (non-text) in the first
  1308. buffer read from a file, it issues a warning and skips line-ending
  1309. conversion on the file, avoiding corruption. This check seems to catch
  1310. all binary files tested, but the original check remains and if a
  1311. converted file is later determined to be binary, that warning is still
  1312. issued. The algorithm now being used for binary detection should allow
  1313. line-ending conversion of text files in UTF-8 and similar encodings.
  1314. .!------------------------------------------------------------------------------
  1315. .indent -4
  1316. 2 VMS_Specifics
  1317. .br
  1318. VMS File Attributes
  1319. .sk;.literal
  1320. -V --VMS-portable
  1321. -VV --VMS-specific
  1322. .end literal;.br
  1323. The -V and -VV options cause Zip to store VMS file atributes (such as
  1324. file organization, record format, carriage control, and so on) in
  1325. VMS-specific "extra fields" in an archive along with the usual data.
  1326. These extra fields are ignored on non-VMS systems, but on a VMS system,
  1327. they allow UnZip to restore the files with their VMS attributes intact.
  1328. .sk
  1329. With -V, Zip ignores any data in the file after the end-of-file (EOF)
  1330. point (defined by FAT$L_EFBLK and FAT$W_FFBYTE), which works well for
  1331. well-formed files (that is, those with no valid data beyond EOF).
  1332. Portable-format files (Stream_LF, fixed-512) archived with -V should be
  1333. extracted properly on a non-VMS system. Files with more complex
  1334. structures, such as indexed files and files with embedded byte counts
  1335. or other such data may be of limited use on other systems. (UnZip on
  1336. non-VMS systems may be able to extract various VMS-format text files,
  1337. however.)
  1338. .sk
  1339. With -VV, Zip processes all allocated blocks for the file (including
  1340. those beyond EOF). When extracted on a VMS system, the original file
  1341. should be reproduced with as much fidelity as possible, but on a non-VMS
  1342. system, most files will be seen as corrupt because of the data from
  1343. beyond EOF.
  1344. .sk
  1345. VMS File Version Numbers
  1346. .sk;.literal
  1347. -w --VMS-versions
  1348. -ww --VMS-dot-versions
  1349. .end literal;.br
  1350. By default, for compatibility with non-VMS systems, Zip strips VMS file
  1351. version numbers from the names stored in an archive. The -w
  1352. (--VMS-versions) option causes Zip to retain file version numbers on
  1353. names in an archive. Without -w, a version number wildcard (";*") can
  1354. cause errors when multiple versions of a single file are treated as
  1355. multiple files with the same name.
  1356. .sk
  1357. For better compatibility with non-VMS systems where semi-colons are less
  1358. popular in file names, the -ww (--VMS-dot-versions) option stores the
  1359. file version numbers with a dot (".nnn") instead of a semi-colon
  1360. (";nnn").
  1361. .!------------------------------------------------------------------------------
  1362. .indent -4
  1363. 2 Copyright_and_License
  1364. .br
  1365. Zip has an option to display its copyright and license.
  1366. .sk;.literal
  1367. -L --license
  1368. .end literal;.br
  1369. The license is reproduced below.
  1370. .sk.lm +3
  1371. This is version 2007-Mar-4 of the Info-ZIP license. The definitive
  1372. version of this document should be available at
  1373. ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely and a copy
  1374. at http://www.info-zip.org/pub/infozip/license.html.
  1375. .lm -3;.sk
  1376. --------------------------------------------------------
  1377. .sk
  1378. Copyright (c) 1990-2007 Info-ZIP. All rights reserved.
  1379. .sk
  1380. For the purposes of this copyright and license, "Info-ZIP" is defined as
  1381. the following set of individuals:
  1382. .sk;.lm +3
  1383. Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
  1384. Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth,
  1385. Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
  1386. David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
  1387. Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
  1388. Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda,
  1389. Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren,
  1390. Rich Wales, Mike White.
  1391. .lm -3;.sk
  1392. This software is provided "as is," without warranty of any kind, express
  1393. or implied. In no event shall Info-ZIP or its contributors be held
  1394. liable for any direct, indirect, incidental, special or consequential
  1395. damages arising out of the use of or inability to use this software.
  1396. .sk
  1397. Permission is granted to anyone to use this software for any purpose,
  1398. including commercial applications, and to alter it and redistribute it
  1399. freely, subject to the above disclaimer and the following restrictions:
  1400. .sk;.lm +7;.indent -4
  1401. 1. Redistributions of source code (in whole or in part) must retain
  1402. the above copyright notice, definition, disclaimer, and this list
  1403. of conditions.
  1404. .sk;.indent -4
  1405. 2. Redistributions in binary form (compiled executables and libraries)
  1406. must reproduce the above copyright notice, definition, disclaimer,
  1407. and this list of conditions in documentation and/or other materials
  1408. provided with the distribution. The sole exception to this condition
  1409. is redistribution of a standard UnZipSFX binary (including SFXWiz) as
  1410. part of a self-extracting archive; that is permitted without inclusion
  1411. of this license, as long as the normal SFX banner has not been removed
  1412. from the binary or disabled.
  1413. .sk;.indent -4
  1414. 3. Altered versions -- including, but not limited to, ports to new operating
  1415. systems, existing ports with new graphical interfaces, versions with
  1416. modified or added functionality, and dynamic, shared, or static library
  1417. versions not from Info-ZIP -- must be plainly marked as such and must not
  1418. be misrepresented as being the original source or, if binaries,
  1419. compiled from the original source. Such altered versions also must not
  1420. be misrepresented as being Info-ZIP releases -- including, but not
  1421. limited to, labeling of the altered versions with the names "Info-ZIP"
  1422. (or any variation thereof, including, but not limited to, different
  1423. capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the
  1424. explicit permission of Info-ZIP. Such altered versions are further
  1425. prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP
  1426. e-mail addresses or the Info-ZIP URL(s), such as to imply Info-ZIP
  1427. will provide support for the altered versions.
  1428. .sk;.indent -4
  1429. 4. Info-ZIP retains the right to use the names "Info-ZIP", "Zip",
  1430. "UnZip", "UnZipSFX", "WiZ", "Pocket UnZip", "Pocket Zip", and
  1431. "MacZip" for its own source and binary releases.
  1432. .lm -7;.sk
  1433. .!------------------------------------------------------------------------------
  1434. .indent -4
  1435. 2 Acknowledgements
  1436. .br
  1437. Thanks to R. P. Byrne for his Shrink.Pas program, which
  1438. inspired this project, and from which the shrink algorithm
  1439. was stolen; to Phil Katz for placing in the public domain
  1440. the zip file format, compression format, and .ZIP filename
  1441. extension, and for accepting minor changes to the file
  1442. format; to Steve Burg for clarifications on the deflate
  1443. format; to Haruhiko Okumura and Leonid Broukhis for providing
  1444. some useful ideas for the compression algorithm; to
  1445. Keith Petersen, Rich Wales, Hunter Goatley and Mark Adler
  1446. for providing a mailing list and ftp site for the Info-ZIP
  1447. group to use; and most importantly, to the Info-ZIP group
  1448. itself (listed in the file infozip.who) without whose
  1449. tireless testing and bug-fixing efforts a portable zip
  1450. would not have been possible. Finally we should thank
  1451. (blame) the first Info-ZIP moderator, David Kirschbaum,
  1452. for getting us into this mess in the first place.
  1453. .!------------------------------------------------------------------------------
  1454. .indent -4
  1455. 2 Bugs
  1456. .br
  1457. All bug reports, patches, or suggestions should go to zip-bugs via the
  1458. web site contact form at http://www.Info-ZIP.org. Patches should be
  1459. sent as unified or context diffs only (diff -u or diff -c).
  1460. .sk
  1461. Any bug report should include the Zip version, any special compilation
  1462. options (see "zip -v" report), the host system type and operating system
  1463. version, and any other relevant information (compiler version, lunar
  1464. phase, ...).
  1465. .!------------------------------------------------------------------------------