From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 14-SEP-1989 08:23
To:	MRGATE::"ARISIA::EVERHART"
Subj:	VMS TAR v1.1   part 2 of 6

Received: From UCBVAX.BERKELEY.EDU by GIZMO.SRI.COM with TCP; Thu, 14 SEP 89 01:52:46 PDT
Received: by ucbvax.Berkeley.EDU (5.61/1.37)
	id AA09736; Thu, 14 Sep 89 01:47:25 -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: 14 Sep 89 20:05:14 GMT
From: uhccux!munnari.oz.au!murtoa.cs.mu.oz.au!viccol!timcc@ames.arc.nasa.gov  (Tim Cook)
Organization: Computer Services, Victoria College, Melbourne
Subject: VMS TAR v1.1   part 2 of 6
Message-Id: <1939@csv.viccol.edu.au>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+
X    calling LIB$CVT_FROM_INTERNAL_TIME, a routine found only in VMS V5.
X    This means that TAR should now work under VMS V4 as well.
X
X6.  Add capability to /APPEND to an archive on tape
X
X    Another item that was not tested in v1.0.  TAR will now APPEND
X    correctly to an archive on a tape MOUNTed /FOREIGN.
X
X7.  Correct behaviour when Ctrl-Z typed at a /CONFIRM prompt
X
X    TAR used to just abort when given a Ctrl-Z at a /CONFIRM prompt, now
X    it cleans up and reports before aborting.
X
X8.  Bug fixes
X
X    Two or three bugs remaining in version 1.0-1 have been fixed,
X    including a bug when TAR attempts to WRITE an archive containing
X    more that 100 files with /MAP_MODE=PREFIX.
$ CALL UNPACK NEW-FEATURES-TAR-1.1;1 371152978
$ create/nolog 'f'
X! Definition of TAR verb.
X
XDEFINE TYPE map_mode_keyword
X   KEYWORD`009prefix, DEFAULT
X   KEYWORD`009absolute
X   KEYWORD`009root
X
XDEFINE syntax tar_extract
X   PARAMETER`009p1, LABEL=option, VALUE (REQUIRED)
X   PARAMETER`009p2, LABEL=filespec, PROMPT="File(s)", VALUE (LIST)
X   QUALIFIER`009literal, PLACEMENT=POSITIONAL
X   QUALIFIER`009confirm
X   QUALIFIER`009archive, NONNEGATABLE, VALUE (TYPE=$FILE, REQUIRED)
X
XDEFINE SYNTAX tar_write
X   PARAMETER`009p1, LABEL=option, VALUE (REQUIRED)
X   PARAMETER`009p2, LABEL=filespec, PROMPT="File(s)", VALUE (LIST, TYPE=$FIL
VE,
X`009`009   DEFAULT="*.*")
X   QUALIFIER`009confirm
X   QUALIFIER`009scan
X   QUALIFIER`009map_mode, DEFAULT, VALUE (TYPE=map_mode_keyword,
X`009`009   DEFAULT="PREFIX")
X   QUALIFIER`009archive, NONNEGATABLE, VALUE (TYPE=$FILE, REQUIRED)
X
XDEFINE SYNTAX tar_append
X   PARAMETER`009p1, LABEL=option, VALUE (REQUIRED)
X   PARAMETER`009p2, LABEL=filespec, PROMPT="File(s)", VALUE (LIST, TYPE=$FIL
VE,
X`009`009   DEFAULT="*.*")
X   QUALIFIER`009confirm
X   QUALIFIER`009scan
X   QUALIFIER`009map_mode, DEFAULT, VALUE (TYPE=map_mode_keyword,
X`009`009   DEFAULT="PREFIX")
X   QUALIFIER`009archive, NONNEGATABLE, VALUE (TYPE=$FILE, REQUIRED)
X
XDEFINE SYNTAX tar_list
X   PARAMETER`009p1, LABEL=option, VALUE (REQUIRED)
X   PARAMETER`009p2, LABEL=filespec, PROMPT="File(s)", VALUE (LIST)
X   QUALIFIER`009literal, PLACEMENT=POSITIONAL
X   QUALIFIER`009full
X   QUALIFIER`009output, NONNEGATABLE, VALUE (TYPE=$FILE, DEFAULT="SYS$OUTPUT
V")
X   QUALIFIER`009archive, NONNEGATABLE, VALUE (TYPE=$FILE, REQUIRED)
X
XDEFINE TYPE tar_options
X   KEYWORD`009extract,`009SYNTAX=tar_extract
X   KEYWORD`009write,`009`009SYNTAX=tar_write
X   KEYWORD`009append,`009`009SYNTAX=tar_append
X   KEYWORD`009list,`009`009SYNTAX=tar_list
X
XDEFINE VERB tar
X   IMAGE`009"CS_SYSTEM:TAR"`009`009! This should be modified
X   PARAMETER`009p1, LABEL=option, PROMPT="Option",
X      VALUE (REQUIRED, TYPE=tar_options)
$ CALL UNPACK TAR.CLD;1 1845845665
$ create/nolog 'f'
X1 TAR
XVMS TAR is a utility that emulates the UNIX tar, or Tape ARchive utility,
Xwhich is used to store a set of files in a single file, usually on an
Xoffline medium, such as 9-track tape.
X
XVMS TAR automatically performs conversion of files to and from the UNIX
Xfile format, and converts between UNIX and VMS file protections and
Xmodification times.
X
XFormat:
X
X
X    TAR keyword `091file-spec`091,...`093`093
X!
X2 Parameters
Xkeyword
X
X  One of the keywords APPEND, EXTRACT, LIST or WRITE.  Each keyword has a
X  different function.  See the help for each keyword.
X
Xfile-spec
X
X  The specification of any file(s) to be APPENDed, EXTRACTed, LISTed or
X  WRITten.
X
X  On an APPEND or WRITE operation, this is a wildcarded VMS file-
X  specification.
X
X  On an EXTRACT or LIST operation, the file-spec parameter is interpreted
X  as a UNIX Bourne shell would interpret it, as per the following rules:
X
X`009*`009Matches any any string (including a null string) that does
X`009`009not contain '/'.
X
X`009?`009Matches any single character, except '/'.
X
X`009`091ab0-9`093`009Matches any one of 'ab0123456789'.
X
X  If you want TAR to interpret the characters *, ? or `091 as normal
X  characters, use the /LITERAL qualifier on the particular file-spec
X  parameter.
X
X  If you do not specify a file-spec parameter, TAR will WRITE or APPEND all
X  files in the current directory, or it will EXTRACT or LIST all files in
X  the nominated archive.
X!
X2 Examples
XFor all TAR operations direct to or from tape, the tape must be MOUNTed
Xas in the following EXTRACT example:
X
X`009$ ALLOCATE MF,MS,MT tar_archive
X`009%DCL-I-ALLOC, _$1$MSA0: allocated
X`009$ MOUNT /FOREIGN /RECORD_SIZE=512 /BLOCK_SIZE=10240 tar_archive
X`009%MOUNT-I-MOUNTED,  mounted on _$1$MSA0:
X`009$ TAR EXTRACT *.COB /CONFIRM
X`009Extract program-1.cob ? (Y/N) `091Y`093: n
X`009Extract deep-space.cob ? (Y/N) `091Y`093: <Return>
X`009%TAR-S-CREATED, created DISK:`091USER`093DEEP-SPACE.COB;1 (2573 records)
X`009Extract terrorpods.cob ? (Y/N) `091Y`093: <Return>
X`009%TAR-S-CREATED, created DISK:`091USER`093TERRORPODS.COB;1 (523 records)
X`009Extract foo.cob ? (Y/N) `091Y`093: Yes
X`009%TAR-S-CREATED, created DISK:`091USER`093FOO.COB;1 (0 records)
X`009%TAR-S-TOTAL, total of 3 files created, 4 files scanned
X`009$ DISMOUNT tar_archive
X`009$ DEALLOCATE tar_archive
X
X
XIf you wanted to create an archive that would later be copied to a tape,
Xthe following sequence of commands might be used:
X
X  `009$ TAR WRITE *.pas /ARCHIVE=PASCAL.TAR
X
Xand later:
X
X`009$ ALLOCATE MSA0:
X`009%DCL-I-ALLOC, _$1$MSA0: allocated
X`009$ MOUNT /FOREIGN /RECORD_SIZE=512 /BLOCK_SIZE=10240 MSA0:
X`009%MOUNT-I-MOUNTED, BLANK1 mounted on _$1$MSA0:
X`009$ COPY/LOG PASCAL.TAR MSA0:
X`009%COPY-S-COPIED, CS:`091STAFF.FRED`093PASCAL.TAR copied to _$1$MSA0:
X  `009 (315 records).
X`009$ (dismount and deallocate)
X
XThe /BLOCK_SIZE qualifier is important for mounting TAR tapes.  UNIX uses a
Xdefault blocking factor of 20, which makes the block size 10240.  A UNIX
Xtar archive might have been created with a different blocking factor,
Xthough.  This may be discovered by mounting such an archive tape without
Xa /BLOCK_SIZE qualifier and DUMPing the tape drive (DUMP will demonstrate
Xthe block size).
X
XIf you are going to use a tape that has previously been used for an unusual
Xformat (like VMS BACKUP), you should initialize the tape, using the
XINITIALIZE command:
X
X`009$ ALLOCATE MF,MS,MT TAR_ARCHIVE
X  `009%DCL-I-ALLOC, _$1$MSA0: allocated
X`009$ INIT TAR_ARCHIVE FREDDO
X!
X2 Supported_Files
XFiles readable by TAR include:
X
X   Record format                       Carriage control
X   -------------                       ----------------
X
X   variable-length                     carriage-return
X                                         stream-lf
X   variable-fixed-control (VFC)        print-file
X   fixed-length                        none
X
XVariable-length VMS files are written to an archive with linefeeds
X('newline's or '\n' to UNIX) as record terminators, which is consistent
Xwith the UNIX text file format, whereas fixed-length VMS files are not.
XExtraction of files that used to be fixed-length is extremely difficult
X(see Caveats), as they are indistinguishable from text files when stored
Xin tar format.  A feature may be added to VMS TAR in future to counter
Xthis.
X
XOther file types may be supported, but a file with FORTRAN carriage
Xcontrol for example, may be transmitted in a useless format.  Note that
Xany file EXTRACTed by tar will always be recreated with the VMS standard
Xtext file attributes; variable-length records and carriage-return carriage
Xcontrol.
X!
X2 Caveats
XTAR_TIMEZONE
X
X   To assist in the conversion of file modification times, TAR uses time
X   zone information.  TAR gets the local time zone from the logical names
X   SYS$TIME_ZONE or TAR_TIMEZONE (the latter is used if the former is not
X   defined).  The format of these logicals is "`091s`093`091`091h`093mm`093"
V, where s is a
X   sign (+ or -), h is the number of hours (1-18) and mm the number of
X   minutes (00-59) to be added to GMT to give the local time.  An example is
X   "+1000" for Australian Eastern Standard Time, which is 10 hours ahead of
X   GMT.
X
X   I'm not sure about the history of SYS$TIME_ZONE.  I saw it somewhere, but
X   I can't remember where.  It is not defined on our systems.
X
X
XThe /SCAN qualifier.
X
X   When writing a file with variable-length records to an archive, TAR's
X   normal behaviour is first to copy the file into a temporary file, in the
X   TAR format.  When this is done, TAR knows the size of the file in bytes,
X   so it can then write a header record to the real archive, and quickly
X   load the contents of the temporary file into the archive.
X
X   The presence of the /SCAN qualifier makes TAR read through the whole of
X   the input file to get its size in bytes, then load it into the archive.
X
X   The first method should save on processing, but the second method
X   should save on I/O, and could help in a situation of stretched disk
X   quota.  I thought both were useful, so I coded both and made the /SCAN
X   qualifier.
X
X   Incidentally, if the input file has fixed-length records, its size is
X   computed using the record size and the size in blocks of the file. This
X   may not be a completely safe algorithm, as it presumes there are no
X   record delimiters in fixed-length record files.
X
X
X!'Directory not found' when EXTRACTing files
X!
X!   If you try to make TAR EXTRACT a file into a directory that does not
X!   exist (it may not have been put in the archive), it will say so,
X!   then extract it into the file '`091`093OUT_FILE.DAT'.  This wasn't actua
Vlly
X!   explicitly coded into TAR by me (a side effect), but it seems a
X!   sensible thing to do until I implement a qualifier to tell TAR to
X!   create the directories it needs (like UNIX tar and BACKUP).
X!
X!   `091 TAR now automatically creates any necessary directories `093
X!
XInternal errors
X
X   If TAR tells you it has encountered an internal error, it means it has
X   caught a Pascal run-time error that it doesn't have a way of handling.`03
V2
X   Generally, this means you have done something strange with TAR that I
X   haven't done myself in testing.  The code supplied in the INTERNERR
X   message corresponds to a VAX Pascal status code, and I would like it if
X   you notify me of how you caused the error and the value of that code.
X
X
XOutput file record wrapping
X
X   VMS TAR has no way of knowing if a file originally had fixed-length
X   records, so it always assumes a file in an archive is to be EXTRACTed
X   with variable-length records, and interprets any LF's it finds
X   accordingly.  But, if a record is longer than a certain number of bytes
X   (currently 8192), the superfluous bytes are used to make a new record in
X   the file (they are wrapped).  The user is told of this if and when it
X   happens during the extraction of a file.  Note however that the user will
X   only be notified the first time it happens to each file.
X
X
XExceeding disk quota
X
X   When a sequential file is written to by VAX RMS, it automatically
X   extends, or allocates more blocks to the file as necessary.  I have
X   seen RMS be overly generous in doing this; to the point where I am
X   fairly sure there are a few bugs deep down in RMS.  This generosity
X   could cause a user's disk quota to be exceeded when creating a TAR
X   archive or extracting files from an archive.  To combat this, you can
X   enter the following DCL command before using TAR:
X
X`009$ SET RMS_DEFAULT/EXTEND=n
X
X   Where n is a fairly low number, like 1 or 2.  The RMS default is 32,
X   but I have seen files with more than 31 allocated but unused blocks
X   attached to them.
X
X   These superflous extents only exist when the file is being written to,
X   they are removed when the file is closed.
X!
X2 APPEND
XThis function is the same as WRITE, except that files written to the
Xarchive are appended (see WRITE).
X!
X3 Qualifiers
X!
X/ARCHIVE
X
X  Specifies the archive to which files are to be APPENDed.  The default is
X  'TAR_ARCHIVE', which might be a logical name pointing to a tape-drive
X  (see Examples).  The archive file specified must be a valid TAR archive
X  file.
X
X/CONFIRM
X
X  If the /CONFIRM qualifier is given on the APPEND keyword, the user is
X  prompted each time TAR is about to append a file to the archive.  The
X  user may then confirm or abort the archiving of the file.
X
X/MAP_MODE
X /MAP_MODE=PREFIX (Default)
X
X  The MAP_MODE keyword tells TAR how to map VMS file specifications to
X  UNIX pathnames when writing files to an archive.  The available modes
X  and their behaviours follows:
X
X     PREFIX    File names in the archive are relative, any directories
X               in the pathname of a file that are common to all files
X               to be written (a common prefix) are removed.
X
X     ABSOLUTE  The VMS device, directory, name and type fields are
X               mapped to an absolute UNIX pathname (one beginning with
X               '/').  A file called 'DISK:`091USER.SUB`093FOO.BAR' would be
X               mapped to '/disk/user/sub/foo.bar'.
X
X     ROOT      The (logical or physical) device specification is omitted
X               from the UNIX pathname, but the directory, name and type
X               are used to form a relative pathname.  The file
X               'DISK:`091USER.SUB`093FOO.BAR' would be mapped to
X               'user/sub/foo.bar'.
X
X/SCAN
X
X  Instructs TAR not to use a temporary archive file for the purpose of
X  writing a file with variable-length records to an archive.  See TAR
X  Caveats.
X!
X2 EXTRACT
XThis function reads files from an archive, and creates VMS files in your
Xcurrent directory with names, protections and modification dates as
Xsimilar as possible to their UNIX names.  As each file is created, its
Xsize in records is logged.
X!
X3 Qualifiers
X!
X/ARCHIVE
X
X  Specifies the archive from which files are to be EXTRACTed.  The default
X  is 'TAR_ARCHIVE', which might be a logical name pointing to a tape-drive
X  (see Examples).
X
X/CONFIRM
X
X  If the /CONFIRM qualifier is given on the EXTRACT keyword, the user is
X  prompted each time TAR is about to extract a file.  The user may then
X  confirm or abort the creation of the file.
X
X/LITERAL
X
X  Instructs TAR to interpret any file-specification literally, i.e., not to
X  interpret any embedded wildcards.  This qualifier is positional, so can be
X  used on particular file-specifications.
X!
X2 LIST
X  This function lists all files, and their sizes in bytes, in an archive
X  that match file-spec.  If file-spec is not supplied, LIST lists all files
X  in the archive.
X!
X3 Qualifiers
X!
X/ARCHIVE
X
X  Specifies the archive TAR is to search for files.  The default is
X  'TAR_ARCHIVE', which might be a logical name pointing to a tape-drive
X  (see Examples).
X
X/FULL
X
X  If the /FULL qualifier is specified on a LIST operation, a more detailed
X  listing of the archive contents is returned; specifically, the
X  protection, owner id-number, group id-number, size and name of the file.
X
X/LITERAL
X
X  Instructs TAR to interpret any file-specification literally, i.e., not to
X  interpret any embedded wildcards.  This qualifier is positional, so can
X  be used on particular file-specifications.
X
X/OUTPUT
X
X  Instructs TAR to direct the output of the LISTing to a file (the default
X  file type for this file is .LIS).
X!
X2 WRITE
XThis function writes files to an archive, copying the modification
Xdate/time and the read and write permission bits (the execute permission
Xis present in most places where the read permission is under VMS, and is
Xtherefore almost meaningless).  The user and group id's are set to 0
X(root).  As each file is written, its size in bytes (under UNIX) is
Xlogged.
X!
X3 Qualifiers
X!
X/ARCHIVE
X
X  Specifies the archive to which files are to be WRITten.  The default is
X  'TAR_ARCHIVE', which might be a logical name pointing to a tape-drive
X  (see Examples).
X
X/CONFIRM
X
X  If the /CONFIRM qualifier is given on the WRITE keyword, the user is
X  prompted each time TAR is about to write a file to the archive.  The
X  user may then confirm or abort the archiving of the file.
X
X/MAP_MODE
X /MAP_MODE=PREFIX (Default)
X
X  The MAP_MODE keyword tells TAR how to map VMS file specifications to
X  UNIX pathnames when writing files to an archive.  The available modes
X  and their behaviours follows:
X
X     PREFIX    File names in the archive are relative, any directories
X               in the pathname of a file that are common to all files
X               to be written (a common prefix) are removed.
X
X     ABSOLUTE  The VMS device, directory, name and type fields are
X               mapped to an absolute UNIX pathname (one beginning with
X               '/').  A file called 'DISK:`091USER.SUB`093FOO.BAR' would be
X               mapped to '/disk/user/sub/foo.bar'.
X
X     ROOT      The (logical or physical) device specification is omitted
X               from the UNIX pathname, but the directory, name and type
X               are used to form a relative pathname.  The file
X               'DISK:`091USER.SUB`093FOO.BAR' would be mapped to
X               'user/sub/foo.bar'.
X
X/SCAN
X
X  Instructs TAR not to use a temporary archive file for the purpose of
X  writing a file with variable-length records to an archive.  See TAR
X  Caveats.
$ CALL UNPACK TAR.HLP;1 1326140103
$ create/nolog 'f'
X! MMS script for TAR, Tim Cook, 20-JUN-1989
X
X.OBJ.EXE :
X`009$(LINK) $(LINKFLAGS) $(MMS$SOURCE_LIST)
X
XLINKFLAGS = $(LINKFLAGS)/NOTRACE
X
XTAR_OBJECTS = tar.obj, tar_write.obj, tar_extract.obj, tar_list.obj, tarmsg.
Vobj
X
XMISC_OBJECTS = vcdefs.obj, dss.obj, libiferr.obj, libitmlst.obj, libparse.ob
Vj
X
XENVIRONMENTS = SYS$LIBRARY:STARLET.PEN, tar.pen, dss.pen, vcdefs.pen
X
XSTARLET_MLB = SYS$LIBRARY:STARLET.MLB
X
X! VAXCRTL.OPT should be a one-line file containing "SYS$SHARE:VAXCRTL/SHARE"
Xtar.exe :`009$(TAR_OBJECTS), $(MISC_OBJECTS), vaxcrtl.opt
X`009$(LINK) $(LINKFLAGS) $(TAR_OBJECTS), $(MISC_OBJECTS), vaxcrtl.opt/OPT
X
Xtar_write.obj :`009tar_write.pas, $(ENVIRONMENTS)
X
Xtar_extract.obj : tar_extract.pas, $(ENVIRONMENTS)
X
Xtar_list.obj :`009tar_list.pas, $(ENVIRONMENTS)
X
Xtar.obj, tar.pen : tar.pas, SYS$LIBRARY:STARLET.PEN, vcdefs.pen
X`009$(PASCAL) $(PFLAGS) $(MMS$SOURCE)
X
Xdss.obj, dss.pen : dss.pas
X`009$(PASCAL) $(PFLAGS) $(MMS$SOURCE)
X
Xvcdefs.obj, vcdefs.pen : vcdefs.pas, SYS$LIBRARY:STARLET.PEN
X`009$(PASCAL) $(PFLAGS) $(MMS$SOURCE)
X
Xtarmsg.obj :`009tarmsg.msg
X
Xlibiferr.obj :`009libiferr.mar, $(STARLET_MLB)
X
Xlibitmlst.obj :`009libitmlst.mar, $(STARLET_MLB)
X
Xlibparse.obj :`009libparse.mar, $(STARLET_MLB)
$ CALL UNPACK TAR.MMS;1 406675306
$ create/nolog 'f'
X`123 TAR.PAS -`009Manipulates Unix 'tar' format archive files.
X!
X! Abstract:`009A proggie to work with Unix 'tar' (Tape ARchive) files on
X!`009`009VMS.  Reads and writes files to/from a file 'TAR_ARCHIVE'
X!`009`009(if not specified differently on command line), so if the tape
X!`009`009drive is MOUNTed/FOREIGN/RECORD=512/BLOCK=10240 (tar default),
X!`009`009and pointed to by a logical 'TAR_ARCHIVE', tar will read from
X!`009`009the tape-drive.
X!
X! Copyright:`009Copyright 1989 Victoria College Computer Services.  See
X!`009`009AAAREADME.1ST for distribution rights.
X!___________________________________________________________________________
V_
X! Author:`009Tim Cook (timcc@viccol.edu.au)
X! Release:`009Version 1.1
X!___________________________________________________________________________
V_`125
X
X`091INHERIT ('SYS$LIBRARY:STARLET', 'VCDEFS'),
X   ENVIRONMENT ('TAR'),
X   IDENT ('T1.1')`093
X
XPROGRAM tar (input, output, archive, archive_temp) ;
X
X
X  CONST
X      record_size = 512 ;
X      tar_record_size = record_size ;
X      VMS_block_size = 512 ;
X      tar_multi_block_count = 32 ;`009`123 Maximum 127 `125
X      space = ' ' ;
X      null = chr (0) ;
X      lf = chr (10) ;
X      crlf = chr (10) + chr (13) ;
X      colon = ':' ;
X      dot = '.' ;
X      dollar = '$' ;
X      underscore = '_' ;
X      slash = '/' ;
X
X      tar_archive_kt = 'TAR_ARCHIVE' ;
X      input_filespec_default = '*.*;' ;   `123 Select only most recent versi
Von `125
X      dot_tar_kt = '.TAR' ;
X      dot_dir_1_kt = '.DIR;1' ;
X      lnm$file_dev_kt = 'LNM$FILE_DEV' ;
X      sys$scratch_kt = 'SYS$SCRATCH:' ;
X
X      archive_kt = 'ARCHIVE' ;
X      confirm_kt = 'CONFIRM' ;
X      filespec_kt = 'FILESPEC' ;
X      full_kt = 'FULL' ;
X      literal_kt = 'LITERAL' ;
X      map_mode_kt = 'MAP_MODE' ;
X      option_kt = 'OPTION' ;
X      output_kt = 'OUTPUT' ;
X      scan_kt = 'SCAN' ;
X
X   VAR
X
X   `123 VMS Error status codes for TAR `125
X
X   `123 Success `125
X      tar__created,
X      tar__createdir,
X      tar__written,
X      tar__appended,
X      tar__totcreat,
X      tar__totwrite,
X      tar__totappend,
X
X   `123 Informational `125
X      tar__empty,
X      tar__hardlink,
X      tar__softlink,
X
X   `123 Warning `125
X      tar__nofiles,
X      tar__wrapped,
X      tar__rectoolong,
X
X   `123 Error `125
X      tar__errcredir,
X
X   `123 Fatal `125
X      tar__parse,
X      tar__openin,
X      tar__close,
X      tar__createrr,
X      tar__badheader,
X      tar__badarchive,
X      tar__errread,
X      tar__errwrite,
X      tar__invtimzon,
X      tar__internerr
X         : `091EXTERNAL,VALUE`093 sts_type ;
X
X   TYPE
X      fab_rfm_type = `091BYTE`093 (undefined, fixed_length, variable_length,
X         variable_fixed_control, stream, stream_lf, stream_cr) ;
X
X      oat_8 = RECORD          `123 Octal Ascii, Terminated by space and null
V `125
X         value : PACKED ARRAY `0911..6`093 OF char ;
X         fill_space : char ;
X         fill_null : char END ;
X      tar_record_type = PACKED RECORD CASE integer OF
X0:(      name : PACKED ARRAY `0911..100`093 OF char ;
X         mode, uid, gid : oat_8 ;
X         siz, mtime : PACKED ARRAY `0911..12`093 OF char ;
X         chksum : oat_8 ;
X         linkflag : char ;
X         linkname : PACKED ARRAY `0911..100`093 OF char ;
X         filler : PACKED ARRAY `0911..175`093 OF char) ;
X1:(      data : PACKED ARRAY `0911..tar_record_size`093 OF char) END ;
X
X      file_mode_type = RECORD CASE integer OF
X0:(      value : unsigned) ;
X1:(      mask : PACKED ARRAY `0910..31`093 OF `091BIT`093 boolean) END ;
X
X      tar_record_ptr = `094tar_record_type ;
X      tar_file_type = FILE OF tar_record_type ;
X      tar_block_type = ARRAY `0911..20`093 OF tar_record_type ;
X      broken_time_type = lib_numtim_type ;
X      class_protection_type = PACKED RECORD
X         noread, nowrite, noexecute, nodelete : `091BIT`093 boolean END ;
X      file_protection_type = PACKED RECORD
X         system, owner, group, world : class_protection_type END ;
X      fixed_string_100 = PACKED ARRAY `0911..100`093 OF char ;
X      small_string = VARYING `09150`093 OF char ;
X      medium_string = VARYING `091256`093 OF char ;
X      filespec_type = medium_string ;     `123 1 > NAM$C_MAXRSS, but aligned
V `125
X      fixed_filespec_type = PACKED ARRAY `0911..256`093 OF char ;
X      large_string = VARYING `0914100`093 OF char ;
X      map_mode_type = (prefix_mode, absolute_mode, root_mode,
X         single_dir_mode) ;
X      match_node_type = RECORD
X         next : `094match_node_type ;
X         literal : boolean ;
X         string : fixed_filespec_type END ;
X      match_node_pointer = `094match_node_type ;
X
X   VAR
X      archive : tar_file_type ;
X      archive_temp : tar_file_type ;
X      output_filespec, archive_filespec : filespec_type ;
X      i, j : integer ;                       `123 miscellaneous counters `12
V5
X      last_char : integer ;                  `123 points to last char buffer
Ved `125
X      eof_mark_found : boolean ;             `123  by write_temp `125
X      archive_temp_open : boolean ;
X      confirm : boolean ;
X      match_node : match_node_pointer ;
X      match_all : boolean ;
X      option : small_string ;
X      opening_archive_input : `091VOLATILE`093 boolean ;
X      creating_archive_output : `091VOLATILE`093 boolean ;
X      inspecting_header : `091VOLATILE`093 boolean ;
X      full_archive_spec : `091VOLATILE`093 filespec_type ;
X
X      default_header : tar_record_type ;
X
X      UNIX_epoch_time : lib_date_type ;
X      delta_seconds : integer ;              `123 Delta time from GMT `125
X
X   VALUE
X      default_header := (0,
X         (100 OF null),             `123 name `125
X         ('   644', space, null),   `123 mode `125
X         ('     0', space, null),   `123 uid `125
X         ('     0', space, null),   `123 gid `125
+-+-+-+-+-+-+-+-  END  OF PART 2 +-+-+-+-+-+-+-+-

