From:	ADVAX::"mcnc!CUNYVM.CUNY.EDU!MAILSERV%FRSIM51.BITNET" 22-FEB-1991 11:36:54.01
To:	ARISIA::EVERHART
CC:	
Subj:	MAEVA:[MAILSERV.PUB.VMSTAR]VMSTAR.SHARE_1;5

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Fri, 22 Feb 91 11:35:56 EST
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA25766 for ; Fri, 22 Feb 91 11:27:24 -0500
Received: from CUNYVM.CUNY.EDU by mcnc.mcnc.org (5.59/MCNC/6-11-90)
	id AA17341; Fri, 22 Feb 91 10:12:58 -0500
	for ARISIA.DNET.ge.com!EVERHART
Message-Id: <9102221512.AA17341@mcnc.mcnc.org>
Received: from FRSIM51.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.2.2MX) with BSMTP id 5122; Fri, 22 Feb 91 10:13:18 EST
Date: 22 FEB 91 16:09:44.14-WET
From: mcnc!CUNYVM.CUNY.EDU!MAILSERV%FRSIM51.BITNET
Subject: MAEVA:[MAILSERV.PUB.VMSTAR]VMSTAR.SHARE_1;5
To: ARISIA::EVERHART
 
$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
$!   On 13-FEB-1991 19:05:32.38   By user FAUCONNET
$!
$! This VMS_SHARE Written by:
$!    Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$!    James Gray       - Original VMS_SHARE
$!    Michael Bednarek - Original Concept and implementation
$!
$!+ THIS PACKAGE DISTRIBUTED IN 4 PARTS, TO KEEP EACH PART
$!  BELOW 30 BLOCKS
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$!       1. AAAREADME.TXT;6
$!       2. VMSTAR.C;45
$!       3. VMSTAR.HLP;9
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error  ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
"output_file"));ENDPROCEDURE;Unpacker;QUIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create 'f'
X        General information
X        -------------------
X
XVMSTAR  is  a  TAR  reader/writer  for  VMS.  It can read archives ("tarfile
Vs")
Xcreated  by  the Un*x command "tar" and also create such archives. Tarfiles
V can
Xbe disk files or directly on tape.
X
XVMSTAR is based on the TAR2VMS and VMS2TAR programs written by:
X
XSid Penstone,
XVLSI Group,
XDepartment of Electrical Engineering,
XQueen's University,
XKingston, Ontario, Canada, K7L3N6
Xphone (613) 545-2925
X
XBITNET:         PENSTONE@QUCDNEE1       (Preferred)
X                PENSTONE@QUCDN  (If the other doesn't work)
X
XThe extra work has been done by:
X
XAlain Fauconnet
XSIM/INSERM U194         (complete address at the end of this file)
XPARIS - FRANCE
X
XBitnet: FAUCONNE@FRSIM51
X
XTAR2VMS and VMS2TAR have been merged into a  single  program.  I  made  seve
Vral
Ximprovements, bug fixes and message cleanup. For those  who  know  TAR2VMS
V  and
XVMS2TAR, the main differences are:
X
X- everything is now in a single program that can be used for extracting file
Vs
Xfrom tar archives, listing the contents of tar archives or creating them.
X
X- VMSTAR now accepts a `60f tarfile' option to explicitely specify the tarfi
Vle
Xname (either a VMS file name or a VMS device name).
X
X- if this option is not used, the logical name "$TAPE" is translated.
X
X- checksums are verified at file extraction.
X
X- VMSTAR will extract files from archives as VMS rfm=stream_lf, rat=cr files
V,
Xexcept if new option `60b' is specified. In this case, extracted files ared
Xcreated as rfm=fixed, mrs=512, rat=none i.e. suitable for compressed files t
Vo
Xbe decompressed using LZDCMP or for VMS images.
X
X- VMSTAR has a more Un*x-like syntax, if several file names are specified as
Xcommand line parameters they must be separated by spaces (not commas) and th
Vere
Xis not context propagation "a la BACKUP".
X
X- VMSTAR allows VMS-style wildcarded strings for Un*x-style file  names  to
V  be
Xspecified when extracting from a tar archive, e.g. :
X
X$ tar xvf foo.tar */source/*/sa%%%.c
X
X- VMSTAR will attempt to create relative tar archives i.e. archives where
Xfilenames are recorded as "./foo/bar/baz" whenever possible. This can be
Xspecifically avoided by having a device name in file name argument, e.g. :
X
X$ tar cvf foo.tar DISK$USERS`5B...`5D*.c
X
Xor specifying an absolute VMS file specification, e.g. :
X
X$ tar cvf foo.tar `5BSMITH.C...`5D
X
X- VMSTAR will handle tar archives which when restored would create more than
V 8
Xlevels of directories (the X11 distribution from MIT for instance !). Excess
Vive
Xlevels of directories will be resolved as follows:
X
Xd1/d2/d3/d4/d5/d6/d7/d8/d9/foo -> `5BD1.D2.D3.D4.D5.D6.D7.D8$D9`5DFOO
X
X- VMSTAR no longer requires the creation of an intermediate scratch file whe
Vn
Xarchiving text files as VMS2TAR did.
X
X- VMSTAR does *not* allow to read tarfiles past the EOF mark as TAR2VMS did.
X
X- the `60w' option (same as "/CONFIRM" for VMS commands) has been implemente
Vd for
Xcreate archive and extract functions.
X
X- VMSTAR has a VMS help file (VMSTAR.HLP) that can be added to your HELPLIB.
VHLB
Xto provide online help.
X
X- many other differences, the code has been extensively reworked with
Xsimplification as a goal. This probably caused the introduction of some bugs
V...
X
X
X        Build and installation instructions
X        -----------------------------------
X
XCompile and link VMSTAR.C as follows:
X
X$ CC VMSTAR
X$ LINK VMSTAR,SYS$INPUT:/OPT
XSYS$SHARE:VAXCRTL/SHARE
X<CONTROL-Z>
X
XDefine a foreign command symbol in SYLOGIN.COM:
X
X$ VMSTAR :== $ <wherever>VMSTAR
X
XI used VAX/VMS C V3.1 to build VMSTAR. I have no idea whether it can be buil
Vt
Xusing other versions or other compilers...
X
XYou can optionally add VMSTAR in your VMS help library as follows:
X
X$ LIBRARY/HELP/INSERT SYS$COMMON:`5BSYSHLP`5DHELPLIB.HLB VMSTAR.HLP
X
X        Usage
X        -----
X
X        tar x`7Ct`7Cc`5Bv`5D`5Bw`5D`5Bb`5D`5Bd`5D`5Bf tarfile`5D `5Bfile `5B
Vfile...`5D`5D
X        x - extract from tarfile, create VMS files
X        t - type directory of tarfile
X        c - create tarfile, archive VMS files
X        v - verbose (list names of files being archived/extracted)
X        w - wait for confirmation before extracting/archiving
X        b - binary mode extract, create (rfm=fixed, rat=none, mrs=512) files
X        d - keep trailing dots in file names
X        f - specify tarfile name, default is $TAPE
X        file - space-separated list of file names, can include VMS-style
X               string wildcards on extract, can be any VMS file name
X               specification (except DECnet) on create archive.
X
X
XTapes for reading/writing of tarfiles should be mounted
X/FOREIGN/RECORD=512/BLOCK=10240
X
XExample:
X
X$ MOUNT/FOREIGN/RECORD=512/BLOCK=10240 MUA0: "" $TAPE
X$ VMSTAR XV
X
X        Restrictions
X        ------------
X
XBecause of diffrences in the Un*x and VMS filesystems, some files may  fail
V  to
Xbe correctly  transferred  to/from  the  tarfile.  This  can  be  caused  by
V  :
X
X- restrictions in VMS file naming scheme: extra dots in file names will be
Xmapped to underscores, dummy directory names will be generated if archive
Xcontains more than 8 levels of subdirectories, links are extracted as empty
Xfiles containing only a short message "this file is only a link to...", all
Xfile names are mapped to uppercase etc.
X
X- restrictions of the Un*x filesystem: tar will only get the latest version
V of
Xa VMS file to enter it into the archive, no trace of the orginal file device
Xname is kept in the archive.
X
X- VMS strong file typing: VMSTAR can only safely tranfer back and forth`20
XVMS "text" files (rfm=vfc or stream_lf with rat=cr) or VMS fixed size record
V,
X512 bytes/record, rat=none files (e.g. .EXE image files).
XVMSTAR will skip other file types (this includes .OBJ and library files,
Xthey *can't* be archived).
X
XOther restrictions:
X
XRMS file attributes are lost in the archive process, text files are archived
V as
X<record><LF><record><LF>, fixed files are archived as is.
X
XVMSTAR  will always restore files relative to your current RMS default if na
Vmes
Xin  tarfile do not begin by `60/'. If file names in tarfile begin with a `60
V/' (bad
Xpractice), an attempt will be made to restore files to the absolute path. Th
Vere
Xis currently no way to explicitely specify the target VMS directory where fi
Vles
Xshould be extracted.
X
XNo  attempt  has  been  made to handle search list as RMS defaults (e.g. SYS
VTEM
Xaccount). Be very careful about that.
X
XThe  current  version  of  VMSTAR  has  *not*  been  fully  tested.  I proba
Vbly
Xintroduced  many  bugs  not  existing  in  Sid  Penstone's  programs. VMSTAR
V is
Xprovided "as-is", I cannot guarantee it will do what you want or even what i
Vt's
Xsupposed  to  do  but  I'd  like  to hear about it if you have problems. If
V you
Xreport  a  problem,  don't  bother  with  providing me a fix but *do* try to
V be
Xprecise on what happened and how it happened.
X
X
X+-------------------------------------------------------------------------+
X`7C  Alain ("HAL 1") Fauconnet   Research laboratory in medical informatics
V `7C
X`7C  System Manager              (expert systems, NL proc., statistics...)
V  `7C
X`7C  SIM/INSERM U194             EARN/Bitnet:       FAUCONNE@FRSIM51
V        `7C
X`7C  Faculte de Medecine         VMS PSI Mail: PSI%+208075090517::FAUCONNET
V `7C
X`7C  91 Boulevard de l'Hopital   FAX:          (+33) 1-45-86-56-85
V          `7C
X`7C  75634 PARIS CEDEX 13 FRANCE PTT net:      (+33) 1-45-85-15-29
V          `7C
X`7C  "HAL... open the door, please!" (2001 Space Odyssey)
V                   `7C
X`7C  Disclaimer: This is machine-generated random text, no meaning at all.
V  `7C
X+-------------------------------------------------------------------------+
$ CALL UNPACK AAAREADME.TXT;6 1634315948
$ create 'f'
X/*
X *`09VMSTAR.C - a Un*x-like tar reader/writer for VMS
X *`09           based on TAR2VMS and VMS2TAR
X *
X * Usage:
X * `09tar x`7Ct`7Cc`5Bv`5D`5Bw`5D`5Bb`5Bd`5D`5D`5Bf tarfile`5D `5Bfile `5Bfi
Vle...`5D`5D
X *`09x - extract from tarfile
X *`09t - type contents of tarfile
X *`09c - create tarfile, archive VMS files
X *`09v - verbose
X *`09w - wait for confirmation before extracting/archiving
X *`09b - binary mode extract, create (rfm=fixed, rat=none, mrs=512) files
X *`09d - keep trailing dots in file names
X *`09f - specify tarfile name, default is $TAPE
X *`09file - space-separated list of file names, can include VMS-style
X *`09       string wildcards on extract, can be any VMS file name
X *             specification (except DECnet) on create archive.
X *
X * Original author of the VMS2TAR and TAR2VMS programs:
X * Copyright 1986, Sid Penstone,
X *  Department of Electrical Engineering,
X *  Queen's University,
X *  Kingston, Ontario, Canada K7L3N6
X * (613)-545-2925
X * BITNET:   PENSTONE@QUCDNEE1
X *
X * Deeply modified by:
X * Alain Fauconnet
X * System Manager
X * SIM - Public Health Research Laboratories
X * 91 Boulevard de l'Hopital
X * 75634 PARIS CEDEX 13 - FRANCE
X * Bitnet: FAUCONNE@FRSIM51
X *
X * PROBLEMS SHOULD BE REPORTED TO ME. PLEASE DON'T BOTHER SID PENSTONE
X * WITH MY OWN BUGS !
X *
X * Version 1.4 13-FEB-1991
X * Based on TAR2VMS V2.2 21-OCT-1986 and VMS2TAR V1.8 23-DEC-1986
X *
X * Sid Penstone did not include any copyright information in his program so
X * this only applies if Sid Penstone agrees: you may use VMSTAR, distribute
V it,
X * modify it freely provided you don't use it for commercial
X * or military purposes. Please include the two above author names in the
X * source file of any modified version of VMSTAR.
X *
X * Modification history:
X * 1.4`09- fixed a bug in scan_title that caused VMSTAR to fail on
X *`09  extraction of absolute tarfiles (thanks to Tom Allebrandi
X *`09  for this one)
X *`09- added some code in scan_title to correctly handle dots in
X *`09  directory names found in tarfile (replaced by "_")
X * 1.3  - changed tar2vms to use standard IO calls (fopen, fread) to
X *        read input tarfile in binary mode i.e. no translation of
X *        RMS record attributes done by C RTL. This fixes problem reading
X *        tarfiles created with rfm=fix, rat=cr
X *      - more room for file size in output formats
X * 1.2  - fixed bug in out_file not closing input VMS file, limited
X *        maximum number of files archived to FILLM quota
X *      - added mapping to underscores of some more characters found
X *        in Un*x file names illegal in VMS file names
X * 1.1  - reworked handling of current VMS default
X *      - will now create *relative* tarfiles (i.e. files known
X *        as "./..." in tar archive directory) except when
X *        device name is specified or wilcard search gives filenames
X *        located above current default (tar cvf foo.tar `5B-...`5D*.* will
X *        lead to this kind of situation)
X *      - attempt to handle more than 8 levels of directories upon
X *        extract : .../d7/d8/d9 will be mapped to `5B...D7.D8$D9`5D
X *      - greatly simplified make_new() because mkdir() creates
X *        intermediate levels of directories if missing
X * 1.0`09Original version from Sid Penstone's code
X *`09- merged VMS2TAR & TAR2VMS into a single source file
X *`09- code reworked, messages cleaned up
X *`09- added support for 'f tarfile' option, changed default to $TAPE
X *`09- added support for VMS style wildcard file names on extract
X *`09- added support for 'b' (binary file extract) option
X *`09- suppressed usage of intermediate scratch file for create operation
+-+-+-+-+-+-+-+-  END  OF PART 1 +-+-+-+-+-+-+-+-
