home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8709 / alex / 2 < prev    next >
Encoding:
Internet Message Format  |  1990-07-13  |  36.3 KB

  1. Path: uunet!seismo!sundc!pitstop!sun!amdcad!ames!ll-xn!husc6!spdcc!m2c!necntc!ncoast!allbery
  2. From: kvancamp@ARDEC.arpa (Kenneth Van Camp -FSAC-)
  3. Newsgroups: comp.sources.misc
  4. Subject: ALEX part 2/2 (MS-DOS library exchange program)
  5. Message-ID: <4768@ncoast.UUCP>
  6. Date: 29 Sep 87 20:28:05 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Lines: 671
  9. Approved: allbery@ncoast.UUCP
  10. X-Archive: comp.sources.misc/8709/alex/2
  11.  
  12. #--------------------------------CUT HERE-------------------------------------
  13. #! /bin/sh
  14. #
  15. # This is a shell archive.  Save this into a file, edit it
  16. # and delete all lines above this comment.  Then give this
  17. # file to sh by executing the command "sh file".  The files
  18. # will be extracted into the current directory owned by
  19. # you with default permissions.
  20. #
  21. # The files contained herein are:
  22. #
  23. # -rw-r--r--   1 allbery  System     33251 Sep 29 16:11 alex.doc
  24. # -rw-r--r--   1 allbery  System      1644 Sep 29 16:11 undigest.c
  25. #
  26. echo 'x - alex.doc'
  27. if test -f alex.doc; then echo 'shar: not overwriting alex.doc'; else
  28. sed 's/^X//' << '________This_Is_The_END________' > alex.doc
  29. X        ALEX USER'S GUIDE (VERSION 1.2)
  30. X        ===============================
  31. X
  32. X    Alex [Automatic Library EXchange] is a program that allows
  33. Xautomatic transfer of groups of files (either ASCII or binary) via
  34. Xelectronic mail. Some assumptions are made in the discussion below:
  35. X  o  You are using the Msg (mmdf) or Mailx electronic mail systems.
  36. X  o  Alex has already been installed on your Unix system.
  37. X  o  You are able to log in to the electronic mail system from your
  38. X     personal computer (PC), using communications software.
  39. X  o  Your communications software supports the Kermit file transfer
  40. X     protocol. This is definitely true if you are using the public
  41. X     domain Kermit program, and may or may not be true if you are
  42. X     using a commercial communications program. Note that the
  43. X     popular Crosstalk XVI (running on the IBM PC, Wyse PC and
  44. X     compatibles) DOES support the Kermit file transfer protocol.
  45. X     Also note that Syterm, which is used widely here at ARDEC, does
  46. X     NOT support Kermit and therefore cannot be used in conjunction
  47. X     with Alex.
  48. X
  49. X    This user's guide explains everything you need to know to be 
  50. Xable to use Alex. It goes through the steps in excruciating detail,
  51. Xand more advanced users may want to skip some of the discussion.
  52. XFor these people, I recommend skipping the download discussion
  53. Xbecause it is very simple (and explained in much shorter terms in the
  54. Xman page -- type 'man alex' on your Unix system). They may proceed
  55. Xdirectly to the section on Uploading.
  56. X    Keep in mind that this documentation details the use of Alex
  57. Xunder BOTH Msg and Mailx.  These are two different electronic mail
  58. Xprograms in use at ARDEC.  If you are using Msg, please ignore all
  59. Xreferences to Mailx.  Of course, if you are using Mailx, ignore all
  60. Xreferences to Msg.
  61. X
  62. XUSING ALEX TO DOWNLOAD:
  63. X    If you receive a library of files that was sent from someone else 
  64. Xusing Alex, you must use Alex to download the files to your PC.  The 
  65. Xdiscussion below assumes you are using one of the U.S.  Army electronic mail 
  66. Xsystems, Msg or Mailx; instructions on other mail systems may vary.  
  67. X    When you are in Msg or Mailx and get a message telling you that an
  68. XAlex-encoded library has been sent, the first thing you must do is
  69. Xdetermine the message number of the library. Usually, the sender will
  70. Xsend you two messages: a cover letter and the library. Since they are
  71. Xusually sent in rapid succession, chances are good that the library
  72. Ximmediately follows the cover letter in your mailbox. To be certain,
  73. Xhowever, you should print out the headers of all your messages. To do
  74. Xthis in Msg, type the letter 'h' (the word 'headers' will appear),
  75. Xfollowed by the letter 'a' (the word 'all' will appear), followed by
  76. Xa carriage return.  To print out the headers in Mailx, just type 'h'.
  77. X    When you see the list of headers, you should look for the
  78. Xlibrary. It usually has the same subject header and sender as the
  79. Xcover letter. Note the message number to the left of the library
  80. Xmessage.
  81. X    Msg users may now type the letter 'l' (the word 'list' will appear), 
  82. Xfollowed by the message number you just noted, and a carriage return.  Msg 
  83. Xshould respond with: 
  84. X    To file/pipe:
  85. XWhen you get this prompt, you should type:
  86. X    | alex
  87. XNote that the vertical bar in the line above is called a 'pipe symbol',
  88. Xand is not to be confused with the letter 'l' or the number '1'. It is
  89. Xa unique symbol which you should be able to locate somewhere on your
  90. Xcomputer keyboard. Follow this line with a carriage return.
  91. X    Mailx users can accomplish the same thing by typing 
  92. X'|<message #> alex' (without the quotes).  For instance:  |2 alex
  93. Xwill pipe message number 2 to Alex.
  94. X    At this point, you have invoked Alex.  After a pause (not usually 
  95. Xmore than 30 seconds), you will get more information from Alex.  First,
  96. Xyou will see a message similar to the following:
  97. X
  98. X    The following files are ready for downloading.
  99. X    Times given are estimated transmission times, in minutes, to send files
  100. X    to your PC.  If you are directly connected to the Sytek cable network,
  101. X    use the T9600 numbers.  If you are using a 1200 baud modem, use T1200.
  102. X    If you are using a 4800 baud modem, use T4800, etc.
  103. X
  104. X     Filename            Size    T1200  T2400  T4800  T9600
  105. X     ======================================================
  106. X     ed.def                97      0.0    0.0    0.0    0.0
  107. X     ed.dir              1642      0.5    0.2    0.1    0.1
  108. X     ed.exe             98644     27.4   13.7    6.9    3.4
  109. X     ed.hlp             50522     14.0    7.0    3.5    1.8
  110. X     ed.spc               784      0.2    0.1    0.1    0.0
  111. X     ed.trs              1837      0.5    0.3    0.1    0.1
  112. X     getyn.com             97      0.0    0.0    0.0    0.0
  113. X     go.bat                12      0.0    0.0    0.0    0.0
  114. X     order               1147      0.3    0.2    0.1    0.0
  115. X     pcwmouse.def        2514      0.7    0.3    0.2    0.1
  116. X     pcwmouse.doc         874      0.2    0.1    0.1    0.0
  117. X     pcwmouse.msc        4575      1.3    0.6    0.3    0.2
  118. X     pr.exe             45656     12.7    6.3    3.2    1.6
  119. X     quicks.me            962      0.3    0.1    0.1    0.0
  120. X     read.me             1503      0.4    0.2    0.1    0.1
  121. X     story               1148      0.3    0.2    0.1    0.0
  122. X     workdisk.bat        3278      0.9    0.5    0.2    0.1
  123. X     ------------------------------------------------------
  124. X     total             215292     59.8   29.9   15.0    7.5
  125. X
  126. XIn this example, 17 files had been sent in the Alex library and were now 
  127. Xready for transmission to the user's PC.  The first column of the table 
  128. Xlists the names of all the files.  The second lists the file sizes, in bytes 
  129. X(the number of characters in the file, approximately).  The last four 
  130. Xcolumns are just to help you estimate how long it will take to transmit all 
  131. Xthe files to your PC.  These times are listed in minutes, and are the result 
  132. Xof a simple calculation based on something called a "baud rate", or 
  133. Xtransmission rate.  Only one of these last four columns applies to you, 
  134. Xdepending on what baud rate your PC is operating at.  If you are operating 
  135. Xat 9600 baud, then you should look at the column labeled "T9600".  If you 
  136. Xare operating at 1200 baud, then look at the column marked "T1200", etc.  If 
  137. Xyou are unsure, then chances are you are probably operating at 9600 baud.  
  138. X(This is the standard rate used on the ARDEC Sytek cable network.) 
  139. X    At the bottom of the table is the total number of bytes of all
  140. Xthe files, and their estimated total transmission times.  This will tell
  141. Xyou roughly how long your PC will be tied up while the files are
  142. Xtransmitted.  Keep in mind that this is just an estimate, and that actual
  143. Xtimes will vary (by as much as a factor of 2).
  144. X    Finally, after the table, you will see this message:
  145. X
  146. X    In a moment, you will see a few meaningless characters at the bottom
  147. X    of your screen. When this happens, start up the Receive Kermit on your PC.
  148. X
  149. X    Now you are ready to begin receiving the files that Alex is ready to 
  150. Xtransmit.  To do this, you must tell your PC to begin receiving files using a 
  151. Xprotocol known as "Kermit".  The actual process of starting up the Receive 
  152. XKermit depends upon the communications software you are using.  Here are 
  153. Xinstructions for doing this on a couple of the popular software packages.  
  154. XIf you do not have one of these, please consult your communications software 
  155. Xdocumentation or your system guru, or send mail to <msdos-request@ARDEC> and 
  156. Xwe will try to help you.  
  157. X
  158. X            CROSSTALK XVI USERS
  159. X            ===================
  160. X    If you are using Crosstalk XVI, starting up Receive Kermit is
  161. Xeasy. The first key you must press is known as the 'Attention' key.
  162. XWhen Crosstalk is sold, the 'Attention' key is defined to be the
  163. X<Esc> key. However, it is possible to redefine this key to be virtually
  164. Xanything on your keyboard. This is commonly done with Unix users, since
  165. Xthe <Esc> key is required for other purposes. A common way to redefine
  166. Xthe 'Attention' key is as <PgUp> (on the numeric keypad). The actual
  167. Xkey set on your version is shown at the lower left corner of your screen
  168. Xwhen Crosstalk is invoked. For instance, it might say 'PgUp for ATtention'
  169. Xif the <PgUp> key is to be used.
  170. X    Whatever your 'Attention' key is, press it. Crosstalk should
  171. Xthen ask for your Command on the bottom line of the screen (the bright
  172. Xline -- also called the Status line). You should type in the letters RK
  173. X(short for Receive Kermit) and a carriage return.
  174. X    The rest is automatic. Crosstalk should respond by placing a
  175. Xsmall rectangular box at the bottom of the screen that shows the status
  176. Xof the file transfers. If more than one file existed in the library, you
  177. Xwill get a new box for each file. When the file transfer is complete,
  178. Xyou will have copies of all the files on the disk of your PC. (If you
  179. Xuse subdirectories, the files will be in the same directory as Crosstalk.)
  180. XYou will be automatically returned to communications with the Unix system 
  181. Xcomputer when the transfer is complete.  You will be back in Msg or Mailx 
  182. Xwhere you left off.  
  183. X
  184. X            KERMIT USERS
  185. X            ============
  186. X    If you are using the public domain Kermit program on the IBM PC,
  187. XWyse PC, or compatible, the instructions for starting up the Receive
  188. XKermit are as follows. First, you must hit the "escape character" on your
  189. Xversion of Kermit.  Note that this is NOT usually the key marked <ESC>
  190. Xon your keyboard.  "Escape character" is probably a poor choice of words,
  191. Xbut that's what they call it.  It is probably better called the Attention 
  192. Xcharacter, like Crosstalk calls it.  At any rate, the "Escape character" in 
  193. XKermit is usually defined to be <Ctrl>] (hold the Control key down and 
  194. Xstrike the right-bracket key at the same time).  It may be defined 
  195. Xdifferently on your version, but this seems to be fairly rare.  (If you want 
  196. Xto be sure, just look at the status line at the bottom of your screen.  At 
  197. Xthe left it probably reads: 
  198. X  Esc-chr: ^]
  199. Xand some other things after that.  The ^] is just a shorthand notation for
  200. X<Ctrl>].
  201. X    After you hit <Ctrl>] (or whatever your escape character is),
  202. Xthe status line at the bottom of your screen should disappear. Now type
  203. Xthe letter 'c', and you should receive the prompt:
  204. X    Kermit-MS>
  205. XNow type in the word 'receive' (minus the quote marks, of course) and
  206. Xhit a carriage return. Your screen will clear and be replaced by a status
  207. Xscreen that shows how the transfers are progressing and the names of the 
  208. Xfiles transferred.  When the transfer is complete (which may take a while, 
  209. Xdepending on the size of the library), you will hear a beep and be returned 
  210. Xto the Kermit-MS> prompt.  Now you should type the letter 'c', followed by a 
  211. Xcarriage return.  You will be back in Msg or Mailx where you left off.  
  212. X
  213. X                ALL USERS
  214. X                =========
  215. X    Now that you have received all the files in the library, you can 
  216. Xdelete the messages in your mailbox.  Use the 'd' command to accomplish 
  217. Xthis.  
  218. X
  219. X
  220. X            UPLOADING USING ALEX
  221. X            ====================
  222. X    Once you have become familiar with the use of Alex, you may wish
  223. Xto submit some of your favorite programs to the msdos library, or to send
  224. Xlibraries of files to other users. We will call this process 'uploading'.
  225. XWhat you have to do to upload is create an electronic mail message for
  226. Xsomeone else that is in a format compatible with Alex. Doing this is
  227. Xquite easy, using the Alex Upload option. In contrast to the normal use
  228. Xof Alex to download files, the upload option should not be executed from
  229. Xwithin Msg. Rather, it should be called from the shell (the $ prompt in
  230. XUnix). At the $ prompt, just type:
  231. X    alex -u
  232. XYou will receive a message from Alex confirming that you have selected the
  233. XUpload option, and then requesting information for the electronic mailer
  234. X(who you want to send the library to, who will get carbon copies, and a 
  235. Xsubject or brief description).  Then you will be presented with a menu of 
  236. Xoptions for sending a cover letter.  A cover letter is just a message that
  237. Xis sent out to the person (or people) to whom you are sending the Alex 
  238. Xlibrary, which explains how to get the library to their PC.  It is sent in
  239. Xa separate message from the library, immediately before the library.  The
  240. Xintent is that the person on the other end will read the cover letter before
  241. Xhe ever sees the Alex library (which is pretty much unreadable, and will
  242. Xconfuse anybody if they just get it alone).  Here is the menu you'll see:
  243. X
  244. XA cover letter may be sent separate from your Alex library.
  245. XYour options are:
  246. X  (1) Send no cover letter.
  247. X  (2) Send standard Alex instruction file.
  248. X  (3) Send your own cover letter that you have already saved in a file
  249. X  (4) Edit the standard cover letter.
  250. XType 1, 2, 3 or 4:
  251. X
  252. X    Option 1 is self-explanatory.  Option 2 allows you to send a
  253. Xstandard message that has been made up beforehand.  It gives good
  254. Xinstructions for downloading Alex libraries to an IBM PC or other
  255. XMSDOS computer, for users of either Msg or Mailx, using either Crosstalk
  256. Xor Kermit communications programs.  If the person you are sending the
  257. XAlex library to fits this description, then you're probably best off
  258. Xjust using the standard cover letter.  If you want to see what the
  259. Xstandard cover letter looks like, use Option 4.  Option 3 allows you
  260. Xto send a cover letter that you have already composed and saved in a
  261. Xfile.  If you select this option, you will next be queried for the name
  262. Xof the file.  Option 4 lets you edit the standard cover letter, using any
  263. Xeditor you like.  This command will allow you to add some comments to
  264. Xthe standard cover letter, like an explanation of what you're sending and 
  265. Xwhy.  The way Option 4 works is as follows: If you know your way around 
  266. XUnix pretty well, you probably know what an "environment variable" is.  If 
  267. Xyou don't know what an environment variable is, then just skip the rest of 
  268. Xthis paragraph because it doesn't pertain to you and isn't necessary.  Alex 
  269. Xchecks to see if the environment variable EDITOR exists, and if so, uses the 
  270. Xeditor specified in that variable for editing the standard cover letter.  
  271. XThe actual command executed is: $EDITOR /tmp/inst$$ where /tmp/inst$$ is 
  272. Xjust the name of a temporary file where Alex stores the standard cover 
  273. Xletter.  
  274. X    If no EDITOR environment variable exists, Alex asks you for the
  275. Xname of your favorite editor.  If you use 'vi', then just type in 'vi'
  276. X(minus the quotes).  If you use jove, type that in, etc.  Muse or
  277. XWordmarc composer should work as well, but you will have to be sure
  278. Xto save the file in ASCII mode.  When the cover letter is complete, you will 
  279. Xget the message: 
  280. X    Please start up the Send Kermit on your PC (XK in Crosstalk).  
  281. X    This process is very similar to the one described above for starting 
  282. Xup the Receive Kermit.  Crosstalk users beware, however: Crosstalk must be 
  283. Xin the 'binary mode' before you start sending any files.  See the note at 
  284. Xthe end of this section on 'binary mode' transfers if you are using 
  285. XCrosstalk.  
  286. X    In Crosstalk, you must hit the ATtention key, and this time type XK.  
  287. XYou will then be prompted for the name of the file you wish to transmit.  
  288. XYou should type in the full filename of the first file you need to send.
  289. X"Wildcards" are permitted, so for instance to send all files on the A: drive
  290. Xyou could type in  A:*.* for the filename.
  291. X    In Kermit, you should hit the <Ctrl>] followed by a 'c', as before.  
  292. XThen at the Kermit-MS> prompt you should type 'send flnm' where flnm is the 
  293. Xfilename of the first file you need to send.  Again, wildcards are permitted.
  294. XHowever, Kermit has an advantage over Crosstalk that it also allows you to
  295. Xsend files from a different directory from the one you are currently in.
  296. XYou can do this by changing the "working directory" with the CWD command at
  297. Xthe Kermit-MS> prompt.  For instance, if you have a directory named
  298. X"PUBLIC", you can make that your working directory by typing CWD \PUBLIC
  299. X    In Kermit, you should be careful to quickly reconnect (the letter
  300. X'c' and return) after your sending is completed; otherwise you will miss
  301. Xthe next message from Alex. In Crosstalk, you needn't worry about this
  302. Xbecause you are automatically reconnected. Alex will then respond:
  303. X    Do you want to send more files (y/n)?
  304. X    If you have additional files to include in this library, you should 
  305. Xtype the letter 'y' (upper or lower case) and return.  If this is the only 
  306. Xfile you are sending, type 'n'.  This process will continue until you have 
  307. Xsent all the files you need to send.
  308. X    When you have finished sending all the files, Alex will mail your
  309. Xcover letter and then your library to the address you specified earlier.
  310. X
  311. X            BINARY MODE IN CROSSTALK
  312. X            ========================
  313. X    As was mentioned earlier, Crosstalk users must put Crosstalk in
  314. X'binary mode' prior to starting up the XK command for uploading. There
  315. Xare two ways to do this, depending on your level of expertise. The easiest
  316. Xway is as follows: Any time after starting up Crosstalk and before you
  317. Xstart up the Alex transfer, you should hit your ATtention key and then type:
  318. X   kermit mode binary
  319. Xfollowed by a carriage return. You need only type this once, each time you
  320. Xstart up Crosstalk. The option will then remain in effect until you leave
  321. XCrosstalk, and will not affect other operations.
  322. X    If you don't want to bother typing this in every time, and if you're
  323. Xhandy with MSDOS files, you can make it automatic so Crosstalk is ALWAYS
  324. Xset to 'binary mode'. All you have to do is create a short 'script' file
  325. Xfor Crosstalk with the following line in it:
  326. X    kermit mode binary
  327. XA script file is any file, in the Crosstalk directory of your disk, that
  328. Xends in a .XTS extension. Furthermore, the first part of the filename should
  329. Xbe the same as your setup file. So if you have saved your setup under the
  330. Xname 'CABLE', for instance, then Crosstalk has saved a file in your 
  331. Xdirectory called 'CABLE.XTK'. Your one-line script file should then be
  332. Xcalled 'CABLE.XTS'. Then, if you start up Crosstalk by typing 'XTALK CABLE'
  333. Xyour script file will automatically be executed (putting you in binary
  334. Xmode), your setup file will be read, and you will be automatically into
  335. Xthe communications mode of Crosstalk.
  336. X    In case you are not familiar with any file editors in MSDOS, the
  337. Xfollowing commands, typed at the DOS level, will create the file CABLE.XTS:
  338. XCOPY CON CABLE.XTS
  339. XKERMIT MODE BINARY
  340. X^Z
  341. X(where ^Z denotes a CTRL-Z; hold down the control button and press Z at the
  342. Xsame time).
  343. X
  344. X           UPLOADING WITHOUT ELECTRONIC MAIL
  345. X           =================================
  346. X    On occasion, you may wish to upload an Alex-format library but
  347. Xkeep it in a file on the Unix system computer, instead of sending it out
  348. Xby electronic mail. (This is necessary for the msdos librarian, who
  349. Xkeeps the archives on the Vax.) The format for accomplishing this is
  350. Xsimple. Instead of just typing:  alex -u
  351. Xyou should type:
  352. X    alex -u libname
  353. Xwhere libname is the name you want to assign to the file that will be
  354. Xcreated. Instructions for the use of this option are the same as above,
  355. Xexcept that mailing instructions will not be generated.
  356. X
  357. X                THE TAC OPTION
  358. X                ==============
  359. X    Users of the Picatinny TAC will be happy to know that the latest
  360. Xversion of Alex contains special support for the TAC.  If you don't know
  361. Xwhat the TAC is, skip this section.  You don't need it.
  362. X    Ordinarily, Alex uses all the default options of Unix Kermit
  363. X(90 byte packets, no parity, and eight data bits).  However, this is not
  364. Xcompatible with the TAC, and thanks to the work of Jim McCoy we have found
  365. Xthe best combination for Kermit to work on the TAC: 40 byte packets, even
  366. Xparity, and seven data bits.  If you use the TAC option of Alex, these
  367. Xparameters will be used.  Selecting the TAC option is easy.  For downloading
  368. Xfiles from Msg, just use the command: 
  369. X    | alex -tac
  370. XIn Mailx, use: 
  371. X    |<message #> alex -tac
  372. XFor more details on packet lengths, parity, and data bits, see the Kermit
  373. Xmanual (type 'man kermit').
  374. X
  375. X            THE LISTING OPTIONS
  376. X            ===================
  377. X    If you have been sent an Alex library and want to know what files
  378. Xit contains, you have two options.  One is to pipe the message to:
  379. X    | alex -q
  380. XThis gives a quick listing of all the files in a library, with a notation
  381. Xas to whether the file is ASCII or binary.  If you also want to know the
  382. Xlengths of the files, you have to use the "long listing" option:
  383. X    | alex -l
  384. XThis option takes considerably longer than the quick listing, but produces
  385. Xa table just like the one issued before downloading.  It gives the size
  386. Xof each file, and estimated transmission times at different baud rates.
  387. XThe reason it takes so much longer to produce is that the entire library
  388. Xhas to be decoded to produce it; the quick listing just checks picks the
  389. Xfile names from the encoded library and prints them out, unadorned.
  390. X
  391. X            ADVANCED FEATURES OF ALEX
  392. X            =========================
  393. X    The remainder of this document is for advanced users only, and
  394. Xneed not be read by the average user of Alex.  The options detailed below
  395. Xshould not be used by anyone who does not have a thorough understanding
  396. Xof file formats and the ASCII codes.
  397. X    There are three advanced options available in Alex.  The first is
  398. Xthe ASCII option (-a).  This option is provided for users who wish to
  399. Xupload plain text files and send them out in a form that is readable on
  400. Xthe Unix system.  This option is not necessary for the average user, since
  401. Xplain text files are automatically treated properly by Alex for transfer
  402. Xbetween PC's.  It is only provided for advanced users who wish to be able
  403. Xto read their Alex libraries on the Unix system.  The effect of choosing
  404. Xthis option in Upload mode is that files are received in Kermit's non-image
  405. Xmode (as opposed to Alex's default, which is to upload everything in image
  406. X-- or binary -- mode).  They are not compressed or encoded, as normal Alex
  407. Xlibraries are.  Instead, they just have an extra line prepended identifying
  408. Xthe file as ASCII and giving the file name.  On downloading, Alex checks
  409. Xeach file for this header line and, if it exists, merely strips off the
  410. Xheader and sends the file in non-image mode, without decoding or
  411. Xuncompressing.  Since each file is checked individually, you can even
  412. Xconstruct an Alex library that contains a mixture of ASCII and binary files.
  413. X(Note that since specifying -a for an upload makes all files ASCII in that
  414. XAlex run, Alex cannot itself create libraries with a mixture of ASCII and
  415. Xbinary files.  You have to do the uploads separately to create two 
  416. Xlibraries, then merge them with a text editor.)  Alex ignores the -a
  417. Xparameter in download mode.
  418. X    The second advanced option is the decode option (-d).  This is
  419. Xa "low-level" command to decode an Alex library (from standard input)
  420. Xand leave the files in the user's current directory.  This command is
  421. Xsimilar to the download option, except that no file transfers are done.
  422. XIt should be noted that text files which originated on a PC will be
  423. Xunreadable on the Unix system, unless they were uploaded with the ASCII
  424. Xoption.  The decode option may not be used in conjunction with any other
  425. XAlex options.
  426. X    The third option is the encode option (-e), which is the inverse 
  427. Xfunction of decode.  The user specifies (on the command line) all the files 
  428. X(on the Unix system) that he wishes to encode together into an Alex library.  
  429. XThe files are put together into an Alex library, and the result send to 
  430. Xstandard output.  It is the responsibility of the user to redirect this 
  431. Xoutput to a file, for example: 
  432. X
  433. Xalex -e foo1 foo2 > foo.lib
  434. X
  435. Xto create an Alex library from the files foo1 and foo2, and call it foo.lib.
  436. XThe encode option may not be used in conjunction with any other Alex options
  437. Xexcept ASCII.
  438. X    The fourth option is the list option (-l), which merely generates
  439. Xfor the user a listing of all files in an Alex library.  (The library is
  440. Xsupplied on the standard input.)
  441. X
  442. X            POSSIBLE PROBLEMS WITH ALEX
  443. X            ===========================
  444. X    If the three advanced options mentioned above are not used, there
  445. Xis very little that can go wrong with an Alex transfer.  About the only
  446. Xthings that go wrong for the average user is the communications.  A Kermit
  447. Xtransfer may be aborted for any number of reasons, and in this case the
  448. Xonly thing to do is try again.  If problems recur, there is probably very
  449. Xlittle Alex (or its author) can do to help you; you have to straighten out
  450. Xyour communications problems before any Alex transfers can be attempted.
  451. XSee the Kermit manual for more information, or send a message to the msdos
  452. Xmaillist to solicit help from other users.
  453. X    Another possible cause of problems is the mailer.  These problems
  454. Xrarely occur, but a file could be corrupted (or only partially mailed)
  455. Xwhen being mailed between different computers.  In this case, you will
  456. Xsee a message:
  457. X
  458. Xbad format or Csum to atob
  459. X
  460. XThe offending file (or files) will be left as zero-length files, and
  461. Xthe rest will be downloaded normally.
  462. X    If the advanced features of Alex are used (especially the ASCII
  463. Xoption), then there is additional potential for problems.  Since files
  464. Xare not encoded, it is possible to confuse Undigest (the program that
  465. Xbreaks up the Alex library into its constituent files).  Undigest works
  466. Xby breaking up files at the occurence of any line that begins with at
  467. Xleast six dashes in a row.  Therefore, any ASCII files that happen to
  468. Xhave a line beginning with six dashes will be improperly broken.  If
  469. Xthis happens, the file you get with that file's name will contain
  470. Xeverything before the first line with six dashes.  The remainder will
  471. Xbe treated by Alex as an encoded file.  When Alex attempts to decode it,
  472. Xyou will get the same error message mentioned above ("bad format or Csum
  473. Xto atob") and the information will be completely lost.
  474. X    The Encode and Decode options can also cause some problems, but
  475. Xnot as serious.  If you encode normal text files on the Unix system, NOT
  476. Xusing the ASCII option, and then someone attempts to download them to a
  477. XPC, the resulting files will NOT look normal.  This results from a subtle
  478. Xdifference between the ways Unix and MSDOS store text files.  In MSDOS,
  479. Xthe end of a line is demarked by both a Carriage Return (CR) and a Line
  480. XFeed (LF) code.  In Unix, just an LF alone is used.  In MSDOS, a CR makes
  481. Xthe cursor return to the first column of the screen when TYPEing a file,
  482. Xand the LF moves the cursor to a new line.  In Unix, the LF alone is
  483. Xsufficient to move the cursor to the first column AND to a new line.
  484. XTherefore, if a Unix text file is printed on an MSDOS screen, the result
  485. Xis that the cursor never returns to the first column, and lines do not
  486. Xlook right.  Conversely, if an MSDOS text file is printed on a Unix screen,
  487. Xall the output appears double-spaced.
  488. X    If this is so, then how come you can use your PC as a terminal and
  489. X'cat' files from Unix, and they look alright?  The answer is that your
  490. Xcommunications software (Crosstalk, or Kermit, or whatever) is translating
  491. Xthese codes for you, converting the Unix LF's to CR/LF pairs and only
  492. Xsending a single CR when you hit the return button.  (Unix will actually
  493. Xaccept EITHER a CR or LF to mark the end of a line.)
  494. X    And given all of this, how come it is still possible to download
  495. Xa text file in Kermit non-image mode, and it looks fine on your PC screen?
  496. XThe answer to this is that Kermit is translating these codes for you.
  497. XEvery time you send a file from a Unix system to an MSDOS system through
  498. XKermit (non-image mode), Kermit changes all the LF's to CR/LF pairs.
  499. XAnd every time you send a file from an MSDOS system to a Unix system,
  500. XKermit changes all the CR/LF pairs to LF's.  This is one of the differences
  501. Xbetween Kermit image and non-image modes; in image mode Kermit does not
  502. Xmake this conversion.
  503. X    The moral to all this is that you cannot encode Unix text files in Alex
  504. Xnon-ASCII mode if you intend to send them to a PC.  Conversely, you cannot
  505. Xdecode MSDOS text files that were uploaded in Alex non-ASCII mode if you intend
  506. Xto read them on the Unix system.  This is a good part of the reason why
  507. Xthe Encode and Decode options were labeled "advanced commands"; you must
  508. Xbe very conscious of the tradeoffs and pitfalls involved.
  509. X
  510. X            ALEX IMPLEMENTATION
  511. X            ===================
  512. X    This section explains how Alex was implemented, and the format
  513. Xof the files it creates.
  514. X    Alex was written on a DEC Vax 11/780 running Unix 4.2 BSD.  Making 
  515. XAlex run on another Unix system should be fairly simple.  You only need 
  516. Xcompile the 'C' programs undigest.c, btoa.c, atob.c and compress.c and put 
  517. Xthem somewhere in your path.  This can be done by: 
  518. X    cc -O -o undigest undigest.c
  519. X    cc -O -o btoa btoa.c
  520. X    cc -O -o atob atob.c
  521. X    cc -O -o compress.c
  522. X    ln compress uncompress
  523. Xassuming that you have already created the files undigest.c, btoa.c, atob.c 
  524. Xand compress.c.  
  525. X    One note on the Btoa and Atob programs. The copies of these programs
  526. Xthat I am sending out with the Alex source files is my own version of the
  527. Xpopular public domain programs of the same name. However, I have slightly
  528. Xmodified these programs to add a minor option. I won't go into details here,
  529. Xbut the main point is that my version is completely compatible with the old
  530. XBtoa and Atob programs; but the old ones won't work with Alex.
  531. X    The only other thing you must do is make a small modification to the
  532. XAlex shell script file. Near the top of the file (immediately following the
  533. Xcomments) you should see a line assigning a value to a variable called
  534. X'mailer'. You should change this line so that the name of the mail
  535. Xprogram on your system is assigned here. For instance, if you are using the
  536. Xstandard Unix mail program, the simple line:
  537. X  mailer=mail
  538. Xwill suffice.
  539. X    You will also note a couple of other comments in the shell script,
  540. Xjust below the mailer definition, for other possible Unix conflicts.
  541. X    With this, the (standard) Alex download feature should work
  542. Xunaided as long as your system supports Kermit. Most Unix systems have
  543. Xa version of Kermit running, so this should be no problem. 
  544. X    If you have difficulty installing Alex on a Unix system, please
  545. Xsend electronic mail to msdos-request@ARDEC, and include a copy of the
  546. X'man' page for your electronic mail program. We will be glad to do our
  547. Xbest to help.
  548. X
  549. X    The format of an Alex library is deliberately simple.  First, all of 
  550. Xthe files to be sent are compressed (unless the ASCII option is used).  Then 
  551. Xthey are encoded using Btoa (again, unless ASCII).  Finally, they are 
  552. Xconcatenated together into one large file, separated only by a line that 
  553. Xbegins with several dashes and has the words "CUT HERE" in the middle.  If 
  554. Xthe ASCII option is used, then the "CUT HERE" line is followed by one more 
  555. Xline identifying the file name: 
  556. X
  557. XASCII filename
  558. X
  559. X    Alex has three major advantages over other similar systems, like the 
  560. Xpublic domain Tarmail.  First, Alex can be ported to non-Unix systems (which 
  561. Xdo not usually have the 'tar' program required by Tarmail).  While it is 
  562. Xtrue that Alex is primarily a Unix shell script program, it turns out that 
  563. Xthe vast majority of the code in this script is for the user interface; very 
  564. Xlittle of it has anything to do with particulars of Unix.  Using the brief 
  565. Xdescription given above of the Alex library format, it should be easy to 
  566. Xwrite Alex in any shell (or batch) language on any operating system.  The 
  567. Xmajor parts of Alex are the public domain C programs (which is certainly not 
  568. Xtrue of Tar).  The only exception to the above is the ASCII option, which is 
  569. Xdecoded using some Unix-specific commands like Cut, Head, and Tail.  
  570. XHowever, this option is really not necessary.  
  571. X    The second advantage to Alex is that it is very easy to manually 
  572. Xbreak up an Alex library (unlike Tarmail).  Many electronic mail systems 
  573. X(like Msg and Mailx) have an 'undigest' command (@ in Msg) that breaks up a 
  574. Xsingle message into several messages, separating them at the location of 
  575. Xlines that begin with several dashes.  Therefore, an Alex-encoded library 
  576. Xcan be easily broken up by undigestifying the message and piping each 
  577. Xindividual message to Atob, and uncompressing any files that end in a .Z 
  578. Xextension.  My special version of Btoa and Atob are necessary, however, to 
  579. Xpreserve the file names.  (Use the '-f' option on Atob.) 
  580. X    The third advantage to Alex over Tarmail deals with modifying an 
  581. Xexisting Alex library.  Since files are separately encoded, and their names 
  582. Xclearly marked in the Btoa listing, a library of Alex files can be broken up 
  583. Xinto its constituent files, and files can be selectively replaced without 
  584. Xremaking the entire library.  
  585. X    Library sizes, incidentally, are about the same for Alex and
  586. XTarmail.  (They both use Compress and Btoa.)
  587. X    One last note: The old version of Alex (1.0) created libraries that 
  588. Xcan be used by the new version, but the converse is not true.  The old Alex 
  589. Xdid not compress files (nor did it uncompress them); the new one 
  590. Xautomatically compresses all files, but checks to see if the files are 
  591. Xcompressed before uncompressing them.  This makes Alex 1.1 and 1.2 upwardly 
  592. Xcompatible.  Versions before 1.1 also do not support the ASCII option, in 
  593. Xeither uploading or downloading.  
  594. X
  595. X            --Ken Van Camp <kvancamp@ARDEC.ARPA>
  596. X    U.S. Army Armament Research Development & Engineering Center
  597. X                SMCAR-FSA-E  Building 329
  598. X            Picatinny Arsenal, NJ  07806-5000
  599. X              (201)724-3334  (AV)880-3334
  600. ________This_Is_The_END________
  601. if test `wc -l < alex.doc` -ne 571; then
  602.     echo 'shar: alex.doc was damaged during transit (should have been 571 bytes)'
  603. fi
  604. fi        ; : end of overwriting check
  605. echo 'x - undigest.c'
  606. if test -f undigest.c; then echo 'shar: not overwriting undigest.c'; else
  607. sed 's/^X//' << '________This_Is_The_END________' > undigest.c
  608. X/* undigest.c: Undigest data from the input stream, and send output
  609. X * to files named fileNN, where file is the parameter given on the
  610. X * commmand line and NN is a numeric file number assigned by undigest.
  611. X * The first file undigestified is named file0, the second file1, and
  612. X * so on.
  613. X * Written by Ken Van Camp, Picatinny Arsenal <kvancamp@ARDEC.ARPA>
  614. X * Version 1.0, June 1986
  615. X */
  616. X
  617. X#include <stdio.h>
  618. X#include <sys/file.h>
  619. X#include <strings.h>
  620. X
  621. X#define CR    '\012'        /* line feed */
  622. X
  623. Xchar    *dashes = {    "-----"
  624. X};
  625. X
  626. Xmain (argc, argv)
  627. Xint argc;
  628. Xchar *argv[];
  629. X{
  630. X    char    *filname,        /* file name output mask */
  631. X        line_buf[256],        /* line buffer */
  632. X        filoutnm[40];    /* name of next file to create */
  633. X    FILE    *filout,        /* output file */
  634. X        *fopen();
  635. X    int    filopen = 0,        /* flag output file open */
  636. X        seqn = 0;        /* version # for output file */
  637. X
  638. X    if (argc < 2){
  639. X        fprintf (stderr, "undigest: No filename specified\n");
  640. X        exit (1);
  641. X    }
  642. X    filname = argv[1];
  643. X
  644. X    while (fgets (line_buf, sizeof line_buf, stdin)){
  645. X        if (!filopen){
  646. X
  647. X            /* Time to open a new file. */
  648. X
  649. X            /* Make sure this isn't just a blank line */
  650. X            if (*line_buf != NULL){
  651. X                sprintf (filoutnm, "%s%d", filname, seqn);
  652. X                if ((filout = fopen(filoutnm, "w+"))==NULL){
  653. X                   fprintf(stderr,"undigest: Can't create %s\n",
  654. X                    filoutnm);
  655. X                   exit(1);
  656. X                }
  657. X                filopen = 1;
  658. X                seqn++;
  659. X            }
  660. X        }
  661. X
  662. X        if (strncmp (dashes, line_buf, 5)){
  663. X            /* No separator in this line */
  664. X            fprintf (filout, "%s", line_buf);
  665. X        }else{
  666. X            /* Found separator; don't print this line */
  667. X            /* Close the old file */
  668. X            if (filopen)
  669. X                fclose (filout);
  670. X            filopen = 0;
  671. X        }
  672. X    } /* while */
  673. X
  674. X    if (filopen)
  675. X        fclose (filout);
  676. X}
  677. ________This_Is_The_END________
  678. if test `wc -l < undigest.c` -ne 69; then
  679.     echo 'shar: undigest.c was damaged during transit (should have been 69 bytes)'
  680. fi
  681. fi        ; : end of overwriting check
  682. exit 0
  683.