From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 17-MAY-1989 18:28
To:	MRGATE::"ARISIA::EVERHART"
Subj:	tar2vms documemtation  (VMS/TAR Part 1 of 4)

Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Wed, 17 MAY 89 07:40:09 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Wed, 17 May 89 07:36:39 PDT
Received: by ucbvax.Berkeley.EDU (5.61/1.36)
	id AA01605; Wed, 17 May 89 07:29:36 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 16 May 89 14:03:50 GMT
From: att!alberta!calgary!.UCalgary.CA!cliff@ucbvax.Berkeley.EDU
Organization: U. of Calgary, Calgary, Alberta, Canada
Subject: tar2vms documemtation  (VMS/TAR Part 1 of 4)
Message-Id: <1385@cs-spool.calgary.UUCP>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

TAR2VMS Documentation
 
Introduction:
 
        The program TAR2VMS.C reads from a /foreign tape,or a file
which is an image of a Tar format tape, and extracts the files into
a directory tree starting in the current default directory.
Directories will be created automatically.
For example, if your default is [JONES.MAIN], then the file
"electric/sub/test.c" will be written into [JONES.MAIN.ELECTRIC.SUB]TEST.C .
        For the simplest operation, just  RUN it after defining the
logical "TAPE" to be the the Tar source and doing a
MOUNT/FOREIGN/BLOCK=10240/RECORD=512 (if it is a tape); this
does the extraction automatically, reporting on stdout as it does. (This
assumes that the UNIX blocking factor was 20, if it not, then use the
correct block size, or try the maximum value for vms: 65532)
 
        The extracted files will be written to your system as C stream files.
The VMS editor EDT will complain about the format, but EVE will not.
---------------------------------------------------------------------------
 
To convert a text file to standard VMS format:
(Thanks to Eric Gisin at U. of Waterloo:)
        You can use the VMS CONVERT utility by first creating a xxxx.FDL file
containing:
 
FILE
        ORGANIZATION            sequential
RECORD
        BLOCK_SPAN              yes
        CARRIAGE_CONTROL        carriage_return
        FORMAT                  variable
 
Then run Convert with the regular DCL:
CONVERT/FDL=xxxx  input-file  output-file
-------------------------------------------------------------------------
 
Tar2vms Usage:
 
        -Define the logical variable "TAPE" to be the desired tape
         unit or the file containing the Tar data.
 
        -Mount the tape /FOREIGN/BLOCK=10240/RECORD=512
 
        (or the block size if it not a UNIX blocking of 20)
 
        -Set the default directory below which the tree will be created
         before calling the program. Thus: if your default directory
         is SYS$SYSDEVICE:[MYDIRE], the file "electric/dbase.c" will
         be written in SYS$DEVICE:[MYDIRE.ELECTRIC]DBASE.C
 
       -Then run TAR2VMS: (either by RUN or as a command)
         if you use RUN, the operation is (extract, verbose)
         otherwise:
'command' [options]
        where the options are:
                "t" (listing only)       Listing of files on tape
                "x" (extract)            Extract files from the tape
                "v" (verbose):           Report activity
                "w" (wait)               ...Not implemented
    -to use the options, the program must be executed using the
     foreign command feature of VMS, by defining a command:
command :== $path:tar2vms      !where path=complete location of tar2vms.exe
 
        Example:
If the command is 'tar2vms', then:
tar2vms t                       will list the contents of the tar file
tar2vms xv                      will extract all of the files, reporting
 
The listing reports the UNIX protection (in octal), the file size in bytes,
the modification date on the tape, and the file name.
 
ERRORS: Most probable causes:
        "Can't open input file" - likely forgot to define TAPE, or mount
                                        the tape.
        "Error reading input"   - unexpected Tar format, or bad file.
        "Error writing output " - directory access error
        "Creation Error...   "  - illegal directory or file name
 
--------------------------------------------------------------------------
Important assumptions for this version (2.3):
 
    The defaults are (no options):
    -Extract all of the files, reporting as each file is created
 
    -Read from a tape, mounted foreign, or a fixed record length
     file,with block size of 10240 bytes or less . If larger block
     size, change the  definition of SIZE.
 
    -Stop on the special (blank header) block written by UNIX.
     (Note, like UNIX Tar, it does not move to the file mark at
     the end of the file. Answer "y" to the prompt to get to another
     tar file on the same tape.)THIS MIGHT NOT WORK...
 
    -All files are assumed to be UNIX stream and are
     just copied. The vms file-attribute will be "stream". This may
     have to be changed in certain cases with CONVERT, or by writing
     a little C program to read the file and rewrite it.
 
    -When a UNIX linked file is encountered, there will be another
     file on the tape that contains the actual data. It may not be an
     earlier file that was the original file, since the files
     are written on in alphabetical order. The program will create a
     file under the name of the linked file, but it will contain only
     a text messsage reporting the name of the file that contains the
     data.
 
 
    This version converts the path names to VMS format before creating
the files. Some special cases:
 
 (1) File names with more than one period (".") in the name have those
        after the first converted to underscores (e.g. "mults.s.c" is
        written out under the name "mults.s_c"
 (2) It is assumed that all of the pathnames on the Tar tape have
        complete directory info, with no device parts.
 (3) Commas and hyphens in file or directory names are converted to
        underscores. If this causes any problems, you can modify the
        code in vms_cleanup().Any such translations are reported in
        "verbose" mode.
 (4) Files are created with the user's default protection. The mode on
        the tape is ignored.
 (5) The dates of files extracted are the date of the extraction, not the
        date of the Tar version.
 (6) UNIX files that have no extension, and end in a letter will have
        a "." added to the name automatically. This can cause some
        mysteries with large programs that look for other files with
        an exact string search. Also, if the files are written out
        to UNIX as a TAR tape from VMS, the "." goes along with the file
        name.
 
------------------------------------------------------------------------
Known Bugs:
 
    - Can't always read another file on the same tape. The program
      only works correctly when the tape had regular EOF marks on it,
      which apparently is not always true.
    - Can't selectively extract files from the tape. The "wait" option
      could be useful, but haven't got around to it..
 
 
 
Cliff Marcellus                UUCP     : {any backbone}!calgary!ssg-vax-a!cliff
Institute for Space Research   DOMAIN   : cliff@ssg-vax-a.phys.UCalgary.CA
Dept of Physics and Astronomy  SPAN     : CANCAL::CLIFF
The University of Calgary                 "If it's not fun, don't do it!"

