home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / vms / 19140 < prev    next >
Encoding:
Internet Message Format  |  1992-12-11  |  8.2 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!NKUVAX.BITNET!FINLEY
  2. From: FINLEY@NKUVAX.BITNET (Kevin Finley)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: tar for vms
  5. Message-ID: <01GS6WQ82EVS8WVZ4C@NKUVAX.BITNET>
  6. Date: 11 Dec 92 17:45:17 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 412
  11.  
  12.  
  13.   Greetings:
  14.  
  15.  
  16.  
  17.   TAR2VMS is the program (Version 2.3) to extract files from  a  Tar  format
  18.  
  19.   tape or file into a VMS system.  Major features:
  20.  
  21.  
  22.  
  23.   1.  It reads from either a tape or a file image of a tar tape
  24.  
  25.  
  26.  
  27.   2.  It transfers files as is, does NOT translate UNIX stream files to  the
  28.  
  29.       format that the VMS editor likes, but this is not a problem unless you
  30.  
  31.       intend to edit the files.  See below.
  32.  
  33.  
  34.  
  35.   3.  It can usually leave the tape positioned ready  to  read  another  Tar
  36.  
  37.       file  from  the tape.  NOTE:  there is a SET MAGTAPE option in VMS 4.x
  38.  
  39.       that will skip files to start reading in the middle of  a  tape.   The
  40.  
  41.       TAR2VMS program does not do any rewinds.
  42.  
  43.  
  44.  
  45.   4.  UNIX "linked" files are handled.
  46.  
  47.  
  48.  
  49.   5.  When file names are modified to suit VMS requirements,  a  message  is
  50.  
  51.       given on stdout.
  52.  
  53.  
  54.  
  55.  
  56.  
  57.   I will be glad to hear of your experiences with the code, since often when
  58.  
  59.   we get a Tar tape from a different system, we find something that I hadn't
  60.  
  61.   anticipated.  The program was developed by looking  at  DUMP  output  from
  62.  
  63.   various  tar  format  tapes  on  a  VMS  system,  so there are undoubtedly
  64.  
  65.   variations that I haven't seen.  ( I am not a UNIX expert..) We looked  at
  66.  
  67.   UNIX  manuals as well, but found some discrepancies in real tapes, so went
  68.  
  69.   with what seemed to work.
  70.  
  71.  
  72.  
  73.   I also have a Tar writer; ask for it if you need to transfer  files  to  a
  74.  
  75.   UNIX system from VMS.
  76.  
  77.  
  78.  
  79.   Sid Penstone,
  80.  
  81.   VLSI Group,
  82.  
  83.   Department of Electrical Engineering,
  84.  
  85.   Queen's University,
  86.  
  87.   Kingston, Ontario, Canada, K7L3N6
  88.  
  89.   phone (613) 545-2925
  90.  
  91.  
  92.  
  93.   BITNET:     PENSTONE@QUCDNEE1     (Preferred)
  94.  
  95.               PENSTONE@QUCDN        (If the other doesn't work)
  96.  
  97.  
  98.  
  99.   Introduction:
  100.  
  101.  
  102.  
  103.   The program TAR2VMS.C reads from a /foreign tape, or a file  which  is  an
  104.  
  105.   image  of  a Tar format tape, and extracts the files into a directory tree
  106.  
  107.   starting in the current default directory.  Directories  will  be  created
  108.  
  109.   automatically.
  110.  
  111.  
  112.  
  113.   For  example,  if  your   default   is   [JONES.MAIN],   then   the   file
  114.  
  115.   "electric/sub/test.c"         will         be         written         into
  116.  
  117.   [JONES.MAIN.ELECTRIC.SUB]TEST.C.
  118.  
  119.  
  120.  
  121.   For the simplest operation, just RUN it after defining the logical  "TAPE"
  122.  
  123.   to  be the the Tar source and doing a MOUNT/FOREIGN/BLOCK=10240/RECORD=512
  124.  
  125.   (if it is a tape); this does the extraction  automatically,  reporting  on
  126.  
  127.   stdout as it does.
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.   Converting the files:
  138.  
  139.  
  140.  
  141.   The extracted files will be written to your system as C stream files.  The
  142.  
  143.   VMS editor EDT will complain about the format, but EVE will not.
  144.  
  145.  
  146.  
  147.   To convert a text file to standard VMS format:
  148.  
  149.   (Thanks to Eric Gisin at U.  of Waterloo:)
  150.  
  151.   You can use the VMS CONVERT utility by  first  creating  a  xxxx.FDL  file
  152.  
  153.   containing:
  154.  
  155.  
  156.  
  157.   FILE
  158.  
  159.           ORGANIZATION            sequential
  160.  
  161.   RECORD
  162.  
  163.           BLOCK_SPAN              yes
  164.  
  165.           CARRIAGE_CONTROL        carriage_return
  166.  
  167.           FORMAT                  variable
  168.  
  169.  
  170.  
  171.   Then run  Convert  with  the  regular  DCL:   CONVERT/FDL=xxxx  input-file
  172.  
  173.   output-file
  174.  
  175.  
  176.  
  177.   Tar2vms Usage:
  178.  
  179.  
  180.  
  181.   To use TAR2VMS you must:
  182.  
  183.  
  184.  
  185.    o  Set up a foreign command by  including  the  following  line  in  your
  186.  
  187.       LOGIN.COM file:
  188.  
  189.  
  190.  
  191.            $ TAR2VMS == "$ Acs$Public:TAR2VMS.Exe"
  192.  
  193.  
  194.  
  195.    o  Define the logical variable "TAPE" to be the desired tape unit or  the
  196.  
  197.       file containing the Tar data.
  198.  
  199.  
  200.  
  201.    o  Mount the tape /FOREIGN/BLOCK=10240/RECORD=512
  202.  
  203.  
  204.  
  205.    o  Set the default directory below which the tree will be created  before
  206.  
  207.       calling   the   program.    Thus:    if   your  default  directory  is
  208.  
  209.       SYS$SYSDEVICE:[MYDIRE], the file "electric/dbase.c" will be written in
  210.  
  211.       SYS$DEVICE:[MYDIRE.ELECTRIC]DBASE.C
  212.  
  213.  
  214.  
  215.    o  Then run TAR2VMS:  (either by RUN or as a command:   TAR2VMS)  if  you
  216.  
  217.       use  RUN  ACS$PUBLIC:TAR2VMS,  the  operation  is  (extract,  verbose)
  218.  
  219.       otherwise:  'command' [options]
  220.  
  221.       where the options are:
  222.  
  223.            "t" (listing only)     Listing of files on tape
  224.  
  225.            "x" (extract)          Extract files from the tape
  226.  
  227.            "v" (verbose)          Report activity
  228.  
  229.            "w" (wait)             ...Not implemented
  230.  
  231.  
  232.  
  233.    o  to use the options, the program must be  executed  using  the  foreign
  234.  
  235.       command feature of VMS, by defining a command, TAR2VMS, as show above.
  236.  
  237.  
  238.  
  239.    o  Example:
  240.  
  241.       If the command is 'tar2vms', then:
  242.  
  243.            tar2vms t      will list the contents of the tar file
  244.  
  245.            tar2vms xv     will extract all of the files, reporting
  246.  
  247.  
  248.  
  249.   The listing reports the UNIX protection  (in  octal),  the  file  size  in
  250.  
  251.   bytes, the modification date on the tape, and the file name.
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.   ERRORS:
  262.  
  263.  
  264.  
  265.   Most probable causes:
  266.  
  267.  
  268.  
  269.       "Can't open input file" - likely forgot to define TAPE, or
  270.  
  271.                                 mount the tape.
  272.  
  273.  
  274.  
  275.       "Error reading input"   - unexpected Tar format, or bad file.
  276.  
  277.  
  278.  
  279.       "Error writing output"  - directory access error
  280.  
  281.  
  282.  
  283.       "Creation Error..."     - illegal directory or file name
  284.  
  285.  
  286.  
  287.  
  288.  
  289.   Important assumptions for this version (2.3):
  290.  
  291.  
  292.  
  293.   The defaults are (no options):
  294.  
  295.  
  296.  
  297.    o  Extract all of the files, reporting as each file is created
  298.  
  299.  
  300.  
  301.    o  Read from a tape, mounted foreign, or a fixed record length  file,with
  302.  
  303.       block  size of 10240 bytes or less .  If larger block size, change the
  304.  
  305.       definition of SIZE.
  306.  
  307.  
  308.  
  309.    o  Stop on the special (blank header) block written by UNIX.  (Note, like
  310.  
  311.       UNIX  Tar,  it  does not move to the file mark at the end of the file.
  312.  
  313.       Answer "y" to the prompt to get  to  another  tar  file  on  the  same
  314.  
  315.       tape.)THIS MIGHT NOT WORK...
  316.  
  317.  
  318.  
  319.    o  All files are assumed to be UNIX stream and are just copied.  The  vms
  320.  
  321.       file-attribute  will  be  "stream".   This  may  have to be changed in
  322.  
  323.       certain cases with CONVERT, or by writing a little C program  to  read
  324.  
  325.       the file and rewrite it.
  326.  
  327.  
  328.  
  329.    o  When a UNIX linked file is encountered, there will be another file  on
  330.  
  331.       the tape that contains the actual data.  It may not be an earlier file
  332.  
  333.       that was the  original  file,  since  the  files  are  written  on  in
  334.  
  335.       alphabetical  order.  The program will create a file under the name of
  336.  
  337.       the linked file, but it will contain only a  text  messsage  reporting
  338.  
  339.       the name of the file that contains the data.
  340.  
  341.  
  342.  
  343.   This version converts the path names to VMS  format  before  creating  the
  344.  
  345.   files.  Some special cases:
  346.  
  347.  
  348.  
  349.   1.  File names with more than one period (".")  in  the  name  have  those
  350.  
  351.       after the first converted to underscores (e.g.  "mults.s.c" is written
  352.  
  353.       out under the name "mults.s_c"
  354.  
  355.  
  356.  
  357.   2.  It is assumed that all of the pathnames on the Tar tape have  complete
  358.  
  359.       directory info, with no device parts.
  360.  
  361.  
  362.  
  363.   3.  Commas and hyphens  in  file  or  directory  names  are  converted  to
  364.  
  365.       underscores.   If this causes any problems, you can modify the code in
  366.  
  367.       vms_cleanup().Any such translations are reported in "verbose" mode.
  368.  
  369.  
  370.  
  371.   4.  Files are created with the user's default protection.  The mode on the
  372.  
  373.       tape is ignored.
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.   5.  The dates of files extracted are the date of the extraction,  not  the
  384.  
  385.       date of the Tar version.
  386.  
  387.  
  388.  
  389.   6.  UNIX files that have no extension, and end in a letter will have a "."
  390.  
  391.       added  to  the name automatically.  This can cause some mysteries with
  392.  
  393.       large programs that look for other files with an exact string  search.
  394.  
  395.       Also, if the files are written out to UNIX as a TAR tape from VMS, the
  396.  
  397.       "." goes along with the file name.
  398.  
  399.  
  400.  
  401.  
  402.  
  403.   Known Bugs:
  404.  
  405.  
  406.  
  407.  
  408.  
  409.    o  Can't always read another file on the same  tape.   The  program  only
  410.  
  411.       works  correctly  when  the  tape  had  regular EOF marks on it, which
  412.  
  413.       apparently is not always true.
  414.  
  415.  
  416.  
  417.    o  Can't selectively extract files from  the  tape.   The  "wait"  option
  418.  
  419.       could be useful, but haven't got around to it..
  420.  
  421.  
  422.  
  423.  
  424.