From:	CSBVAX::MRGATE!@KL.SRI.Com:info-vax-request@kl.sri.com@SMTP  6-AUG-1987 23:09
To:	EVERHART
Subj:	VMS_SHAR Version 4 (2/2)

Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Wed 5 Aug 87 16:21:05-PDT
Received: by ucbvax.Berkeley.EDU (5.58/1.27)
	id AA21835; Wed, 5 Aug 87 09:46:24 PDT
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: 5 Aug 87 07:32:08 GMT
From: uunet!munnari!murdu!u3369429@seismo.css.gov  (Michael Bednarek)
Organization: I.A.E.S.R., Melbourne University
Subject: VMS_SHAR Version 4 (2/2)
Message-Id: <1284@murdu.OZ>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

[Continuation of VMS_SHAR]

$Part2:
$ File_is="VMS_SHAR.READ_ME"
$ Check_Sum_is=1127444719
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
XVMS_SHAR.READ_ME:
X
XVMS_SHAR is an attempt to provide a tool to package source modules for
Xmail transmission. It will package any number of files into a self-unpacking
Xprocedure. A number of steps are taken to insure file integrity.
X
XVMS_SHAR is convenient for applications consisting of a number of source
Xmodules, because they are automatically created at the receiver's end;
Xit is necessary because various mailers may mutilate source code,
Xe.g. split lines >80 characters, remove leading white space (the problem
Xof converting TABs to SPACEs is addressed in my procedure DETAB.COM).
X
XFeatures:
X o Through the use of SET SYMBOL/SCOPE=(NOLOCAL,NOGLOBAL) both VMS_SHAR
X   and the procedures created by it are very rubust against local
X   idiosyncrasies with symbols. Imagine a user who does: IF=="!" !
X o The resulting file gives the username of its creator and date/time
X   of creation. If the global symbol REAL_NAME exists, its content is
X   also displayed.
X o The resulting file contains a list of all its files.
X o At creation time, each line is preceded by character 'X' which is
X   removed at unpacking time. This is to preserve leading tabs/spaces
X   through various mailers.
X o Some mailers disallow postings above a certain size. VMS_SHAR will check
X   that the resulting file will not exceed MAX_PART_SIZE which is currently
X   set to 31 blocks (our mailer disallows postings >16000 characters).
X   If more than 31 blocks are to be posted, VMS_SHAR will create multiple
X   files by appending a 'part number' to the output file name.
X   If one single input file exceeds MAX_PART_SIZE the user will be notified,
X   and 'part number' will be incremented such that subsequent manual splitting
X   has free 'part numbers' available.
X o At both creation and unpacking time, each file is CHECKSUMmed; the result
X   of the comparison of both values is displayed to the user.
X o Signatures and such, which might occur at the end of each part, don't
X   need to be stripped. They are skipped by the unpacking procedure.
X o The created procedure will check for VMS version 4.4 or higher.
X
XAbout Version 2.00:
XMainly a cleaning-up re-write. Fixed the case where full pathnames were
Xgiven. Also checks now whether the output filename is among the input
Xfilenames.
XThe procedure now performs in two distinct steps:
X a) collecting file names and their size information,
X b) actually packaging the files.
XThis allows to include an indication of the number of parts at the top
Xof the resulting file. It also allows to omit part-suffixes if not required.
XHowever, under rare circumstances this might not work.
XOne condition which springs to mind where it doesn't work is:
XYou package two files, the first one 30 blocks, the second 1 block.
XLet's call the difference between 512 and the number of bytes which are
Xactually used in the first file's last block "spare bytes".
XIf the number of lines in the first file is greater than 512+"spare bytes",
Xthen VMS_SHAR will attempt to create a filename for part 2, but it has not
Xbeen properly initialised and will fail. Well, not really. It will complain
Xabout an unknown symbol "I", and will not append its version suffixes, but
Xwill still create the files, only using standard VMS version increments.
X
XAnother case which is insufficiently handled is when one single file
Xexceeds MAX_PART_SIZE. The whole numbering scheme gets out of kilter
Xand the packager is left with a renaming task.
X
XAbout Version 3.00:
XI had some discussions with usenet members, particularly with
XEd <MCGUIRE@GRIN2.BITNET> about trailing white space.
XHe suggested to use a length count at the beginning of each line, and to
Xsplit lines longer than 80 characters and restore them at the receiving site.
XI didn't follow that suggestion for three reasons:
X 1. The unix shar doesn't cater for this either.
X 2. It would have increased processing time a lot.
X 3. I didn't ever experience serious difficulties due to lost trailing
X    white space.
X
XHowever, it was Ed who came up with a method to use EDT to insert/remove
Xthose leading "X"s. As this turned out to be 3 times faster than my
Xprevious method (OPEN/READ/lexical function/WRITE) this was implemented
Xin version 3.00
X
XSome days later, after some more good arguments and examples from Ed:
XOK, I'm convinced that splitting lines is a good idea.
XHowever, this will take some time to implement as it needs to be done
Xin TPU and I'm a complete TPU agnostic. But that's what producing these
Xtoys is all about, no? Playful learning.
X
XThe created procedure will now have "Goto <next part>" at the end of
Xeach part and "Exit" as its last statement. This should take care of
Xsignatures which might occur at the end of each part.
X
X3.07 introduced usage of TPU to add/remove leading Xs. I'm slowly getting
Xon top of TPU.
X
XOn Version 4.00:
XAfter some further useful contributions from the net - esp. BERNIE@UMBC2.EDU
X(Bernie Duffy) - a line splitting feature was introduced. I.e. if a line is
Xlonger than 79 characters it gets split. However, if a line contains TABs
Xthis may not be sufficient. The only way out is to compensate for TABs,
Xassuming standard 8-column-TABs. However, I couldn't get TPU to search for
Xa TAB within a line. So you have to de-TAB the files before you feed them
Xto VMS_SHAR. I hope to be able to present a TPU-deTAB soon.
X
X05-Aug-1987, after some holidays (Cook Islands, great spot):
XNow, thanks to
X TOLLIVER%ORN.MFENET@NMFECC.ARPA (John Tolliver) and
X STRASSER@RSBS0.ANU (Mike Strasser) and
X MSIEWEKE@GTRI01@BITNET
XI know how to search for TABs within a line, but this was of course a
Xdead end street, as detabbing would mess up the checksums.
XSo instead, I came up with a TPU detabbing procedure, called DETAB.COM
$ GoSub Convert_File
$ Exit
