home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / compress / zoosrc20.zoo / vmsbugs.doc < prev    next >
Text File  |  1989-07-25  |  20KB  |  501 lines

  1.  
  2.  
  3.                            Zoo 2.0 on VAX/VMS
  4.                                    by
  5.                               Rahul Dhesi
  6.  
  7.  
  8. The zoo archiver is used to create and maintain archives containing mul-
  9. tiple files that may be stored in compressed format.  Consult the zoo
  10. manual for more details.  This document describes those features of
  11. VAX/VMS zoo that are specific to the VAX/VMS implementation.
  12.  
  13.  
  14.                               INSTALLATION
  15.  
  16. The file "descrip.mms" is a makefile suitable for use with DEC's imple-
  17. mentation of make, called MMS.  To avoid any confusion, delete the file
  18. called "makefile" as that is not for VAX/VMS systems and it might con-
  19. fuse MMS.  With all source files in the current directory, simply type
  20. MMS and wait while all files get compiled and linked.  (If your system
  21. does not have MMS, you will have to compile each C source file by hand,
  22. providing the C compiler with the necessary defines on the command line.
  23. If you are not familiar with the format of makefiles, find somebody who
  24. is, and do what MMS would have done by following what is in
  25. "descrip.mms".)  The result should be the executable program "zoo.exe".
  26.  
  27. Then give the command "mms fiz" to build "fiz.exe".
  28.  
  29. Optionally, the command "mms zoobig.exe" will create a version of the
  30. executable that is linked without the shareable library.  This may be
  31. more portable if you intend to transfer it to an VMS system that does
  32. not have its own C compiler.  But "zoobig.exe" will be about twice the
  33. size of "zoo.exe".
  34.  
  35. Also compile the program "bilf.c".  This is done manually and not from
  36. the makefile.  Compile with "cc bilf.c" and link with "link bilf,
  37. options/opt".
  38.  
  39. To run zoo, bilf, and fiz, you will need to set up symbols by giving
  40. commands similar to the following, either by typing them at the system
  41. prompt or by putting them in your "login.com" file.
  42.  
  43.      $ zoo  :== $ user$disk:[userdir]zoo.exe
  44.      $ fiz  :== $ user$disk:[userfir]fiz.exe
  45.      $ bilf :== $ user$disk:[userdir]bilf.exe
  46.  
  47. In place of "user$disk" use the name of the device on which
  48. your login directory is located, and instead of "userdir" use
  49. the name of the directory in which you have placed the executable
  50. programs "zoo.exe" and "fiz.exe".
  51.  
  52.  
  53.                           WARNING -- VMS BUGS
  54.  
  55. VAX/VMS peculiarities cause unusual bahavior.
  56.  
  57.    - VMS C does not preserve uppercase characters in a command line.  To
  58.      specify a command containing an uppercase character, enclose the
  59.      command in double quotes.  For example, the command
  60.  
  61.           zoo aM stuff *
  62.  
  63.      will not work under VMS.  To make this command work under VMS, use
  64.      double quotes like this:
  65.  
  66.           zoo "aM" stuff *
  67.  
  68.    - For most text files that are not in stream-LF format, VMS returns
  69.      an incorrect file size to zoo.  This will be evident if you use the
  70.      "f" modifier to tell zoo to archive files without compression.
  71.      Files that were in stream-LF format will be stored with the correct
  72.      size;  other text files will be stored with an incorrect value for
  73.      the original size of the file.
  74.  
  75.      When such files are extracted, however, they are extracted in
  76.      stream-LF format, which is the only file format that VMS seems to
  77.      handle correctly.  Thus, so far as I can determine, no file con-
  78.      tents are actually lost, and the only evidence of the problem is
  79.      that in archive listings, files stored without compression may
  80.      still appear to be compressed by about 1 to 5 percent, or occasion-
  81.      ally by some meaningless value.
  82.  
  83.    - I have not yet found a way of making zoo for VMS restore file
  84.      timestamps at extraction time.  The standard utime() function seems
  85.      to be entirely missing in VMS C.  One of these days I will have to
  86.      figure out RMS extended attribute blocks.
  87.  
  88.    - VAX/VMS uses many different types of file structures.  Zoo creates
  89.      archives in stream-LF format, and all archives used by zoo in any
  90.      way must be in this format.  It is dangerous to use zoo on an
  91.      archive that is in any other format, because it may permanently
  92.      corrupt the archive contents.  Thus, if you have uploaded an
  93.      archive to a VMS system using Kermit, do not try to manipulate it
  94.      with zoo until you have converted it to stream-LF format.  File
  95.      conversion instructions are given later in this document.
  96.  
  97.    - The VAX/VMS batch system causes the C statement
  98.  
  99.           fflush(stdout);
  100.  
  101.      to become equivalent to:
  102.  
  103.           printf("\n");
  104.  
  105.      The result is that if files are added to a zoo archive from a batch
  106.      run, the batch log will look very strange and contain spurious new-
  107.      lines.
  108.  
  109. "Again," says my VMS C manual, "VAX C adds functionality".  The internal
  110. working of zoo has been designed to evade this added functionality.  I
  111. believe that text files and executable files are currently correctly
  112. handled by zoo.  But each version of VMS C seems to have its own special
  113. features, and it is hard to say how future changes in the VMS C compiler
  114. will affect the zoo archiver.  I believe I will be able to follow these
  115. changes, and to continue to work around past, present, and future added
  116. functionality in VMS C, but don't bet your life on it.
  117.  
  118.  
  119.                         ARCHIVING SELECTED FILES
  120.  
  121. Zoo can read filenames from standard input.  This allows you to use an
  122. external program to generate a list of files to be archived.  When this
  123. list is fed to zoo, it will archive only the selected files.
  124.  
  125. For this example, assume that files are to be archived in an archive
  126. called "backups.zoo".
  127.  
  128. To achieve redirection of input under VAX/VMS, the following steps are
  129. necessary:
  130.  
  131.  1.  Create a file containing the filenames to be archived.  Suppose
  132.      this file is called "names.lis".
  133.  
  134.  2.  Redirect zoo's standard input thus:
  135.  
  136.           $ define /user_mode SYS$INPUT names.lis
  137.  
  138.  
  139.  3.  Invoke zoo thus:
  140.  
  141.           $ zoo "aI" backups
  142.  
  143.      This command line will cause zoo to read a list of filenames from
  144.      its standard input, and archive them into "backups.zoo".  Since the
  145.      logical name SYS$INPUT was changed to refer to the file
  146.      "names.lis", zoo will read filenames from that file.
  147.  
  148. A good way of creating a list of files to be archived is to use the vms
  149. "directory" command.  Include at least the switches shown:
  150.  
  151.      $ directory /noheading /notrailing /column=1 /output=names.lis
  152.  
  153. This tells VMS to produce a list of filenames, one per line, and to
  154. store the resulting output in the file "names.lis".  You can also add
  155. additional selection options.  For example, to select all files that
  156. have been modified in the last 12 hours:
  157.  
  158.      $ dir/nohead/notrail/col=1/out=names.lis/since=-12:00/modified
  159.  
  160. A good way to decrease the effort is to create a symbol as follows:
  161.  
  162.      $ select:=="dir/nohead/notrail/col=1/out=names.lis/modified/since="
  163.  
  164. Now you can archive all *.c files modified in the last 60 minutes by
  165. giving the following commands:
  166.  
  167.      $ select -1:00:00 *.c
  168.      $ define/user sys$input names.lis
  169.      $ zoo "aI" backups
  170.  
  171.  
  172.                        FILE TRANSFERS WITH KERMIT
  173.  
  174. Zoo archives can be uploaded to a VAX/VMS system and downloaded from it
  175. using Kermit.  Due to VMS limitations, some file conversions must be
  176. done to avoid a corrupted zoo archive.
  177.  
  178. Zoo always expects zoo archives to be in stream-LF format.  However, the
  179. standard VAX/VMS Kermit does not create stream-LF files, and treats them
  180. as text files when it reads them, resulting in corrupted downloads.
  181. Thus you must handle Kermit transfers with care. The following discus-
  182. sions refers solely to the standard Kermit-32, which I believe is from
  183. the Stevens Institute of Technology.  If the following instructions are
  184. carefully followed, you should be able to transfer zoo archives between
  185. a VAX/VMS system and a microcomputer running Kermit.
  186.  
  187. KERMIT UPLOADS:  To transfer a zoo archive from a microcomputer to a
  188. VAX/VMS system, do the following.
  189.  
  190.  1.  Invoke VAX/VMS Kermit as shown below.  It will prompt you with the
  191.      string "Kermit-32>".  Give it a command as shown to tell it to
  192.      receive a binary file:
  193.  
  194.           $ kermit
  195.           Kermit-32> set file type binary
  196.           Kermit-32> set block-check 3
  197.           Kermit-32> receive
  198.  
  199.      Note:  Do not use the command "set file type fixed".  In most cases
  200.      it will not work.
  201.  
  202.      The command to set the block-check is optional, but tells Kermit to
  203.      use a 16-bit CRC, which is much more reliable than the default 6-
  204.      bit CRC.  Use this command if your version of Kermit does not use a
  205.      16-bit CRC by default.
  206.  
  207.  2.  At this point, VAX/VMS Kermit is waiting for you to send it a file.
  208.      Now tell your local Kermit to send the file.  On an MS-DOS system,
  209.      using MS-Kermit, you would do this by first typing the local escape
  210.      sequence to get to the local mode, where the prompt is "MS-
  211.      Kermit>", then telling your local Kermit to send the zoo archive as
  212.      a binary file.  A typical sequence of commands is:
  213.  
  214.           (type escape sequence to get back to local mode)
  215.           MS-Kermit> set eof noctrl-z
  216.           MS-Kermit> send stuff.zoo
  217.  
  218.      It is important that your local Kermit send the zoo archive as a
  219.      binary file, not a text file.  How you do this depends on your sys-
  220.      tem;  on MS-DOS systems it suffices to give say "set eof noctrl-z".
  221.  
  222.  3.  Wait until the Kermit upload is complete.  Then tell your local
  223.      Kermit to go into terminal mode (usually by giving the command CON-
  224.      NECT), and exit from VAX/VMS Kermit with the command EXIT.  A typi-
  225.      cal sequence is:
  226.  
  227.           MS-Kermit> connect
  228.           (stuff from MS-Kermit printed...)
  229.           (hit carriage return if necessary to get the next prompt)
  230.           Kermit-32> exit
  231.           $
  232.  
  233.      Now you are back at the VAX/VMS prompt.  At this point, you must
  234.      convert the uploaded zoo archive, which is currently in binary for-
  235.      mat, to stream-LF format so that it can be used by VAX/VMS zoo.
  236.      You do this by using the Bilf utility, which can convert files
  237.      between binary and stream-LF formats.  Give the command:
  238.  
  239.           $ bilf l stuff.zoo
  240.  
  241.  4.  After Bilf has done the conversion, you will have a new generation
  242.      of stuff.zoo that is in stream-LF format.  Now you can manipulate
  243.      it normally with VAX/VMS zoo.
  244.  
  245. DON'T TRY TO USE ZOO TO MANIPULATE AN UPLOADED ARCHIVE WITHOUT PERFORM-
  246. ING THE CONVERSION TO STREAM-LF FORMAT, ELSE YOU MAY PERMANENTLY DESTROY
  247. ARCHIVE CONTENTS.
  248.  
  249. KERMIT DOWNLOADS:  Before downloading a zoo archive from VAX/VMS to a
  250. microcomputer, you must convert it to binary format.    Then use VMS
  251. Kermit normally.  A sample sequence is shown.
  252.  
  253.  1.  Convert the zoo archive to binary format.
  254.  
  255.           $ bilf b stuff.zoo
  256.  
  257.  2.  Invoke VMS Kermit and tell it to send the file.
  258.  
  259.           $ kermit
  260.           Kermit-32> set block-check 3
  261.           Kermit-32> send stuff.zoo
  262.  
  263.  3.  Get back to your local Kermit and tell it to receive a binary file.
  264.  
  265.           (type escape sequence to get into local mode)
  266.           MS-Kermit> set eof noctrl-z
  267.           MS-Kermit> receive
  268.           (transfer takes place)
  269.  
  270.  
  271.                          FILE TRANSFER SUMMARY
  272.  
  273. Here are pictorial summaries of the steps involved in performing file
  274. transfers of zoo archives using Kermit.
  275.  
  276. ======================================================================
  277.  
  278. DOWNLOADS:
  279.                                            files on a VMS
  280.                                          system to be archived
  281.                                                using zoo
  282.                                                     |
  283.                                    archive created  |
  284.                                    using zoo.exe    |
  285.                                    or zoobig.exe    |
  286.                                    on a VMS system  |
  287.                                                     v
  288.  
  289. zoo archive on VMS      bilf b           zoo archive on VMS, in
  290. in fixed-length     <----------------    in stream-LF format
  291. binary format
  292.       |
  293.       |
  294.       | archive transferred
  295.       | from VMS to microcomputer
  296.       | using Kermit; receiving
  297.       | Kermit must be told this
  298.       | is a binary file; sending
  299.       | Kermit may need to be told too
  300.       |
  301.       v
  302. zoo archive
  303. on microcomputer
  304. system
  305.  
  306. ======================================================================
  307.  
  308. UPLOADS:
  309.  
  310. zoo archive
  311. on microcomputer
  312. system
  313.     |
  314.     |
  315.     | archive uploaded to VMS using Kermit;
  316.     | receiving Kermit on VMS must be given
  317.     | command "set file type binary"
  318.     | (NOTE:  "set file type fixed" will
  319.     | usually not work);  sending Kermit
  320.     | must be told this is a binary file
  321.     |
  322.     v
  323. zoo archive on VMS,       bilf l         zoo archive on VMS, in
  324. in variable-length    ---------------->    in stream-LF format
  325. binary format                                      |
  326.                                                    | extract
  327.                                                    | normally using
  328.                                                    | zoo on VMS
  329.                                                    |
  330.                                                    v
  331.                                          files extracted from zoo
  332.                                           archive on a VMS system
  333.  
  334. ======================================================================
  335.  
  336.  
  337.                        ENSURING ARCHIVE INTEGRITY
  338.  
  339. After performing a transfer of a zoo archive using Kermit (and perform-
  340. ing any file conversion necessary for VMS), make it a habit to immedi-
  341. ately test the integrity of the transferred archive with the -test com-
  342. mand of zoo, illustrated for VMS:
  343.  
  344.      $ zoo -test stuff
  345.  
  346. In addition, also get a listing of the archive contents:
  347.  
  348.      $ zoo -list stuff
  349.  
  350. If neither command reports an error, it is reasonable to assume that
  351. archive integrity was not harmed by the Kermit transfer.
  352.  
  353. The -test command tests the integrity of each stored file.  The -list
  354. command tests the integrity of the internal archive structure.  Both are
  355. checked using separate cyclic redundancy codes, one for each archived
  356. file, and one for each directory entry in the archived. (Actually, the
  357. -list command ignores deleted entries, so if the archive contains any,
  358. use the "ld" command instead.)
  359.  
  360.  
  361.                                WILDCARDS
  362.  
  363. All implementations of zoo on all systems use the same wildcard charac-
  364. ters:  "*" matches any sequence of zero or more characters, and "?"
  365. matches any one character.
  366.  
  367. ADDING FILES:  For specifying directory names when adding files, use the
  368. usual VAX/VMS syntax.  Thus, to recursively archive all files in the
  369. current directory and all its subdirectories, the command syntax is:
  370.  
  371.      $ zoo a stuff [...]*
  372.  
  373.  The character range wildcard of the form "c-c" is also available, which
  374.  will select all files beginning with the specified character range.
  375.  For example,
  376.  
  377.       $ zoo a stuff [...]a-d [...]x-z
  378.  
  379.  will archive all files beginning with the characters a through d, and
  380.  with the characters x through z, in the current directory and all its
  381.  subdirectories.  A side-effect of this is that during addition to
  382.  archives, dots in filenames must be explicitly matched.  Thus to add
  383.  all files with an extension of DOC, you would type:
  384.  
  385.       $ zoo a stuff *.doc
  386.  
  387.  and "*doc" will not work.  As a special case, a trailing "*.*" in any
  388.  filename you specify can always be replaced by just a trailing "*".
  389.  The safest rule to follow when adding files is to always specify the
  390.  dot in each filename.
  391.  
  392.  EXTRACTING FILES:  During extraction, both the directory name and the
  393.  filename must be specified according to zoo syntax.  Thus you could say
  394.  
  395.       $ zoo x stuff [*xyz*]*.doc
  396.  
  397.  to extract all archived files with filenames that match "*.doc" and
  398.  that contain the string "xyz" in the directory name.  Note that VMS
  399.  syntax for selecting directories won't work here:
  400.  
  401.       $ zoo x stuff [...]*.doc        ! won't work for extraction
  402.  
  403.  If you do not specify the directory name at all, zoo will only perform
  404.  the match against filenames;  thus
  405.  
  406.       $ zoo x stuff *.doc
  407.  
  408.  will extract all files matching *.doc regardless of the directory name.
  409.  
  410.  Also note that if you specify extraction of "*.*", as in
  411.  
  412.       $ zoo x stuff *.*
  413.  
  414.  it will result in the extraction of files whose filename contains at
  415.  least one dot.  Similarly, the command
  416.  
  417.       $ zoo x stuff *_*
  418.  
  419.  will select all filename containing at least one underscore.
  420.  
  421.  To extract all files, specify no filename, e.g.
  422.  
  423.       $ zoo x stuff
  424.  
  425.  or use "*" rather than "*.*".
  426.  
  427.  SAFEST RULE OF THUMB:  WHEN SELECTING FILES ON DISK, SPECIFY THE DOT IN
  428.  EACH FILENAME;  WHEN SELECTING FILES INSIDE A ZOO ARCHIVE, SPECIFY A
  429.  DOT ONLY IF YOU NEED ONE.  But to select all files, you can always just
  430.  use "*".
  431.  
  432.  
  433.                             FILE GENERATIONS
  434.  
  435.  When a file is added to an archive, the generation number (if any) that
  436.  it is given in the archive is not related to the generation number it
  437.  had in the VAX/VMS filesystem.  At extraction time a new version is
  438.  always created for an extracted file.  The overwrite option ("O") does
  439.  not cause overwriting, but simply suppresses the warning message that
  440.  zoo normally gives when it finds that a file about to be extracted
  441.  already exists.
  442.  
  443.  
  444.                              FILE STRUCTURES
  445.  
  446.  At extraction time, zoo preserves all data bytes in binary files, and
  447.  stores all text files as lines of text terminated with linefeeds. The
  448.  internal file structure maintained by DEC's RMS is not currently
  449.  preserved.  (Support for this is planned for the distant future.)
  450.  Thus, the following two types of files can be safely archived and
  451.  restored:
  452.  
  453.     - All text files are extracted in stream-LF format.  Most VMS utili-
  454.       ties that accept text files will accept such files.  The EDT edi-
  455.       tor may complain, but will still work.
  456.  
  457.     - VMS executable files, when stored and then extracted, are
  458.       extracted in stream-LF format.  Such files can be restored to
  459.       their original state using Bilf with the "b" option.  (However,
  460.       current versions of VAX/VMS seem to be able to load and execute
  461.       stream-LF files, so conversion may not be necessary.)
  462.  
  463.  HANDLING VMS EXECUTABLE FILES.  You can archive an executable program
  464.  called "xyz.exe":
  465.  
  466.       $ zoo a stuff xyz.exe
  467.       $ delete xyz.exe;*
  468.  
  469.  Now the only copy of xyz.exe is in the archive "stuff.zoo".  Extract
  470.  it:
  471.  
  472.       $ zoo x stuff xyz.exe
  473.  
  474.  The extracted copy of "xyz.exe" is in stream-LF format and VMS may or
  475.  may not execute it.  Now we convert it back to fixed-length record for-
  476.  mat thus:
  477.  
  478.       $ bilf b xyz.exe
  479.       $ purge xyz.exe
  480.  
  481.  Now "xyz.exe" has been converted to binary format and can be executed.
  482.  It should be identical to the original copy of "xyz.exe" that was
  483.  archived.
  484.  
  485.  TEXT FILES FROM OTHER SYSTEMS.  A text file archived on a different
  486.  computer system will use either linefeeds, or carriage returns plus
  487.  linefeeds, as line terminators.  Text files with linfeeds only can be
  488.  be extracted and used exactly as if they had been archived on a VAX/VMS
  489.  system.  Text files containing carriage returns plus linefeeds will,
  490.  when extracted, contain a spurious carriage return at the end of each
  491.  line.  This extra carriage return can be removed using EDT's "substi-
  492.  tute" command while in screen mode.  Simply replace all carriage returns
  493.  with nothing.  The VMS C compiler currently appears to accept trailing
  494.  carriage returns in files without any trouble.
  495.  
  496.  Text files trasnferred from MS-DOS or CP/M or similar systems may con-
  497.  tain a trailing control Z character.  This may cause problems on VMS
  498.  and should be edited out with a text editor.
  499.  
  500.                                      -- Rahul Dhesi 1988/02/04
  501.