home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / packer / infozip / sources / vms.zoo / VMS.notes < prev    next >
Encoding:
Text File  |  1992-02-29  |  13.1 KB  |  307 lines

  1.                      VMS Notes for UnZip 4.2
  2.                         28 February 1992
  3.  
  4.  
  5. The various VMS tweaks to UnZip 4.2 and ZipInfo 0.96 were tested on a 
  6. VAX 8600 running VMS 5.2 (and, later, VMS 5.4) and VAX C 3.0.  Older 
  7. versions were also tested on a VAX 11/785.
  8.  
  9. To build UnZip (and its trusty sidekick, ZipInfo), just run the included 
  10. command file MAKE_UNZIPINFO.COM (i.e., "@make_unzipinfo").  By default, 
  11. this creates shareable-image executables, which are smaller and (sup-
  12. posedly) load faster than the normal type.  They also (supposedly) will 
  13. be better able to take advantage of any bug fixes or new capabilities 
  14. that DEC might introduce, since the library code isn't built into the 
  15. executable.  The shared executable is about a quarter the size of the 
  16. ordinary type in the case of UnZip.
  17.  
  18. [Btw, the VMS make utility "MMS" seems not to be compatible enough with
  19. Unix make to use the same makefile.  Antonio Querubin, Jr., sent along an 
  20. MMS makefile, subsequently modified by Igor Mandrichenko.  Read the
  21. comments at the top of DESCRIP.MMS for more info.]
  22.  
  23. UnZip is written to return the standard PK-type return codes (or error
  24. codes, or exit codes, or whatever you want to call them).  Unfortunately,
  25. VMS insists on interpreting the codes in its own lovable way, and this
  26. results in endearing commentary such as "access violation, error mask =
  27. 0005, PC = 00003afc" (or something like that) when you run UnZip with no
  28. arguments.  To avoid this I've added a special VMS_return() function which
  29. either ignores the error codes (and exits with normal status) or interprets
  30. them, prints a semi-informative message (enclosed in square [] brackets), 
  31. and then exits with a normal error status.  I personally can't stand the 
  32. latter behavior, so by default the error codes are simply ignored.  Tastes
  33. vary, however, and some people may actually like semi-informative messages.
  34. If you happen to be one of those people, you may enable the messages by 
  35. recompiling misc.c with RETURN_CODES defined.  (This adds a block or two
  36. to the executable size, though.)  The syntax is as follows:
  37.     cc /def=(RETURN_CODES) misc
  38.  
  39. To use UnZip in the normal way, define a symbol "unzip" as follows:
  40.     unzip :== "$diskname:[directory]unzip.exe"
  41. (substitute for "diskname" and "directory" as appropriate, and DON'T FORGET
  42. THE `$'!  It won't work if you omit that.)  In general it's wise to stick 
  43. such assignments in your LOGIN.COM file and THEN forget about them.  It is 
  44. no longer necessary to worry about the record type of the zipfile...er, 
  45. well, most of the time, anyway (see the Kermit section below).
  46.  
  47. Having done all this you are ready to roll.  Use the unzip command in
  48. the usual way; as with the Unix, OS/2 and MS-DOS versions, this one uses 
  49. '-' as a switch character.  If nothing much happens when you do a directory
  50. listing, for example, you're probably trying to specify a filename which
  51. has uppercase letters in it...VMS thoughtfully converts everything on the
  52. command line to lowercase, so even if you type:
  53.     unzip -v zipfile Makefile
  54. what you get is:
  55.     unzip -v zipfile makefile
  56. which, in my example here, doesn't match the contents of the zipfile.
  57. This is relatively easy to circumvent, by enclosing the filespec(s) in 
  58. quotes:
  59.     unzip -tq unzip401 "Makefile" "VMS*" *.c *.h
  60. [This example also demonstrates the use of wildcards, which act like Unix
  61. wildcards, not VMS ones.   In other words, "VMS*" matches files VMSNOTES,
  62. VMS_MAKE.COM, and VMSSHARE.OPT, whereas the normal VMS behavior would be
  63. to match only the first file (since the others have extensions--ordinarily,
  64. you would be required to specify "VMS*.*").]
  65.  
  66. Note that created files get whatever default permissions you've set, but 
  67. created directories additionally inherit the (possibly more restrictive) 
  68. permissions of the parent directory.  And, of course, things probably won't 
  69. work too well if you don't have permission to write to whatever directory 
  70. into which you're trying to extract things.  (That made sense; read it 
  71. again if you don't believe me.)
  72.  
  73. ZipInfo, by the way, is an amusing little utility which tells you all sorts
  74. of amazingly useless information about zipfiles.  Occasionally it's useful
  75. to debug a problem with a corrupted zipfile (for example, we used it to 
  76. find a bug in PAK-created zipfiles, versions 2.5 and earlier).  Feel free
  77. to blow it away if you don't need it.  It's about 30 blocks on my system,
  78. and I find I actually prefer its listing format to that of UnZip now (hardly
  79. surprising, since I wrote it :-) ).  I also find it useful to use "ii" 
  80. rather than "zipinfo" as the symbol for zipinfo, since it's easier to type 
  81. than either "zipinfo" or "unzip -v", and it echoes the common Unix alias 
  82. "ll" for the similar style of directory listings.  Oh, and the reason it's 
  83. still got a beta version number is that I haven't finished it yet--it would 
  84. be better with an automatic paging function, for example.  Oh well.
  85.  
  86. RANDOM OTHER NOTES:  (1) Igor Mandrichenko (leader of our fearless Russian 
  87. contingent) rewrote major portions of the VMS file-handling code, with
  88. the result that UnZip is much smarter now about VMS file formats.  He
  89. made a corresponding set of changes to Zip, but those are not yet avail-
  90. able.  When they are, however, UnZip will be able handle them.  In the
  91. meantime, the notes at the end of this file from Hugh Schmidt and Mike
  92. Freeman give hints on how to save VMS attributes using Zip 1.0.  These
  93. notes refer to UnZip 4.1, but they should still hold for this version.
  94. (2) Zip 1.0 cannot handle any zipfile that isn't in stream-LF format, so 
  95. you may need to use Rahul Dhesi's BILF utility which is included with 
  96. UnZip.  It may also be necessary for certain other special occasions, like 
  97. when you've forgotten to set the correct Kermit parameters while uploading
  98. a zipfile (see Hugh Schmidt's note below for comments about Kermit, too).
  99.  
  100. Greg Roelofs,
  101.  not really involved with VMS UnZip anymore, but updating this file one
  102.  last time since it's mine. :-)
  103.  
  104. ====================
  105.  
  106. From INFO-ZIP Digest (Wed, 6 Nov 1991), Volume 91, Issue 290
  107.  
  108.                 VMS attributes and PKZIP compatibility
  109.                   VMS attributes restored! (2 msgs)
  110.  
  111. ------------------------------
  112.  
  113. Date: Tue, 5 Nov 91 15:31 CDT
  114. From: Hugh Schmidt <HUGH@macc.wisc.edu>
  115. Subject: VMS attributes and PKZIP compatibility
  116. Message-ID: <21110515313938@vms.macc.wisc.edu>
  117.  
  118.            ******************************************************
  119. (1)        *** Retaining VMS attributes - a proposed strategy ***
  120.            ******************************************************
  121.  
  122. This is a proposed strategy for recovering VMS file attributes after
  123. zip/unzip:
  124.  
  125. a) capture VMS file attributes: VMS ANALYZE/RMS/FDL/OUTPUT=fdlfile vmsfile.ext
  126. b) compress files on VMS......: ZIP zipfile vmsfile.ext, fdlfile.fdl
  127. c) uncompress files on VMS....: UNZIP zipfile vmsfile.ext, fdlfile.fdl
  128. d) recover VMS file attributes: CONVERT/FDL=fdlfile.fdl vmsfile.ext vmsfile.ext
  129.  
  130. The wrinkle is that UNZIP creates files which are unreadable by CONVERT
  131. despite a concerted effort to accomodate VMS file management system:
  132.  
  133. file_io.c, line 178: ...creat(filename,0, "rat=cr", "rfm=streamlf")
  134.  
  135. These files are unCONVERTABLE because they appear to VMS to contain
  136. records with 512+ bytes.  Poring over VMS manuals (Programming V-6A, VAX
  137. C RTL Reference Manual) doesn't readily suggest better alternatives.
  138. Experimentation with "rat=fix", etc. may help suppress the spurious
  139. block-end delimeters.
  140.  
  141.           ****************************************************
  142. (2)       *** VMS ZIP and PKZIP compatibility using KERMIT ***
  143.           ****************************************************
  144.  
  145. Many use Procomm's kermit to transfer zipped files between PC and VMS
  146. VAX.  The following VMS kermit settings make VMS-ZIP compatible with
  147. PKZIP:
  148.  
  149.                                              VMS kermit      Procomm kermit
  150.                                            ---------------   --------------
  151. Uploading PKZIPped file to be UNZIPped:    set fi ty fixed    set fi ty bi
  152. Downloading ZIPped file to be PKUNZIPped:  set fi ty block    set fi ty bi
  153.  
  154. "Block I/O lets you bypass the VMS RMS record-processing capabilities
  155. entirely", (Guide to VMS file applications, Section 8.5).  The kermit
  156. guys must have known this!
  157.  
  158.          ************************************************
  159. (3)      *** Making ZIP files compatible with VMS RMS ***
  160.          ************************************************
  161.  
  162. It looks like a crummy patch, but to make VMS RMS happy, I inserted the
  163. following near line 570 in the putend() section of zipfile.c:
  164.  
  165. #ifdef VMS
  166.  fprintf(f,"\n")
  167. #endif
  168.  
  169. It's probably of no consequence, but it satisfies VMS ANALYZE.
  170.  
  171. ------------------------------
  172.  
  173. Date: Tue, 5 Nov 91 19:40 CDT
  174. From: Hugh Schmidt <HUGH@macc.wisc.edu>
  175. Subject: VMS attributes restored!
  176. Message-ID: <21110519403912@vms.macc.wisc.edu>
  177.  
  178.            ************************************************************
  179.            ***   Aha!  It works!  VMS attributes can be restored! *****
  180.            ***                                                      ***
  181.            *** Change FAB$C_STMLF to FAB$C_FIX in file_io.c         ***
  182.            *** ANALYZE => .FDL | CONVERT => original VMS attributes ***
  183.            ************************************************************
  184.  
  185. (1) Change line 147 in file_io.c and dropping lines 148-149:
  186.  
  187.     fileblk.fab$b_rfm = FAB$C_STMLF;    /* stream-LF record format */
  188.     fileblk.fab$b_rat = FAB$M_CR;       /* carriage-return carriage ctrl */
  189.     /*                      ^^^^ *NOT* V_CR!!!     */
  190.  
  191. =>
  192.  
  193.     fileblk.fab$b_rfm = FAB$C_FIX;    /* fixed record format */
  194.  
  195. (2) Use VMS ANALYZE to store the VMS attributes for the original file
  196.     into a file descripion language file.  Save the .FDL file with the
  197.     original file.
  198.  
  199. (3) Apply the original attributes to the UNZIPped file using VMS CREATE
  200.     and the description file (test.fdl).
  201.  
  202. In the following example, the original attributes of a SPSSX system
  203. format file were restored.  Later, SPSSX successfully read the UNZIPped/
  204. CONVERTed file.
  205.  
  206. !******** Procedure (or method for you ai'ers)
  207. !********
  208. !******** Create an .FDL file using ANALYZE
  209.  
  210. $ analyze/rms/fdl/out=test test.spssxsav;1
  211.  
  212. !******** ZIP the file and its description file
  213.  
  214. $ zip test test.spssxsav;1 test.fdl;1
  215. adding test.spssxsav (imploded 62%)
  216. adding test.fdl (imploded 90%)
  217.  
  218. !******** When the ZIPPED file is needed, UNZIP it and its description file
  219.  
  220. $ unzip test
  221.   Exploding: test.spssxsav
  222.   Exploding: test.fdl
  223.  
  224. !******** To restore the original attributes, apply the description file to
  225. !********  the UNZIPped file using VMS CONVERT
  226.  
  227. $ convert/fdl=test  test.spssxsav;2 test.spssxsav;3
  228.  
  229. ! ******* The following show that the VMS attributes are restored.
  230.  
  231. $ analyze/rms/check test.spssxsav;1
  232.  
  233.     File Spec: PROJDISK5:[322042.CORE]TEST.SPSSXSAV;1
  234.     File Organization: sequential
  235.     Record Format: fixed
  236.     Record Attributes:
  237.     Maximum Record Size: 4
  238.     Longest Record: 4
  239.  
  240. The analysis uncovered NO errors.
  241.  
  242. $ analyze/rms/check test.spssxsav;2
  243.     File Spec: PROJDISK5:[322042.CORE]TEST.SPSSXSAV;2
  244.     File Organization: sequential
  245.     Record Format: undefined
  246.     Record Attributes:
  247.     Maximum Record Size: 0
  248.     Longest Record: 512
  249. The analysis uncovered NO errors.
  250.  
  251. $ analyze/rms/check test.spssxsav;3
  252.     File Spec: PROJDISK5:[322042.CORE]TEST.SPSSXSAV;3
  253.     File Organization: sequential
  254.     Record Format: fixed
  255.     Record Attributes:
  256.     Maximum Record Size: 4
  257.     Longest Record: 4
  258.  
  259. Thank you all for your help and comments.  It was very reasurring to
  260. know that I was on the right track.  This is a humble contribution
  261. compared to the great efforts of others in the ZIP project.
  262.  
  263. ------------------------------
  264.  
  265. Date: Wed, 6 Nov 91 12:49:33 EST
  266. From: Mike Freeman <freeman@watsun.cc.columbia.edu>
  267. Subject: Re: VMS attributes restored!
  268. Message-ID: <CMM.0.90.0.689449773.freeman@watsun.cc.columbia.edu>
  269.  
  270. Hello, all.
  271.  
  272. HUGH@macc.wisc.edu has come up with a commendable method for saving/
  273. restoring record attributes in Vax/VMS files when ZIPping/UNZIPping.
  274. There are a couple of potential problems in his specific implementation,
  275. however:
  276.  
  277. (a) It would be better to leave the output file(s) in STREAM_LF format
  278.     and use Joe Meadows' FILE utility to put them in fixed-record
  279.     format if CONVERT has trouble reading them.
  280.  
  281.     Outputting a text file as fixed-record format could be a pain, and
  282.     one would have to use FILE anyway.
  283.  
  284.     (Incidentally, I ZIPped up a text file, UNZIPped it and used Hugh's
  285.     method to restore the attributes.  CONVERT had no trouble with the
  286.     STREAM_LF format -- it's only a problem with binary files and, as I
  287.     say, Joe Meadows' FILE will fix this.)
  288.  
  289. (b) Even if ANALYZE/RMS complains, I do not think one ought to put the
  290.     "\n" in as Hugh advocates.  This contradicts the ZIP philosophy of
  291.     byte-for-byte storage/retrieval.
  292.  
  293.     As Mr. Roelofs has said, there is nothing wrong with the ZIP file;
  294.     it's just that ANALYZE/RMS expects STREAM_LF files to end in an
  295.     <LF>.
  296.  
  297. Anyway, I was able to use Hugh's method without modifying ZIP 1.0.  We
  298. really ought to get the word out about FILE, though -- it's very handy.
  299.  
  300. Mike Freeman, K7UIJ     |       Internet: freeman@watsun.cc.columbia.edu
  301. 301 N.E. 107th Street   |       GEnie: M.FREEMAN11
  302. VancouvEr, WA 98685 USA |       Confidence is the feeling you have
  303. Telephone (206)574-8221 |       before you understand the situation.
  304.  
  305. ------------------------------
  306.  
  307.