home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!seismo!sundc!pitstop!sun!amdcad!ames!ll-xn!husc6!spdcc!m2c!necntc!ncoast!allbery
- From: kvancamp@ARDEC.arpa (Kenneth Van Camp -FSAC-)
- Newsgroups: comp.sources.misc
- Subject: ALEX part 2/2 (MS-DOS library exchange program)
- Message-ID: <4768@ncoast.UUCP>
- Date: 29 Sep 87 20:28:05 GMT
- Sender: allbery@ncoast.UUCP
- Lines: 671
- Approved: allbery@ncoast.UUCP
- X-Archive: comp.sources.misc/8709/alex/2
-
- #--------------------------------CUT HERE-------------------------------------
- #! /bin/sh
- #
- # This is a shell archive. Save this into a file, edit it
- # and delete all lines above this comment. Then give this
- # file to sh by executing the command "sh file". The files
- # will be extracted into the current directory owned by
- # you with default permissions.
- #
- # The files contained herein are:
- #
- # -rw-r--r-- 1 allbery System 33251 Sep 29 16:11 alex.doc
- # -rw-r--r-- 1 allbery System 1644 Sep 29 16:11 undigest.c
- #
- echo 'x - alex.doc'
- if test -f alex.doc; then echo 'shar: not overwriting alex.doc'; else
- sed 's/^X//' << '________This_Is_The_END________' > alex.doc
- X ALEX USER'S GUIDE (VERSION 1.2)
- X ===============================
- X
- X Alex [Automatic Library EXchange] is a program that allows
- Xautomatic transfer of groups of files (either ASCII or binary) via
- Xelectronic mail. Some assumptions are made in the discussion below:
- X o You are using the Msg (mmdf) or Mailx electronic mail systems.
- X o Alex has already been installed on your Unix system.
- X o You are able to log in to the electronic mail system from your
- X personal computer (PC), using communications software.
- X o Your communications software supports the Kermit file transfer
- X protocol. This is definitely true if you are using the public
- X domain Kermit program, and may or may not be true if you are
- X using a commercial communications program. Note that the
- X popular Crosstalk XVI (running on the IBM PC, Wyse PC and
- X compatibles) DOES support the Kermit file transfer protocol.
- X Also note that Syterm, which is used widely here at ARDEC, does
- X NOT support Kermit and therefore cannot be used in conjunction
- X with Alex.
- X
- X This user's guide explains everything you need to know to be
- Xable to use Alex. It goes through the steps in excruciating detail,
- Xand more advanced users may want to skip some of the discussion.
- XFor these people, I recommend skipping the download discussion
- Xbecause it is very simple (and explained in much shorter terms in the
- Xman page -- type 'man alex' on your Unix system). They may proceed
- Xdirectly to the section on Uploading.
- X Keep in mind that this documentation details the use of Alex
- Xunder BOTH Msg and Mailx. These are two different electronic mail
- Xprograms in use at ARDEC. If you are using Msg, please ignore all
- Xreferences to Mailx. Of course, if you are using Mailx, ignore all
- Xreferences to Msg.
- X
- XUSING ALEX TO DOWNLOAD:
- X If you receive a library of files that was sent from someone else
- Xusing Alex, you must use Alex to download the files to your PC. The
- Xdiscussion below assumes you are using one of the U.S. Army electronic mail
- Xsystems, Msg or Mailx; instructions on other mail systems may vary.
- X When you are in Msg or Mailx and get a message telling you that an
- XAlex-encoded library has been sent, the first thing you must do is
- Xdetermine the message number of the library. Usually, the sender will
- Xsend you two messages: a cover letter and the library. Since they are
- Xusually sent in rapid succession, chances are good that the library
- Ximmediately follows the cover letter in your mailbox. To be certain,
- Xhowever, you should print out the headers of all your messages. To do
- Xthis in Msg, type the letter 'h' (the word 'headers' will appear),
- Xfollowed by the letter 'a' (the word 'all' will appear), followed by
- Xa carriage return. To print out the headers in Mailx, just type 'h'.
- X When you see the list of headers, you should look for the
- Xlibrary. It usually has the same subject header and sender as the
- Xcover letter. Note the message number to the left of the library
- Xmessage.
- X Msg users may now type the letter 'l' (the word 'list' will appear),
- Xfollowed by the message number you just noted, and a carriage return. Msg
- Xshould respond with:
- X To file/pipe:
- XWhen you get this prompt, you should type:
- X | alex
- XNote that the vertical bar in the line above is called a 'pipe symbol',
- Xand is not to be confused with the letter 'l' or the number '1'. It is
- Xa unique symbol which you should be able to locate somewhere on your
- Xcomputer keyboard. Follow this line with a carriage return.
- X Mailx users can accomplish the same thing by typing
- X'|<message #> alex' (without the quotes). For instance: |2 alex
- Xwill pipe message number 2 to Alex.
- X At this point, you have invoked Alex. After a pause (not usually
- Xmore than 30 seconds), you will get more information from Alex. First,
- Xyou will see a message similar to the following:
- X
- X The following files are ready for downloading.
- X Times given are estimated transmission times, in minutes, to send files
- X to your PC. If you are directly connected to the Sytek cable network,
- X use the T9600 numbers. If you are using a 1200 baud modem, use T1200.
- X If you are using a 4800 baud modem, use T4800, etc.
- X
- X Filename Size T1200 T2400 T4800 T9600
- X ======================================================
- X ed.def 97 0.0 0.0 0.0 0.0
- X ed.dir 1642 0.5 0.2 0.1 0.1
- X ed.exe 98644 27.4 13.7 6.9 3.4
- X ed.hlp 50522 14.0 7.0 3.5 1.8
- X ed.spc 784 0.2 0.1 0.1 0.0
- X ed.trs 1837 0.5 0.3 0.1 0.1
- X getyn.com 97 0.0 0.0 0.0 0.0
- X go.bat 12 0.0 0.0 0.0 0.0
- X order 1147 0.3 0.2 0.1 0.0
- X pcwmouse.def 2514 0.7 0.3 0.2 0.1
- X pcwmouse.doc 874 0.2 0.1 0.1 0.0
- X pcwmouse.msc 4575 1.3 0.6 0.3 0.2
- X pr.exe 45656 12.7 6.3 3.2 1.6
- X quicks.me 962 0.3 0.1 0.1 0.0
- X read.me 1503 0.4 0.2 0.1 0.1
- X story 1148 0.3 0.2 0.1 0.0
- X workdisk.bat 3278 0.9 0.5 0.2 0.1
- X ------------------------------------------------------
- X total 215292 59.8 29.9 15.0 7.5
- X
- XIn this example, 17 files had been sent in the Alex library and were now
- Xready for transmission to the user's PC. The first column of the table
- Xlists the names of all the files. The second lists the file sizes, in bytes
- X(the number of characters in the file, approximately). The last four
- Xcolumns are just to help you estimate how long it will take to transmit all
- Xthe files to your PC. These times are listed in minutes, and are the result
- Xof a simple calculation based on something called a "baud rate", or
- Xtransmission rate. Only one of these last four columns applies to you,
- Xdepending on what baud rate your PC is operating at. If you are operating
- Xat 9600 baud, then you should look at the column labeled "T9600". If you
- Xare operating at 1200 baud, then look at the column marked "T1200", etc. If
- Xyou are unsure, then chances are you are probably operating at 9600 baud.
- X(This is the standard rate used on the ARDEC Sytek cable network.)
- X At the bottom of the table is the total number of bytes of all
- Xthe files, and their estimated total transmission times. This will tell
- Xyou roughly how long your PC will be tied up while the files are
- Xtransmitted. Keep in mind that this is just an estimate, and that actual
- Xtimes will vary (by as much as a factor of 2).
- X Finally, after the table, you will see this message:
- X
- X In a moment, you will see a few meaningless characters at the bottom
- X of your screen. When this happens, start up the Receive Kermit on your PC.
- X
- X Now you are ready to begin receiving the files that Alex is ready to
- Xtransmit. To do this, you must tell your PC to begin receiving files using a
- Xprotocol known as "Kermit". The actual process of starting up the Receive
- XKermit depends upon the communications software you are using. Here are
- Xinstructions for doing this on a couple of the popular software packages.
- XIf you do not have one of these, please consult your communications software
- Xdocumentation or your system guru, or send mail to <msdos-request@ARDEC> and
- Xwe will try to help you.
- X
- X CROSSTALK XVI USERS
- X ===================
- X If you are using Crosstalk XVI, starting up Receive Kermit is
- Xeasy. The first key you must press is known as the 'Attention' key.
- XWhen Crosstalk is sold, the 'Attention' key is defined to be the
- X<Esc> key. However, it is possible to redefine this key to be virtually
- Xanything on your keyboard. This is commonly done with Unix users, since
- Xthe <Esc> key is required for other purposes. A common way to redefine
- Xthe 'Attention' key is as <PgUp> (on the numeric keypad). The actual
- Xkey set on your version is shown at the lower left corner of your screen
- Xwhen Crosstalk is invoked. For instance, it might say 'PgUp for ATtention'
- Xif the <PgUp> key is to be used.
- X Whatever your 'Attention' key is, press it. Crosstalk should
- Xthen ask for your Command on the bottom line of the screen (the bright
- Xline -- also called the Status line). You should type in the letters RK
- X(short for Receive Kermit) and a carriage return.
- X The rest is automatic. Crosstalk should respond by placing a
- Xsmall rectangular box at the bottom of the screen that shows the status
- Xof the file transfers. If more than one file existed in the library, you
- Xwill get a new box for each file. When the file transfer is complete,
- Xyou will have copies of all the files on the disk of your PC. (If you
- Xuse subdirectories, the files will be in the same directory as Crosstalk.)
- XYou will be automatically returned to communications with the Unix system
- Xcomputer when the transfer is complete. You will be back in Msg or Mailx
- Xwhere you left off.
- X
- X KERMIT USERS
- X ============
- X If you are using the public domain Kermit program on the IBM PC,
- XWyse PC, or compatible, the instructions for starting up the Receive
- XKermit are as follows. First, you must hit the "escape character" on your
- Xversion of Kermit. Note that this is NOT usually the key marked <ESC>
- Xon your keyboard. "Escape character" is probably a poor choice of words,
- Xbut that's what they call it. It is probably better called the Attention
- Xcharacter, like Crosstalk calls it. At any rate, the "Escape character" in
- XKermit is usually defined to be <Ctrl>] (hold the Control key down and
- Xstrike the right-bracket key at the same time). It may be defined
- Xdifferently on your version, but this seems to be fairly rare. (If you want
- Xto be sure, just look at the status line at the bottom of your screen. At
- Xthe left it probably reads:
- X Esc-chr: ^]
- Xand some other things after that. The ^] is just a shorthand notation for
- X<Ctrl>].
- X After you hit <Ctrl>] (or whatever your escape character is),
- Xthe status line at the bottom of your screen should disappear. Now type
- Xthe letter 'c', and you should receive the prompt:
- X Kermit-MS>
- XNow type in the word 'receive' (minus the quote marks, of course) and
- Xhit a carriage return. Your screen will clear and be replaced by a status
- Xscreen that shows how the transfers are progressing and the names of the
- Xfiles transferred. When the transfer is complete (which may take a while,
- Xdepending on the size of the library), you will hear a beep and be returned
- Xto the Kermit-MS> prompt. Now you should type the letter 'c', followed by a
- Xcarriage return. You will be back in Msg or Mailx where you left off.
- X
- X ALL USERS
- X =========
- X Now that you have received all the files in the library, you can
- Xdelete the messages in your mailbox. Use the 'd' command to accomplish
- Xthis.
- X
- X
- X UPLOADING USING ALEX
- X ====================
- X Once you have become familiar with the use of Alex, you may wish
- Xto submit some of your favorite programs to the msdos library, or to send
- Xlibraries of files to other users. We will call this process 'uploading'.
- XWhat you have to do to upload is create an electronic mail message for
- Xsomeone else that is in a format compatible with Alex. Doing this is
- Xquite easy, using the Alex Upload option. In contrast to the normal use
- Xof Alex to download files, the upload option should not be executed from
- Xwithin Msg. Rather, it should be called from the shell (the $ prompt in
- XUnix). At the $ prompt, just type:
- X alex -u
- XYou will receive a message from Alex confirming that you have selected the
- XUpload option, and then requesting information for the electronic mailer
- X(who you want to send the library to, who will get carbon copies, and a
- Xsubject or brief description). Then you will be presented with a menu of
- Xoptions for sending a cover letter. A cover letter is just a message that
- Xis sent out to the person (or people) to whom you are sending the Alex
- Xlibrary, which explains how to get the library to their PC. It is sent in
- Xa separate message from the library, immediately before the library. The
- Xintent is that the person on the other end will read the cover letter before
- Xhe ever sees the Alex library (which is pretty much unreadable, and will
- Xconfuse anybody if they just get it alone). Here is the menu you'll see:
- X
- XA cover letter may be sent separate from your Alex library.
- XYour options are:
- X (1) Send no cover letter.
- X (2) Send standard Alex instruction file.
- X (3) Send your own cover letter that you have already saved in a file
- X (4) Edit the standard cover letter.
- XType 1, 2, 3 or 4:
- X
- X Option 1 is self-explanatory. Option 2 allows you to send a
- Xstandard message that has been made up beforehand. It gives good
- Xinstructions for downloading Alex libraries to an IBM PC or other
- XMSDOS computer, for users of either Msg or Mailx, using either Crosstalk
- Xor Kermit communications programs. If the person you are sending the
- XAlex library to fits this description, then you're probably best off
- Xjust using the standard cover letter. If you want to see what the
- Xstandard cover letter looks like, use Option 4. Option 3 allows you
- Xto send a cover letter that you have already composed and saved in a
- Xfile. If you select this option, you will next be queried for the name
- Xof the file. Option 4 lets you edit the standard cover letter, using any
- Xeditor you like. This command will allow you to add some comments to
- Xthe standard cover letter, like an explanation of what you're sending and
- Xwhy. The way Option 4 works is as follows: If you know your way around
- XUnix pretty well, you probably know what an "environment variable" is. If
- Xyou don't know what an environment variable is, then just skip the rest of
- Xthis paragraph because it doesn't pertain to you and isn't necessary. Alex
- Xchecks to see if the environment variable EDITOR exists, and if so, uses the
- Xeditor specified in that variable for editing the standard cover letter.
- XThe actual command executed is: $EDITOR /tmp/inst$$ where /tmp/inst$$ is
- Xjust the name of a temporary file where Alex stores the standard cover
- Xletter.
- X If no EDITOR environment variable exists, Alex asks you for the
- Xname of your favorite editor. If you use 'vi', then just type in 'vi'
- X(minus the quotes). If you use jove, type that in, etc. Muse or
- XWordmarc composer should work as well, but you will have to be sure
- Xto save the file in ASCII mode. When the cover letter is complete, you will
- Xget the message:
- X Please start up the Send Kermit on your PC (XK in Crosstalk).
- X This process is very similar to the one described above for starting
- Xup the Receive Kermit. Crosstalk users beware, however: Crosstalk must be
- Xin the 'binary mode' before you start sending any files. See the note at
- Xthe end of this section on 'binary mode' transfers if you are using
- XCrosstalk.
- X In Crosstalk, you must hit the ATtention key, and this time type XK.
- XYou will then be prompted for the name of the file you wish to transmit.
- XYou should type in the full filename of the first file you need to send.
- X"Wildcards" are permitted, so for instance to send all files on the A: drive
- Xyou could type in A:*.* for the filename.
- X In Kermit, you should hit the <Ctrl>] followed by a 'c', as before.
- XThen at the Kermit-MS> prompt you should type 'send flnm' where flnm is the
- Xfilename of the first file you need to send. Again, wildcards are permitted.
- XHowever, Kermit has an advantage over Crosstalk that it also allows you to
- Xsend files from a different directory from the one you are currently in.
- XYou can do this by changing the "working directory" with the CWD command at
- Xthe Kermit-MS> prompt. For instance, if you have a directory named
- X"PUBLIC", you can make that your working directory by typing CWD \PUBLIC
- X In Kermit, you should be careful to quickly reconnect (the letter
- X'c' and return) after your sending is completed; otherwise you will miss
- Xthe next message from Alex. In Crosstalk, you needn't worry about this
- Xbecause you are automatically reconnected. Alex will then respond:
- X Do you want to send more files (y/n)?
- X If you have additional files to include in this library, you should
- Xtype the letter 'y' (upper or lower case) and return. If this is the only
- Xfile you are sending, type 'n'. This process will continue until you have
- Xsent all the files you need to send.
- X When you have finished sending all the files, Alex will mail your
- Xcover letter and then your library to the address you specified earlier.
- X
- X BINARY MODE IN CROSSTALK
- X ========================
- X As was mentioned earlier, Crosstalk users must put Crosstalk in
- X'binary mode' prior to starting up the XK command for uploading. There
- Xare two ways to do this, depending on your level of expertise. The easiest
- Xway is as follows: Any time after starting up Crosstalk and before you
- Xstart up the Alex transfer, you should hit your ATtention key and then type:
- X kermit mode binary
- Xfollowed by a carriage return. You need only type this once, each time you
- Xstart up Crosstalk. The option will then remain in effect until you leave
- XCrosstalk, and will not affect other operations.
- X If you don't want to bother typing this in every time, and if you're
- Xhandy with MSDOS files, you can make it automatic so Crosstalk is ALWAYS
- Xset to 'binary mode'. All you have to do is create a short 'script' file
- Xfor Crosstalk with the following line in it:
- X kermit mode binary
- XA script file is any file, in the Crosstalk directory of your disk, that
- Xends in a .XTS extension. Furthermore, the first part of the filename should
- Xbe the same as your setup file. So if you have saved your setup under the
- Xname 'CABLE', for instance, then Crosstalk has saved a file in your
- Xdirectory called 'CABLE.XTK'. Your one-line script file should then be
- Xcalled 'CABLE.XTS'. Then, if you start up Crosstalk by typing 'XTALK CABLE'
- Xyour script file will automatically be executed (putting you in binary
- Xmode), your setup file will be read, and you will be automatically into
- Xthe communications mode of Crosstalk.
- X In case you are not familiar with any file editors in MSDOS, the
- Xfollowing commands, typed at the DOS level, will create the file CABLE.XTS:
- XCOPY CON CABLE.XTS
- XKERMIT MODE BINARY
- X^Z
- X(where ^Z denotes a CTRL-Z; hold down the control button and press Z at the
- Xsame time).
- X
- X UPLOADING WITHOUT ELECTRONIC MAIL
- X =================================
- X On occasion, you may wish to upload an Alex-format library but
- Xkeep it in a file on the Unix system computer, instead of sending it out
- Xby electronic mail. (This is necessary for the msdos librarian, who
- Xkeeps the archives on the Vax.) The format for accomplishing this is
- Xsimple. Instead of just typing: alex -u
- Xyou should type:
- X alex -u libname
- Xwhere libname is the name you want to assign to the file that will be
- Xcreated. Instructions for the use of this option are the same as above,
- Xexcept that mailing instructions will not be generated.
- X
- X THE TAC OPTION
- X ==============
- X Users of the Picatinny TAC will be happy to know that the latest
- Xversion of Alex contains special support for the TAC. If you don't know
- Xwhat the TAC is, skip this section. You don't need it.
- X Ordinarily, Alex uses all the default options of Unix Kermit
- X(90 byte packets, no parity, and eight data bits). However, this is not
- Xcompatible with the TAC, and thanks to the work of Jim McCoy we have found
- Xthe best combination for Kermit to work on the TAC: 40 byte packets, even
- Xparity, and seven data bits. If you use the TAC option of Alex, these
- Xparameters will be used. Selecting the TAC option is easy. For downloading
- Xfiles from Msg, just use the command:
- X | alex -tac
- XIn Mailx, use:
- X |<message #> alex -tac
- XFor more details on packet lengths, parity, and data bits, see the Kermit
- Xmanual (type 'man kermit').
- X
- X THE LISTING OPTIONS
- X ===================
- X If you have been sent an Alex library and want to know what files
- Xit contains, you have two options. One is to pipe the message to:
- X | alex -q
- XThis gives a quick listing of all the files in a library, with a notation
- Xas to whether the file is ASCII or binary. If you also want to know the
- Xlengths of the files, you have to use the "long listing" option:
- X | alex -l
- XThis option takes considerably longer than the quick listing, but produces
- Xa table just like the one issued before downloading. It gives the size
- Xof each file, and estimated transmission times at different baud rates.
- XThe reason it takes so much longer to produce is that the entire library
- Xhas to be decoded to produce it; the quick listing just checks picks the
- Xfile names from the encoded library and prints them out, unadorned.
- X
- X ADVANCED FEATURES OF ALEX
- X =========================
- X The remainder of this document is for advanced users only, and
- Xneed not be read by the average user of Alex. The options detailed below
- Xshould not be used by anyone who does not have a thorough understanding
- Xof file formats and the ASCII codes.
- X There are three advanced options available in Alex. The first is
- Xthe ASCII option (-a). This option is provided for users who wish to
- Xupload plain text files and send them out in a form that is readable on
- Xthe Unix system. This option is not necessary for the average user, since
- Xplain text files are automatically treated properly by Alex for transfer
- Xbetween PC's. It is only provided for advanced users who wish to be able
- Xto read their Alex libraries on the Unix system. The effect of choosing
- Xthis option in Upload mode is that files are received in Kermit's non-image
- Xmode (as opposed to Alex's default, which is to upload everything in image
- X-- or binary -- mode). They are not compressed or encoded, as normal Alex
- Xlibraries are. Instead, they just have an extra line prepended identifying
- Xthe file as ASCII and giving the file name. On downloading, Alex checks
- Xeach file for this header line and, if it exists, merely strips off the
- Xheader and sends the file in non-image mode, without decoding or
- Xuncompressing. Since each file is checked individually, you can even
- Xconstruct an Alex library that contains a mixture of ASCII and binary files.
- X(Note that since specifying -a for an upload makes all files ASCII in that
- XAlex run, Alex cannot itself create libraries with a mixture of ASCII and
- Xbinary files. You have to do the uploads separately to create two
- Xlibraries, then merge them with a text editor.) Alex ignores the -a
- Xparameter in download mode.
- X The second advanced option is the decode option (-d). This is
- Xa "low-level" command to decode an Alex library (from standard input)
- Xand leave the files in the user's current directory. This command is
- Xsimilar to the download option, except that no file transfers are done.
- XIt should be noted that text files which originated on a PC will be
- Xunreadable on the Unix system, unless they were uploaded with the ASCII
- Xoption. The decode option may not be used in conjunction with any other
- XAlex options.
- X The third option is the encode option (-e), which is the inverse
- Xfunction of decode. The user specifies (on the command line) all the files
- X(on the Unix system) that he wishes to encode together into an Alex library.
- XThe files are put together into an Alex library, and the result send to
- Xstandard output. It is the responsibility of the user to redirect this
- Xoutput to a file, for example:
- X
- Xalex -e foo1 foo2 > foo.lib
- X
- Xto create an Alex library from the files foo1 and foo2, and call it foo.lib.
- XThe encode option may not be used in conjunction with any other Alex options
- Xexcept ASCII.
- X The fourth option is the list option (-l), which merely generates
- Xfor the user a listing of all files in an Alex library. (The library is
- Xsupplied on the standard input.)
- X
- X POSSIBLE PROBLEMS WITH ALEX
- X ===========================
- X If the three advanced options mentioned above are not used, there
- Xis very little that can go wrong with an Alex transfer. About the only
- Xthings that go wrong for the average user is the communications. A Kermit
- Xtransfer may be aborted for any number of reasons, and in this case the
- Xonly thing to do is try again. If problems recur, there is probably very
- Xlittle Alex (or its author) can do to help you; you have to straighten out
- Xyour communications problems before any Alex transfers can be attempted.
- XSee the Kermit manual for more information, or send a message to the msdos
- Xmaillist to solicit help from other users.
- X Another possible cause of problems is the mailer. These problems
- Xrarely occur, but a file could be corrupted (or only partially mailed)
- Xwhen being mailed between different computers. In this case, you will
- Xsee a message:
- X
- Xbad format or Csum to atob
- X
- XThe offending file (or files) will be left as zero-length files, and
- Xthe rest will be downloaded normally.
- X If the advanced features of Alex are used (especially the ASCII
- Xoption), then there is additional potential for problems. Since files
- Xare not encoded, it is possible to confuse Undigest (the program that
- Xbreaks up the Alex library into its constituent files). Undigest works
- Xby breaking up files at the occurence of any line that begins with at
- Xleast six dashes in a row. Therefore, any ASCII files that happen to
- Xhave a line beginning with six dashes will be improperly broken. If
- Xthis happens, the file you get with that file's name will contain
- Xeverything before the first line with six dashes. The remainder will
- Xbe treated by Alex as an encoded file. When Alex attempts to decode it,
- Xyou will get the same error message mentioned above ("bad format or Csum
- Xto atob") and the information will be completely lost.
- X The Encode and Decode options can also cause some problems, but
- Xnot as serious. If you encode normal text files on the Unix system, NOT
- Xusing the ASCII option, and then someone attempts to download them to a
- XPC, the resulting files will NOT look normal. This results from a subtle
- Xdifference between the ways Unix and MSDOS store text files. In MSDOS,
- Xthe end of a line is demarked by both a Carriage Return (CR) and a Line
- XFeed (LF) code. In Unix, just an LF alone is used. In MSDOS, a CR makes
- Xthe cursor return to the first column of the screen when TYPEing a file,
- Xand the LF moves the cursor to a new line. In Unix, the LF alone is
- Xsufficient to move the cursor to the first column AND to a new line.
- XTherefore, if a Unix text file is printed on an MSDOS screen, the result
- Xis that the cursor never returns to the first column, and lines do not
- Xlook right. Conversely, if an MSDOS text file is printed on a Unix screen,
- Xall the output appears double-spaced.
- X If this is so, then how come you can use your PC as a terminal and
- X'cat' files from Unix, and they look alright? The answer is that your
- Xcommunications software (Crosstalk, or Kermit, or whatever) is translating
- Xthese codes for you, converting the Unix LF's to CR/LF pairs and only
- Xsending a single CR when you hit the return button. (Unix will actually
- Xaccept EITHER a CR or LF to mark the end of a line.)
- X And given all of this, how come it is still possible to download
- Xa text file in Kermit non-image mode, and it looks fine on your PC screen?
- XThe answer to this is that Kermit is translating these codes for you.
- XEvery time you send a file from a Unix system to an MSDOS system through
- XKermit (non-image mode), Kermit changes all the LF's to CR/LF pairs.
- XAnd every time you send a file from an MSDOS system to a Unix system,
- XKermit changes all the CR/LF pairs to LF's. This is one of the differences
- Xbetween Kermit image and non-image modes; in image mode Kermit does not
- Xmake this conversion.
- X The moral to all this is that you cannot encode Unix text files in Alex
- Xnon-ASCII mode if you intend to send them to a PC. Conversely, you cannot
- Xdecode MSDOS text files that were uploaded in Alex non-ASCII mode if you intend
- Xto read them on the Unix system. This is a good part of the reason why
- Xthe Encode and Decode options were labeled "advanced commands"; you must
- Xbe very conscious of the tradeoffs and pitfalls involved.
- X
- X ALEX IMPLEMENTATION
- X ===================
- X This section explains how Alex was implemented, and the format
- Xof the files it creates.
- X Alex was written on a DEC Vax 11/780 running Unix 4.2 BSD. Making
- XAlex run on another Unix system should be fairly simple. You only need
- Xcompile the 'C' programs undigest.c, btoa.c, atob.c and compress.c and put
- Xthem somewhere in your path. This can be done by:
- X cc -O -o undigest undigest.c
- X cc -O -o btoa btoa.c
- X cc -O -o atob atob.c
- X cc -O -o compress.c
- X ln compress uncompress
- Xassuming that you have already created the files undigest.c, btoa.c, atob.c
- Xand compress.c.
- X One note on the Btoa and Atob programs. The copies of these programs
- Xthat I am sending out with the Alex source files is my own version of the
- Xpopular public domain programs of the same name. However, I have slightly
- Xmodified these programs to add a minor option. I won't go into details here,
- Xbut the main point is that my version is completely compatible with the old
- XBtoa and Atob programs; but the old ones won't work with Alex.
- X The only other thing you must do is make a small modification to the
- XAlex shell script file. Near the top of the file (immediately following the
- Xcomments) you should see a line assigning a value to a variable called
- X'mailer'. You should change this line so that the name of the mail
- Xprogram on your system is assigned here. For instance, if you are using the
- Xstandard Unix mail program, the simple line:
- X mailer=mail
- Xwill suffice.
- X You will also note a couple of other comments in the shell script,
- Xjust below the mailer definition, for other possible Unix conflicts.
- X With this, the (standard) Alex download feature should work
- Xunaided as long as your system supports Kermit. Most Unix systems have
- Xa version of Kermit running, so this should be no problem.
- X If you have difficulty installing Alex on a Unix system, please
- Xsend electronic mail to msdos-request@ARDEC, and include a copy of the
- X'man' page for your electronic mail program. We will be glad to do our
- Xbest to help.
- X
- X The format of an Alex library is deliberately simple. First, all of
- Xthe files to be sent are compressed (unless the ASCII option is used). Then
- Xthey are encoded using Btoa (again, unless ASCII). Finally, they are
- Xconcatenated together into one large file, separated only by a line that
- Xbegins with several dashes and has the words "CUT HERE" in the middle. If
- Xthe ASCII option is used, then the "CUT HERE" line is followed by one more
- Xline identifying the file name:
- X
- XASCII filename
- X
- X Alex has three major advantages over other similar systems, like the
- Xpublic domain Tarmail. First, Alex can be ported to non-Unix systems (which
- Xdo not usually have the 'tar' program required by Tarmail). While it is
- Xtrue that Alex is primarily a Unix shell script program, it turns out that
- Xthe vast majority of the code in this script is for the user interface; very
- Xlittle of it has anything to do with particulars of Unix. Using the brief
- Xdescription given above of the Alex library format, it should be easy to
- Xwrite Alex in any shell (or batch) language on any operating system. The
- Xmajor parts of Alex are the public domain C programs (which is certainly not
- Xtrue of Tar). The only exception to the above is the ASCII option, which is
- Xdecoded using some Unix-specific commands like Cut, Head, and Tail.
- XHowever, this option is really not necessary.
- X The second advantage to Alex is that it is very easy to manually
- Xbreak up an Alex library (unlike Tarmail). Many electronic mail systems
- X(like Msg and Mailx) have an 'undigest' command (@ in Msg) that breaks up a
- Xsingle message into several messages, separating them at the location of
- Xlines that begin with several dashes. Therefore, an Alex-encoded library
- Xcan be easily broken up by undigestifying the message and piping each
- Xindividual message to Atob, and uncompressing any files that end in a .Z
- Xextension. My special version of Btoa and Atob are necessary, however, to
- Xpreserve the file names. (Use the '-f' option on Atob.)
- X The third advantage to Alex over Tarmail deals with modifying an
- Xexisting Alex library. Since files are separately encoded, and their names
- Xclearly marked in the Btoa listing, a library of Alex files can be broken up
- Xinto its constituent files, and files can be selectively replaced without
- Xremaking the entire library.
- X Library sizes, incidentally, are about the same for Alex and
- XTarmail. (They both use Compress and Btoa.)
- X One last note: The old version of Alex (1.0) created libraries that
- Xcan be used by the new version, but the converse is not true. The old Alex
- Xdid not compress files (nor did it uncompress them); the new one
- Xautomatically compresses all files, but checks to see if the files are
- Xcompressed before uncompressing them. This makes Alex 1.1 and 1.2 upwardly
- Xcompatible. Versions before 1.1 also do not support the ASCII option, in
- Xeither uploading or downloading.
- X
- X --Ken Van Camp <kvancamp@ARDEC.ARPA>
- X U.S. Army Armament Research Development & Engineering Center
- X SMCAR-FSA-E Building 329
- X Picatinny Arsenal, NJ 07806-5000
- X (201)724-3334 (AV)880-3334
- ________This_Is_The_END________
- if test `wc -l < alex.doc` -ne 571; then
- echo 'shar: alex.doc was damaged during transit (should have been 571 bytes)'
- fi
- fi ; : end of overwriting check
- echo 'x - undigest.c'
- if test -f undigest.c; then echo 'shar: not overwriting undigest.c'; else
- sed 's/^X//' << '________This_Is_The_END________' > undigest.c
- X/* undigest.c: Undigest data from the input stream, and send output
- X * to files named fileNN, where file is the parameter given on the
- X * commmand line and NN is a numeric file number assigned by undigest.
- X * The first file undigestified is named file0, the second file1, and
- X * so on.
- X * Written by Ken Van Camp, Picatinny Arsenal <kvancamp@ARDEC.ARPA>
- X * Version 1.0, June 1986
- X */
- X
- X#include <stdio.h>
- X#include <sys/file.h>
- X#include <strings.h>
- X
- X#define CR '\012' /* line feed */
- X
- Xchar *dashes = { "-----"
- X};
- X
- Xmain (argc, argv)
- Xint argc;
- Xchar *argv[];
- X{
- X char *filname, /* file name output mask */
- X line_buf[256], /* line buffer */
- X filoutnm[40]; /* name of next file to create */
- X FILE *filout, /* output file */
- X *fopen();
- X int filopen = 0, /* flag output file open */
- X seqn = 0; /* version # for output file */
- X
- X if (argc < 2){
- X fprintf (stderr, "undigest: No filename specified\n");
- X exit (1);
- X }
- X filname = argv[1];
- X
- X while (fgets (line_buf, sizeof line_buf, stdin)){
- X if (!filopen){
- X
- X /* Time to open a new file. */
- X
- X /* Make sure this isn't just a blank line */
- X if (*line_buf != NULL){
- X sprintf (filoutnm, "%s%d", filname, seqn);
- X if ((filout = fopen(filoutnm, "w+"))==NULL){
- X fprintf(stderr,"undigest: Can't create %s\n",
- X filoutnm);
- X exit(1);
- X }
- X filopen = 1;
- X seqn++;
- X }
- X }
- X
- X if (strncmp (dashes, line_buf, 5)){
- X /* No separator in this line */
- X fprintf (filout, "%s", line_buf);
- X }else{
- X /* Found separator; don't print this line */
- X /* Close the old file */
- X if (filopen)
- X fclose (filout);
- X filopen = 0;
- X }
- X } /* while */
- X
- X if (filopen)
- X fclose (filout);
- X}
- ________This_Is_The_END________
- if test `wc -l < undigest.c` -ne 69; then
- echo 'shar: undigest.c was damaged during transit (should have been 69 bytes)'
- fi
- fi ; : end of overwriting check
- exit 0
-