NOTES.TXT 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. VMS Notes for Info-ZIP Zip 3.0 and UnZip 6.0
  2. ============================================
  3. This document describes some VMS-specific behavior and implementation
  4. details of the Info-ZIP Zip and UnZip programs.
  5. Last modified: 2009-03-02.
  6. Command-line Case
  7. -----------------
  8. Zip and UnZip now include code which can preserve the case of
  9. command-line parameters and options, which obviates quoting upper-case
  10. options like "-V" or "-Z". This works on non-VAX systems with a
  11. sufficiently recent C RTL, and SET PROCESS /PARSE_STYLE = EXTENDED.
  12. (Sufficiently recent here means __CRTL_VER >= 70301000, which includes
  13. VMS V7.3-1 with a C Run Time Library ECO, or V7.3-2 or newer.) This
  14. code uses the decc$feature_set_value() function to enable the
  15. DECC$ARGV_PARSE_STYLE feature. There is a small range of C RTL versions
  16. where this function is unavailable, but where manually setting the
  17. logical name DECC$ARGV_PARSE_STYLE to "ENABLE" will work. HELP CRTL
  18. leads to some additional information on these features.
  19. File Name Case (ODS5)
  20. ---------------------
  21. In general, Zip 3.0 and UnZip 6.0 should handle file name case (and
  22. extended file names) in reasonable ways on ODS5 disks.
  23. Zip offers a variety of "-C" (/PRESERVE_CASE) options to control how
  24. case is handled when adding files to an archive. The default settings
  25. ("-C2-", /PRESERVE_CASE = NOODS2, down-case ODS2 file names; "-C5",
  26. /PRESERVE_CASE = ODS5, preserve case of ODS5 file names) should be
  27. consistent with previous Zip versions for files on ODS2 disks, and
  28. reasonable for files on ODS5 disks.
  29. UnZip should preserve case when it extracts to an ODS5 destination
  30. disk (unless "-2" (/ODS2) is specified). (Note that previous UnZip
  31. versions, including version 5.52, did not properly preserve case for
  32. directories, which were always up-cased.)
  33. The Zip and UnZip builders should work properly on ODS2 and ODS5
  34. disks, with old (pre-ODS5) and new (case-conscious) versions of MMS (or
  35. MMK). All testing was done with SET PROCESS /CASE_LOOKUP = BLIND.
  36. Various problems may be expected with /CASE_LOOKUP = SENSITIVE.
  37. For consistency, the builders should always create product files
  38. (.OBJ, .EXE, .HLB, and so on) with upper-case names, whether the build
  39. is done on an ODS2 or ODS5 disk. Note, however, that in a world with
  40. both ODS2 and ODS5 disks, and old and new Zip and UnZip versions, it's
  41. possible to encounter lower-case product file names. For example, a VMS
  42. binary kit could be created on an ODS2 disk, and a Zip archive created
  43. from that (using Zip 2.x, or Zip 3.x with default settings). Such a Zip
  44. archive would contain down-cased names for those product files, and
  45. those lower-case names would then normally be preserved when UnZip was
  46. used to extract that archive onto an ODS5 destination. Normally, things
  47. will work regardless of such case changes, but there may be some
  48. untested combinations of unexpected name cases and quirky MMS (or MMK)
  49. behavior, where something goes wrong. Complaints are always welcome,
  50. but it may not be possible to get everything to work as expected with
  51. every version of VMS, MMS (or MMK), Zip, and UnZip, on every file
  52. system.
  53. It might help matters if _all_ VMS binary kits were produced on ODS5
  54. disks, and packaged using (case-preserving) Zip version 3.x, but this
  55. would certainly be different from the way things have been done before,
  56. and maintaining control over this process is essentially impossible.
  57. Symbolic Links (ODS5)
  58. ---------------------
  59. VMS V8.3 offers support for symbolic links (symlinks) on ODS5 disks.
  60. In previous Zip and UnZip versions, the generic code for symlinks was
  61. disabled, and there was no VMS-specific code for symlinks. Now, by
  62. default, Zip and UnZip attempt to support symlinks wherever the C
  63. headers and C run-time library include the functions needed for symlink
  64. support. This means non-VAX systems with __CRTL_VER >= 70301000, so
  65. this includes VMS V7.3-1 and up, and thus symlink-capable Zip and UnZip
  66. programs may be built on systems which do not themselves offer symlink
  67. support. (Various run-time failures may be expected if symlinks are
  68. encountered on pre-V8.3 systems, either in a file system or in a Zip
  69. archive.)
  70. Symlink support can be disabled at build-time, if desired, by
  71. defining the C macro NO_SYMLINKS. (See comments in the builder
  72. regarding LOCAL_UNZIP or LOCAL_ZIP, as appropriate.) For example, using
  73. MMS to build UnZip:
  74. MMS /DESCRIP = [.VMS] /MACRO = ("LOCAL_UNZIP=NO_SYMLINKS=1")
  75. or, using the command procedure to build Zip:
  76. LOCAL_ZIP == "NO_SYMLINKS=1"
  77. @ [.VMS]BUILD_ZIP.COM
  78. DELETE /SYMBOL /GLOBAL LOCAL_ZIP
  79. The Zip or UnZip "-v" (/VERBOSE) report should include
  80. SYMLINK_SUPPORT (Zip) or SYMLINKS (UnZip) in its list of "special
  81. compilation options" if the program was built with symlink support.
  82. File I/O Performance
  83. --------------------
  84. When compiled using DEC/Compaq/HP C (not GNU C or VAX C), the Zip and
  85. UnZip file I/O code now includes access callback functions which are
  86. used to try to set some RMS parameters to non-default values, with the
  87. intention of improving file I/O speed. This affects reading an archive
  88. file in UnZip and writing one in Zip. (Reading and writing the
  89. individual data files are handled in more exotic ways, making these
  90. parameters less important for them.)
  91. Currently, the built-in default parameters enable read-ahead and
  92. write-behind, using a multi-buffer count of 2, and a multi-block count
  93. of 127 (the maximum). For writing the archive, the default extend
  94. quantity is 16384 blocks (8MB), with truncation enabled. This
  95. combination is believed to be, at worst, fairly harmless for most
  96. situations, and, in most cases, to provide a substantial speed
  97. improvement, especially with large archives.
  98. This code allows SET RMS_DEFAULT parameters to override the built-in
  99. default values. On some old VMS versions, sys$getjpi() can not provide
  100. the SET RMS_DEFAULT values, and in this situation, the callback function
  101. will not try to use its improved parameter values. Users on such old
  102. VMS versions who seek improved I/O speed may wish to bypass this check,
  103. which requires changing the code in the get_rms_defaults() function in
  104. [.VMS]VMS.C. The "-vv" (/VERBOSE = MORE) option on both programs
  105. enables diagnostic messages which show the operation of the callback
  106. function. A message showing a failure status from sys$getjpi()
  107. indicates this problem.
  108. Sample results (UnZip shown, Zip similar):
  109. VMS VAX V5.4, VAX C. Callback code disabled, no messages:
  110. WIMP $ unzip -tvv TESTMAKE.ZIP
  111. Archive: SYS$SYSDEVICE:[UTILITY.SOURCE.ZIP.UNZIP60C]TESTMAKE.ZIP;1
  112. [...]
  113. VMS VAX V5.5-2, DEC C. SYS$GETJPI() fails (%SYSTEM-F-BADPARAM):
  114. WEAK $ unzip -tvv TESTMAKE.ZIP
  115. Get RMS defaults. getjpi sts = %x00000014.
  116. Archive: DUA1:[UTILITY.SOURCE.ZIP.UNZIP60C]TESTMAKE.ZIP;1
  117. [...]
  118. VMS VAX V7.3, DEC/Compaq C. Callback code works:
  119. WUSS $ unzip -tvv TESTMAKE.ZIP
  120. Get RMS defaults. getjpi sts = %x00000001.
  121. Default: deq = 0, mbc = 0, mbf = 0.
  122. Open callback. ID = 1, deq = 16384, mbc = 127, mbf = 2.
  123. Archive: ALP$DKA0:[UTILITY.SOURCE.ZIP.UNZIP60C]TESTMAKE.ZIP;1
  124. [...]
  125. VMSV5.5-2 is too old. V7.3 is new enough. Anyone with more precise
  126. information is invited to contribute it.
  127. Users who find other parameter sets more beneficial, or who find
  128. particular problems with this set are welcome to comment.
  129. In this version, as in previous versions, when UnZip expands a -V
  130. archive, it allocates the entire extent of a data file before writing
  131. any of its data. In some previous versions, this could cause the
  132. destination disk to be locked for a considerable time (minutes), if
  133. highwater marking was enabled on that disk. Now, the FAB SQO
  134. ("sequential access only") flag (or equivalent) is set, which prevents
  135. this troublesome disk locking.
  136. In some previous versions, when UnZip expanded a non-V archive, it
  137. did no pre-allocation, and used the default extension quantity. This
  138. could slow file creation significantly for large files. Now, space for
  139. extracted files is pre-allocated, and the same SQO ("sequential access
  140. only") flag is set, as with a -V archive.
  141. Changes to the "-V" (/VMS) Option
  142. ---------------------------------
  143. The intent of the "-V" (/VMS) option was to store VMS file attributes
  144. in a Zip archive, allowing UnZip to extract an exact copy of a file on a
  145. VMS system, including all its VMS attributes.
  146. In Zip before version 2.31, using the "-V" (/VMS) option created an
  147. archive which usually contained data from beyond the EOF (End-of-File)
  148. marker in a data file, but generally not all the disk blocks allocated
  149. for the file. When extracted on a VMS system, the result was usually
  150. acceptable (because the data from beyond the EOF marker were usually
  151. ignored). However, when extracted on a non-VMS system, the resulting
  152. file was usually corrupted by being NUL-padded to the next larger 16KB
  153. multiple in size.
  154. Now (Zip 2.31 and later), with "-V" (/VMS), Zip truncates a data file
  155. at EOF, and portable-format files (Stream_LF, fixed-512) should be
  156. extracted properly on a non-VMS system. On a VMS system, well-formed
  157. files (that is, those with no valid data beyond EOF) should also be
  158. restored correctly.
  159. With the new "-VV" (/VMS = ALL) option, the archive includes all
  160. allocated blocks for the file (including those beyond EOF). When
  161. extracted on a VMS system, the original file should be reproduced with
  162. as much fidelity as possible, but on a non-VMS system, most files will
  163. be seen as corrupt because of the data from beyond EOF.
  164. Changes to Program Exit Status Values
  165. -------------------------------------
  166. Zip and UnZip exit with 32-bit VMS status values which are formed
  167. from their internal OS-independent status values. In previous program
  168. versions, this was done by converting the internal success code (0) into
  169. %x00000001 (SS$_NORMAL), and converting the other internal warning and
  170. error codes using an artificial control/facility code, 0x7FFF (which
  171. includes some reserved bits), and a severity value which was determined
  172. according to rules specified in the VMS-specific exit function.
  173. Curiously, the internal status codes were left-shifted by 4 bits instead
  174. of 3, so all the resulting VMS message codes (bits 13:3) were even.
  175. Zip and UnZip now have facility names and codes assigned by HP
  176. (UnZip: IZ_UNZIP, 1954; Zip: IZ_ZIP, 1955). Now, by default, the
  177. programs exit with standard 32-bit VMS status values which differ from
  178. the old ones in several ways: The official facility code is used, and
  179. the facility-specific bit is set. (For compatibility with older
  180. versions, the internal status codes are still left-shifted by 4 bits.
  181. This also makes it easier to extract the internal status code from a
  182. hexadecimal representation of the VMS status code.) The builders also
  183. create non-executable message files (UNZIP_MSG.EXE and ZIP_MSG.EXE) so
  184. that, after a suitable SET MESSAGE command, the program messages will be
  185. available from DCL. For example:
  186. $ SET MESSAGE dev:[dir]ZIP_MSG.EXE
  187. $ ZIP FRED.ZIP no_such_file
  188. zip warning: name not matched: no_such_file
  189. zip error: Nothing to do!
  190. (dev:[dir]FRED.ZIP;)
  191. ALP $ WRITE SYS$OUTPUT F$MESSAGE( $STATUS)
  192. %IZ_ZIP-W-NONE, Nothing to do
  193. The message files may be copied into SYS$MESSAGE to make them generally
  194. available, although this could cause some confusion if multiple versions
  195. of the programs are used on the system, and their error message source
  196. files differ. Each different destination directory will get its own
  197. UNZIP_MSG.EXE or ZIP_MSG.EXE ([.ALPHA], [.ALPHAL], [.VAX], and so on),
  198. but all of the same-architecture files are equivalent to each other.
  199. That is, on an Alpha system, any of the [.ALPHA*]ZIP_MSG.EXE files could
  200. be used; on an IA64 system, any of the [.IA64*]ZIP_MSG.EXE files could
  201. be used; and on a VAX system, any of the [.VAX*]ZIP_MSG.EXE files could
  202. be used. (Similar for UNZIP_MSG.EXE, of course.)
  203. If desired, the programs may be built to use the old exit status values
  204. by defining a C macro with the old facility value:
  205. "CTL_FAC_IZ_UNZIP=0x7FFF" (UnZip) or "CTL_FAC_IZ_ZIP=0x7FFF" (Zip).
  206. (See comments in the builder regarding LOCAL_UNZIP or LOCAL_ZIP, as
  207. appropriate.) This will maintain compatibility with older program
  208. versions, but will make the programs incompatible with the new error
  209. message files.
  210. VMS File Attribute Schemes
  211. --------------------------
  212. Zip's "-V" (/VMS) option causes VMS file attributes to be stored in
  213. an archive. Since Zip version 2.2 (released in 1996), Zip has, by
  214. default, stored VMS file attributes using a scheme ("PK") which is
  215. compatible with the one used by PKWARE in their PKZIP product. Before
  216. that, a different scheme ("IM") was used. UnZip versions before 5.2
  217. support only the older IM scheme, but since UnZip version 5.2, both
  218. schemes have been supported by UnZip.
  219. The IM scheme has not been well tested recently, but it is still
  220. available. Some problems were seen when the IM scheme was used with
  221. symbolic links on VMS V8.3. Details on how build Zip to use the IM
  222. scheme instead of the PK scheme are included in comments in the main
  223. builder files. Look for VMS_IM_EXTRA in [.VMS]BUILD_ZIP.COM or IM in
  224. [.VMS]DESCRIP.MMS.
  225. The "special compilation options" section of a "zip -v" ("zip
  226. /verbose") report should show either VMS_PK_EXTRA or VMS_IM_EXTRA,
  227. according to how Zip was built.
  228. UTC Date-Times
  229. --------------
  230. Zip archives traditionally include local (MS-DOS compatible)
  231. date-time information for files. Since Zip version 2.1, it has also
  232. been possible to store UTC date-time information in the archive, and
  233. since UnZip version 5.2, UnZip has been able to use this UTC date-time
  234. information when extracting files.
  235. On VMS, support in the C run-time environment for UTC became
  236. available with VMS V7.0. UTC support in Zip and UnZip is automatically
  237. enabled at compile time, if it is available on the system where the code
  238. is compiled (__CRTL_VER >= 70000000). It may be disabled at compile
  239. time by defining the C macro NO_EF_UT_TIME. Details on how build Zip
  240. and UnZip with additional C macros defined are included in comments in
  241. the main builder files. Look for LOCAL_[UN]ZIP in
  242. [.VMS]BUILD_[UN]ZIP.COM or in [.VMS]DESCRIP.MMS. For example, using MMS
  243. to build UnZip:
  244. MMS /DESCRIP = [.VMS] /MACRO = ("LOCAL_UNZIP=NO_EF_UT_TIME=1")
  245. or, using the command procedure to build Zip:
  246. LOCAL_ZIP == "NO_EF_UT_TIME=1"
  247. @ [.VMS]BUILD_ZIP.COM
  248. DELETE /SYMBOL /GLOBAL LOCAL_ZIP
  249. The "special compilation options" section of a "zip -v" ("zip
  250. /verbose") or "unzip -v" ("unzip /verbose") report should show
  251. USE_EF_UT_TIME if the program was built with UTC support.
  252. Building with the LIST option using MMK or MMS
  253. ----------------------------------------------
  254. Currently, building with MMK or MMS using the LIST option (as in
  255. "/MACRO = LIST=1") may cause a failure for some old versions of the DEC
  256. C compiler. The LIST option currently adds "/show = (all, nomessages)"
  257. to the CC command line, and some old DEC C compilers do not support the
  258. "nomessages" keyword. When VAX C is used, this keyword is omitted, but
  259. the builder does not distinguish between the various DEC/Compaq/HP C
  260. versions. The work-arounds are to use BUILD_[UN]ZIP.COM, or edit
  261. [.VMS]DESCRIP_SRC.MMS to remove the troublesome keyword.
  262. GNU C
  263. -----
  264. Zip and UnZip have been built using GNU C (VAX) version 2.3, mostly
  265. for fun, but serious users are encouraged to report any interest in
  266. continuing this activity. The GNU C 2.3 header files were missing some
  267. things, including definitions of SEEK_CUR, SEEK_END, and SEEK_SET. The
  268. VMS-specific code now expects to find unixio.h and unixlib.h, which were
  269. absent from the GNU C 2.3 distribution.
  270. To work around these difficulties, the Zip and UnZip kits include
  271. some emergency replacement unixio.h and unixlib.h files which appear to
  272. work for these programs, at least. To install them, use commands like
  273. the following:
  274. COPY [.VMS]UNIXIO_GCC.H GNU_CC_INCLUDE:[000000]UNIXIO.H
  275. COPY [.VMS]UNIXLIB_GCC.H GNU_CC_INCLUDE:[000000]UNIXLIB.H
  276. SET PROTECTION W:RE GNU_CC_INCLUDE:[000000]UNIXIO.H, UNIXLIB.H
  277. There may be an error in the GNU C header file ATRDEF.H which can
  278. cause Zip to fail, when making a "-V" archive, with a spurious "could
  279. not open for reading" error message, followed by more bad behavior. It
  280. probably also causes trouble of some kind in UnZip. To check the
  281. questionable macro definition, use a command like the following:
  282. SEARCH GNU_CC_INCLUDE:[000000]ATRDEF.H ATR$S_JOURNAL
  283. This should show something equivalent to this:
  284. #define ATR$S_JOURNAL 0x001
  285. If you see "0x002" (or equivalent) instead of "0x001" (or equivalent),
  286. then this value must be corrected in the file before building Zip or
  287. UnZip.
  288. You may also see several warnings from the compiler caused by other
  289. defects in the GNU C header files, such as:
  290. <various>: warning: passing arg 4 of `qsort' from incompatible pointer type
  291. [...]rab.h:134: warning: unnamed struct/union that defines no instances
  292. [...]rab.h:143: warning: unnamed struct/union that defines no instances
  293. These warnings appear to be harmless.