home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / UNZP50P1.ZIP / VMS / VMS.notes < prev    next >
Text File  |  1993-01-23  |  14KB  |  310 lines

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