home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / vms_share / freeware_readme.txt next >
Text File  |  1998-12-15  |  17KB  |  4 lines

  1. JVMS_SHARE, UTILITIES, Pack multiple files into a form suitable for mailing              A B S T R A C TF  VMS_SHARE is designed to package a series of files into a multi-partH  share file suitable for mailing across a network. Files are encoded to?  be resistant to the corruption that many mailers and networksG  generate.  When all parts of the share file are combined and run as aD  command procedure, the packaged directory tree is recreated in its  original format.@  This software is copyright (C) of the author and comes with noH  warranties either expressed or implied.  It may be distributed free ofF  charge to anyone who may require a copy, provided that all copyrightG  notices remain intact. Any problems arising from its use are entirely!  the responsibility of the user.
  2.   Andy Harper  Systems Manager  Computing Centre  Kings College London   The Strand  London WC2R 2LS      England  Tel:  +44 (0) 71 873 2347.  E-mail:   UDAA055 @ UK.AC.KCL.CC.OAK (JANET)D            UDAA055%OAK.CC.KCL.AC.UK @ NSFNET-RELAY.AC.UK (INTERNET).            TECHNICAL INFORMATION ABOUT VMS_SHARE                                    Version 8.4                                    May 19931. INTRODUCTIONKVMS_SHARE is designed to package a series of files into a form that can be Leasily mailed across many different networks. Difficulties arise with doing Lthis because of the many and varied possibilities for corruption of data in Itransit.  For example, line wrapping, case folding, transposition of key characters etc.MVMS_SHARE encodes files before transmission so that these things may be kept @under control and proper restoral effected at the receiving end.KFor a given series of files to be packaged, VMS_SHARE combines them into a Osingle large 'text archive' file that can be unpacked into its component files Fsimply by running it as a command procedure at the receiving end. For Lconvenience, VMS_SHARE will optionally split the result into multiple parts Dthat can be individually mailed and recombined at the receiving end.MNOTE - VMS_SHARE is designed for Digital VAX or Alpha systems running the VMSKoperating system. It will not work on other operating systems/hardware, and3minimum operating system versions must be observed.2. WHAT VMS_SHARE DOES NOT DOLBecause VMS_SHARE relies on electronic mail to ship the files, there are no Jprotocols that can be used to check the accuracy of the received file(s). MThere is a reliance on the underlying mail system to get everything there in Kone piece and unchanged.  VMS_SHARE is unable to ask for retransmission of missing or damaged pieces.OVMS_SHARE should therefore be used to send files only via essentially reliable Omail systems which can get files, whose characters fall within certain bounds, 
  3. there intact.JVMS_SHARE is intended for sequential files only. Other file formats can beKpackaged into a backup saveset, whose file format is supported by VMS_SHARE<3. LIMITATIONS OF MAILERS AND HOW VMS_SHARE GETS AROUND THEMKVarious mail systems have different limitations within them. For instance, Othey will wrap or truncate lines that are too long, they may limit the size of Man individual mail message, they may transpose characters incorrectly if the Munderlying character set is different from the transmitter (ASCII/EBCDIC is agood example of this). IVMS_SHARE encodes the files in different ways to get around the problems.LPlease note however, that the encoding techniques are NOT foolproof. We haveJmerely tried to anticipate all possible corruptions and devise an encodingOscheme which ensures that the conditions under which corruption occurs does notOarise. If a form of corruption that has not been anticipated occurs, corruptionLto the transmitted files will be irreparable except through manual editing. "3.1 Maximum Size of a Mail MessageLMany mail systems cannot cope with single mail messages larger than a fixed Nnumber of bytes and will truncate messages or maybe even fail to deliver them  altogether.MThis is a real problem if a large software package is being sent.  VMS_SHARE Ktries to overcome this by splitting the packaged files into several parts, Keach part being smaller than some fixed size. By default, a part size of 30Bblocks is chosen; this can be overriden by defining a logical nameL(SHARE_PART_SIZE) or by a qualifier on the command line (/PART_SIZE=nn). ForLexample, we might send a  total of 300 blocks of code as 10 parts each of 30Mblocks or less. VMS_SHARE  will automatically split at the 30 block boundary.KIt should be noted that mail headers added on route can account for severalGblocks worth of extra space so this should be realised when setting themaximum part size.3.2 Maximum Line LengthMMany mail systems do not like lines longer than some fixed maximum length, a Nmaximum length of 80 characters is typical. This results in longer lines being7wrapped or truncated at seemingly arbitrary positions. NVMS_SHARE tries to cope with this by wrapping long lines itself and inserting Omarkers to allow them to be rejoined at the receiving end. What VMS_SHARE does Nis to prefix each line with a flag character. This flag character says EITHER J'this is the first part of a line' OR 'this line is a continuation of the previous line'.OThe maximum line size is configured into the code as a global value and  can beIeasily changed if required. It is not intended that this value should  be$altered by the average user however.3.3 Trailing BlanksKSome mailers interfere with blanks at the start and end of lines. VMS_SHARELencodes blanks (and tabs) as if they were troublesome characters (see below)Mto get around this. During unpacking of an encoded file, any blank characters are ignored.3.4 Escaped CharactersKUndoubtedly the biggest problem is that a mail message moving through many Ddifferent systems on route to the destination may undergo character Jconversions (for example - ASCII to EBCDIC if moving from VAX to an IBM). NUnfortunately, not all systems keep similar translation tables and characters Mcan get translated into something unexpected at the remote end. Culprits are Mcaret (^), tilde (~), square and curly brackets ( [ ] { } ) and a few others.GVMS_SHARE deals with this problem by replacing each of the troublesome Mcharacters - the ones mentioned above plus any non-printing character - by anOescape sequence. The escape sequence is recognized at the receiving end and is Ntranslated back to the original character.  Obviously, to work correctly, the Aescape sequence itself must be immune from translation problems. NThe escape technique used is to replace each character by a string of the formL`xx   where the ` symbol flags the start of an escape sequence and 'xx' is aF2-digit string which is the hexadecimal form of the ASCII code for theLcharacter. Naturally, the ` character itself must be escaped in this form toKavoid confusion. For example, a space would be replaced by  `20   and a tab    by  `09. %3.5 Additional Compression TechniquesLTwo additional forms of character encoding can be optionally selected by theNuser to reduce the size of the packaged data - either run-length encoding or a(modified form of Lempel-Ziv compression.NA file compressed with one of these options will be automatically decompressedDwhen unpacked. It is not necessary for the recipient to use externaldecompression tools.3.5.1 Run-Length EncodingOA form of run length encoding is used to encode sequences of the same characterIinto a 5 character sequence. In this instance, the generated sequence is:   &nnXXDwhere & is the run length sequence flag, nn is the count (in hex) ofNcharacters, and ZZ is the hex code of the ascii character.  For example, a runHof 15 spaces would be replaced by  &0F20 (`0F' = 15, `20' = hex code forspace).GThe use of run length encoding dramatically increases the time spent onOencoding the files. In many cases, it will be of no benefit. Because of this itis not active by default.3.5.2 Lempel-Ziv CompressionKThe Lempel-Ziv algorithm scans for common substrings in a file and replacesIthem by a pointer back to a previous occurrence within the file. For thisOimplementation, a number of changes have been made to the basic idea to fit theOrestrictions of the TPU utility, and the line wrapping and quoting schemes used,for long lines and non-printable characters.IThe file is scanned for the longest previously occurring substring and is+replaced by an escape sequence of the form:   \bbllIwhere \ is the flag to indicate an lz encoded string, bb is a 2 digit hexLencoded backwards count to the start of the original string, and ll is a twoJdigit hex encoded length. Because of the 2 digit hex encoding, the maximumIbackwards search distance is 255 bytes and the maximum length is also 255Nbytes. Therefore up to 255 bytes can be compressed to a 5 char sequence in theKoptimal case. In practice, compression ratios are nothing like as dramatic.FThis form of compression is very slow in operation due to the repeatedOsearching for substrings that have previously occurred. Some optimisations haveHbeen made to the searching but it should still be selected only if it iscertain to be of some benefit.*3.6 Detecting Damaged Files with ChecksumsOIn cases where some corruption occurs despite the encodings used by VMS_SHARE, Ndetection of damage (BUT NOT REPAIR!) should be possible because each file is @checked for accuracy using a checksum once it has been unpacked.HVMS_SHARE uses the currently undocumented CHECKSUM command to produce a Kchecksum value for the source file. This checksum is carried across in the Opacked share file and checked when the file is restored. A failed match causes Ka message and the receiver can take action to try to locate and repair the damage.The DCL command:     $ CHECKSUM filenameEwrites the checksum value into a DCL symbol called CHECKSUM$CHECKSUM.HThe CHECKSUM command does not work with files that have certain types ofNrecords (specifically, those with an MRS value of 0 and records exceeding 2048Mbytes). Therefore, VMS_SHARE cannot verify such files. Unfortunately, for theOsame reason, VMS_SHARE is unable package such files at all, so an error message"is issued and the file is skipped.4. VMS_SHARE IMPLEMENTATIONNVMS_SHARE is provided as a combination of DCL and TPU code in order to ensure Kthat it will run on any VMS system.  A specific program would be faster of .course but then portability is not guaranteed.EThe DCL part of the software is used merely to pick up parameters andJqualifiers, and parse filenames, passing them to the TPU code in a scratchfile.HThe TPU code does the hard work of packaging the files, wrapping lines, Nescaping characters, compressing if requested,  and generating multiple parts.OAs distributed, the DCL and TPU code are bundled into a single large procedure Obut there is no reason why the TPU code could not be extracted and made into a Fsection file for enhanced speed. The modifications required are quite straightforward.4.1 Long LinesEBecause the code is based upon TPU, some limitations are imposed uponKVMS_SHARE. In particular, early versions of TPU (pre-VMS 5.4 on VAX) do notHallow records longer than 960 bytes so it is impossible to package them.HVersions of TPU at VMS 5.4 and beyond (VAX) or any OpenVMS (Alpha) allowCrecords up to 65535 bytes, so the problem virtually disappears. ForMcompatibility, VMS_SHARE still uses the old record length unless requested byMthe user with the /LONGLINES qualifier. Use of this requires a minimum VMS ofO5.4 (VAX), or any OpenVMS (Alpha) and the generated share file will unpack only4on VMS 5.4 or greater (VAX), or any OpenVMS (Alpha).LTPU file handling is limited. Files can only be written with variable lengthGrecords and CR carriage control. To allow other formats to be packaged,NVMS_SHARE encodes selected file record attributes into the share file and usesNthe CONVERT utility to restore those attributes during the unpacking phase. InJprinciple, this allows VMS_SHARE to package files of most types, includingL.EXE, .OBJ and .BCK files. In the case of .BCK files, this is subject to theOBACKUP block length being compatible with the maximum record length selected byOthe user (960 or 65535 as appropriate). Allowing BACKUP savesets to be packagedNallows files of all other types to be packaged, provided they are first storedOin a saveset. BACKUP requires a minimum block length of 2048 bytes, so the long)line support is a pre-requisite for this.4.2 Part Size DeterminationMThe size of a part is conceptually simple. Find the size of a buffer in bytesNand divide by 512 to get the number of blocks it will occupy. However, this iscomplicated by several things.LFirst, TPU does not count line ends when returning the `LENGTH' of a buffer.LSecond, when a buffer is written to disk, there is a 2 byte overhead on eachNrecord giving the length of the record. Finally, within a disk block, a recordKalways starts on a word boundary so that some records may be padded with anadditional null byte.OTo accurately determine how much disk space a buffer would occupy would involveOsome complex computations. However, since we know that each record has either aM2 byte or a 3 byte overhead we can get a reasonably accurate approximation byLtaking the LENGTH of the buffer and adding 3 bytes for each record. We use 3Kbytes to allow for the worst case and ensure that the part, when written toOdisk, never exceeds the specified part size. In practice, this means that partsMwill sometimes be less than the part size - the discrepancy grows as the partsize is increased.5. USING VMS_SHAREGAs distributed, VMS_SHARE is run as a command procedure (usually via a -suitable symbol set up to point to it) thus:-%     $ @VMS_SHARE filespecs sharefileJwhere 'filespecs' is a comma separated list of wildcarded filenames to be Mpackaged, and 'sharefile' is the name to be given to the packaged files. EachDpart of the sharefile will be suffixed by a part number in the form:    nnn-OF-mmmBwhere nnn is the part number and mmm is the total number of parts.>There are some restrictions on the filenames that can be used:L     - Subdirectories may be used provided that they are beneath the currentL       directory. It is not permitted to package files in other directories.K     - At least one valid file must be given in 'filespecs' or no sharefile       will be produced.6. UNPACKING A VMS_SHARE FILENIn general, a package delivered using the VMS_SHARE software will arrive in a Nnumber of parts, from 1 up to 'n'.  All parts should be concatenated together Oin order. It is NOT necessary to remove superfluous mail headers from any part )other than part 1 prior to concatenation.NThe resulting combined file should then be executed as a command procedure in $order to unpack the resulting files.6.1 Typical Unpack Sequence,A typical sequence of events goes like this:D - Set your default directory to a scratch directory which is empty.E - Go into MAIL and select the folder which contains the parts of the    package.O - Extract part 1 into a file, using the command 'EXTRACT/NOHEADER        file'O   Extract part 2 into a file, using the command 'EXTRACT/NOHEADER/APPEND file'   ...   ...O   Extract part n into a file, using the command 'EXTRACT/NOHEADER/APPEND file'* - Read warning below BEFORE proceeding!!!? - Execute as a command procedure, using the following command:
  4.       $ @file 6.2 WarningNIt is strongly suggested that the generated command procedure ('file.SHAR' in Nthe above example) be carefully checked before execution. It is possible that Hunscrupulous persons might tamper with the source before sending it and Mintroduce a virus into the VMS_SHARe'd code. There is nothing that VMS_SHARE Ncan do about this automatically. However, since all the files should be human Lreadable it should be possible to detect fraudulent code by manual checking.HCertainly the lines starting with '$' symbols, and the TPU code near theNstart, should be checked carefully as these are most likely to be troublesome.7. DECLARATION AND DISCLAIMERLThis software is in the public domain and may be freely distributed without Hcharge as required. However, all copyright notices and references to the*author in the source must be left intact. KThird party modifications may be made to the source but any errors arising ?from their use are entirely the responsibility of the modifier.MThe author accepts no responsibility for the suitability of this software forFany specific purpose. Any errors arising from its use are entirely theresponsibility of the user.  Andy HarperKings College London UK