home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / k95 / ckermit.upd < prev    next >
Text File  |  2020-01-01  |  189KB  |  4,292 lines

  1. File CKERMIT.UPD, Supplement to "Using C-Kermit", 1st Edition.    -*- text -*-
  2.  
  3. As of C-Kermit version:  6.0.192
  4. and Kermit 95 version:   1.1.7
  5. This file last updated:  Wed Jul 17 09:40:31 1996
  6.  
  7. Authors: Frank da Cruz and Christine M. Gianone
  8. Address: The Kermit Project
  9.          Watson Laboratory
  10.          Columbia University
  11.          612 West 115th Street, New York NY 10025-7799, USA.
  12. Fax:     +1 212 662-6442  -- or --  +1 212 663-8202
  13. E-Mail:  kermit@columbia.edu
  14. Web:     http://www.columbia.edu/kermit/
  15.  
  16.   Copyright (C) 1992, 1996, Trustees of Columbia University in the City of
  17.   New York.  All rights reserved.
  18.  
  19. ------------------------------
  20. WHAT IS IN THIS FILE
  21.  
  22. This file lists changes made to C-Kermit since version 5A(188) was released
  23. and the first edition of the book "Using C-Kermit" was published in 1993.
  24. Use this file as a supplement to "Using C-Kermit".  If you have the second
  25. edition of "Using C-Kermit" (1997), you don't need this file.
  26.  
  27. If the "most recent update" shown above is long ago, contact Columbia
  28. University to see if there is a newer release.
  29.  
  30. For further information, also see the CKCKER.BWR ("C-Kermit beware") file for
  31. hints, tips, tricks, restrictions, frequently asked questions, etc, plus the
  32. system-specific "beware file", e.g. CKUKER.BWR for UNIX, CKVKER.BWR for VMS,
  33. etc, and also any system-specific update files such as BUGS.DOC and
  34. UPDATES.DOC for Windows 95 and NT.
  35.  
  36. ------------------------------
  37. NOTE TO KERMIT 95 USERS
  38.  
  39. This file concentrates on the aspects of C-Kermit that are common to all
  40. versions: UNIX, VMS, OS/2, etc.  Please refer to your Kermit 95 documentation:
  41. the "Kermit 95" booklet, the UPDATES.DOC and BUGS.DOC files, and to all the
  42. other files in the Kermit 95 DOCS directory for information that is specific
  43. to Kermit 95.  Also, please note that "Using C-Kermit" predates Kermit 95
  44. altogether, and so please pardon the fact that it does not mention Windows 95
  45. or NT; it is still the definitive reference for the C-Kermit command and
  46. script programming language.
  47.  
  48. -----------------------------------------
  49. A WORD ABOUT VERSIONS AND VERSION NUMBERS
  50.  
  51. "C-Kermit" refers to all the many programs that are compiled in whole or in
  52. part from common C-language source code, comprising:
  53.  
  54.  . A Kermit file transfer protocol module
  55.  . A command parser and script execution module
  56.  . A modem-dialing module
  57.  . A network support module
  58.  . A character-set translation module.
  59.  
  60. and several others.  These "system-independent" modules are combined with
  61. system-dependent modules for each platform to provide the required
  62. input/output functions, and also in some cases overlaid with an alternative
  63. user interface, such as Macintosh Kermit's point-and-click interface, and in
  64. some cases also a terminal emulator, as in Macintosh Kermit, OS/2 C-Kermit, or
  65. Kermit 95.
  66.  
  67. The C-Kermit version number started as 1.0, ... 3.0, 4.0, 4.1 and then
  68. (because of confusion at the time with Berkeley UNIX 4.2), 4B, 4C, and so on,
  69. with the specific edit number in parentheses, for example 4E(072) or 5A(188).
  70. This scheme was used through 5A(191), but now we have gone back to the
  71. traditional numbering scheme with decimal points:  major.minor.edit; for
  72. example 6.0.192.
  73.  
  74. Meanwhile, C-Kermit versions for some platforms might go through several
  75. releases while C-Kermit itself remains the same.  These versions have their
  76. own platform-specific version numbers, such as Kermit 95 1.1.1, 1.1.2, and
  77. so on, or Macintosh Kermit 0.993.
  78.  
  79. ------------------------------
  80. CONTENTS
  81.  
  82.  I.  C-KERMIT DOCUMENTATION: Information about the C-Kermit manual.
  83.  
  84.  II. NEW FEATURES: Documentation for features added since 5A(188) --
  85.  
  86.      (1) PROGRAM MANAGEMENT
  87.          1.0. Finding and Executing Command Files
  88.      1.1. Command Retry, Recall, and Typeahead
  89.      1.2. The System-Wide Initialization File
  90.      1.3. The SET EXIT Command
  91.          1.4. The SET BELL Command
  92.          1.5. Command-File Line Numbers
  93.          1.6. Disabling System Access
  94.          1.7. The "KERMIT" Command
  95.          1.8. Automatic CD
  96.          1.9. Improved ?-Menus
  97.          1.10. "More?" prompting
  98.      (2) MAKING AND USING CONNECTIONS
  99.          2.0. Modems and Dialing
  100.          2.1. Using the Services Directory
  101.      2.1.1. Login Macros
  102.      2.1.2. Connection Details
  103.          2.2. Incoming TCP/IP Connections
  104.          2.3. Controlling TCP Parameters
  105.          2.4. The Network Directory
  106.          2.5. Automatic Flow Control
  107.      (3) TERMINAL CONNECTION
  108.          3.0. Automatic File Transfer
  109.      3.1. The APC Escape Sequence
  110.      3.2. The CONNECT Command
  111.      3.3. The SET KEY Command
  112.      3.4. The SET TERMINAL Command
  113.          3.5. The SET TELNET Command
  114.      (4) FILE TRANSFER AND MANAGEMENT
  115.          4.0. New File Transfer Commands
  116.      4.0.1.  Automatic Transfer Mode
  117.      4.0.2.  Dynamic Packet Timeouts
  118.      4.0.3.  The MOVE and MMOVE Commands
  119.      4.0.4.  The BINARY and TEXT Commands
  120.      4.0.5.  The FAST, CAUTIOUS, and ROBUST Macros
  121.      4.0.6.  New Default Block Check Type
  122.      4.0.7.  New Auto-up/download Feature
  123.          4.0.8.  Packet Length Slow Start
  124.      4.0.9.  Download Directory
  125.      4.0.10. The SEND List
  126.          4.0.11. The -Q Option
  127.      4.1. File Transfer Recovery
  128.      4.1.1.  The RESEND and REGET Commands
  129.      4.1.2.  Manual Recovery: The PSEND Command
  130.      4.2. Control-Character Unprefixing
  131.      4.3. Keyboard Cancellation of Packet Mode
  132.      4.4. New RECEIVE Command Features
  133.      4.5. Automatic Directory Creation
  134.      4.6. Pausing Between Packets
  135.      4.7. Fullscreen File Transfer Display Improvements
  136.      4.7.1.  Thermometer
  137.      4.7.2.  Repainting the Screen
  138.          4.8. Improved Status Codes
  139.          4.9. Managing Directories
  140.          4.10. Printing
  141.          4.11. Text-file Record-format Control
  142.          4.12. Incoming File Destination Control
  143.      (5) NEW CLIENT/SERVER FEATURES
  144.          5.0. REMOTE Command Redirection
  145.      5.1. New REMOTE Commands
  146.      5.2. "WHATAMI" -- Making Kermit GET more like FTP GET
  147.          5.3. Idle Timeout for Server
  148.          5.4. Internally Generated Directory Listings
  149.          5.5. Server GET Path
  150.      (6) INTERNATIONAL CHARACTER SETS
  151.      6.1. Hebrew File Transfer
  152.      6.2. Hebrew Terminal Emulation
  153.      6.3. The Hewlett Packard Roman8 Character Set
  154.      (7) SCRIPT PROGRAMMING
  155.      7.1. New IF Commands
  156.      7.2. New \v() Variables
  157.      7.3. New \f() functions
  158.      7.4. INPUT and OUTPUT Command Improvements
  159.      7.5. The New MINPUT Command
  160.      7.6. Other New or Improved Script Programming Commands
  161.          7.7. Arrays
  162.          7.8. Arithmetic
  163.          7.9. New Block Structure for Commands
  164.          7.10. Local Variables
  165.          7.11. More Uses for "Long Variable Names"
  166.          7.12. hh:mm:ss Time Notation in Selected Commands
  167.          7.13. The SWITCH Command
  168.      (8) USING OTHER FILE TRANSFER PROTOCOLS
  169.          8.0. Built-in XYZMODEM (Kermit 95 only)
  170.      8.1. The REDIRECT Command
  171.      8.2. New Macros for External Protocols
  172.          8.3. Built-in Selection for External Protocols
  173.  
  174.      (9) NEW COMMAND-LINE OPTIONS
  175.  
  176. III. APPENDICES  
  177.  
  178.      Appendix 1: UNIX C-KERMIT
  179.      Appendix 2: VMS C-KERMIT
  180.      Appendix 3: OS/2 C-KERMIT
  181.      Appendix 4: MACINTOSH KERMIT
  182.      Appendix 5: STRATUS VOS C-KERMIT
  183.   
  184. IV. ERRATA & CORRIGENDA: Corrections to "Using C-Kermit"
  185.  
  186. ------------------------------
  187. I. C-KERMIT DOCUMENTATION
  188.  
  189. The user manual for C-Kermit is:
  190.  
  191.   Frank da Cruz and Christine M. Gianone, "Using C-Kermit", Digital Press /
  192.   Butterworth-Heinemann, Woburn, MA, 1993, 514 pages, ISBN 1-55558-108-0
  193.  
  194.   US single-copy price: $39.95; quantity discounts available.  Available in
  195.   computer bookstores or directly from Columbia University:
  196.  
  197.     The Kermit Project
  198.     Columbia University
  199.     612 West 115th Street
  200.     New York NY  10025-7799
  201.     USA
  202.     Telephone: +1 (212) 854-3703
  203.     Fax:       +1 (212) 663-8202
  204.  
  205.   Domestic and overseas orders accepted.  Price: US $39.95 (US, Canada, and
  206.   Mexico), $50 elsewhere.  Orders may be paid by MasterCard or Visa, or
  207.   prepaid by check in US dollars.  Add $35 bank fee for checks not drawn on
  208.   a US bank.  Price includes shipping.  Do not include sales tax.
  209.   Inquire about quantity discounts.
  210.  
  211.   You can also order by phone from the publisher, Digital Press /
  212.   Butterworth-Heinemann, with MasterCard, Visa, or American Express:
  213.  
  214.     +1 800 366-2665   (Woburn, Massachusetts office for USA & Canada)
  215.     +44 1865 314627   (Oxford, England distribution centre for UK & Europe)
  216.     +61 03 9245 7111  (Melbourne, Vic, office for Australia & NZ)
  217.     +65 356-1968      (Singapore office for Asia) 
  218.     +27 (31) 2683111  (Durban office for South Africa)
  219.  
  220.   A German-language edition is also available:
  221.  
  222.     Frank da Cruz and Christine M. Gianone, "C-Kermit - Einfuehrung und
  223.     Referenz", Verlag Heinz Heise, Hannover, Germany (1994).
  224.     ISBN 3-88229-023-4.  Deutsch von Gisbert W. Selke.  Price: DM 88,00.  
  225.     Verlag Heinz Heise GmbH & Co. KG, Helstorfer Strasse 7, D-30625 Hannover.
  226.     Tel. +49 (05 11) 53 52-0, Fax. +49 (05 11) 53 52-1 29.
  227.  
  228. The Kermit file transfer protocol is specified in:
  229.  
  230.   Frank da Cruz, "Kermit, A File Transfer Protocol", Digital Press,
  231.   Bedford, MA, 1987, 379 pages, ISBN 0-932376-88-6.
  232.   US single-copy price: $32.95.  Availability as above.
  233.  
  234. Kermit for Windows 95 is documented in:
  235.  
  236.   Christine M. Gianone and Frank da Cruz, "Kermit 95",
  237.   Manning Publications, Greenwich CT (1996), 88 pages, ISBN 1-884777-14-7.
  238.   US single-copy price: $14.95.  Included in Kermit 95 shrink wrapped
  239.   package and available separately from Columbia University or direct
  240.   from the publisher:
  241.  
  242.     Manning Publications Co.
  243.     3 Lewis Street
  244.     Greenwich CT  06830
  245.     USA
  246.     Fax:   +1 (203) 661 9018
  247.     Email: 73150.1431@compuserve.com
  248.  
  249. News and articles about Kermit software and protocol are published
  250. periodically in the journal, Kermit News.  Subscriptions are free; contact
  251. Columbia University at the address above.
  252.  
  253. Online news about Kermit is published in the comp.protocols.kermit.announce
  254. and comp.protocols.kermit.misc newsgroups.
  255.  
  256. ------------------------------
  257. II. NEW FEATURES
  258.  
  259. Items are grouped together by major topic, roughly corresponding to the
  260. chapters of "Using C-Kermit".
  261.  
  262. (1) PROGRAM MANAGEMENT
  263.  
  264. 1.0. Finding and Executing Command Files
  265.  
  266. The recommended extension (filetype) for Kermit scripts is KSC (Kermit SCript).
  267. This avoids conflicts other types of files that might have extensions like
  268. SCR (e.g. in Windows this means "Screen Saver"), CMD (OS/2 Rexx file), etc.
  269.  
  270. When you give a TAKE command, specifying the name of a command file, C-Kermit
  271. tries to find the file in the normal way and fails if it can't.  As of edit
  272. 192, if it can't find the file, then, if the filename that you gave was not
  273. "absolute" -- that is, it did not include a full path -- then Kermit looks in
  274. either your home directory or your Kermit software installation area,
  275. depending on the operating system.  In OS/2, Windows NT or Windows 95, it
  276. looks in the SCRIPTS subdirectory directory.  In UNIX it looks in your home
  277. (login) directory.
  278.  
  279. So, for example, in Windows 95, if your Kermit 95 directory is D:\K95, and you
  280. keep all your Kermit 95 command files in D:\K95\SCRIPTS, then you can give
  281. TAKE commands for them by name only, no matter what your current directory is:
  282.  
  283.   [C:\TMP] K-95> take oofa.ksc
  284.  
  285. Starting in edit 192, error messages issued during execution of a command file
  286. show the file name and line number at which the error occurred.  This makes it
  287. easier to debug scripts.  If an error occurred during execution of a macro,
  288. the line number indicates the file line where the macro was invoked, not the
  289. line or command within the macro.  Lines are numbered starting at 1.
  290.  
  291. Similarly, if you SET SET TAKE ECHO ON, the line numbers from the file are
  292. shown.
  293.  
  294. 1.1. Command Retry, Recall, and Typeahead
  295.  
  296. These features apply only when you are typing commands at the C-Kermit>
  297. prompt, and not to command file or macro execution.  They were added in
  298. edit 190.
  299.  
  300. If you enter a command that contains a syntax error, C-Kermit now reprompts
  301. you automatically with the portion of the command that was correct, so you
  302. don't have to retype it.  Example:
  303.  
  304.   C-Kermit>set block-check oofa
  305.   ?No keywords match - oofa
  306.   C-Kermit>set block-check _
  307.  
  308. "_" shows the position of the cursor after you are reprompted.  At this
  309. point, you can type question mark (?) to find out what is legal here, or you
  310. can complete the command, or you can erase it with Ctrl-U, etc, just as if
  311. you had retyped the initial words yourself.  If you want to disable this
  312. feature, tell C-Kermit to:
  313.  
  314.   SET COMMAND RETRY OFF
  315.  
  316. C-Kermit versions that are built with the "DYNAMIC" memory allocation option
  317. now support command recall (type "show features" and look for DYNAMIC and/or
  318. CK_RECALL).  C-Kermit saves your commands in a command recall (history)
  319. buffer, which, by default, holds your last 10 commands.  To recall your
  320. previous command, type Ctrl-P (that is, hold down the Control or Ctrl key and
  321. press the P or p key) or Ctrl-B.  Type Ctrl-P (or Ctrl-B) again to recall the
  322. command before that, and so on.  If you try to go back too far, C-Kermit beeps
  323. at you.
  324.  
  325.   NOTE: In OS/2 and Windows you should use Ctrl-B rather than Ctrl-P because,
  326.   at least in certain kinds of sessions, depending on your system's
  327.   configuration, Ctrl-P is trapped by OS/2 or Windows itself as a "toggle
  328.   printer" command, as in MS-DOS.
  329.  
  330. Each time you recall a command, it appears before you as if you had typed it
  331. up to, but not including, the Enter (Carriage Return) that actually causes it
  332. to execute.  If you want to execute the command, press the Enter (Carriage
  333. Return) key.  If you want to edit it, use the editing keys, including Ctrl-U
  334. to erase it.
  335.  
  336. When you are viewing recalled commands, you can also go forwards in the
  337. command recall buffer by typing Ctrl-N.  This is handy in case (for example),
  338. you typed too many Ctrl-P's, and went back too far.
  339.  
  340.   NOTE: In general, arrow keys (and mice, etc) can not be used for command
  341.   recall.  Why?  Because C-Kermit would have to grow to twice its size to
  342.   include all the operating-system, version, hardware, keyboard, and terminal
  343.   dependent code to make these devices work uniformly on all (or even some) of
  344.   the computers where C-Kermit runs.  EXCEPTION: The up- and down-arrow keys
  345.   can be used in Windows and OS/2 to scroll up and down in the command recall
  346.   buffer.
  347.  
  348. You can change the size of the command recall buffer to hold any number of
  349. commands you like, subject to the memory limitations of your computer.  The
  350. command is:
  351.  
  352.   SET COMMAND RECALL-BUFFER-SIZE number
  353.  
  354. where "number" is the number of commands you want to keep.  The more you keep,
  355. the more memory C-Kermit uses.  If you enter a size of 0, the command recall
  356. feature is disabled.  Whenever you give the SET COMMAND RECALL-BUFFER-SIZE
  357. command, your previous command history is lost.  You can display the size of
  358. your command recall buffer, as well as your COMMAND RETRY setting, with:
  359.  
  360.   SHOW COMMAND
  361.  
  362. (Note: SET CMD and SHOW CMD are synonyms for SET COMMAND and SHOW COMMAND)
  363.  
  364. Typeahead is now permitted during entry of interactive commands.  Typeahead is
  365. not preserved, however, over execution of command files or macros, because
  366. these might themselves require keyboard input, or might enter CONNECT or file
  367. transfer protocol mode.  Edit 190.
  368.  
  369. 1.2. The System-Wide Initialization File
  370.  
  371. As of edit 190, C-Kermit can be configured to execute its initialization file
  372. from a single system-wide directory, rather than requiring a copy in each
  373. user's home directory.  This is particularly important for UNIX; VMS C-Kermit
  374. already had a facility for this.  A common initialization file saves disk
  375. space and management headaches.  It is recommended that all the features of
  376. the standard initialization file (dialing directory and services directory
  377. setup, chaining to customization file, etc) be kept intact.
  378.  
  379. 1.3. The SET EXIT Command
  380.  
  381. SET EXIT WARNING { ON, OFF, ALWAYS } tells whether C-Kermit should issue a
  382. warning message and require confirmation if an EXIT command, or a SET LINE
  383. (SET PORT), SET HOST, or TELNET command is given and a connection (dialed or
  384. network) still appears to be open, since any of these commands would close the
  385. currently open connection.  The default is OFF, meaning no warnings.  ALWAYS
  386. means always warn.
  387.  
  388. If SET EXIT WARNING is ON, a warning is issued if a network connection appears
  389. to be open:
  390.  
  391.   C-Kermit>exit
  392.    A network connection to foo.bar.edu might still be active.
  393.   OK to exit?
  394.  
  395. at which point you can type Yes or No.
  396.  
  397. You will also get a warning if the serial SET LINE device has the carrier (CD,
  398. DCD) signal and C-Kermit has not been told to SET CARRIER-WATCH OFF:
  399.  
  400.   C-Kermit>set line /dev/acu
  401.    A serial connection might still be active on /dev/ttyh6.
  402.   OK to close?
  403.  
  404. Note that not all versions of C-Kermit have access to the carrier signal; if
  405. your version of C-Kermit says "Modem signals not available" when you give a
  406. SHOW COMM command, then SET EXIT WARNING ON will always warn you about a
  407. possibly active serial connection when you try to exit after using a SET LINE
  408. / SET PORT connection.
  409.  
  410. SET EXIT STATUS <number> tells C-Kermit to use the given number as its program
  411. exit (return) code.  This lets the user set program return code without
  412. actually having to exit; for example, the user can OR in various bits at
  413. different times.
  414.  
  415. Display the SET EXIT values with SHOW EXIT.  Edit 190.
  416.  
  417. 1.4. SET BELL { AUDIBLE { BEEP, SYSTEM-SOUNDS }, VISIBLE, NONE }
  418.  
  419. This command applies only to OS/2 and Windows.  It tells how bell (beep)
  420. characters / noises should be sounded or displayed.  VISIBLE means to
  421. flash the screen rather than making a noise.  AUDIBLE means to make a noise,
  422. which can be either the standard "beep", or else "System sounds" that give
  423. you three different noises for "information", "warning", and "error".
  424.  
  425. 1.5. Command-File Line Numbers
  426.  
  427. Beginning in edit 192, any errors that occur during execution of a command
  428. file display the offending line, the name of the file that it's in, and
  429. its line number within the file.  File line numbers are also shown during
  430. command-file execution if you SET TAKE ECHO ON.
  431.  
  432. 1.6. Disabling System Access
  433.  
  434. Many sites wish to install C-Kermit "behind a menu" in such a way that users
  435. can only do things that the system administrator approves of.  In many cases
  436. the administrator does not want to let users "escape to the shell", which
  437. is accomplished in C-Kermit using RUN, !, PUSH, REDIRECT, and similar
  438. commands.  There has long been a compile-time option, NOPUSH, to remove
  439. these functions from C-Kermit, but beginning in edit 192, there is now also
  440. a runtime option.  If the command NOPUSH is given, all of these facilities
  441. are disabled until the program exits.  Thus NOPUSH can be included in a
  442. system-wide initialization file, or on the command line (kermit -C nopush),
  443. etc.  Furthermore, if C-Kermit is started and the environment variable
  444. (logical name in VMS) CK_NOPUSH is defined (to be anything at all), this is
  445. equivalent to giving the NOPUSH command.
  446.  
  447. 1.7. The "kermit" Command
  448.  
  449. Most versions of C-Kermit have two kinds of commands: command-line options
  450. (like a traditional 1960s-vintage UNIX program) and interactive commands
  451. and the two are completely different.
  452.  
  453. Beginning in edit 192, it is possible to give a C-Kermit command-line 
  454. invocation at the C-Kermit> interactive-mode prompt, and it will actually
  455. work as expected, for example:
  456.  
  457.   C-Kermit> kermit -r
  458.  
  459. Tells C-Kermit to receive a file, just as "kermit -r", when given at the
  460. system prompt, starts Kermit in RECEIVE mode.  Note, however, that you must
  461. use C-Kermit's own grouping mechanism in these commands, not your shell's.
  462. Example: kermit -C { command, command } rather than kermit -C " command,
  463. command ".
  464.  
  465. 1.8. Automatic CD
  466.  
  467. In the Windows and OS/2 versions, if you give a disk letter followed by
  468. a colon, at the C-Kermit> prompt, C-Kermit will treat it the same way the
  469. DOS prompt does -- it will change to the given disk.  As an added bonus,
  470. you may also include a directory name after the colon, which you can't
  471. do at the DOS prompt.
  472.  
  473. 1.9. Improved ?-Menus
  474.  
  475. In 6.0.192, context-sensitive help menus (the lists you get when you type
  476. a question mark (?) in a command) are now organized maximally for your screen
  477. or window size, rather than into fixed-size columns.  Furthermore, if C-Kermit
  478. knows your screen length, then rather than scrolling long lists right off the
  479. screen, it gives you a "More?" prompt, described in the next section.
  480.  
  481. When using ? to view a file list, the list is now alphabetized, and in most
  482. cases it is allowed to be significantly longer than in previous releases.
  483.  
  484. 1.10. "More?" Prompting
  485.  
  486. In displays produced by a C-Kermit commands, such as the keyword or file lists
  487. mentioned in 1.9, as well as the output of various SHOW commands, the HELP
  488. command, etc, C-Kermit does its best to pause at the end of each screenful,
  489. ask "More?", and wait for you to type something before displaying the next
  490. screen.
  491.  
  492. The place where C-Kermit pauses is based upon its idea of your screen size,
  493. which it obtains by asking the operating system.  If the operating system
  494. doesn't know, then 24 lines by 80 columns is assumed.  You can change
  495. C-Kermit's idea of your command-screen dimensions with the commands:
  496.  
  497.   SET COMMAND HEIGHT <number-of-rows>
  498.   SET COMMAND WIDTH <number-of-columns>
  499.  
  500. In the Windows and OS/2 versions, these commands change the size of the
  501. command screen size.  In UNIX, VMS, and the other versions, they are used 
  502. to adjust C-Kermit to what the size actually is.
  503.  
  504. The "More?" prompt gives you time to read the material on the screen.  At the
  505. "More?" prompt you can reply "y" (or press the space bar) to see the next
  506. screen, or "n" or "q" to cancel the list and return to the prompt.
  507.  
  508. Furthermore (in edit 192 and later), you can turn more-prompting on and off
  509. with the command:
  510.  
  511.   SET COMMAND MORE-PROMPTING { ON, OFF }
  512.  
  513. If you turn it off, long reports -- such as file lists produced by typing
  514. a question mark in a filename field (such as "send ?") will scroll past
  515. without pausing.  This behavior might be preferred by those whose command
  516. windows have vertical scroll bars.
  517.  
  518. NOTE: "More?" prompting presently does not work for listings produced by
  519. system processes that are started by C-Kermit, e.g. by commands like RUN or
  520. DIRECTORY.  However, in most systems you can achieve it yourself; e.g. by
  521. using "run dir /p" in Windows or OS/2 or "!ls -l | more" in UNIX (a good use
  522. for macros).
  523.  
  524. (2) MAKING AND USING CONNECTIONS
  525.  
  526. 2.0 Modems and Dialing
  527.  
  528. Dial and modem operations were totally overhauled in edit 192 to give you
  529. total control over every aspect of modem setup and configuration, as well as
  530. dialing procedures and phone number format.  The dialing directory format
  531. was changed to allow for "portable" phone numbers that can be dialed from
  532. any location.  All of these improvements -- hopefully all of them backwards
  533. compatible so as not to break current setups -- are detailed in separate
  534. files.
  535.  
  536. Also note that new modem types are being added all the time.  To get a
  537. current list, type "set modem type ?" at the C-Kermit> prompt.
  538.  
  539. 2.1 Using The Services Directory
  540.  
  541.   NOTE: The Services Directory is replaced in Kermit 95 by the 
  542.   graphical Dialer.  Kermit 95 users should skip this section.
  543.   Kermit 95's graphical Dialer is explained in the Kermit 95 manual.
  544.  
  545. In the original release of C-Kermit, 5A(188), the services directory feature
  546. was provided mainly as an illustration of how C-Kermit's script programming
  547. language can be used to build handy communications tools, and so it was not
  548. presented or explained until Chapter 13 of "Using C-Kermit", and therefore was
  549. probably missed by a lot of readers (and users).
  550.  
  551. Since then, the services directory feature has proven to be quite useful in
  552. its own right, and has also been improved in one small but important way.
  553. Here is a brief nontechnical explanation.
  554.  
  555. The services directory is a plain-text file in your home directory, containing
  556. one line, or "entry", for each service that you want to access.  Each service
  557. listed in your services directory can be connected to and logged in to
  558. automatically, no matter whether this involves dialing up a modem, making a
  559. network connection, or any other type of connection that C-Kermit can handle.
  560. The name of the services directory file is .ksd in UNIX and OS-9, and
  561. CKERMIT.KSD in OS/2, VMS, and elsewhere.
  562.  
  563. The services directory can be used only if you are also using the standard
  564. C-Kermit initialization file.
  565.  
  566. Each line in the services directory has the following parts:
  567.  
  568.   <name-of-entry> <login-macro-name> <username> <connection-details>
  569.  
  570. For example:
  571.  
  572.   HP9000 unixlogin olga net tcp/ip hp.xyzcorp.com
  573.  
  574. where "HP9000" is the entry name, "unixlogin" is the login macro name,
  575. "olga" is the username, and "net tcp/ip hp.xyzcorp.com" are the connection
  576. details.
  577.  
  578. To use this entry, you would give the following command at the C-Kermit
  579. prompt:
  580.  
  581.   access hp9000
  582.  
  583. or:
  584.  
  585.   access hp9000 xxxxxx
  586.  
  587. where "xxxxxx" is your password on the computer you will be accessing.
  588. C-Kermit's ACCESS macro (defined in your C-Kermit initialization file) handles
  589. the connection details: "net" means it's a network connection; "tcp/ip" tells
  590. which type of network, and "hp.xyzcorp.com" tells the name or address (in this
  591. case, the name) of the computer or service on the network.  If you don't
  592. supply a password to the ACCESS command, you are prompted for it.  You do not
  593. (can not, and should not) include passwords in your services directory file.
  594.  
  595. Here's another example, in which the connection is made by dialing a modem:
  596.  
  597.   COMPUSERVE cislogin  765,4321  call hayes /dev/cua 2400 93,876-5432
  598.  
  599. Here, "COMPUSERVE" is the entry name, "cislogin" is the name of the login
  600. macro, "765,4321" is your CompuServe user ID, and the connection details are:
  601. "call hayes /dev/cua 2400 93,876-5432".  "Call" means we will be making a
  602. phone call; "hayes" tells which type of modem, "/dev/cua" is the name of the
  603. device that modem is connected to, "2400" tells the communication speed, and
  604. "93,876-5432" is the phone number to dial.
  605.  
  606. 2.1.1. Login Macros
  607.  
  608. Each login macro looks for the appropriate prompts from the host or service
  609. and responds accordingly with your username, password, and/or other
  610. information, and then waits until it sees the main prompt of the host or
  611. service, or other indication that you have been logged in successfully.
  612.  
  613. The following login macros are available in the standard C-Kermit
  614. initialization file (.kermrc on UNIX and OS-9, CKERMIT.INI elsewhere):
  615.  
  616. UNIXLOGIN
  617.   For logging in to all types of UNIX systems: Solaris, HP-UX, Linux, IRIX,
  618.   DG/UX, NeXTSTEP, OSF/1, SunOS, etc etc.  The default system prompt
  619.   (explained below) is "\13\10$\32"; that is, carriage return, linefeed,
  620.   dollar sign, space.
  621.  
  622. VMSLOGIN 
  623.   For logging in to DEC VAX/VMS or OpenVMS systems.  The default system prompt
  624.   is "\10\13$\32"; that is, linefeed, carriage return, dollar sign, space.
  625.   This macro can also be used for logging in to DG AOS/VS systems if you
  626.   specify a different prompt ("\13\10)\32").  NOTE: The VMSLOGIN macro has
  627.   been updated to account for new procedures for use with VMS 6.0 and/or 6.1,
  628.   while retaining comptability with earlier VMS releases.
  629.  
  630. VMLINELOGIN
  631.   For logging into IBM mainframes with VM/CMS over linemode connections.
  632.  
  633. VMFULLOGIN
  634.   For logging into IBM mainframes with VM/CMS over fullscreen connections.
  635.  
  636. CISLOGIN
  637.   For logging in to CompuServe.
  638.  
  639. DOWLOGIN
  640.   For logging in to Dow Jones News/Retrieval.
  641.  
  642. DJNRSPRINT
  643.   For logging in to Dow Jones News/Retrieval over SprintNet.
  644.  
  645. NOLOGIN
  646.   For accessing computers or services that do not require logging in.
  647.  
  648. Each login macro name must be followed by a username, even NOLOGIN.
  649. For NOLOGIN, just include a "dummy" name, like "xxxx", that will not be used.
  650.  
  651. Other login macros can be easily constructed, modeled on those above.  Read
  652. Chapters 11-13 of "Using C-Kermit" for full instructions.  If you add or
  653. modify login macros, you should put their definitions in your C-Kermit
  654. customization file (.mykermrc in UNIX and OS-9, CKERMOD.INI elsewhere).
  655.  
  656. There was a problem with the login macros in C-Kermit 5A(188-189), namely that
  657. the system prompt was hard-coded into the macro.  For example, the UNIXLOGIN
  658. macro assumed that the UNIX shell prompt was "$ " (dollar sign followed by
  659. space), but in many cases it might be something else, and the only way to
  660. allow for different prompts was to edit the macro itself.  In C-Kermit 5A(190)
  661. and later, you may include the system prompt in your services directory by
  662. grouping it together in curly braces with the login macro name:
  663.  
  664.   {macroname prompt}
  665.  
  666. For example:
  667.  
  668.   CSHELL    {unixlogin \13\10%\32} olga net tcp/ip bsd.xyzcorp.com
  669.   CHEMISTRY {vmslogin \10\13CHEM$} OLGA net tcp/ip chemlab.xyzcorp.com
  670.   DG        {vmslogin \13\10)\32}  olga net tcp/ip aosvs.xyzcorp.com
  671.  
  672. The first example specifies the C-Shell prompt, "% ", rather than using the
  673. default UNIX (Bourne Shell, K-Shell) prompt of "$ ".  The second example
  674. accesses a system that has a custom prompt.  The third uses the VMSLOGIN macro
  675. to access a Data General AOS/VS system by specifying the AOS/VS prompt, ") ",
  676. since otherwise the Username: and Password: prompts are the same as for VMS.
  677.  
  678. The "backslash-number" notation is a way of including special (usually
  679. nonprintable) characters in C-Kermit commands and files, explained on pages
  680. 21-22 of "Using C-Kermit".  The number is the ASCII character number, such as
  681. 10 for linefeed, 32 for space.
  682.  
  683. 2.1.2. Connection Details
  684.  
  685. The Connection Details part of a services directory entry starts with one
  686. of the following words:
  687.  
  688.   CALL     - The connection is made with a phone call through a modem.
  689.   SERIAL   - The connection is a direct (dedicated) serial connection.
  690.   NET      - The connection is made on a network.
  691.  
  692. The subsequent information depends on the type of connection.
  693.  
  694. CALL must be followed by the following information, in this order:
  695.  
  696.   1. The modem type (a valid SET MODEM value).
  697.   2. The name of the device on your computer that the modem is connected to.
  698.   3. The speed, in bits per second, at which to use the device.
  699.   4. The telephone number to dial.  This can also be the name of an entry
  700.      in your dialing directory.
  701.  
  702. SERIAL must be followed by the following information, in this order:
  703.  
  704.   1. The serial device name.
  705.   2. The communication speed.
  706.  
  707. NET must be followed by:
  708.  
  709.   1. The network type: TCP/IP, X.25, DECNET, etc (a valid SET NET TYPE value).
  710.   2. The name or address of the host or service you want to connect to.
  711.   3. Additional network-specific information, like a service or socket number.
  712.  
  713. For TCP/IP network connections, you can include a socket number by appending
  714. to the IP name or address with a colon, for example:
  715.  
  716.   WEATHER  nologin  xxxx  net tcp/ip madlab.sprl.umich.edu:3000
  717.  
  718. Create your services directory file using a text editor, as a plain-text
  719. (ASCII) file.  If you are using a word processor, be sure to save your
  720. services directory as a plain text (ASCII) file.
  721.  
  722. To use your services directory, just type "access" and the service name at the
  723. C-Kermit prompt, for example:
  724.  
  725.   C-Kermit> access hp9000
  726.    olga's password: __________
  727.  
  728. To list your services directory, type "list" at the C-Kermit prompt.  To look
  729. up a particular services directory entry, type "list" and then the name, for
  730. example "list hp9000".
  731.  
  732. 2.2. Incoming TCP/IP Connections
  733.  
  734. As of September 27, 1995, Kermit protocol has an official TCP Registered Port
  735. Number from the Internet Assigned Numbers Authority (RFC 1340):
  736.  
  737.   1649
  738.  
  739. We haven't quite decided what to do with it yet, so let's hold it in reserve.
  740.  
  741. In the OS/2, Windows NT, and Windows 95 versions of C-Kermit, which support
  742. incoming TCP/IP connections, this is the default port number for "set host *".
  743. You still can (and should) specify any other desired port after the "*",
  744. e.g. "set host * 3333".
  745.  
  746. In edit 192 incoming TCP/IP connections were also added for UNIX and VMS,
  747. as long as the underlying operating system or TCP/IP library provides the
  748. select() function.  You can tell if your version of Kermit supports this
  749. feature by giving the command "SHOW FEATURES" and looking to see that
  750. TCPSOCKET is listed and NOLISTEN is not listed -- or simply by trying it.
  751.  
  752. For the present, incoming connections can be used in the following ways:
  753.  
  754.  . For chat sessions.  This requires both Kermit programs to be in
  755.    CONNECT mode.  
  756.  
  757.  . For protocol operations.  For this you would typically put the 
  758.    listening Kermit in server mode after the connection came in.
  759.  
  760.  . For "host mode", such as the one that comes with Kermit 95, which is
  761.    implemented as a script.  This gives incoming clients a nice menu.
  762.  
  763. One good use for this feature is when you want to exchange files with someone
  764. else on the Internet, and neither of you has a login ID on the other person's
  765. computer.  Anonymous ftp is often not a solution because (e.g. on UNIX) you
  766. might not have write access to the /pub/ftp tree to put something there to be
  767. picked up, and/or your site does not allow anonymous users write access.  Or,
  768. perhaps more to the point, the files to be transferred are of a private nature
  769. and you might not want to trust them to email.  In this case you can set up an
  770. access point only for the intended person.  See the example at the end of this
  771. section.
  772.  
  773. Since the SET HOST * command blocks until a connection comes in (or until you
  774. interrupt it with Ctrl-C), you would normally have to sit and wait for this to
  775. happen before you type the next command (CONNECT, SERVER, etc).  For this
  776. reason, incoming connections are best set up from a command file or macro.
  777. For example, to set up a server:
  778.  
  779.   define be_a_server set host * 3333, if success serve
  780.   define lets_chat set host * 4444, if sucess connect
  781.  
  782. and so on.
  783.  
  784. In operating systems like UNIX and VMS, which have real user IDs, passwords,
  785. groups, access controls, and so on, C-Kermit does not interface with those
  786. mechanisms in any way (this might come in a later release).  Instead, it runs
  787. as the user who started it -- in the user's file space, name space, etc, with
  788. all of the user's access rights in effect.
  789.  
  790. To achieve a measure of security, use the DISABLE and ENABLE commands
  791. described in "Using C-Kermit", Chapter 7, page 148.  For example, if you use
  792. DISABLE CD in combination with SET FILE DOWNLOAD-DIRECTORY (see section 4.0),
  793. you can restrict the client's read access to one directory and its write
  794. access to a different directory.
  795.  
  796. The SET SERVER LOGIN command was also added in edit 192 for an additional
  797. measure of protection:
  798.  
  799.   SET SERVER LOGIN [ username [ password [ account ] ] ]
  800.  
  801. The maximum length for each field is 32.  If you give this command prior to
  802. putting C-Kermit in server mode, nobody will be able to issue any commands
  803. until they use REMOTE LOGIN to supply a username (and password, if you
  804. specified one) that match those from SET SERVER LOGIN exactly.  Logins and
  805. logouts are recorded in the transaction log ("log transactions").
  806.  
  807. Presently only one username/password combination can be set up; there is no
  808. "password file" or user list by which the Kermit server supports multiple
  809. users.  WARNING: this command echoes like any other, so the password will be
  810. visible when you type it; furthermore there is no encryption of any kind.
  811.  
  812. In short, use this feature at your own risk :-)  And use your imagination...
  813. Note: C-Kermit is not yet suitable for use as a system service or daemon, e.g.
  814. for running under inetd, or like (say) ftpd is.
  815.  
  816. As to performance, measurements made on a fast and unloaded computer on a
  817. fast an unloaded network showed file transfer speed improved over 90% when
  818. the Kermit server was accessed directly on a socket as opposed to going
  819. through an intermediate Telnet server and pseudoterminal driver.
  820.  
  821. Here's an example of setting up a TCP/IP Kermit server:
  822.  
  823.   $ cd private
  824.   $ kermit
  825.   [/usr/olga/private] C-Kermit> log transactions
  826.   [/usr/olga/private] C-Kermit> disable cd
  827.   [/usr/olga/private] C-Kermit> set download directory ./incoming
  828.   [/usr/olga/private] C-Kermit> set server login olaf supersecret  
  829.   [/usr/olga/private] C-Kermit> define xx set host * 4444, server
  830.   [/usr/olga/private] C-Kermit> xx
  831.   Binding to socket 4444 ...
  832.   Listening ...
  833.   Waiting to accept a TCP/IP connection on port 4444 ...
  834.  
  835. When the connection comes in, C-Kermit automatically enters server mode
  836. (because of the xx macro), but whoever made the connection cannot use it for
  837. anything until they log in with the proper username and password.  Once they
  838. do, they can get files from the "private" directory, and they can send files
  839. to the "private/incoming" directory.
  840.  
  841. The user on the other end would do as follows (using Kermit 95, C-Kermit, or
  842. MS-DOS Kermit):
  843.  
  844.   Kermit> set host <olga's-host-name-or-address> 4444
  845.   
  846. (Note: in MS-DOS Kermit the above command would be "set port tcp" rather
  847. than "set host".)
  848.  
  849.   Kermit> remote login olaf supersecret
  850.   Logged in.
  851.   Kermit> 
  852.  
  853. (Now any server commands can be issued -- SEND, GET, REMOTE xxx, etc)
  854.  
  855.   Kermit> remote logout
  856.   Kermit> hangup
  857.  
  858. Hint: Pick a port number above 1000, but make sure nobody else is using the
  859. same one.  But how would you know?  One way is to try connecting to the port
  860. yourself.  If Telnet (or Kermit) says "connection refused", that probably
  861. means the port is not in use.
  862.  
  863. 2.3. Controlling TCP Parameters
  864.  
  865. The following commands were added in 6.0.192 (Kermit 95 1.1.3):
  866.  
  867. SET TCP KEEPALIVE { ON, OFF }
  868.   Setting this ON might help to detect broken connections
  869.   more quickly.  Default is ON.
  870.  
  871. SET TCP LINGER { ON [<timeout>], OFF }
  872.   Setting this ON ensures that a connection doesn't close before
  873.   all outstanding data has been transferred and acknowledged.
  874.   The optional <timeout> specifies how many 10th of a millisecond
  875.   we should wait for a close to succeed.
  876.   0 means no timeout, wait forever.  Default is OFF.
  877.  
  878. SET TCP NODELAY { ON, OFF }
  879.   ON means send short TCP packets immediately rather than waiting
  880.   to accumulate a bunch of them before transmitting (Nagle Algorithm).
  881.   Default is OFF.  Turning this ON can significantly degrade overall
  882.   network performance -- use it only if you have to.
  883.  
  884. SET TCP RECVBUF <number>
  885. SET TCP SENDBUF <number>
  886.   TCP receive and send buffer sizes.  The system default sizes are used
  887.   unless a specific size is specified.
  888.  
  889. These items are designed to let you tune TCP networking performance on a
  890. per-connection basis by adjusting items that you normally would not have
  891. access to.  You should use these commands only if you feel that the TCP/IP
  892. protocol stack that Kermit is using is giving you inadequate performance, and
  893. then only if you understand the concepts (see, for example, the Comer TCP/IP
  894. books), and then at your own risk.  These settings are displayed by SHOW
  895. NETWORK.  Not all options are necessarily available in all C-Kermit versions;
  896. it depends on the underlying TCP/IP services.
  897.  
  898. 2.4. The Network Directory
  899.  
  900. Similar to the Dialing Directory (see DIALING.DOC).
  901.  
  902. SET NETWORK DIRECTORY [ file [ file [ file [ ... ] ] ] ]
  903.   Chooses zero, one, or more network directory files, which, together,
  904.   make up the network directory.
  905.  
  906. The standard C-Kermit initialization file assumes you have one network
  907. directory file called .knd (UNIX or OS-9) or ckermit.knd (elsewhere) in
  908. your home directory.  This can be overridden by the environment variable
  909. K_NET_DIRECTORY.
  910.  
  911. If you have a network directory, then SET HOST, RLOGIN, and TELNET commands
  912. look up their argument there if it starts with a letter.
  913.  
  914. Directory format:
  915.  
  916. ; Full-line command
  917.  
  918. entryname networktype address network-specific-items ; trailing comment
  919.  
  920. Full-line comments and blank lines are allowed; trailing comments must
  921. begin with a semicolon preceded by at least one space.
  922.  
  923. "entryname" is the name of entry, must start with a letter.
  924.  
  925. "networktype" is one of the following:
  926.  
  927.   tcp/ip x.25 decnet superlat netbios named-pipe
  928.  
  929. (type "set network type ?" for a list of types that are supported in your
  930. version of C-Kermit.)
  931.  
  932. "address" is the host name or address you would use in a SET HOST command,
  933. such as an IP hostname, and IP address, and X.121 address, a DECnet node name,
  934. etc.
  935.  
  936. "network-specific-items" are optional.
  937.  
  938. For TCP/IP:   TCP service port name or number, username.
  939. For SuperLAT: Password (we do NOT recommend recording this).
  940.  
  941. For X.25 we use keyword parameters:
  942.  
  943.   cug=<number>                Closed user group, if any
  944.   cud=<string>                Call user data, if any
  945.   rev=on (or) off             Reverse charge on or off
  946.   pad=p:v,p:v,p:v,p:v,...     PAD numeric parameter:value sequence
  947.  
  948. and can be given in any combination or any order.
  949.  
  950. 2.5. Automatic Flow Control
  951.  
  952. As of 6.0.192, the default flow control setting is AUTOMATIC, meaning that
  953. whenever you SET LINE, SET PORT, SET MODEM TYPE, SET MODEM CAPABILITIES, or
  954. SET HOST (or TELNET), an appropriate type of flow control is chosen
  955. automatically:
  956.  
  957.  . In VMS C-Kermit, it is always set to Xon/Xoff, which actually means
  958.    /TTSYNC/HOSTSYNC, which should always be used.  The rest apply to all
  959.    systems except VMS.
  960.  
  961.  . For network connections (SET HOST or TELNET), flow control is set to NONE;
  962.    the underlying network protocols handle flow control themselves.
  963.  
  964.  . For direct serial connections (SET MODEM TYPE NONE, SET PORT/LINE xxx),
  965.    FLOW is set to RTS/CTS if the C-Kermit implementation supports it,
  966.    otherwise to Xon/Xoff.
  967.  
  968.  . For modem connections, FLOW is set to RTS/CTS if C-Kermit supports AND if
  969.    the modem supports it (as determined from the modem's capabilities list,
  970.    shown as HWFC by SHOW MODEM); otherwise to Xon/Xoff.
  971.  
  972. To override this behavior, SET FLOW to the desired specific value: NONE,
  973. XON/XOFF, RTS/CTS, or other ("set flow ?" for list of the options available
  974. in your version of C-Kermit).
  975.  
  976. (3) TERMINAL CONNECTION
  977.  
  978. 3.0. Automatic File Transfer
  979.  
  980. If SET TERMINAL AUTODOWNLOAD is ON, and C-Kermit is in CONNECT mode, then the
  981. terminal emulator automatically recognizes certain kinds of Kermit packets
  982. (and, if external or internal ZMODEM protocol is supported, also incoming
  983. ZMODEM transfers) and automatically goes into receive or server mode using the
  984. appropriate protocol, and then returns to terminal emulation automatically
  985. when the transfer is finished.  Edit 192: Kermit 95, OS/2, VMS, UNIX.
  986.  
  987. Example:  Tell C-Kermit to "set terminal autodownload on", then "connect".
  988. Then while in CONNECT mode, to download a file to C-Kermit, just tell the
  989. remote Kermit to "send" the file.  To upload a file from C-Kermit to the
  990. remote Kermit, tell the remote Kermit to "get" the file.
  991.  
  992. Also be sure to read section 8.3, subsection "Receiving files", about this,
  993. and particularly the caution regarding multihop Kermit connections.
  994.  
  995. 3.1. The APC Escape Sequence
  996.  
  997. Kermit 95 and, as of edit 190, also the OS/2, UNIX, and VMS versions of
  998. C-Kermit are able to respond automatically to "autoupload", "autodownload",
  999. or auto-anything-else directives from the remote computer during CONNECT
  1000. mode.  These directives come in the form of an Application Program Command
  1001. escape sequence, or APC.
  1002.  
  1003. The APC is sent by a host application to a terminal emulator, containing one
  1004. or more commands to be executed by the terminal emulation program.  This
  1005. mechanism lets the host application software control your communications
  1006. software, allowing an unprecedented degree of automation and convenience.
  1007.  
  1008. Good uses for this feature include: (a) automatic communications, protocol,
  1009. terminal, keyboard, or other setups by the host application; (b) automatic
  1010. initiation of file transfer by the host application.
  1011.  
  1012. The form of an APC is "<ESC>_text<ESC>\", where "<ESC>" is ASCII character 27
  1013. (Escape), and "text" is a command or a list of commands separated by commas.
  1014. The APC sequence was originally defined defined in ANSI X3.64 and first
  1015. implemented by Digital Equipment Corporation for its VT300-series and higher
  1016. terminals.
  1017.  
  1018. There are two "ends" to an APC operation, and you need to understand how
  1019. to control each end.  Let's call the application which sends an APC escape
  1020. sequence the "APC sender", and the application that receives it, and which is
  1021. supposed to execute the commands it contains, the "APC receiver".
  1022.  
  1023. Any host application can be an APC sender.  To send an APC, all it needs to do
  1024. is display the desired commands on your terminal screen, enclosed in <ESC>_
  1025. and <ESC>\.  C-Kermit 5A(189) (and later) has a command for doing this:
  1026.  
  1027.   APC text
  1028.  
  1029. where the "text" is a command (or commands) for the APC receiver.  Leading and
  1030. trailing spaces are removed from the text unless it is enclosed in braces:
  1031.  
  1032.   APC { text }
  1033.  
  1034. Here's an example that sets MS-DOS Kermit parameters from the C-Kermit command
  1035. line.  It assumes that C-Kermit is being accessed from MS-DOS Kermit 3.13 or
  1036. later, which is in CONNECT mode:
  1037.  
  1038.   C-Kermit>apc set receive packet-length 2000, set window 4
  1039.  
  1040. This command causes C-Kermit to send the following characters to the terminal
  1041. (i.e. MS-DOS Kermit's terminal emulator):
  1042.  
  1043.   <ESC>_set receive packet-length 2000, set window 4<ESC>\
  1044.  
  1045. MS-DOS Kermit recognizes the APC sequence, extracts the commands from it,
  1046. and processes them automatically, according to the rules listed below.
  1047.  
  1048. Here's an example in which you define and then execute a C-Kermit macro to
  1049. send a file from C-Kermit, causing MS-DOS Kermit to receive it automatically
  1050. without your having to escape back and type "receive".  You do not need to
  1051. CONNECT again after the transfer is done, either; this too happens
  1052. automatically.
  1053.  
  1054.   C-Kermit>define autosend apc receive, send \%1
  1055.   C-Kermit>autosend oofa.txt
  1056.  
  1057. A macro is used because if you type APC RECEIVE at the C-Kermit prompt, MS-DOS
  1058. Kermit goes immediately into RECEIVE mode and you have no way to give the SEND
  1059. command to C-Kermit.  Conversely, if you type the SEND command first, C-Kermit
  1060. goes into SEND mode, and you have no opportunity to give it an APC command.
  1061. When the macro (or a TAKE command file) is the source of commands, the
  1062. "Catch-22" is avoided because the keyboard is out of the picture.
  1063.  
  1064. The APC receiver can be:
  1065.  
  1066.  . MS-DOS Kermit 3.13 or later
  1067.  . Kermit 95
  1068.  . C-Kermit 5A(190) or later for OS/2
  1069.  . C-Kermit 5A(190) or later for UNIX
  1070.  . C-Kermit 5A(190) or later for VMS
  1071.  
  1072. When one of these Kermit programs is in CONNECT mode, and an APC escape
  1073. sequence arrives, the commands it contains are executed if:
  1074.  
  1075.   1. Terminal emulation is VT100, VT102, VT220, VT320, ANSI-BBS,
  1076.      SCOANSI, AT386, or Wyse370, and:
  1077.   2. SET TERMINAL APC is ON and the commands are not "dangerous", or:
  1078.   3. SET TERMINAL APC is UNCHECKED.
  1079.  
  1080. After processing the APC sequence, whether its commands are executed or not,
  1081. the APC receiver returns to CONNECT mode automatically.
  1082.  
  1083. The C-Kermit initialization file defines several macros to let you take
  1084. advantage of the APC feature.  They are to be used at the C-Kermit> prompt,
  1085. when you are accessing C-Kermit through an APC receiver.  They include:
  1086.  
  1087. PCSEND <filespec> [ <as-name> ]
  1088.   Sends the file or files from C-Kermit to the "PC" that's on your desk.
  1089.   (Of course, the PC might also be a UNIX workstation, etc).  If the <filespec>
  1090.   does not contain wildcard characters (that is, it is the name of a single
  1091.   file), you can include the optional "as-name" to send it under a different
  1092.   name.  The file or files are sent according to C-Kermit's current FILE TYPE
  1093.   setting, text or binary (except in VMS, where VMS C-Kermit determines the
  1094.   file type and transfer automatically for each file).  In other words, the
  1095.   PCSEND macro is exactly like the SEND command, except it automatically puts
  1096.   your local Kermit program into RECEIVE mode, and then back into CONNECT mode
  1097.   again when the transfer is complete.  This process is sometimes referred to
  1098.   as "autodownloading".
  1099.  
  1100. PCGET <filespec> [ <as-name> ]
  1101.   This tells C-Kermit to get the specified file or files from your "PC".
  1102.   It puts your local Kermit program into server mode, GETs the specified
  1103.   files from it, then sends it a FINISH command and puts it back in CONNECT
  1104.   mode automatically.  The transfer type is governed by C-Kermit's current
  1105.   FILE TYPE setting.
  1106.  
  1107. This process can be called "autouploading".
  1108.  
  1109. C-Kermit's response to APC sequences is controlled by the following command:
  1110.  
  1111.   SET TERMINAL APC { ON, OFF, UNCHECKED }
  1112.  
  1113. The default setting is OFF, meaning that C-Kermit ignores APC sequences unless
  1114. you tell it otherwise.  In the OS/2 version, they are harmlessly absorbed and
  1115. not displayed.  In the UNIX and VMS versions of C-Kermit, they are passed
  1116. through transparently, in case you want them acted upon by your actual
  1117. terminal or terminal emulator.
  1118.  
  1119. To activate the APC feature, use:
  1120.  
  1121.   SET TERMINAL APC ON
  1122.  
  1123. This allows execution of all commands received in APC sequences except those
  1124. considered dangerous, such as: PUSH, RUN, !, REDIRECT, DELETE, RENAME, OUTPUT,
  1125. ENABLE, DISABLE, SCRIPT, and SET TERMINAL APC.  With this setting, for
  1126. example, it would not be possible for someone to send you a "letter bomb" or
  1127. screen message that contained an APC sequence to execute a command on your
  1128. computer (because RUN and ! are disabled).  The commands allowed by SET
  1129. TERMINAL APC ON are only the ones which affect Kermit itself, including the
  1130. initiation of Kermit file transfers.
  1131.  
  1132. Should you want to enable APC execution of ALL commands, which can be
  1133. dangerous and is therefore not recommended unless you know exactly what you
  1134. are doing, you can:
  1135.  
  1136.   SET TERMINAL APC UNCHECKED
  1137.  
  1138. Use UNCHECKED at your own risk.
  1139.  
  1140. 3.2. The CONNECT Command
  1141.  
  1142. The CONNECT command now has an optional "switch", /QUIETLY, to suppress the
  1143. verbose CONNECT message on versions of C-Kermit (such as UNIX, VMS, etc) that
  1144. normally give one:
  1145.  
  1146.   C-Kermit>CONNECT /QUIETLY
  1147.  
  1148. or:
  1149.  
  1150.   C-Kermit>C /Q
  1151.  
  1152. or even just:
  1153.  
  1154.   C-Kermit C /
  1155.  
  1156. This switch has no effect on versions of C-Kermit that contain true terminal
  1157. emulators, such as the OS/2, Windows 95, and Macintosh versions.
  1158.  
  1159. 3.3. The SET KEY Command
  1160.  
  1161. The SET KEY command now allows you to press the Return or Enter key after
  1162. the word KEY to be prompted for a keystroke and then a definition separately.
  1163. Using this form of the command lets you assign material to a key or key
  1164. combination without having to know its key code.  After you press the key to
  1165. be assigned, you are shown its current definition, if any.  You can cancel by
  1166. typing Ctrl-C, restore the default definition by pressing the Return or Enter
  1167. key, or enter a new definition.  Example:
  1168.  
  1169.   C-Kermit>set key
  1170.    Press key:
  1171.    Key code \16 => Character: \16 (self, no translation)
  1172.    Definition: blah
  1173.   C-Kermit>
  1174.  
  1175. NOTE: There are many changes and additions to the key mapping facility in the
  1176. OS/2 and Windows versions.  Please refer to the platform-specific
  1177. documentation for details.
  1178.  
  1179. In version 6.0.192, C-Kermit allows you to save your current key map.
  1180. The command is:
  1181.  
  1182.   SAVE KEYMAP [ <filename> [ { NEW, APPEND } ] ]
  1183.  
  1184. If you don't specify a filename, KEYMAP.INI is used.  If you don't specify
  1185. NEW or APPEND after the filename, a new file is created.  If you specify the
  1186. name of an existing file, and the APPEND, the material is written to the end
  1187. of the existing file.  The keymap is written in the form of a series of SET
  1188. KEY commands, one for each key that has a non-default definition.  Thus you
  1189. can TAKE a SAVE KEYMAP file to execute all of the SET KEY commands that are
  1190. in it.
  1191.  
  1192. 3.4. The SET TERMINAL Command
  1193.  
  1194. SET TERMINAL DEBUG { ON, OFF }
  1195.   SET TERMINAL DEBUG ON is a synonym for SET DEBUG SESSION.
  1196.   SET TERMINAL DEBUG OFF turns off session debugging without interfering
  1197.   with any other debugging that might be active (such as LOG DEBUG).
  1198.   Session debugging status is displayed in the SHOW TERMINAL display.
  1199.   Edit 190.
  1200.  
  1201. SET TERMINAL ESCAPE-CHARACTER { ENABLED, DISABLED }
  1202.   ENABLED allows normal processing of the CONNECT-mode escape character.
  1203.   DISABLED causes the CONNECT-mode escape character to be treated like any
  1204.   other data character -- i.e. simply transmitted to the remote computer or
  1205.   service, thus preventing you from being able to escape back or issue any of
  1206.   the other <escape-char>? commands.  On OS/2 and Windows you can still use
  1207.   Alt-X (or whatever \Kexit is assigned to), but in UNIX, VMS, etc, there is
  1208.   no way to get back except logging out from the remote host or service, but
  1209.   only if that normally pops you back to the C-Kermit prompt anyway.  DISABLED
  1210.   is mainly intended for use on UNIX, VMS, AOS/VS, etc, when it is "in the
  1211.   middle" and you need a totally transparent connection between the two end
  1212.   systems, e.g.  to transfer a file using XMODEM (in which case, also remember
  1213.   to SET COMMAND BYTESIZE 8 and SET TERMINAL BYTESIZE 8).
  1214.  
  1215. NOTE: There are numerous other new SET TERMINAL commands for Kermit 95 and
  1216. OS/2 C-Kermit.  Please refer to the Kermit 95 or OS/2-specific documentation
  1217. for details.
  1218.  
  1219. 3.4. The SET TELNET Command
  1220.  
  1221. SET TELNET BINARY-MODE { ACCEPTED, REFUSED, REQUESTED }
  1222.   This command tells C-Kermit how it should respond to requests to enter
  1223.   Telnet Binary mode.  The default Telnet connection type is Network
  1224.   Virtual Terminal (NVT) mode.  By negotiating Binary mode a cleaner 8-bit
  1225.   connection is established which may allow XYZmodem transfers that were
  1226.   not possible before.  The default is ACCEPTED.
  1227.  
  1228. SET TELNET NEWLINE-MODE { ON, OFF, RAW }
  1229.   This command tells C-Kermit what to send during CONNECT mode on a TELNET
  1230.   connection when you type Carriage Return (Return or Enter key).  ON (the
  1231.   default) means to send Carriage Return and Linefeed (CRLF); OFF means to
  1232.   send Carriage Return and NUL (ASCII 0).  The TELNET protocol Network Virtual
  1233.   Terminal specification says that Carriage Return must always be followed by
  1234.   LF or NUL.  However, certain TCP/IP services do not like CRLF or CR-NUL,
  1235.   and so in edit 190, the RAW option was added, which means to send CR as 
  1236.   itself, i.e. a plain carriage return.
  1237.  
  1238. (4) FILE TRANSFER
  1239.  
  1240. 4.0. New File Transfer Commands (edit 192).
  1241.  
  1242. 4.0.1. Automatic Transfer Mode
  1243.  
  1244. Beginning in version 6.0.192, C-Kermit has a new capability to exchange
  1245. "system-type" information with the other Kermit, and to set its file transfer
  1246. mode accordingly, automatically.  If the other Kermit also has this
  1247. capability, and indicates that it is on the same type of system (e.g. UNIX) as
  1248. we are, then C-Kermit performs the following commands implicitly:
  1249.  
  1250.   SET FILE TYPE BINARY
  1251.   SET FILE NAMES LITERAL
  1252.  
  1253. For VMS-to-VMS transfers, and for OS/2-to-OS/2 transfers, instead of BINARY,
  1254. we use LABELED, so that complex files can be transferred with all their
  1255. directory info and attributes and structure intact.
  1256.  
  1257. Like all features in C-Kermit, you can turn this one off and on if you want
  1258. to.  The command is:
  1259.  
  1260. SET TRANSFER MODE { AUTOMATIC, MANUAL }
  1261.  
  1262. AUTOMATIC is the default.
  1263.  
  1264. Upon exit from protocol, the user's most recent SET FILE TYPE and SET FILE
  1265. NAMES settings are restored automatically.
  1266.  
  1267. 4.0.2. Dynamic Packet Timeouts
  1268.  
  1269. Beginning in version 6.0.192, C-Kermit has the ability to adjust its packet
  1270. timeouts dynamically according to the observed packet arrival rate, and
  1271. in fact, does this unless you tell it otherwise:
  1272.  
  1273.   SET SEND TIMEOUT <number> [ { DYNAMIC [ <min> [ <max> ] ], FIXED } ]
  1274.  
  1275. When the SEND TIMEOUT is FIXED (the old behavior), then the given <number> is
  1276. always used as the timeout (in seconds) when waiting for a packet to come in.
  1277. When it is DYNAMIC, the given <number> is the INITIAL timeout, which is
  1278. adjusted every time a packet arrives based upon a weighted average (in which
  1279. the most recent packets count the most) and standard deviation of the packet
  1280. arrival times (with a lower limit of one second and an upper limit of six
  1281. times <number>).  This should result in faster and more robust error recovery.
  1282. It also should help prevent file transfer failures when timeouts have been set
  1283. too low by mistake, as was common in earlier versions when accessing
  1284. C-Kermit's host from a low-speed modem dialed up to a network terminal server.
  1285.  
  1286. In case dynamic timeouts become too short, resulting in spurious
  1287. retransmissions, or too long, resulting in overly long waits for packets that
  1288. don't show up, you can specify your own minimum and maximum dynamic timeout
  1289. values after the word DYNAMIC, e.g.:
  1290.  
  1291.   set send timeout 10 dynamic 4 20
  1292.  
  1293. The minimum must be greater than 0.  The maximum, if greater than 0, is taken
  1294. literally; if 0, it means to use the default of 6 times <number>, and if less
  1295. than 0 it means there should be no maximum at all.  All numbers are in
  1296. seconds.  These values are shown in the SHOW PROTOCOL display.
  1297.  
  1298. The fullscreen file transfer display has a new line, "RTT/Timeout", which
  1299. shows the average round-trip time (RTT -- the amount of time from when a
  1300. packet was sent until its acknowledgement is received), an indicator of the
  1301. amount of delay in the connection, and the current timeout, which is based on
  1302. the rate at which packets arrive, and may or may not be shorter than the RTT.
  1303.  
  1304. 4.0.3. The MOVE and MMOVE Commands
  1305.  
  1306. MOVE is like SEND, except if (and only if) the file is sent successfully,
  1307. it is deleted.  Thus MOVE really MOVEs the file from the sending system to
  1308. the receiving system.
  1309.  
  1310. MMOVE is like MSEND, but deletes the source files after they are successfully
  1311. sent.
  1312.  
  1313. 4.0.4. The BINARY and TEXT Commands
  1314.  
  1315. BINARY is an "invisible" synonym for SET FILE TYPE BINARY.  TEXT and ASCII are
  1316. invisible synonyms for SET FILE TYPE TEXT.  Invisible means they don't show up
  1317. in the command list when you type ? at the C-Kermit> prompt, but you can still
  1318. give these commands as shorthands for the longer versions.  Edit 192.
  1319.  
  1320. 4.0.5. The FAST, CAUTIOUS, and ROBUST Macros
  1321.  
  1322. As of edit 192, there are also three new built-in "macros" (commands that
  1323. execute a group of commands) that you can use to switch among three levels
  1324. Kermit file-transfer protocol settings:
  1325.  
  1326. FAST is equivalent to:
  1327.   SET WINDOW 20                   ; or 4, depending on memory configuration
  1328.   SET RECEIVE PACKET-LENGTH 4096  ; or 2200, depending on memory configuration
  1329.   SET PREFIXING MINIMAL
  1330.  
  1331. CAUTIOUS is equivalent to:
  1332.   SET WINDOW 4
  1333.   SET RECEIVE PACKET-LENGTH 1000
  1334.   SET PREFIXING CAUTIOUS
  1335.  
  1336. ROBUST is equivalent to:
  1337.   SET WINDOW 1
  1338.   SET RECEIVE PACKET-LENGTH 90
  1339.   SET PREFIXING ALL
  1340.  
  1341. 4.0.6. New Default Block Check Type
  1342.  
  1343. As of edit 192, the default block-check type is 3 -- the 16-bit CRC.  If the
  1344. other Kermit does not support this, C-Kermit falls back to type 1
  1345. automatically.
  1346.  
  1347. 4.0.7.  New Auto-up/download Feature
  1348.  
  1349. SET TERMINAL AUTODOWNLOAD { ON, OFF }
  1350.   When ON (which is the default), and Kermit is in CONNECT mode, Kermit
  1351.   automatically goes into receive mode when the other Kermit sends a file to
  1352.   it.  Also works with ZMODEM.  The feature works independent of your SET
  1353.   PROTOCOL setting.  Autodownloads switch the appropriate protocol (Kermit or
  1354.   ZMODEM) temporarily for the transfer, and then back to the prevailing SET
  1355.   PROTOCOL setting.  Edit 192.
  1356.  
  1357. When your protocol is Kermit, autouploads are also possible.  Just tell the
  1358. remote Kermit program to GET <filename>, and the local C-Kermit program goes
  1359. into server mode automatically, sends the file, exits server mode
  1360. automatically, and returns to CONNECT mode, also automatically.  The same will
  1361. happen if you give any client command: REMOTE <anything>, MAIL, FINISH (though
  1362. there is not much point in that), BYE (ditto).
  1363.  
  1364. If you give a REMOTE command whose main purpose is to display something, like
  1365. REMOTE DIRECTORY, be sure to redirect it to a file or else the results won't
  1366. have anywhere to go (see section 5.0), e.g.:
  1367.  
  1368.   remote directory > dirfile
  1369.  
  1370. 4.0.8. Packet Length Slow Start
  1371.  
  1372. Beginning in 6.0.192, Kermit protocol sends use a "slow start" algorithm for
  1373. growing the packet length to the maximum negotiated length.  If the negotiated
  1374. packet length is 500 or greater, C-Kermit begins with a packet of 244 bytes,
  1375. and then doubles the length each time an acknowledgement is received, until
  1376. the maximum negotiated length is reached or an error occurs.  (Note that when
  1377. the window size is greater than 1, a whole window full of these shorter
  1378. packets might go out before the first acknowledgement comes back.)
  1379.  
  1380. The idea is to calibrate the best packet length for the connection, so in case
  1381. of transmission errors Kermit knows the best length to fall back to.  In the
  1382. event that your connection is known to be relatively free of errors and
  1383. obstructions, you can turn off the slow-start procedure with:
  1384.  
  1385.   SET TRANSFER SLOW-START OFF
  1386.  
  1387. 4.0.9. Download Directory
  1388.  
  1389. SET FILE DOWNLOAD-DIRECTORY [ <directory-name> ]
  1390.   Use this command to specify whether Kermit should place received files into
  1391.   a special "download directory" rather than into its current directory.  If
  1392.   you specify a directory name, then all received files will go into that
  1393.   directory, no matter what your current directory is (except that you can
  1394.   override this on a per-file basis with "receive <filespec>" or "set receive
  1395.   pathnames on").  If you omit the <directory-name>, then incoming files are
  1396.   placed in Kermit's current directory in the absence of any other
  1397.   instructions.  Edit 192.
  1398.  
  1399. 4.0.10. The SEND List
  1400.  
  1401. Version 6.0.192 also allows you to build up a list of files to be sent, in
  1402. which each file or group in the list can have its own text/binary transfer
  1403. mode and its own "as-name".  All the files in the list are sent in a single
  1404. transaction; thus the other Kermit can receive them all with a single
  1405. RECEIVE command.  The new commands are:
  1406.  
  1407.   ADD SEND-LIST <filespec> [ <mode> [ <as-name> ] ]
  1408.   SHOW SEND-LIST
  1409.   CLEAR SEND-LIST
  1410.   SEND
  1411.  
  1412. To start a new SEND-LIST, use CLEAR-SEND LIST.  Use ADD to add files or
  1413. file groups to it, and SEND (by itself) to send all the files from the
  1414. list.  Example:
  1415.  
  1416.   CLEAR SEND-LIST
  1417.   SET FILE TYPE TEXT
  1418.   ADD SEND-LIST ck*.h                 ; Transfer mode defaults to TEXT
  1419.   ADD SEND ck*.c text                 ; No as-name
  1420.   ADD SEND wart binary                ; Transfer mode forced to binary
  1421.   ADD SEND wermit binary
  1422.   ADD SEND ck*.o binary
  1423.   ADD SEND makefile text ckuker.mak   ; As-name given
  1424.   SEND
  1425.  
  1426. The SEND-LIST stays put after the SEND command, in case you want to send it
  1427. again.  To display it, use SHOW SEND-LIST.  To get rid of it, use CLEAR
  1428. SEND-LIST.  Even when a SEND list is defined, you can still SEND files in the
  1429. regular ways, by specifying their name(s) in a SEND or MSEND command, etc,
  1430. without disturbing the SEND-LIST.
  1431.  
  1432. The SEND list is intended mainly for use by programs or scripts that generate
  1433. file lists, although of course it can be used interactively too.  For example,
  1434. a program might build up a list of files and determine whether each one was
  1435. text or binary depending on some criterion best known to itself, such as
  1436. whether its name ended in ".EXE".
  1437.  
  1438. 4.0.11. The -Q Option
  1439.  
  1440. The -Q command-line option sets all of the file-transfer performance
  1441. features at once:
  1442.  
  1443.  . 20 window slots
  1444.  . 4K-byte packets (or less, depending on configured packet buffer size)
  1445.  . "Cautious" control-character unprefixing
  1446.  
  1447. 4.1. File Transfer Recovery
  1448.  
  1449. Beginning with version (190) the UNIX, Windows 95 and NT, OS/2, AOS/VS, and
  1450. Amiga versions of C-Kermit, and MS-DOS Kermit 3.14, have the ability to
  1451. continue interrupted binary-mode file transfers, and also allow you to
  1452. "manually" recover from certain other types of failures.
  1453.  
  1454. 4.1.1. The RESEND and REGET Commands
  1455.  
  1456. The new RESEND command lets you continue a file transfer from the point where
  1457. it was interrupted (for example, because of a telephone disconnection) without
  1458. having to retransmit the data that was already successfully transmitted.
  1459. Imagine, for example, transferring a ten-megabyte file over a 2400-bps modem
  1460. connection when, after 9 megabytes have been sent, your call-waiting feature
  1461. kicks in and drops the modem connection.  9 megabytes at 240 cps takes about
  1462. 11 hours.  The remaining megabyte would take about 1.2 hours.  The recovery
  1463. feature lets you complete the failed transfer in the amount of time it takes
  1464. to send the as-yet-untranmsitted part of the file, rather than sending the
  1465. entire file again from the beginning -- in this example, a savings of 11
  1466. hours.
  1467.  
  1468. Before seeing how to use this feature, let's look at the restrictions:
  1469.  
  1470.  1. Recovery works only for binary-mode transfers between computers that have
  1471.     Kermit programs that support this feature.  It does not work with any
  1472.     other transfer modes, including text or labeled.  In other words, if you
  1473.     want to be able to use the recovery feature, you must tell the file sender
  1474.     to:
  1475.  
  1476.       SET FILE TYPE BINARY
  1477.  
  1478.     In VMS, C-Kermit will switch to binary mode automatically if the file
  1479.     has a fixed record format.  You can also force binary-mode transfer in
  1480.     VMS via SET FILE TYPE IMAGE.
  1481.  
  1482.  2. The original transfer must have been done with SET FILE INCOMPLETE KEEP
  1483.     in effect at the receiver, meaning that incompletely received files are
  1484.     kept rather than discarded.  In C-Kermit 5A(190) and later, this is the
  1485.     default, which is a change from previous releases.
  1486.  
  1487.  3. Recovery only works between two Kermit programs that have this capability
  1488.     and negotiate it successfully.  As of this writing, these programs include
  1489.     C-Kermit 5A(190) and later for UNIX, OS/2, VMS, VOS, and the Commodore
  1490.     Amiga, and MS-DOS Kermit 3.14 and later for DOS and Windows.  (But see
  1491.     below for a way around this.)
  1492.  
  1493.  4. You should never use SET FILE COLLISION RENAME if you intend to use the
  1494.     recovery feature (see the CKCKER.BWR file for an explanation).
  1495.  
  1496. Hint: You can also resend text files as long as you transfer them in binary
  1497. mode.  You can transfer text files in binary mode as long as (a) both
  1498. computers represent text files in stream-CRLF format, and (b) you do not
  1499. need character-set translation.
  1500.  
  1501. To recover a failed upload: reestablish the connection, access the same
  1502. account and directory to which you were sending the file previously, start
  1503. Kermit there and put it in RECEIVE or SERVER mode.  Then escape back to the
  1504. local Kermit program and give it these commands:
  1505.  
  1506.   SET FILE TYPE BINARY
  1507.   RESEND filename [ as-name ]
  1508.  
  1509. The RESEND command should use exactly the same names (and SET FILE NAME
  1510. options) as the SEND command that was interrupted.  When you RESEND a file,
  1511. the receiving Kermit, upon getting the filename, looks up the file and gets
  1512. its size; it sends the size back to the sending Kermit, and the sending Kermit
  1513. resumes sending from that point; the receiving Kermit appends incoming
  1514. material to the partial file rather than creating a new file.
  1515.  
  1516. You can recover a failed download in the same way.  Just make sure you are
  1517. accessing the same directories as before, and the files have (or are being
  1518. sent with) the same names as before.
  1519.  
  1520. The RESEND command ignores your SET FILE COLLISION setting; thus you need not
  1521. change your FILE COLLISION setting when RESENDing, and you will not find it
  1522. altered afterwards either.  (But please, as mentioned earlier, do not use SET
  1523. FILE COLLISION RENAME if you ever intend to use the RESEND command.)
  1524.  
  1525. If the RESEND command is used, but a partial file of the same name does not
  1526. exist on the receiving end, RESEND behaves just like SEND -- it sends the
  1527. whole file.  If the file on the receiving is the same size as the sender's
  1528. copy, RESEND does nothing; both files are left alone (exception: when VMS
  1529. C-Kermit is receiving a resend, it will replace the file's final block).
  1530. These properties let you resume the interrupted transfer of a group of files.
  1531. Suppose you had originally done this:
  1532.  
  1533.   Receiver:                         Sender:
  1534.    SET FILE INCOMPLETE KEEP          SET FILE TYPE BINARY
  1535.    RECEIVE (or SERVER)               SEND *.ZIP
  1536.  
  1537. and the phone hung up in the middle of one of the ZIP files.  Just reestablish
  1538. the connection, and recover this way:
  1539.  
  1540.   Receiver:                         Sender:
  1541.    SET FILE INCOMPLETE KEEP          SET FILE TYPE BINARY
  1542.    RECEIVE (or SERVER)               RESEND *.ZIP
  1543.  
  1544. The files that were already sent are skipped, the file that was partially
  1545. sent is recovered, and the files that were not sent yet are sent.
  1546.  
  1547. In order for the recovery feature feature to be useful at all, the default for
  1548. SET FILE INCOMPLETE was changed from DISCARD to KEEP when the RESEND command
  1549. was added in edit 190.  Otherwise an interrupted transfer would leave no
  1550. partial file behind unless you had remembered to change the default.  But now
  1551. you have to pay closer attention to Kermit's messages to know whether a
  1552. transfer succeeded or failed -- previously, if it failed, the file would not
  1553. show up on the receiving end at all; in edit 190 and later, you'll get a
  1554. partial file which could easily be mistaken for the complete file unless you
  1555. change the default back to DISCARD or read the screen messages, or keep a
  1556. transaction log.
  1557.  
  1558. Watch out for SET FILE COLLISION RENAME, especially when used in conjunction
  1559. with recovery.  Recall that this option (which is NOT the default) renames
  1560. the incoming file if a file already exists with the same name (the default is
  1561. to rename the previously existing file, and store the incoming file with its
  1562. own name).  It is strongly recommended that you do not use SET FILE COLLISION
  1563. RENAME if you ever intend to use the recovery feature:
  1564.  
  1565.  . When the file is first received by C-Kermit, its name will be changed if
  1566.    another file already has the same name.  When you RESEND the same file
  1567.    after a failure, C-Kermit will probably try to append the re-sent portion
  1568.    to the wrong file.
  1569.  
  1570.  . Assuming that you get RESEND to work with FILE COLLISION RENAME, C-Kermit,
  1571.    when receiving the remainder of the file during a RESEND operation, will
  1572.    report back the wrong name.  Nothing can be done about this because the
  1573.    name is reported back before the receiving Kermit program finds out that
  1574.    it is a recovery operation.   
  1575.  
  1576. Using RESEND, you can write a script program to REALLY, REALLY send a file.
  1577. Here is a sample, in which we dial up to a UNIX computer and send the MS-DOS
  1578. Kermit distribution ZIP file.  This script program runs under C-Kermit 5A(190)
  1579. or later on OS/2 (and with a change in the dialout device name, under UNIX
  1580. too), and under MS-DOS Kermit 3.14 or later.  If the transfer fails, we
  1581. reestablish the connection and restart the transfer from the point of failure,
  1582. as many times as it takes to get the file across.
  1583.  
  1584. ---(cut here)---
  1585. ask \%u { username: }
  1586. askq \%p { \%u's password: }
  1587. ;
  1588. ; Settings for entire session.
  1589. ;
  1590. define \%s 20             ; Seconds to pause between each try
  1591. define \%n 7654321        ; Phone number
  1592. set modem type hayes      ; Modem type
  1593. set port com1             ; Communication port (use /dev/whatever for UNIX)
  1594. set speed 19200           ; Speed
  1595.  
  1596. set file type binary      ; File transfer mode must be binary
  1597. set input timeout quit    ; This is just to keep the script program short...
  1598. set count 50              ; Try up to 50 times to send the file
  1599. goto nomsg                ; Skip message the first time
  1600.  
  1601. :LOOP                     ; Come here to redial
  1602. hangup                    ; Give the phone a rest
  1603. echo CONNECTION BROKEN.
  1604. echo Pausing for \%s seconds...
  1605. sleep \%s
  1606. Echo redialing...
  1607.  
  1608. :NOMSG
  1609. dial \%n                  ; Dial the phone number
  1610. if fail goto AGAIN        ; Keep trying...
  1611. output \13                ; System answered, send a carriage return
  1612. input 15 login:           ; Get login prompt
  1613. output \%u\13             ; Send user ID
  1614. input 8 Password:         ; Get password prompt
  1615. output \%p\13             ; Send password
  1616. input 60 {$ }             ; Get system prompt
  1617. cd /kermit                ; CD to desired source directory
  1618. output cd mskermit\13     ; and destination directory
  1619. input 8 {$ }              ; Get system prompt
  1620. out kermit -r\13          ; kermit -r(eceive) on remote system
  1621. input 10 KERMIT READY     ; Wait for READY message
  1622. pause 1                   ; Plus a second for safety
  1623. resend msvibm.zip         ; RESEND the file
  1624. if success goto done      ; Success means file is completely transferred
  1625.  
  1626. :AGAIN
  1627. if count goto LOOP        ; Otherwise, try again.
  1628. Stop 1 Too many tries.    ; Too many tries, give up.
  1629.  
  1630. :DONE
  1631. echo File transferred OK  ; Success, give message
  1632. output exit\13            ; Log out from remote computer
  1633. pause 5                   ; Give it time...
  1634. hangup                    ; Hang up
  1635. stop 0 Script succeeded   ; Finished, the end.
  1636. ---(cut here)---
  1637.  
  1638. The REGET Command allows the client of a Kermit server to request the server
  1639. to RESEND the given file.
  1640.  
  1641. 4.1.2. Manual Recovery: The PSEND Command
  1642.  
  1643. The PSEND ("partial send") command is like the SEND command, but it begins
  1644. sending from a specified position in the file:
  1645.  
  1646.   PSEND <filename> <position> [ <as-name> ]
  1647.  
  1648. <filename> must refer to a single file, not a file group.  <position> is the
  1649. byte position in (offset into) the file; 0 means the beginning, 1000 means the
  1650. 1001st byte.  As with the SEND command, the file is sent under its own name
  1651. unless you specify an "as-name".  Unlike RESEND, PSEND can be used for both
  1652. text and binary transfers, and no special capabilities are required of the
  1653. Kermit program on the receiving end.  The PSEND command can be viewed as part
  1654. of a "do-it-yourself" recovery feature to be used when the other Kermit
  1655. program does not support recovery.  For example, suppose you were sending a
  1656. file called OOFA when the connection hung up, and that the receiving Kermit
  1657. program had been instructed to keep incompletely received files (SET FILE
  1658. INCOMPLETE KEEP).  If the transfer was in binary mode, you could note the
  1659. length of the partial file on the receiving end; let's say it was 123456.
  1660. Then tell the file receiver to:
  1661.  
  1662.   SET FILE COLLISION APPEND
  1663.   RECEIVE
  1664.  
  1665. and tell the sender to:
  1666.  
  1667.   SET FILE TYPE BINARY
  1668.   PSEND OOFA 123456
  1669.  
  1670. If the receiver does not support SET FILE COLLISION APPEND, you could just
  1671. use PSEND to create a new file:
  1672.  
  1673.   SET FILE TYPE BINARY
  1674.   PSEND OOFA 123456 OOFA.NEW
  1675.  
  1676. and then, after the transfer is complete, join the two pieces together on
  1677. the receiving end, using a system command or utility.
  1678.  
  1679. 4.2. Control-Character Unprefixing
  1680.  
  1681. This feature allows you to improve C-Kermit's file transfer performance on
  1682. connections that you know are transparent to certain control characters.  It
  1683. lets you tell C-Kermit exactly which control characters need to be prefixed
  1684. and encoded, and which ones can be transmitted "bare" when sending files.
  1685.  
  1686. SET { SEND, RECEIVE } CONTROL-PREFIX <code>
  1687.   Sets the control-character prefix which C-Kermit uses to the ASCII character
  1688.   represented by the numeric <code>.  The <code> must be in the range 33-63 or
  1689.   96-126.  Normally it is 35 (#, number sign).  SEND is the one that C-Kermit
  1690.   should use in packets it is sending.  RECEIVE should normally never be used,
  1691.   except to override some kind of protocol negotiation foulup with a buggy
  1692.   commercial or shareware Kermit implementation.
  1693.   Synonym: SET { SEND, RECEIVE } QUOTE.
  1694.  
  1695. SET CONTROL-CHARACTER UNPREFIXED { <code>..., ALL }
  1696.   Says you think it's safe to include the control character represented by
  1697.   <code> without prefixing in packets which C-Kermit sends.  The <code> is the
  1698.   numeric ASCII code for a control character, 1-31, 127-159, or 255.  For
  1699.   example, linefeed (code 10) is normally sent as two printable characters,
  1700.   #J.  SET CONTROL UNPREFIXED 10 lets linefeed be sent literally.  Include the
  1701.   word ALL to unprefix all control characters (except 0).  Or you can specify
  1702.   a list of one or more numeric values, separated by spaces, e.g.:
  1703.  
  1704.      SET CONTROL UNPREFIXED 2 4 5 18 20
  1705.  
  1706.   If you can safely declare a lot of control characters to be UNPREFIXED, you
  1707.   can send binary files (esp. precompressed ones) up to about 20-25% faster.
  1708.   If you include a control character in this category that causes trouble,
  1709.   however, the transfer will fail, so experimentation is necessary.  This
  1710.   command will not let you "unprefix" the NUL character (0), nor the following
  1711.   characters if C-Kermit's current FLOW-CONTROL setting is XON/XOFF: 17, 19,
  1712.   145, 147.  Nor can you unprefix character 255 on a TELNET connection (if
  1713.   C-Kermit *knows* it's a TELNET connection).
  1714.  
  1715. SET CONTROL-CHARACTER PREFIXED { <code>..., ALL }
  1716.   Says that the given control character(s) must be prefixed in Kermit packets.
  1717.   By default, all control characters, 0-31, 127-159, and 255, are prefixed.
  1718.  
  1719. SET PREFIXING { ALL, CAUTIOUS, MINIMAL, NONE }  (edit 192)
  1720.   This command gives you quick access to commonly-used control-character
  1721.   (un)prefixing configurations:
  1722.  
  1723.      NONE prefixes only 0.
  1724.      MINIMAL prefixes the start- and end-of-packet characters, 0, 
  1725.         carriage return (13), and their 8-bit counterparts, and 255.
  1726.      CAUTIOUS is like MINIMAL, plus 3, 16, 17, 19, 28, 29, 30
  1727.         and their 8-bit counterparts.
  1728.      ALL prefixes all control characters (= SET CONTROL PREFIX ALL)
  1729.  
  1730. SHOW CONTROL-PREFIXING
  1731.   Displays the current control prefix and a table of all control-character
  1732.   values, showing 1 for each one that will be prefixed and 0 for each one that
  1733.   will not be prefixed.
  1734.  
  1735. SET REPEAT PREFIX <code>
  1736.   Sets the repeat-count prefix to the ASCII character represented by the
  1737.   numeric <code>.  Normally it is 126 (tilde).  The <code> must be in the
  1738.   range 33-63 or 96-126.
  1739.  
  1740. SET REPEAT COUNTS { OFF, ON }
  1741.   Turns the repeat-count compression mechanism off and on.  REPEAT COUNTS are
  1742.   ON by default.  Turn them OFF in case they cause trouble when used against a
  1743.   faulty Kermit implementation in a shareware or commercial communications
  1744.   program.  Or when transferring precompressed files (like .ZIP or .Z files),
  1745.   since it is very rare to find runs of repeated characters, and disabling the
  1746.   repeat-count mechanism frees another character from prefixing, thus
  1747.   resulting in slightly more efficient transfers.
  1748.  
  1749. The purpose of the SET CONTROL UNPREFIX command is to UNILATERALLY configure
  1750. C-Kermit to skip prefixing and printable encoding of selected control
  1751. characters to achieve higher performance when sending files.  This feature
  1752. takes advantage of the fact that most Kermit programs will accept control
  1753. characters within packet data-fields literally, provided they get through at
  1754. all, and provided they do not have a special meaning to the receiving Kermit
  1755. program (such as, in many cases, the packet-start and packet-end characters).
  1756.  
  1757. There is no protocol negotiation between the two Kermit programs to determine
  1758. a "safe set" of control characters, and in fact any such negotiation would be
  1759. largely meaningless, because in most cases the two Kermit programs don't have
  1760. all the needed information.  For example, there might be a terminal server or
  1761. PAD between them that is sensitive to a particular control character, even
  1762. though the two Kermit programs are not.
  1763.  
  1764. If you include in your SET CONTROL UNPREFIXED list one or more control
  1765. characters that are unsafe, any of several things might happen:
  1766.  
  1767.  1. Transfer of any file containing these characters will fail.
  1768.  
  1769.  2. The receiving Kermit program might be interrupted or halted.
  1770.  
  1771.  3. Your connection might become hung, stuck, or broken.  For example because
  1772.     a control character causes a PAD, terminal server, modem, or similar
  1773.     device to go from online mode to command mode.
  1774.  
  1775. The set of safe control characters depends on the two Kermit programs, their
  1776. settings, the host operating systems and their settings, the communication and
  1777. flow control methods, and all the devices, drivers, and protocols that lie
  1778. between the two Kermit programs.  Therefore, this feature is recommended only
  1779. for use on well-known and often-used connections, so the time invested in
  1780. finding an optimal unprefixed control-character set will pay off over many
  1781. file transfers.
  1782.  
  1783. You must be willing to experiment in order to achieve the optimal safe set.
  1784. Here is one way.  Create a short file containing all 256 possible bytes in
  1785. sequence and also in pairs, as well as several text strings surrounded by
  1786. CRLFs; for example, compile and run the following program, redirecting its
  1787. output to a file:
  1788.  
  1789. ---(cut here)---
  1790. #include <stdio.h>
  1791. main() {
  1792.     int i;
  1793.     puts("\r\n256-byte test pattern:\r\n");
  1794.     for (i = 0; i < 256; i++) putchar(i); /* singles */
  1795.     puts("\r\n256-double-byte test pattern:\r\n");
  1796.     for (i = 0; i < 256; i++) { putchar(i); putchar(i); } /* in pairs */
  1797.     puts("\r\nEnd of test patterns\r\n");
  1798. }
  1799. ---(cut here)---
  1800.  
  1801. To send the file to MS-DOS Kermit from either C-Kermit or MS-DOS Kermit,
  1802. try the following settings:
  1803.  
  1804.   SET CONTROL UNPREFIXED ALL ; Turn prefixing off for all but 0
  1805.   SET CONTROL PREFIXED 1     ; Turn it back on for packet-start character
  1806.   SET CONTROL PREFIXED 129   ; and 8-bit version thereof
  1807.  
  1808. (HINT: Abbreviate SET CON U and SET CON P)
  1809.  
  1810. Or to send the file from MS-DOS Kermit to C-Kermit, tell MS-DOS Kermit to:
  1811.  
  1812.   SET CON U ALL   ; Turn prefixing off for all
  1813.   SET CON P 0     ; Turn it back on for NUL
  1814.   SET CON P 3     ; and for Ctrl-C
  1815.   SET CON P 131   ; as well as Ctrl-C + parity bit
  1816.  
  1817. NOTE 1: 3 and 131 normally need not be prefixed when sending to C-Kermit
  1818. 5A(190) or later, nor to 5A(189) if you have SET TRANSFER CANCELLATION OFF.
  1819.  
  1820. NOTE 2: The start-of-packet character (normally 1 and 129) need not be
  1821. prefixed when sending files *to* C-Kermit, but must be prefixed when sending
  1822. files to MS-DOS Kermit.  However, you should unprefix this character only on
  1823. connections that are very clean and fast, where you know there will be no
  1824. corruption or timeouts.
  1825.  
  1826. NOTE 3: 13 (carriage return, the customary packet terminator) normally need
  1827. not be prefixed when sending files to either C-Kermit or MS-DOS Kermit,
  1828. except on a TELNET connection (because TELNET servers are likely to change
  1829. CRLF into CR).
  1830.  
  1831. Try to send the test file in binary mode.  If it works, fine.  If not, try
  1832. prefixing some of the other likely control characters (see below).  Once you
  1833. find the minimum set of prefixed control characters for the test file, it is
  1834. likely they will also work for any other file on the same connection.  Try
  1835. sending a large precompressed (e.g. ZIP or .Z or GZIP) file.  And, of course,
  1836. for maximum performance, also use a window size greater than 1 and a packet
  1837. length of 1000 or more.
  1838.  
  1839. Under ideal conditions (totally transparent and clean serial connection, no
  1840. Xon/Xoff, no TELNET, no parity, and C-Kermit has been told to SET TRANSFER
  1841. CANCELLATION OFF, see below), the minimum set of control characters that need
  1842. to be prefixed is:
  1843.  
  1844.   SENDER          RECEIVER         PREFIXED CONTROLS
  1845.    MS-DOS Kermit   MS-DOS Kermit    1 129
  1846.    MS-DOS Kermit   C-Kermit         0
  1847.    C-Kermit        MS-DOS Kermit    0 1 129
  1848.    C-Kermit        C-Kermit         0
  1849.  
  1850. For example, to set up C-Kermit to unprefix the minimum set of prefixed
  1851. control characters for sending files to MS-DOS Kermit, tell C-Kermit to:
  1852.  
  1853.   SET FLOW NONE            ; Or SET FLOW RTS/CTS
  1854.   SET CONTROL UNPREFIX ALL
  1855.   SET CONTROL PREFIX 1 129 ; C-Kermit always prefixes character 0
  1856.  
  1857. When the mininum set doesn't work, consult this list of control characters
  1858. that are apt to cause trouble and are therefore likely candidates for
  1859. prefixing.  In particular, note that unprefixing of the packet-start character
  1860. (normally 1 and 129), can cause problems when sending to C-Kermit if the
  1861. communication link (including device input buffers) is noisy or apt to lose
  1862. characters.
  1863.  
  1864. set con p 0   ; Ctrl-@ = NUL, internal string terminator in C-Kermit.
  1865.               ;          Also, often discarded as padding.
  1866. set con p 1   ; Ctrl-A = Packet-start character.
  1867. set con p 3   ; Ctrl-C = Packet breakout for remote-mode C-Kermit,
  1868.               ;          packet breakout for server-mode MS-DOS Kermit,
  1869.               ;          likely to cause interruptions on other systems.
  1870. set con p 13  ; Ctrl-M = Carriage return, packet-end character.
  1871.               ;          Always prefix on TELNET connections.
  1872. set con p 14  ; Ctrl-N = Shift Out
  1873. set con p 15  ; Ctrl-O = Shift In
  1874. set con p 16  ; Ctrl-P = Commonly-used X.25/X.3 PAD escape character
  1875. set con p 17  ; Ctrl-Q = XON, must be prefixed with Xon/Xoff flow control
  1876. set con p 19  ; Ctrl-S = XOFF, must be prefixed with Xon/Xoff flow control
  1877. set con p 27  ; Ctrl-[ = ESC, prefix if going through some kind of ANSI device
  1878. set con p 28  ; Ctrl-\ = CONNECT-mode escape for C-Kermit
  1879. set con p 29  ; Ctrl-] = CONNECT-mode escape for TELNET
  1880. set con p 30  ; Ctrl-^ = Cisco terminal server escape.
  1881. set con p 127 ; Ctrl-? = DEL, often discarded as padding.
  1882.               ;          Also becomes TELNET IAC if parity bit is added.
  1883. set con p 128 ; = NUL    + 128 (i.e. NUL + parity bit)
  1884. set con p 129 ; = Ctrl-A + 128
  1885. set con p 131 ; = Ctrl-C + 128
  1886. set con p 141 ; = CR     + 128
  1887. set con p 145 ; = XON    + 128
  1888. set con p 147 ; = XOFF   + 128
  1889. set con p 255 ; 255 = TELNET IAC, must be prefixed on TCP/IP TELNET connections
  1890.                 INCLUDING TELNET connections through terminal servers!
  1891.  
  1892. Note, by the way, that nothing special need be done for SLIP connections,
  1893. since the four special SLIP characters are in the G1 printable range:
  1894.  
  1895.   192 SLIP END character
  1896.   219 SLIP ESC character
  1897.   220 SLIP END quote
  1898.   221 SLIP ESC quote
  1899.  
  1900. Here is a suggested (conservative) starting point for experimenting with
  1901. control-character unprefixing.  Tell the file sender to:
  1902.  
  1903.   SET CONTROL UNPREFIX ALL
  1904.   SET CONTROL PREFIX 0 1 3 13 17 19 127 129 131 141 145 147 255
  1905.  
  1906. Perhaps some of these can be removed, depending on the connection, and maybe
  1907. others need to be added.  If you are going through a terminal server or an
  1908. intermediate Kermit or TELNET program, also add the appropriate escape
  1909. character values (bare, and plus 128).
  1910.  
  1911. PREFIXING NOTES:
  1912.  
  1913. If C-Kermit or MS-DOS Kermit has initiated a TELNET connection, prefixing of
  1914. 255 (TELNET IAC) is forced automatically.
  1915.  
  1916.   IMPORTANT WARNING: When you have a TELNET connection through a
  1917.   terminal server, neither one of the Kermit programs knows that
  1918.   it's a TELNET connection, and in this case unprefixing of 255 is
  1919.   NOT automatically disabled.  This can cause file transfer failures.
  1920.   When in doubt, do not unprefix 255.
  1921.  
  1922. Kermit will not let you unprefix XON (17), XOFF (19), XON+128 (145), or
  1923. XOFF+128 (147) if its FLOW-CONTROL setting is XON/XOFF.  If you want to
  1924. unprefix these, make sure *both* Kermits have first been told to SET FLOW
  1925. NONE (or RTS/CTS), and that XON/XOFF flow control is not in effect anywhere
  1926. along the communication path between the two Kermits.
  1927.  
  1928. When sending files to C-Kermit 189 or earlier, and C-Kermit is in remote
  1929. mode, you should normally tell the file sender to SET CONTROL PREFIX 3 and
  1930. SET CONTROL PREFIX 131, because C-Kermit 189 and earlier (by default) takes
  1931. two Ctrl-C's (3 or 131) in a row as cancellation of packet-mode.  However,
  1932. you can UNPREFIX these characters if you know your files do not contain two
  1933. Ctrl-C's in a row, or if you tell C-Kermit to SET TRANSFER CANCELLATION OFF,
  1934. or SET TRANSFER CANCELLATION ON <code> <number> when you know that <number>
  1935. copies of <code> do not occur in a row in the data.  When sending files to
  1936. edit 190 of C-Kermit and later, you can leave 3 and 131 unprefixed unless you
  1937. have disabled repeat-count compression.
  1938.  
  1939. 4.3. Keyboard Cancellation of Packet Mode
  1940.  
  1941. When C-Kermit is in remote mode and in packet mode, the user no longer has
  1942. normal control of the terminal.  Characters typed at the keyboard do not
  1943. echo, commands have no effect, etc.  This is because C-Kermit is trying to
  1944. read file-transfer protocol packets from your local Kermit program.  If you
  1945. have put C-Kermit into packet mode by giving a SEND, RECEIVE, SERVER, BYE,
  1946. or similar command, but you did not mean to do this, or you do not have a
  1947. local Kermit handy to exchange packets with (for example, because you
  1948. neglected to give a SET LINE or SET HOST command first), you can force
  1949. C-Kermit back to its prompt by typing a special sequence of characters.
  1950.  
  1951. By default, the packet-mode interruption character is Control-C (ASCII 3).  In
  1952. edits 189 and earlier, two consecutive copies of this character were required
  1953. to get out of packet mode, and the parity bit was always ignored.  In edit 190
  1954. and later, three copies are required by default, and the parity bit is ignored
  1955. if C-Kermit's PARITY setting is not NONE.
  1956.  
  1957. On noisy connections, two or three Control-C's might show up as noise; or you
  1958. might want to allow C-Kermit to accept Control-C characters literally in data
  1959. packets during file transfer.  The following command lets you control this
  1960. feature:
  1961.  
  1962.   SET TRANSFER CANCELLATION { OFF, ON [ <code> [ <number ] ] }
  1963.  
  1964. OFF turns off the packet-mode cancellation feature, preventing escape from
  1965.   packet mode except by normal protocol operations: completion, timeout, error
  1966.   packet, etc.  USE WITH CAUTION.
  1967.  
  1968. ON enables this feature.  The optional <code> is the ASCII code for the
  1969.   control character (0 through 31 or 127) to be used for interruption (the
  1970.   default is 3 = Ctrl-C), and the optional <number> is the number
  1971.   of consecutive copies of the character required to cause interruption.  For
  1972.   example, "SET XFER CANCEL ON 6 5" tells C-Kermit to break out of packet mode
  1973.   upon receipt of 5 consecutive Ctrl-F (ASCII 6) characters.  Note that the
  1974.   parity bit is ignored for this purpose, so (for example) 3 and 131 are
  1975.   treated the same.
  1976.  
  1977. If you SET TRANSFER CANCELLATION OFF, you might still need a manual method of
  1978. getting remote-mode C-Kermit out of packet mode.  This can be accomplished by
  1979. escaping back to your local Kermit and giving a RECEIVE command, then typing E
  1980. (or Ctrl-E) to send an error packet.  Or just type the following Kermit packet:
  1981.  
  1982.   <Ctrl-A># E*   <-- This is a "fatal error" packet.
  1983.  
  1984. If the remote Kermit is in server mode, you can send a FINISH command, or if
  1985. you don't have a local Kermit to escape back to, type:
  1986.  
  1987.   <Ctrl-A>$ GF4  <-- This is a FINISH command packet, for the server.
  1988.  
  1989. The SET TRANSFER CANCELLATION command was installed for the UNIX, VMS, and DG
  1990. versions of C-Kermit 5A(189).  Use SHOW PROTOCOL to find out the current
  1991. settings.  It has affect only when C-Kermit is in remote mode; when C-Kermit
  1992. has been used to establish a connection to another computer (i.e. when
  1993. C-Kermit is in local mode), this feature is inactive -- there is no need for
  1994. it because you have control of the program via the file-transfer interruption
  1995. characters (X, Z, C, E, etc).
  1996.  
  1997. In edit 190, the default number of packet-mode cancellation characters was
  1998. raised from two to three.  That is, if you are looking at a remote C-Kermit in
  1999. packet mode, and have no other way to get back to the C-Kermit> prompt, you'll
  2000. have to type three consecutive Control-C's (or whatever your transfer
  2001. cancellation character is), instead of two, by default.  This was done to
  2002. allow SET CONTROL UNPREFIX n (where n = the ASCII code for the cancellation
  2003. character) to work, even with the default TRANSFER CANCELLATION settings;
  2004. three or more consecutive copies of any character are transformed by Kermit
  2005. protocol into a repeat count plus one copy of the character, thus preventing
  2006. three consecutive Control-C's from appearing as data in a Kermit packet,
  2007. provided the other Kermit supports repeat-count compression (all popular
  2008. Kermit implementations do) and it has been successfully negotiated (which it
  2009. will be unless you take special measures to prevent it; see SET REPEAT above).
  2010.  
  2011. 4.4. New RECEIVE Command Features
  2012.  
  2013. In edit 190 and later, the RECEIVE command can accept a device or directory
  2014. name as an argument, and all incoming files will go into the specified device
  2015. or directory under the names they were sent with.  If the argument is not
  2016. a device or directory name, it is treated as before: as a name under which to
  2017. store the (first) incoming file.  This change also affects the '-a' ("as-name")
  2018. command-line option.
  2019.  
  2020. This feature depends on the symbol CK_TMPDIR being defined at compile time,
  2021. plus the supporting code for each operating system.  Type SHOW FEATURES to see
  2022. if CK_TMPDIR is defined in your version.  As of edit 190, this feature is
  2023. available in the UNIX, OS/2, and VMS versions of C-Kermit.  And of course also
  2024. in Kermit 95.
  2025.  
  2026. 4.5. Automatic Directory Creation
  2027.  
  2028. File names are treated according to the SET FILE NAMES command (see p.114 of
  2029. "Using C-Kermit"), CONVERTED (the default) or LITERAL.  SET FILE NAMES LITERAL
  2030. means:
  2031.  
  2032.  . When sending files, put the filespec into the outgoing file header packet
  2033.    exactly as the user typed it.  What happens on the receiving end is
  2034.    entirely up to the receiver.
  2035.  
  2036.  . When receiving files, use the file specification from the incoming file
  2037.    header exactly as given, so if it happens to include a device or directory
  2038.    specification, C-Kermit attempts to use it, and if the device and/or
  2039.    directory does/do not exist or are not write-accessible, the transfer fails.
  2040.  
  2041. SET FILE NAMES CONVERTED, which is the default, transforms outgoing filenames
  2042. by (a) removing device, directory, and other "extraneous" information, (b)
  2043. uppercasing all lowercase letters, (c) making sure there is no more than one
  2044. period, and (d) translating all "uncommon" characters to X's.
  2045.  
  2046.   NOTE: As of version 6.0.192, SET FILE NAMES CONVERTED is a bit more
  2047.   liberal, at least on UNIX.  Incoming names are lowercased only if they
  2048.   contained NO lowercase letters.  When sending, names that contain
  2049.   multiple periods (like cku192.tar.gz) keep the LAST period rather than
  2050.   the first, and change the other ones to underscores rather than X's.
  2051.  
  2052. A new command allows us to strike a compromise between these two methods:
  2053.  
  2054.   SET { SEND, RECEIVE } PATHNAMES { ON, OFF }
  2055.  
  2056. SET SEND PATHNAMES ON means to leave pathnames ON outbound file names, which
  2057. is the default for compatibility with earlier behavior.  Note, however, that
  2058. PATHNAMES are always stripped from outbound filenames when FILE NAMES are
  2059. CONVERTED, and in Windows and OS/2, disk letters are always stripped.
  2060.  
  2061. SET SEND PATHNAMES OFF means to strip OFF path information, leaving only the
  2062. file's name.  SET SEND PATHNAME applies only to the filename given directly to
  2063. a SEND or MSEND command, and not to the "as-name", which is always sent
  2064. literally and without modification, regardless of SEND PATHNAME or FILE NAMES
  2065. settings.
  2066.  
  2067. SET RECEIVE PATHNAMES applies to the filenames in incoming file header
  2068. packets; ON means to leave the name alone and attempt to use it as-is, OFF
  2069. means to attempt to strip the path information ON THE ASSUMPTION that any path
  2070. information found there would be in the notation of the local file system, and
  2071. therefore recognizable.  If not, the results are unpredictable; for example,
  2072. if a file called MYVAX::DUA0:[OLAF.PICS]MONA_LISA.GIF;17 arrives on a UNIX
  2073. system, UNIX C-Kermit can not be expected to distinguish the path information
  2074. from the name (it is a general principle of communication protocols that a
  2075. particular computer must not be expected to understand the conventions and
  2076. formats of some other kind of computer).
  2077.  
  2078. In VMS, UNIX, Windows, and OS/2, SET RECEIVE PATHNAMES has an additional
  2079. meaning: If the incoming file name contains directory information (such as
  2080. [.KERMIT]OOFA.TXT, kermit/oofa.txt, or C:\TEXT\LETTERS\ANGRY\OOFA.TXT) --
  2081. either absolute or relative -- then, if the named directory, or any of its
  2082. ancestors, does not exist, Kermit attempts to create it (or them) before
  2083. opening the output file.
  2084.  
  2085. For example, suppose your current directory (in UNIX) is /usr/olga/budget, and
  2086. a file arrives under the name "aaa/bbb/ccc/ddd/bankrupt.txt", and that the
  2087. /usr/olga/budget/aaa directory already exists, but it does not have a bbb
  2088. subdirectory.  Then Kermit will create the bbb subdirectory, and then the ccc
  2089. subdirectory under bbb, and then the ddd subdirectory under ccc, and then it
  2090. will store the bankrupt.txt file in the /usr/olga/budget/aaa/bbb/ccc/ddd
  2091. directory.
  2092.  
  2093. In UNIX, tilde notation for usernames (like "~olga") is recognized, and any
  2094. directories that are created inherit the permissions of their parents, and the
  2095. owner and group of the user who is running the Kermit program.  Naturally,
  2096. directory creation fails if the user lacks the appropriate permissions.
  2097. Directory creation fails in Windows or OS/2 if a disk letter is included for a
  2098. nonexistent or non-writable disk.
  2099.  
  2100. Use SHOW FILE to display the SEND/RECEIVE PATHNAME settings.
  2101.  
  2102. 4.6. Pausing Between Packets
  2103.  
  2104. The new command:
  2105.  
  2106.   SET { SEND, RECEIVE } PAUSE <number>
  2107.  
  2108. tells C-Kermit to pause the given number of milliseconds (thousandths of
  2109. seconds) before sending each packet.  This might be necessary when
  2110. communicating with certain devices or over certain kinds of connections.
  2111. Don't use this except as a final resort, since it slows transfers down.  SHOW
  2112. PROTOCOL displays the current setting.  SET SEND PAUSE and SET RECEIVE PAUSE
  2113. do exactly the same thing.  Edit 190.
  2114.  
  2115. 4.7. Fullscreen File Transfer Display Improvements
  2116.  
  2117. As of version 6.0.192, the fullscreen file transfer display is the default
  2118. style in all C-Kermit versions that are capable of producing it; in all others
  2119. it is the CRT style.
  2120.  
  2121. 4.7.1. Thermometer
  2122.  
  2123. Versions of Kermit that support SET FILE DISPLAY FULLSCREEN now are able to
  2124. show a file-transfer "thermometer" (percent bar-graph) to graphically
  2125. represent the progress of the file transfer.  It can be explicitly selected or
  2126. deselected via the new trailing argument to this command:
  2127.  
  2128.   SET FILE DISPLAY FULLSCREEN { THERMOMETER, NO-THERMOMETER }
  2129.  
  2130. A running display of the transfer speed in characters per second (CPS) is also
  2131. shown; it is computed once per second as the total actual file characters
  2132. transferred so far versus elapsed time.
  2133.  
  2134. 4.7.2. Repainting the Screen
  2135.  
  2136. On multiuser operating systems like UNIX and VMS, it is possible for messages
  2137. to be sent to your terminal screen while Kermit is in the middle of
  2138. transferring a file.  If you are using the fullscreen file transfer display,
  2139. this will jumble the formatting.  C-Kermit has no way to know this has
  2140. happened.  In edit 190 and later, however, you can make C-Kermit clear and
  2141. repaint the file transfer display screen by typing Ctrl-L (or L or R or r)
  2142. while the display is active.  Control-W is also accepted for this purpose.
  2143. This will result in either a full or partial reconstruction of the display,
  2144. depending on the underlying operating system.  Edit 190.
  2145.  
  2146. 4.7.3. Round Trip Time and Timeout Value
  2147.  
  2148. As of edit 192, a field labeled "RTT/Timeout" is shown on the fullscreen file
  2149. transfer display.  This is the average, or smoothed, observed round trip time
  2150. (the time between when a packet is sent and the same packet is acknowledged),
  2151. in seconds, followed by the current packet timeout, also in seconds, which is
  2152. calculated dynamically on a per-packet basis based upon the statistical
  2153. behavior of the round-trip time (approximately the current round-trip time
  2154. plus three standard deviations).  See section 4.0 for details.
  2155.  
  2156. 4.7.4. Protocol Name
  2157.  
  2158. In C-Kermit versions that support multiple protocols internally, the
  2159. fullscreen transfer display shows which protocol is being used.
  2160.  
  2161. 4.8. Improved Status Codes
  2162.  
  2163. Like most other C-Kermit commands, file transfer commands such as SEND,
  2164. RECEIVE, GET, etc, return a status code for use with IF SUCCESS, IF FAILURE,
  2165. etc.  Prior to edit 190, these codes were not always accurate.  In particular,
  2166. if a file was rejected (for any reason at all) via the attribute refusal
  2167. mechanism, success was always indicated.  In edit 190, the status codes have
  2168. been improved as follows:
  2169.  
  2170.  . If the transfer completes successfully, the status is success.
  2171.  . If a file is refused via the attribute refusal mechanism, the status
  2172.    is failure UNLESS the reason was "date" or "name", in which case the
  2173.    file was not transferred because it was already there (SET FILE
  2174.    COLLISION UPDATE or DISCARD), and so the transfer is considered successful.
  2175.  . If the transfer terminates with an error (E packet), loss of connection,
  2176.    etc, the status is failure.
  2177.  
  2178. You can use SHOW STATUS after any command to test its success or failure.
  2179. Also, the \v(status) variable is set to 0 if the most recent command
  2180. succeeded, and to a nonzero value if it failed.
  2181.  
  2182. 4.9. Managing Directories
  2183.  
  2184. MKDIR <string> creates a directory with the given name.  The name may be
  2185.   absolute or relative.  In Windows and OS/2, forward slashes are allowed
  2186.   as directory separators, which simplifies matters considerably for Kermit
  2187.   script programs.  This is in contrast to "run mkdir", which does not
  2188.   accept forward slashes, and therefore requires the Kermit script programmer
  2189.   to use doubled backslashes instead, and becomes even more complicated with
  2190.   the use of variable names.  It also differs from "run mkdir" in returning
  2191.   an accurate status code (for IF SUCCESS / IF FAILURE).
  2192.  
  2193. RMDIR <string> removes the directory with the given name, if it is
  2194.   empty.  Same comments about directory separators as for MKDIR.
  2195.   Synonym: RD.
  2196.  
  2197. 4.10. Printing
  2198.  
  2199. The SET PRINTER command, added in 6.0.192, controls four things:
  2200.  
  2201.  1. In C-Kermit versions that have terminal emulators (such as Windows
  2202.     and OS/2), it determines where transparent-print and autoprint
  2203.     material are directed.  This does not apply to C-Kermit versions
  2204.     for UNIX, VMS, etc.
  2205.  
  2206.  2. When C-Kermit is in server mode, it determines where received
  2207.     REMOTE PRINT material goes.
  2208.  
  2209.  3. It determines where the PRINT command sends its files.
  2210.  
  2211.  4. With SET DESTINATION PRINTER in effect (section 4.12), it controls
  2212.     where incoming files go.
  2213.  
  2214. The syntax is:
  2215.  
  2216.   SET PRINTER [ { devicename, filename, command } ]
  2217.  
  2218. If "set printer" is entered by itself, your default printer is restored, which
  2219. depends on your operating system and configuration.  On systems such as VMS
  2220. and Windows, where a printer has a device name, you can specify a device name
  2221. such as LPT:, LPT1:, PRN, or NUL, using the syntax of your operating system
  2222. for device names to specify a real printer or other device, or the "null"
  2223. device in case you want all printer output to be discarded.
  2224.  
  2225. If you specify a filename, then printer output is appended to the given file.
  2226.  
  2227. To specify a command, use the "pipe" symbol, vertical bar (|), for example:
  2228.  
  2229.   set printer |lpr                      (UNIX)
  2230.  
  2231. or:
  2232.  
  2233.   set printer |textps.exe>\dev\lpt1     (Windows or OS/2)
  2234.  
  2235. If you need to include spaces, enclose the command in curly braces:
  2236.  
  2237.   set printer { | lpr -Pmyprintername }
  2238.  
  2239. 4.11. Text-File Record-Format Control
  2240.  
  2241. Edit 192.  New command:
  2242.  
  2243.   SET FILE EOL { CR, CRLF, LF }
  2244.  
  2245. Lets you choose one of three line terminators (Carriage Return only, Carriage
  2246. Return and Line Feed, or Line Feed only) for purposes of record-format
  2247. conversion during transfer of files in text mode.  This is handy in case you
  2248. have a text file stored on your computer that is in some other computer's
  2249. format -- for example, a UNIX-format file on DOS, or vice versa.
  2250.  
  2251.   CR   is used on the Macintosh and in OS-9.
  2252.   CRLF is used in DOS, Windows, OS/2, VMS, ...
  2253.   LF   is used in UNIX, AOS/VS, ...
  2254.  
  2255. 4.12. Incoming File Destination Control
  2256.  
  2257. Added in version 6.0.192:
  2258.  
  2259. SET [ FILE ] DESTINATION { DISK, PRINTER, SCREEN }
  2260.  
  2261. This applies to files being received by Kermit protocol.  The default is
  2262. DISK, meaning incoming files are stored on disk in the normal way.  PRINTER
  2263. means they are sent to the current SET PRINTER device (or file, or command;
  2264. see section 4.10).  SCREEN means they are displayed on the screen.
  2265.  
  2266. (5) NEW CLIENT/SERVER FEATURES
  2267.  
  2268. 5.0. REMOTE Command Redirection
  2269.  
  2270. Prior to version 6.0.192, output from REMOTE commands always appeared on
  2271. the screen; there was no way to direct them elsewhere, such as to a file or
  2272. a printer.  In 6.0.192 and later, any REMOTE command can be followed by
  2273. a UNIX-style "redirection indicator".  Examples:
  2274.  
  2275.   remote directory                         ; Displays on screen
  2276.   remote directory > filename              ; Goes to a (new) file
  2277.   remote directory >> filename             ; Appends to a file
  2278.   remote directory | command               ; Piped into a command
  2279.   remote directory | command > filename    ;  .. whose output goes to a file
  2280.   remote directory | command >> filename   ;  .. or is appended to a file
  2281.  
  2282. In REMOTE HOST commands, however, redirection indicators are ambiguous:
  2283.  
  2284.   remote host ls -lt > filename
  2285.  
  2286. Does this mean the command "ls -lt" is to be executed on the host with its
  2287. output sent a file on the host, or with its output sent to a file on your
  2288. your local computer?  In cases like this, you can "disambiguate" redirectors
  2289. using braces:
  2290.  
  2291.   remote host blah blah > file             ; File on this end
  2292.   remote host { blah blah } > file         ; File on this end
  2293.   remote host { blah blah > file }         ; File on that end
  2294.   remote host { blah blah > file } > file  ; Files on both ends
  2295.  
  2296. 5.1. New REMOTE Commands
  2297.  
  2298. The following commands are all new to edit 190.
  2299.  
  2300. REMOTE PWD
  2301.   Allows the client to ask for the server's current directory in
  2302.   system-independent way.  Formerly, this could only be done via system-
  2303.   dependent REMOTE HOST commands.  The response is displayed on the screen.
  2304.  
  2305. REMOTE SET FILE TYPE { TEXT, BINARY, LABELED }
  2306.   The LABELED option has been added to this command in the VMS and OS/2
  2307.   versions only.  Also, the file type specified in this command also takes
  2308.   effect locally.  Previously, it was only sent to the server.  Edit 190.
  2309.  
  2310. REMOTE QUERY { KERMIT, SYSTEM, USER } <name>
  2311.   Asks the server to send the value of the variable of the given type that has
  2312.   the given name.  If the query succeeds, the value is displayed on your
  2313.   screen and it is also stored in a local read-only Kermit variable, \v(query)
  2314.   If the query fails, an error message is printed and the \v(query) variable
  2315.   is set to the empty string.
  2316.  
  2317.   In C-Kermit and MS-DOS Kermit, "KERMIT" variables are the \v(name) kind,
  2318.   such as \v(time), \v(version), \v(date), etc, or \f...() functions.
  2319.  
  2320.   "SYSTEM" variables are DOS or UNIX environment variables, such as PATH,
  2321.   USER, HOME, or VMS logical names, etc.  USER variables are everything else
  2322.   -- \%a-z, \%1-9, and macro names used as long variable names.
  2323.  
  2324.   The <name> of a KERMIT or SYSTEM variable must be given in an
  2325.   implementation-independent format without special syntax, e.g. TIME, DATE,
  2326.   VERSION, PATH, USER, etc, rather than (say) \v(time), \$(PATH).  Similarly
  2327.   for functions: "remote query kermit files(oofa.*)" rather than "remote
  2328.   query \ffiles(oofa.*)"
  2329.  
  2330.   However, in most cases, case matters in system variables.  The <name> of a
  2331.   USER variable is given in the syntax of the server, e.g. \%a.
  2332.  
  2333. Examples:
  2334.  
  2335.   C-Kermit>remote query kermit time
  2336.   13:25:18
  2337.   C-Kermit>echo The server's time is: \v(query)
  2338.   The server's time is: 13:25:18
  2339.   C-Kermit>rem q k dir ; Note, abbreviations allowed.
  2340.   /usr/olga/letters
  2341.   C-Kermit>echo The server's current directory is: \v(query)
  2342.   The server's current directory is: /usr/olga/letters
  2343.   C-Kermit>rem q system USER
  2344.   olga
  2345.   C-Kermit>echo user = \v(query)
  2346.   user = olga
  2347.   C-Kermit>remote query kermit files(oofa.*)
  2348.  
  2349. REMOTE ASSIGN <name> [ <value> ]
  2350.   Asks the server to assign the given <value> to the remote user variable
  2351.   denoted by <name>.  The <value> is fully evaluated LOCALLY before being sent
  2352.   to the Kermit server.  The maximum length for the value is governed by the
  2353.   maximum negotiated packet length, i.e. the server's RECEIVE PACKET-LENGTH.
  2354.   Synonym: REMOTE ASG.
  2355.  
  2356. Examples:
  2357.  
  2358.   C-Kermit>remote assign \%a \v(time) ; Assign client's time to server's \%a
  2359.   C-Kermit>remote query user \%a   
  2360.   13:41:18                            ; This is the client's time
  2361.   C-Kermit>rem asg myname Olga        ; Assign my name to server's myname macro
  2362.   C-Kermit>remote assign oofa \\ffiles(oofa.*)
  2363.   C-Kermit>remote query user oofa
  2364.  
  2365. To force a string corresponding to a local variable name to be sent literally,
  2366. use two backslashes:
  2367.  
  2368.   C-Kermit>remote assign \%a \\v(time) ; Assign "\v(time)" to server's \%a.
  2369.   C-Kermit>remote query user \%a   
  2370.   13:41:18                             ; This is the server's time.
  2371.   C-Kermit>
  2372.  
  2373. You can disable and enable the server's handling of REMOTE QUERY and ASSIGN
  2374. with the commands:
  2375.  
  2376.   DISABLE QUERY    The server should not respond to REMOTE QUERY commands
  2377.   DISABLE ASSIGN   The server should not respond to REMOTE ASSIGN commands
  2378.   ENABLE QUERY     The server should respond to REMOTE QUERY commands
  2379.   ENABLE ASSIGN    The server should respond to REMOTE ASSIGN commands
  2380.  
  2381. By default, like all other ENABLE/DISABLE items, the initial state is ENABLEd.
  2382.  
  2383. 5.2. "WHATAMI" -- Making Kermit GET more like FTP GET
  2384.  
  2385. Those who are accustomed to using client/server applications such as FTP
  2386. expect that certain kinds of commands, when given to the client, will affect
  2387. the server correspondingly.  Most notable among these commands (in FTP's case)
  2388. are those that set the transfer mode: BINARY, ASCII, etc.
  2389.  
  2390. In Kermit, however, the transfer mode has always been determined by the file
  2391. sender, a concept totally unrelated to the client/server distinction, and less
  2392. than obvious to most people.  Furthermore, Kermit programs do not always have
  2393. a client/server relationship -- there is also the send/receive arrangement.
  2394.  
  2395. C-Kermit 5A(190) (and later) and MS-DOS Kermit 3.14 (and later) implement
  2396. a new "What Am I" feature, which operates transparently to the user (i.e.
  2397. there are no commands to control it), and results in FTP-like operation when:
  2398.  
  2399.  1. One Kermit program is in SERVER mode, the other is a client, AND:
  2400.  
  2401.  2. Both Kermit programs support the WHATAMI feature.  Currently, these are
  2402.     limited to C-Kermit 5A(190), MS-DOS Kermit 3.14.  A forthcoming release
  2403.     of IBM Mainframe Kermit will support it too.
  2404.  
  2405. Presently, the WHATAMI feature affects only the GET command, and addresses the
  2406. following scenario:
  2407.  
  2408.  1. User starts a Kermit server, giving it no special settings.
  2409.  
  2410.  2. User tells the client to:
  2411.  
  2412.       SET FILE TYPE BINARY
  2413.       SET FILE NAMES LITERAL
  2414.       GET cku190.tar.Z
  2415.     
  2416.  3. The file is transferred in text mode when the user expected a binary
  2417.     transfer, and the name was converted even though the user wanted it not
  2418.     to be changed.
  2419.     
  2420. At the beginning of any protocol transaction, the two Kermits exchange "What
  2421. Am I" information as part of the S or I packet data.  This information
  2422. includes (a) whether I am a client or server; (b) my transfer mode (text or
  2423. binary); and (c) my file name handling (literal or converted).
  2424.  
  2425. Then, when the server receives a GET-command packet from the client, AND if
  2426. WHATAMI information has been successfully exchanged, then the server switches
  2427. its file transfer mode and file name handling to the client's corresponding
  2428. modes.  Nothing special happens when files are sent TO the server, since this
  2429. works right anyway, using the previous mechanisms.
  2430.  
  2431. Hopefully this change will result in more pleasant surprises than unpleasant
  2432. ones.  One Beta tester (a seasoned Kermit user), however, was unpleasantly
  2433. surprised when he sent the following commands from a client to a server:
  2434.  
  2435.   REMOTE SET FILE TYPE BINARY
  2436.   GET OOFA.ZIP
  2437.  
  2438. The file arrived in text mode because the client was in text mode.  The user
  2439. was relying of the old rule, by which the file sender informs the file
  2440. receiver of the transfer mode via the attribute packet, but since the WHATAMI
  2441. exchange took place after the REMOTE SET, it changed the server's mode back to
  2442. text.  To cure this situation, REMOTE SET FILE TYPE now sets the local file
  2443. transfer mode too.
  2444.  
  2445. Should all this sound confusing, remember that the WHATAMI feature (and the
  2446. other mechanisms for reconciling file transfer mode) make a difference only
  2447. when the sender and receiver's file transfer modes do not agree.  The rules
  2448. can be summarized like this:
  2449.  
  2450.  1. To be certain of the file transfer mode, give the same SET FILE TYPE
  2451.     command to both Kermits (exception: when VMS C-Kermit is sending a file,
  2452.     it determines the transfer mode for each file automatically).
  2453.  
  2454. In case you did not do this, and the transfer modes of the two Kermit programs
  2455. disagree when the file transfer starts:
  2456.  
  2457.  2. If the file sender is VMS C-Kermit, it determines the file type 
  2458.     automatically unless its file type has been set to IMAGE or LABELED.
  2459.     Otherwise:
  2460.  
  2461.  3. If both Kermits have the WHATAMI feature, the client program's transfer
  2462.     mode prevails.  Otherwise:
  2463.  
  2464.  4. If both Kermit programs have Attribute-packet capability, the sender will
  2465.     inform the receiver of the transfer mode, and the receiver will switch to
  2466.     the sender's transfer mode automatically.  Otherwise:
  2467.  
  2468.  5. The transfer proceeds with each Kermit program using the transfer mode
  2469.     that the user has told it to use.  This can result in mismatches, which
  2470.     are usually not what was intended.
  2471.  
  2472. Since not all Kermit implementations -- particularly those found in commercial
  2473. or shareware software packages -- implement the WHATAMI feature or Attribute
  2474. packets, it is always safest to inform both Kermit programs of the transfer
  2475. mode prior to file transfer.
  2476.  
  2477. 5.3. Idle Timeout for Server
  2478.  
  2479. Edit 192; Windows 95, Windows NT, and OS/2 only.  The new command:
  2480.  
  2481. SET SERVER IDLE-TIMEOUT [ <seconds> ]
  2482.  
  2483. Sets a limit on how long C-Kermit is to wait for a command to come in when it
  2484. is in server mode.  The default idle-timeout is 0, which means there is no
  2485. limit.  This feature allows a Kermit server to be set up for a specified
  2486. amount of time, and then to shut down automatically if it is not used within
  2487. that amount of time.  It does not, however, impose any restriction on the
  2488. amount of time the server can be in use.  After each use, the idle-time limit
  2489. is restarted.  The idle timeout is ignored if Kermit has been told to
  2490. DISABLE FINISH.
  2491.  
  2492. 5.4. Internally Generated Directory Listings
  2493.  
  2494. Beginning with version 6.0.192, C-Kermit, when in server mode and given REMOTE
  2495. DIRECTORY, REMOTE TYPE, and similar commands, generates the results itself,
  2496. rather than running a shell command to do it.  This is more portable, more
  2497. secure, less consumptive of resources, and faster.
  2498.  
  2499. 5.5. Server GET Path
  2500.  
  2501. The SET SERVER GET-PATH, command, added in edit 192, lets you specify a list
  2502. of directories for the server to look in when it receives a GET request for a
  2503. file whose name is not an absolute pathname.  (In UNIX, an absolute pathname
  2504. starts with a slash; in DOS or Windows, with a backslash possibly after a disk
  2505. letter and colon, etc etc).  Directory names are separated by spaces.  If the
  2506. trailing directory separator is omitted, C-Kermit supplies it.  Example
  2507. (UNIX):
  2508.  
  2509.   SET SERVER GET-PATH /usr/olga/ ~olaf /tmp
  2510.  
  2511. results in:
  2512.  
  2513.   /usr/olga/
  2514.   /usr/olaf/  (assuming olaf's login directory is /usr/olaf)
  2515.   /tmp/
  2516.  
  2517. If a SERVER GET-PATH is set, then it, and only it, is used for finding files
  2518. whose names are not absolute.  The filename from the GET request is appended
  2519. to the first element in the GET-PATH and C-Kermit checks to see if the file
  2520. exists.  If not, the process repeats for the second and subsequent GET-PATH
  2521. element until the file is located or the GET-PATH is exhausted.
  2522.  
  2523. The maximum number of elements in the GET-PATH varies with the C-Kermit
  2524. implementation, usually somewhere between 16 and 128.  Use SHOW FEATURES
  2525. and look for "MAXGETPATH=".
  2526.  
  2527. If you want Kermit to look in its current directory when a GET-PATH is in
  2528. effect, the current directory must be included in the GET-PATH.  If the client
  2529. sends an absolute (fully qualified) pathname, that takes precedence over the
  2530. GET-PATH.  If it sends a relative pathname (or simply a filename), then the
  2531. directories in the GET-PATH are searched, in the order given, and the file is
  2532. sent from the first directory in which it is found; if it is not found in any
  2533. of them, a "File not found" error message is sent.  The SERVER GET-PATH takes
  2534. precedence over DISABLE CD.  The GET path, if any, is shown by SHOW SERVER.
  2535.  
  2536. (6) INTERNATIONAL CHARACTER SETS
  2537.  
  2538. Since "Using C-Kermit" was published:
  2539.  
  2540.  . Edit 189 of C-Kermit added support for Hebrew character sets.
  2541.  . Edit 190 added Hebrew terminal emulation to OS/2 C-Kermit.
  2542.  . Edit 190 added support for the Hewlett-Packard Roman8 character set.
  2543.  
  2544. 6.1. Hebrew File Transfer
  2545.  
  2546. C-Kermit 5A(189) has the following new commands for Hebrew file transfer:
  2547.  
  2548.   SET TRANSFER CHARACTER-SET HEBREW-ISO = ISO 8859-8 Latin/Hebrew Alphabet
  2549.  
  2550.   SET FILE CHARACTER-SET HEBREW-ISO     = ISO 8859-8 Latin/Hebrew Alphabet
  2551.   SET FILE CHARACTER-SET CP862          = Hebrew PC Code Page
  2552.   SET FILE CHARACTER-SET HEBREW-7       = DEC 7-Bit (VT100) Hebrew
  2553.  
  2554. These commands work just like the corresponding commands for Cyrillic
  2555. character sets, described in Chapter 9 of "Using C-Kermit".  When receiving
  2556. files, C-Kermit recognizes Hebrew files automatically if the file sender tags
  2557. the file as Hebrew in the Attribute packet, which the file sender should do if
  2558. it has been given the SET TRANSFER CHARACTER-SET HEBREW command; C-Kermit does
  2559. not, however, switch automatically to a Hebrew file character-set, so you must
  2560. choose one in advance if that's what you want.  The tag is "I6/138" (these are
  2561. ISO registration numbers).  When sending files in Hebrew mode, of course,
  2562. C-Kermit includes the same tag.
  2563.  
  2564. An invertible translation table between Latin/Hebrew and CP862 is used during
  2565. both terminal emulation and file transfer.  The translation table between
  2566. Hebrew-7 and Latin/Hebrew, however, is not invertible because these character
  2567. sets are different sizes.
  2568.  
  2569. Here is an example of uploading a Hebrew file from a PC to UNIX.  The PC
  2570. version is coded in the Hebrew PC code page, and the UNIX version is to be
  2571. stored in the 7-bit Hebrew character-set so it can be sent as network e-mail:
  2572.  
  2573.   C-Kermit> set file character-set hebrew-7 ; I want a 7-bit version for email
  2574.   C-Kermit> receive                         ; Wait for the file.
  2575.   <Alt-X>                                   ; Escape back to the PC
  2576.   MS-Kermit> set file type text             ; Make sure we are in text mode
  2577.   MS-Kermit> set file character-set cp862   ; File coded in Hebrew PC code page
  2578.   MS-Kermit> set xfer character-set hebrew  ; Send using ISO Latin/Hebrew
  2579.   MS-Kermit> send rab.oof                   ; Send the file
  2580.  
  2581. The file sender automatically tells the file receiver that the transfer
  2582. character-set is Hebrew.
  2583.  
  2584. The three Hebrew character sets are also available for use in C-Kermit's
  2585. TRANSLATE command, which translates a local file from one character-set to
  2586. another.  Thus you can use C-Kermit to convert a local file from, say,
  2587. Latin/Hebrew to Hebrew-7.
  2588.  
  2589. C-Kermit's Hebrew file transfer features can be used in conjunction with
  2590. MS-DOS Kermit 3.13 and later (with which C-Kermit shares the same translation
  2591. tables to ensure consistent translations) and IBM Mainframe Kermit 4.2 or
  2592. later, which translates between Latin/Hebrew and IBM CECP 424 (the Hebrew
  2593. EBCDIC Country Extended Code Page).
  2594.  
  2595. 6.2. Hebrew Terminal Emulation
  2596.  
  2597.   NOTE:  See the HEBREW.DOC file that accompanies OS/2 C-Kermit and Kermit 95
  2598.   for information about Hebrew terminal emulation in OS/2 C-Kermit.
  2599.  
  2600. There is no support for right-to-left screen-writing direction or other
  2601. terminal emulation features in C-Kermit, since C-Kermit (except the OS/2 and
  2602. Macintosh versions) does not do terminal emulation itself, but just provides a
  2603. terminal-independent "pipe" to your terminal emulator.  However, you can still
  2604. have C-Kermit provide the character translations during CONNECT mode:
  2605.  
  2606.   SET TERMINAL CHARACTER-SET { HEBREW-ISO, HEBREW-7, CP862 } [ local-cset ]
  2607.  
  2608. The terminal character-set affects not only CONNECT mode, but also the session
  2609. log and the TRANSMIT command.
  2610.  
  2611. You can test for the presence of Hebrew support in your version of C-Kermit
  2612. using the CHECK HEBREW command or the SHOW FEATURES command.
  2613.  
  2614. 6.3. The Hewlett Packard Roman8 Character Set
  2615.  
  2616. C-Kermit 5A(190) adds support for Hewlett Packard ROMAN8 as a file
  2617. character-set and a terminal character-set.  This is an 8-bit character-set
  2618. roughly equivalent, but not identical, to Latin-1, and (of course) with
  2619. entirely different encoding.  The translations between HP ROMAN8 and Latin-1
  2620. are invertible.
  2621.  
  2622. (7) SCRIPT PROGRAMMING
  2623.  
  2624. 7.1. New IF Commands
  2625.  
  2626. Note that all IF conditions can also be used as WHILE conditions.
  2627.  
  2628. IF DIRECTORY <name> succeeds if <name> is the name of a directory or a
  2629.   file-structured device, fails otherwise.  Available, as of edit 190, in UNIX,
  2630.   VMS, Windows 95 and NT, and OS/2.
  2631.  
  2632. IF FALSE never succeeds.  Edit 192.
  2633.  
  2634. IF NEWER <file1> <file2> compares modification (or creation) date/times of two
  2635.   files, succeeds if first file is newer than second file.  Edit 190.
  2636.  
  2637. IF REMOTE-ONLY succeeds if C-Kermit was started with the -R (uppercase)
  2638.   command-line option, fails otherwise.  This lets you advise C-Kermit that you
  2639.   only intend to use it in remote mode; the initialization and customization
  2640.   files can (and the standard ones do) include IF REMOTE-ONLY commands to skip
  2641.   over time-and-space-consuming items, such as the dialing and services
  2642.   directories, that will not be used in remote mode.  This allows Kermit to
  2643.   start more quickly.  For examples of use, see the standard initialization
  2644.   file, ckermit.ini / .kermrc.  Edit 190.
  2645.  
  2646. IF TRUE always succeeds.  Edit 192.
  2647.  
  2648. IF EQUAL, IF LLT, IF LGT string comparison commands, as of edit 190, allow the
  2649.   use of braces around comparands that contain imbedded spaces, for example:
  2650.  
  2651.     IF EQUAL {\%a} {sentence with four words} echo They are equal.
  2652.  
  2653.   Prior to edit 190, constructions like this would cause a parse error (see
  2654.   p.239, "Using C-Kermit").  Be sure to use braces around both items.
  2655.  
  2656. 7.2. New \v() Variables
  2657.  
  2658. \v(charset) C-Kermit's local character set.  Use this (e.g.) in scripts
  2659.   for deciding which character set to use when printing screen messages.
  2660.  
  2661. \v(connection) When C-Kermit has made a SET LINE or SET HOST connection, this
  2662.   variable tells the connection type: "serial", "tcp/ip telnet", "decnet lat",
  2663.   "decnet cterm", "x.25", etc.  If C-Kermit is in remote mode -- i.e. it has
  2664.   not made a connection to another computer -- the value of this variable is
  2665.   "remote".
  2666.  
  2667. \v(cps) gives speed in characters (bytes) per second of the most recent
  2668.   file transfer.  If a group of files was transferred, the figure applies
  2669.   to the whole group.
  2670.  
  2671. \v(dialnumber) the number (or directory entry name) given most recently to a
  2672.   DIAL command.
  2673.  
  2674. \v(dialstatus) contains a numeric result code for the most recent DIAL command:
  2675.  
  2676.   -1 No DIAL command given yet
  2677.    0 DIAL succeeded
  2678.    1 Modem type not specified
  2679.    2 Communication device not specified
  2680.    3 Device can't be opened
  2681.    4 Communication speed not specified
  2682.    5 Hangup failure
  2683.    6 Internal error (memory allocation, etc)
  2684.    7 Device input/output error
  2685.    8 DIAL TIMEOUT expired
  2686.    9 Dialing interrupted by user
  2687.   10 Modem not ready
  2688.   11-19 (reserved)
  2689.   20 Modem command error
  2690.   21 Failure to initialize modem
  2691.   22 Phone busy
  2692.   23 No carrier
  2693.   24 No dialtone
  2694.   25 Ring (incoming call)
  2695.   26 No answer
  2696.   27 Disconnected
  2697.   28 Answered by voice
  2698.   29 Access denied, forbidden call
  2699.   30 Blacklisted
  2700.   31 Delayed
  2701.   32 Fax connection
  2702.   98 Unknown error
  2703.   99 Unspecified failure detected by modem
  2704.  
  2705. NOTE: The fact that these codes exist does not necessarily mean that Kermit
  2706. will ever return them.  That depends upon (a) the modem being configured to
  2707. return the desired set of result codes (usually with the Xn command, where
  2708. n is a number; see your modem manual), and (b) Kermit being programmed to know
  2709. about each such response from each such modem.  Example: Most Hayes-like
  2710. modems will say NO CARRIER if the phone doesn't answer, but can usually be
  2711. configured (with X4 or somesuch) to give a more specific reason, like BUSY
  2712. or NO ANSWER.  If you don't get the required level of differential of failure
  2713. reasons, try using the SET MODEM DIAL-COMMAND command to add (say) X4 to
  2714. the dial command -- e.g. ATD<number> becomes ATX4D<number>.
  2715.  
  2716. \v(dialresult)
  2717.   The actual text of the message from modem in response to the most recent
  2718.   DIAL, REDIAL, or ANSWER command, e.g. "CONNECT 2400", "NO CARRIER", "NO
  2719.   DIALTONE", "CONNECT 28800/LAPM/V34"
  2720.  
  2721. \v(download)  
  2722.   The SET FILE DOWNLOAD-DIRECTORY value.  Edit 192.
  2723.  
  2724. \v(errno) = Value of the "errno" variable, usually the error returned
  2725.   by the most recent system call.  Not necessarily totally reliable, but
  2726.   might aid in debugging scripts, especially commands that open or close
  2727.   devices or files, or that do file or device input or output.
  2728.  
  2729. \v(errstring) = The error message, if any, associated with the current value
  2730.   of \v(errno), from the system's error-message list.
  2731.  
  2732. \v(evaluate) = result of most recent EVALUATE command  Edit 190.
  2733.  
  2734. \v(exedir) = The directory the C-Kermit executable is located in.  Edit 192.
  2735.   (K95 and OS/2).
  2736.  
  2737. \v(fsize) = Size of last transfered file.  Edit 190.
  2738.  
  2739. \v(ftype) = current FILE TYPE setting: "text" or "binary".  In OS/2 and VMS,
  2740.   also "labeled".  In VMS only, also "image".
  2741.  
  2742. \v(inidir) = directory the INI file is located in.  (K95 and OS/2 only)
  2743.   Edit 192.
  2744.  
  2745. \v(instatus) = result of the most recent INPUT command:
  2746.  -1 = No INPUT command given yet
  2747.   0 = Succeeded
  2748.   1 = Timed out
  2749.   2 = Interrupted by user (keystroke or SIGINT)
  2750.   3 = Internal error
  2751.   4 = I/O error or connection lost
  2752.  
  2753. \v(ipaddress)
  2754.   The IP address of the computer that C-Kermit is running on.  This variable
  2755.   is set when you first make an IP connection; prior to that it is empty.
  2756.  
  2757. \v(keyboard) (K95 and OS/2 only), the keyboard model: "88", "101", "102", 
  2758.    or "122".
  2759.  
  2760. \v(minput) = number telling which MINPUT search string was matched: 0 = none
  2761.   of them; 1 = the first one, etc. (see section on MINPUT below).
  2762.  
  2763. \v(modem) = current modem type (SET MODEM TYPE value).
  2764.  
  2765. Various modem setup strings.  Edit 192:
  2766.  
  2767. \v(m_aa_off) = Command to turn Auto Answer Off.
  2768. \v(m_aa_on)  = Command to turn Auto Answer On.
  2769. \v(m_dc_off) = Data Compression Off.
  2770. \v(m_dc_on)  = Data Compression On.
  2771. \v(m_dial)   = Dial a number.
  2772. \v(m_ec_off) = Error Correction Off.
  2773. \v(m_ec_on)  = Error Correction On.
  2774. \v(m_fc_hw)  = Flow Control Hardware.
  2775. \v(m_fc_no)  = Flow Control None.
  2776. \v(m_fc_sw)  = Flow Control Software.
  2777. \v(m_hup)    = Hangup.
  2778. \v(m_init)   = Initialization.
  2779. \v(m_pulse)  = Pulse Dialing.
  2780. \v(m_tone)   = Tone Dialing.
  2781.  
  2782. \v(newline) is the newline character or sequence appropriate to the operating
  2783.   system where C-Kermit is running, for example linefeed (\10) for UNIX,
  2784.   carriage return (\13) for OS-9, carriage-return linefeed (\13\10) for OS/2
  2785.   and Windows.
  2786.  
  2787. \v(packetlen) = current RECEIVE PACKET-LENGTH.
  2788.  
  2789. \v(parity) = current PARITY setting: "even", "odd", "mark", "none", or "space".
  2790.  
  2791. \v(protocol)
  2792.   The SET PROTOCOL value.  Edit 192.
  2793.  
  2794. \v(rexx) (os/2 32-bit only) = the return value from the last Rexx command 
  2795.   issued.  
  2796.  
  2797. \v(rows) = the number of rows (lines) on the console terminal / screen,
  2798.   i.e. its length, -1 if unknown.
  2799.  
  2800. \v(cols) = the number of columns on the console terminal / screen,
  2801.   i.e. its width, -1 if unknown..
  2802.  
  2803. \v(terminal) = terminal type, if known, otherwise "unknown".
  2804.  
  2805. \v(tmpdir) = directory for creating temporary files.  Value is system-
  2806.   dependent and can be hardwired (e.g. /tmp/ for UNIX), or come from
  2807.   environment variables (e.g. TMP or TEMP in OS/2 or Windows), and in any
  2808.   case can be overriden by the user with SET TEMP-DIRECTORY.
  2809.  
  2810. \v(query) = result of most recent REMOTE QUERY command.
  2811.  
  2812. \v(select) (OS/2 and Kermit 95 only)
  2813.   Current (mouse) selection in terminal screen, if any.
  2814.  
  2815. \v(space) = number of free bytes on current storage device (OS/2 and K95 only).
  2816.  
  2817. \v(startup) (OS/2 & K95 only)
  2818.   Disk:Directory from which C-Kermit was started.
  2819.  
  2820. \v(sysid) = Kermit system/OS code, from pp.275-278 of the Kermit book:
  2821.        U8 = MS-DOS (and Windows)
  2822.        U1 = UNIX
  2823.        D7 = VMS
  2824.        UD = OS-9
  2825.        L3 = Amiga
  2826.        A3 = Macintosh
  2827.        UO = OS/2
  2828.        F3 = AOS/VS
  2829.        K2 = Atari ST
  2830.        MV = Stratus VOS
  2831.        UN = Kermit-95 (Windows 95 and Windows NT)
  2832.        etc...
  2833.  
  2834. \v(userid) = Username as reported by the Operating System (K95).  Or as 
  2835.   defined in the USER environment variable (OS/2), or as set by SET LOGIN
  2836.   USERID, or by the last RLOGIN <host> <username> command.  Edit 192.
  2837.  
  2838. \v(window) = Current SET WINDOW size.
  2839.  
  2840. \v(xversion) = The product-specific C-Kermit version number, for versions
  2841.   that are given numbers other than the main C-Kermit version number, e.g.
  2842.   115 for Kermit 95 1.1.5; otherwise 0 (for UNIX, VMS, etc).
  2843.  
  2844. \v(_line) = The current line number from the current command file,
  2845.   if any; 1-based.  If no command file is active, then 0.
  2846.  
  2847. Dialing-related (edit 192):
  2848.  
  2849.   \v(d$ac) = SET DIAL AREA-CODE value.
  2850.   \v(d$cc) = DIAL COUNTRY-CODE value.
  2851.   \v(d$lp) = DIAL LD-PREFIX value.
  2852.   \v(d$ip) = DIAL INTL-PREFIX value.
  2853.  
  2854. 7.3. New \f() Functions
  2855.  
  2856. In edit 192, all numeric arguments are automatically treated as expressions,
  2857. so it is no longer necessary to enclose expressions in numeric function
  2858. argument fields within calls to \feval().  For example:
  2859.  
  2860.   Pre-192:  echo \findex(x,abcxyz,\feval(1+1))
  2861.   192:      echo \findex(x,abcxyz,1+1)
  2862.  
  2863. Functions affected include:
  2864.   \fchar()
  2865.   \findex()
  2866.   \flpad()
  2867.   \fmax()
  2868.   \fmin()
  2869.   \fmod()
  2870.   \frepeat()
  2871.   \fright()
  2872.   \frindex()
  2873.   \frpad()
  2874.   \fsubstring()
  2875.   \fverify()
  2876.  
  2877. Of course the old way still works too.
  2878.  
  2879. In edit 192, function argument processing was corrected to allow grouping
  2880. with braces, so that commas or parentheses can be included as part of a
  2881. function argument.  Examples:
  2882.  
  2883.                         Value.....
  2884.                         Old    New
  2885.   \flength(abc)          3      3
  2886.   \flength({abc})        5      3
  2887.   \flength(a{b}c)        5      3
  2888.   \flength({{abc}})      7      5
  2889.   \flength(a,b,c)        1      1
  2890.   \flength({a,b,c})      2      5
  2891.   \flength(a{,}b{,}c)    9      5
  2892.  
  2893. Note that only outermost braces are stripped, and inner ones are kept, so
  2894. whenever you need to include braces themselves, just double them up.
  2895. Note that \fliteral is an exception -- whatever goes in the parentheses is
  2896. returned literally.
  2897.  
  2898. \Fbreak(s,c)
  2899.   Returns the left substring of the string s up until the first occurrence
  2900.   of the character c, like the Snobol BREAK function.  If the character c
  2901.   does not occur in the string s, or is omitted, the entire string s is
  2902.   returned.  If the second argument contains more than one character, only
  2903.   the first character is used.
  2904.  
  2905. \Fcapitalize(s)
  2906.   Returns the string s with its initial letter uppercased and all subsequent
  2907.   letters lowercased.  Synonym: \Fcaps().
  2908.  
  2909. \Fdate(filename) returns the modification (or creation) date of the given
  2910.   file in "yyyymmdd hh:mm:ss" format, or else the empty string upon failure.
  2911.   As of edit 190, available in UNIX, VMS, and OS/2 versions.
  2912.  
  2913. \Fhexify(s)
  2914.   Returns the hexadecimal representation of the argument string s.
  2915.  
  2916. \Fipaddr(s,n)
  2917.   Finds and returns the first IP address in string s starting at position n
  2918.   (= 1 by default).  IP address must be four decimal numeric fields of 1-3
  2919.   digits each, separated by periods.  No range checking is done (i.e. for 255
  2920.   or less).  Use with \v(input) to parse IP addresses given, e.g., during
  2921.   SLIP or PPP setup.  Edit 192.
  2922.  
  2923. \Fltrim(s1[,s2])
  2924.   "Left trim".  Returns the string that is obtained by removing all characters
  2925.   from the left of string s1 that are also in string s2, stopping with the
  2926.   first character that is not in s2.  If s2 is omitted, space and tab
  2927.   ("whitespace") are removed.  Also see \Ftrim().
  2928.  
  2929. \Fmodulus(n1,n2)
  2930.   Returns the remainder obtained after dividing n1 by n2.  Equivalent to
  2931.   \Feval(n1%n2).  
  2932.  
  2933. \Freplace(s1,s2,s3).  This function replaces all occurrences of the string s2
  2934.   in the string s1 by the string s3.  s1 and s2 must be at least one character
  2935.   long.  s3 can be omitted, in which case all occurrences of s2 are removed
  2936.   from s1.  If s2 is omitted, s1 is returned unchanged.  Examples:
  2937.  
  2938.     \freplace(oofa,o,O)  = OOfa
  2939.     \freplace(oofa,o,oo) = oooofa
  2940.     \freplace(oofa,o)    = fa
  2941.     \freplace(oofa)      = oofa
  2942.  
  2943.   or (more practically for DOS, Windows, and OS/2):
  2944.  
  2945.     \freplace(\v(cmdfile),\\,/) ; replace backslashes by forward slashes
  2946.  
  2947. \Frindex(s1,s2,n) - Right index.  Searches for string s1 in string s2 starting
  2948.   from the right.  If the optional number n is included, the rightmost n
  2949.   characters of s2 are ignored.  Returns the index (position) of the rightmost
  2950.   occurrence of string s2 in s1 (ignoring the rightmost n characters of s2).
  2951.  
  2952. \Fsize(filename) tells the size, in characters (bytes), of the given file.
  2953.  
  2954. \Fspan(s1,s2)
  2955.   Returns the left substring of s1 that contains only characters from s2,
  2956.   like the Snobol SPAN function.
  2957.  
  2958. \Ftod2secs(hh:mm:ss)
  2959.   Converts a time of day, expressed in 24-hour clock notation, to seconds
  2960.   since midnight.  Example: \Ftod2secs(12:01:01) gives 43261.
  2961.   Note: \ftod2secs(\v(time)) should be equal to \v(ntime).
  2962.  
  2963. \Ftrim(s1[,s2])
  2964.   Returns the string that is obtained by removing all characters from the
  2965.   right of s1 that are also in s2, stopping with the first character that
  2966.   is not in s2.  If s2 is omitted, space and tab ("whitespace") are removed.
  2967.   Also see \Fltrim().
  2968.  
  2969. \Funhexify(string)
  2970.   Converts a hexadecimal string to its normal representation.  If the string
  2971.   contains any non-hex characters (i.e. other than 0-9, a-f or A-F), or has
  2972.   an odd length, the empty string is returned.
  2973.  
  2974. \Fverify(s1,s2,n) returns the index (position) of the first character in s2
  2975.   that is not also in s1.  If n is given, we only look at s2 beginning at
  2976.   position n.  Use for preverifying hex numbers, phone numbers, etc.
  2977.  
  2978. 7.4. INPUT and OUTPUT Command Improvements
  2979.  
  2980. (Also see section 7.5, the MINPUT command.)
  2981. (Also see section 7.6, "wait until given time of day" feature.)
  2982.  
  2983. As of edit 192, in the Windows and OS/2 versions -- i.e. the version with
  2984. terminal emulators -- INPUT material is also passed through the terminal
  2985. emulator.  Thus, even though Kermit is not in CONNECT mode, the virtual
  2986. screen is being updated correctly, and, perhaps more important, the terminal
  2987. emulator automatically responds to queries -- such as "What Are You?" and
  2988. "What Is Your Screen Size?" -- from the host.  Thus it is no longer necessary
  2989. (or advisable :-) for script programs to look for query escape sequences and
  2990. send their own responses.
  2991.  
  2992. As of edit 190, the INPUT and OUPUT commands are buffered, which results
  2993. in greater speed of execution.
  2994.  
  2995. In edit 192, a new variable, \v(instatus) was added to hold the result of
  2996. the most recent INPUT command.  So now, for example, it is possible to tell
  2997. whether an INPUT failed because it timed out or because the user interrupted
  2998. it by pressing a key.  See section 7.2, New \v() Variables.
  2999.  
  3000. The new command:
  3001.  
  3002.   SET INPUT BUFFER-LENGTH <number>
  3003.  
  3004. Lets you specify the size of the INPUT buffer, in bytes.  Previously it was
  3005. a fixed size of 256 bytes.  Normally this presents no particular problem,
  3006. since the INPUT and REINPUT commands handle wraparound and so forth just fine.
  3007. However, it prevents the REINPUT command from working when the search target
  3008. was more than 256 bytes "behind" the "front end" of the buffer.  In cases like
  3009. this, you can SET INPUT BUFFER-LENGTH to be any size you want, within reason.
  3010.  
  3011. The new command:
  3012.  
  3013.   SET OUTPUT PACING <number>
  3014.  
  3015. causes C-Kermit to pause for (at least) the indicated number of milliseconds
  3016. (thousandths of a second) between each character in the OUTPUT string.  Use
  3017. this option when OUTPUT'ing characters to a device that can't receive
  3018. characters at the full communication speed without losing or garbling them.
  3019. The default OUTPUT PACING is 0, i.e. no pauses.  Display with SHOW SCRIPTS.
  3020. Edit 189.
  3021.  
  3022. The OUTPUT command accepts three special notations for sending special signals
  3023. or characters:
  3024.  
  3025.   \B or \b
  3026.     Send a BREAK signal.  On serial connections, this is a 250 millisecond
  3027.     spacing condition.  On network connections, it is a network-specific
  3028.     BREAK protocol message, such as a TELNET BREAK.
  3029.  
  3030.   \L or \l
  3031.     Send a Long BREAK signal.  On serial connections, this is a 1.5-second
  3032.     spacing condition.  On network connections, it is the same as \B (BREAK).
  3033.  
  3034.   \N or \n
  3035.     Send a NUL (ASCII 0) character.  \0 can't be used for this because it is
  3036.     the terminator for C-language strings.  (\N is new to edit 190.)
  3037.  
  3038. If you need to send \B, \L, or \N literally (e.g. to configure certain kinds
  3039. of modems), you can use either:
  3040.  
  3041.   OUTPUT \fliteral(\B) (or \fliteral(\L) or \fliteral(\N))
  3042. or:
  3043.   OUTPUT \\B (or \\L or \\N)
  3044.  
  3045. Note: \fliteral() can be abbreviated, e.g. \flit(\N).
  3046.  
  3047. Or, you can SET COMMAND QUOTING OFF.  NOTE:  None of this worked quite right
  3048. prior to version 6.0.192.
  3049.  
  3050. 7.5. The MINPUT Command
  3051.  
  3052. The MINPUT command ("multiple input"), added in version 5A(190), is a
  3053. variation on the INPUT command that looks for more than one string at a time.
  3054. Syntax:
  3055.  
  3056.   MINPUT <sec> [ string1 [ string2 [ string2 [ ... ] ] ] ]
  3057.  
  3058. Strings are separated by spaces.  If any of the search strings is encountered
  3059. within the timeout interval, the command succeeds and the \v(minput) variable
  3060. is set to the number of the string that was found: 1, 2, 3, etc.  If none of
  3061. the search strings is found, the command times out, fails, and \v(minput) is
  3062. set to 0.  All SET INPUT paramaters apply - SET INPUT CASE, etc.  Example:
  3063.  
  3064.   minput 30 Login: Username: Ready
  3065.   if success goto LBL\v(minput)
  3066.   end 1 Prompt didn't arrive.
  3067.  
  3068. looks for any of the three strings "Login:", "Username:", or "Ready" and
  3069. then goes to one of the labels "LBL1", "LBL2", or "LBL3", depending on which
  3070. string was matched.
  3071.  
  3072. To include a space in a string, enclose it in { braces }.
  3073.  
  3074.   minput 20 {a b} c
  3075.  
  3076. This searches for either "a b" or "c".
  3077.  
  3078. As in the regular INPUT and REINPUT commands, leading and trailing spaces are
  3079. stripped from each search string unless it is enclosed in { braces }.
  3080. Example:
  3081.  
  3082.   minput 20 {  abc  }, {{ def }},    ghi
  3083.  
  3084. searches for "  abc  ", "{ def }", or "ghi".
  3085.  
  3086. 7.6. Other New or Improved Script Programming Commands
  3087.  
  3088. UNDEFINE <variable-or-macro-name>
  3089.   Undefines the named variable or macro (edit 192).  This is the same as
  3090.   giving a DEFINE or ASSIGN command for it without a definition.
  3091.  
  3092. SET ALARM / IF ALARM / SHOW ALARM (edit 192)
  3093.   These work as in MS-DOS Kermit and were added for compatibility.  "SET
  3094.   ALARM n" starts an n-second timer.  "SET ALARM 22:30:00" sets a timer for
  3095.   the indicated time.  IF ALARM succeeds if the timer has expired, fails if
  3096.   there is still some time left on the timer.  SHOW ALARM shows the data/time
  3097.   at which the timer expires.  SET ALARM by itself (no "n" or "hh:mm:ss")
  3098.   clears any pending alarm.  Alarms cannot be nested.
  3099.  
  3100. SET TEMP-DIRECTORY [ <directory-name> ]
  3101.   Lets you override the value of the \v(tmpdir) variable, which can be used
  3102.   in scripts in a system-independent fashion to indicate the place for
  3103.   creating temporary files.
  3104.  
  3105. EVALUATE <arithmetic-expression>
  3106.   The new EVALUATE command evaluates arithmetic expressions for you, printing
  3107.   the answer.  It is exactly like the \feval() function described in the book,
  3108.   but for interactive use: you can type the expression directly, and the
  3109.   answer is printed, e.g.:
  3110.  
  3111.     C-Kermit> evaluate 1+1
  3112.     2
  3113.     C-Kermit> eval 6!
  3114.     720
  3115.     C-Kermit> def \%a (7 + 8)
  3116.     C-Kermit> ev (1 + 2) * (\%a - 3)
  3117.     36
  3118.  
  3119.   For convenience in typing, the EVALUATE command accepts some special
  3120.   notation for the number base.  If a number ends in "h" or "x", it is treated
  3121.   as hexadecimal.  If it ends in "o" or "q", it is treated as octal.  If it
  3122.   ends in "t", it is treated as binary, e.g.:
  3123.  
  3124.     C-Kermit> eval ffh & 0101t
  3125.     5
  3126.  
  3127.   Of course you could also use "eval \xff & 5" (C-Kermit presently does not
  3128.   have backslash notation for binary numbers).  Note: This same special
  3129.   notation can also be used in the \fevaluate() function:
  3130.  
  3131.     C-Kermit> echo \feval(ffh & 0101t)
  3132.     5
  3133.  
  3134. FORWARD <label>
  3135.   Like GOTO, except the label search begins at the current position in
  3136.   the macro or command file, rather than at the beginning.  It will not find
  3137.   labels that have already been passed.  The major use for a command like
  3138.   this would be to improve the performance of script programs that contain
  3139.   a lot of forward GOTOs, especially when that program is a command file that
  3140.   will be executed from a diskette.  This is obviously not good programming
  3141.   practice -- since such programs can easily break of blocks of code are
  3142.   moved around -- but then neither are GOTOs themselves.  If the FORWARD
  3143.   label search fails in the current macro or TAKE file, the search continues
  3144.   in the forward direction only in superior macros macros and TAKE files.
  3145.  
  3146.     NOTE: The FORWARD command has been used extensively in the CKERMIT.INI
  3147.     file for C-Kermit 5A(190), resulting in a dramatic decrease in startup
  3148.     time.
  3149.  
  3150. GETC <variable-name> [ <prompt-string> ]
  3151.   The new GETC command (edit 190) lets a script program prompt the user to
  3152.   type a single character.  Example:
  3153.  
  3154.     GETC \%a Press any key to continue:
  3155.  
  3156.   The character is stored in the given variable.
  3157.  
  3158. WRITE-LINE <file> <text>
  3159.   This is exactly like the WRITE command, which is used to send text to the
  3160.   specified file or log.  The difference is that WRITE-LINE always formats the
  3161.   output text as a line, or record, appropriate to the underlying operating
  3162.   system's file format.  This allows Kermit script programs to create text
  3163.   files in a system-independent fashion.  Synonym: WRITELN.  WR, WRI, and WRIT
  3164.   are still accepted as abbrevitions for WRITE.  Also see the \v(newline)
  3165.   variable.  Edit 190.
  3166.  
  3167. RENAME <oldfilename> <newfilename>
  3168.   In the UNIX, Windows, and OS/2 versions, the second argument (normally the
  3169.   new name for the file) is allowed to be a directory name (or, in OS/2, a
  3170.   device and directory name), in which case the file is moved to the given
  3171.   (device and) directory, keeping its original name.  Edit 190.
  3172.  
  3173. RETURN and END
  3174.   These commands may now be given, with the expected results, from
  3175.   within the command-lists of FOR, WHILE, or XIF commands.  Edit 190.
  3176.  
  3177. ASK and ASKQ
  3178.   These commands now allow question mark and backslash to be entered just like
  3179.   any other text character.  Prior to edit 190, question mark would make a
  3180.   help message pop up, and backslash would fulfill its normal function of
  3181.   introducting a variable or quoting a special character.  However, these
  3182.   commands are unlikely ever to be used by somebody who will reply to a
  3183.   question with a Kermit variable name and expect it to be evaluated.  Nor
  3184.   should they be expected to "quote" question marks.  This change makes for
  3185.   smoother dialogs between Kermit scripts and users, and it also allows users
  3186.   to type DOS-like filenames such as C:\TEMP\OOFA.TXT, which could not
  3187.   otherwise be entered except by doubling each backslash.  However, script
  3188.   writers should note that the mere fact that a DOS path name can be entered
  3189.   into a variable via:
  3190.  
  3191.     ask \%f { Please type the DOS path name: }
  3192.      Please type the DOS path name: c:\123\files\widgets.wks
  3193.  
  3194.   does not mean that the resulting variable can be used bare and unprotected.
  3195.   For example:
  3196.  
  3197.     send foo.bar \%f
  3198.  
  3199.   will not do what you think, because the SEND command will evaluate \%f "too
  3200.   much" (in this case "\123" becomes becomes "{", i.e. ASCII character number
  3201.   123, and \files looks like the beginning of a Kermit function, and results
  3202.   in a syntax error).  The needed protection comes from \fcontents():
  3203.  
  3204.     send foo.bar \fcontents(\%f)
  3205.  
  3206.   which evaluates to the variable's definition ("contents") but does not
  3207.   evaluate it any further.
  3208.  
  3209. READ, ASK, ASKQ, and GETC
  3210.   Modified in edit 192 to allow macro names to be used as the target
  3211.   of the definition, whereas previously only \%x or \&x[] variables could
  3212.   be used.
  3213.  
  3214. There is also a new command in edit 190 to turn the backslash and question-
  3215. mark features on and off for any commands at all:
  3216.  
  3217. SET COMMAND QUOTING { ON, OFF }
  3218.   When ON (which is the default), backslash and question mark fulfill their
  3219.   normal roles in C-Kermit commands.  When OFF, backslash and question mark
  3220.   are treated just like any other ordinary text characters by the command
  3221.   reader.
  3222.  
  3223. You can display the current command quoting setting with:
  3224.  
  3225.   SHOW COMMAND (synonym: SHOW CMD)
  3226.  
  3227. Before this feature was added to C-Kermit, users C-Kermit for UNIX, VMS, etc,
  3228. had to do something like this when referring to DOS files (because DOS uses
  3229. backslash as a directory separator and question mark as a wildcard character):
  3230.  
  3231.   send foo.bar c:\\foo\\bar\\baz\\oofa.txt
  3232.   get d:\\files\\\?\?\?.\?
  3233.  
  3234. Now it is possible to allow natural DOS notation:
  3235.  
  3236.   set command quoting off
  3237.   send foo.bar c:\foo\bar\baz\oofa.txt
  3238.   get d:\files\???.?
  3239.   set command quoting on
  3240.  
  3241. This feature is also handy on computers that have DOS-like files systems,
  3242. such as PCs with OS/2 or Windows 95:
  3243.  
  3244.   set command quoting off
  3245.   cd \
  3246.   set port \\server\modem
  3247.   directory e:\pictures\pic???.gif
  3248.   set command quoting on
  3249.  
  3250. rather than:
  3251.  
  3252.   cd \\
  3253.   set port \\\\server\\modem
  3254.   directory e:\\pictures\\pic\?\?\?.gif
  3255.   set command quoting on
  3256.  
  3257. Caution: Expect unpleasant results if you try to run script programs with
  3258. COMMAND QUOTING OFF.
  3259.  
  3260. FOR loops, as of edit 192, evaluate their loop variables only at loop
  3261. entry, not each time through the loop.  Also in edit 192, \v(argc) can
  3262. be used as a FOR-loop variable.
  3263.  
  3264. 7.7. Arrays
  3265.  
  3266. Edit 192: Relaxed syntax on array references to allow spaces in them, as in
  3267. \&a[ 3 ] or \&a[ \feval( 1 + 1 ) ], as long as the context in which the array
  3268. reference appears is not constrained to a "single word" (but this can often,
  3269. though not always, be circumvented with { braces } ).
  3270.  
  3271. Also, \feval() is now implied around all array subscripts, so \&a[1+1]
  3272. evaluates automatically to \&a[2], so you no longer have to write
  3273. \&a[\feval(1+1)].
  3274.  
  3275. 7.8. Arithmetic
  3276.  
  3277. There are many places where only a number is valid, including certain fields
  3278. of certain commands and numeric arguments to functions.  In these places, it
  3279. is now permissible to put an arithmetic expression; e.g.:
  3280.  
  3281.   \fmod(3+4,5-2)
  3282.  
  3283. rather than:
  3284.  
  3285.   \fmod(\feval(3+4),\feval(5-2))
  3286.  
  3287. (of course variables can be used in place of the numbers).  Similarly:
  3288.  
  3289.   \fsubstring(\%s,\%a+1,\%b-1)
  3290.   SET RETRY \%a+5
  3291.   SET RECEIVE PACKET-LENGTH \v(packetlen)+1000
  3292.   IF > \v(ntime)+60 (\%a-1)*3600 ...
  3293.   FOR \%i \%n-1 \%m/2 -1 { ... }
  3294.  
  3295. And in some cases also implicitly:
  3296.  
  3297.   DEFINE \%a \%b+1
  3298.   INCREMENT \%a
  3299.  
  3300. In general there can be no imbedded spaces in the expression, but in some
  3301. cases you can use braces to get around this.
  3302.  
  3303. 7.9. New Block Structure for Commands
  3304.  
  3305. A macro definition is a single Kermit command, and so, like all other
  3306. commands, it must be given on one line.  The general form of a macro
  3307. definition is:
  3308.  
  3309.   DEFINE name command, command, command, ...
  3310.  
  3311. in which comma separates the commands that compose the macro, e.g.:
  3312.  
  3313.   DEFINE OOFA echo \%1, echo \%2, echo \%3
  3314.  
  3315. The definition can also be enclosed in curly braces, as discussed on page
  3316. 218 of "Using C-Kermit":
  3317.  
  3318.   DEFINE name { command, command, command, ... }
  3319.  
  3320. This doesn't change how the macro works at all.
  3321.  
  3322. It is often desirable to have macro definitions that don't fit on one line.
  3323. Thic can be done with the continuation character ("-"):
  3324.  
  3325.   DEFINE OOFA -
  3326.     echo \%1,-
  3327.     echo \%2,-
  3328.     echo \%3
  3329.  
  3330. Note that trailing comments can be put on continued lines, as long as the
  3331. comment comes AFTER the dash:
  3332.  
  3333.   DEFINE OOFA -  ; comment
  3334.     echo \%1,-   ; comment
  3335.     echo \%2,-
  3336.     echo \%3     ; comment
  3337.  
  3338. But this is ugly and also tends to result in errors that are hard to track
  3339. down when commas or dashes or omitted accidentally.
  3340.  
  3341. Beginning in version 6.0.192, there is an alternative syntax that is more
  3342. pleasant to look at and also more familiar to C programmers.  The rules are
  3343. simple:
  3344.  
  3345.  . If a line (not counting any trailing comment) ENDS with an opening
  3346.    curly brace ("{"), this begins a "block".
  3347.  
  3348.  . If a line (not counting any trailing comment) BEGINS with a closing
  3349.    curly brace ("}"), this ends a block.
  3350.  
  3351. In a block, lines are significant.  At the end of a line, Kermit supplies
  3352. a comma.  Example:
  3353.  
  3354.   DEFINE OOFA {    ; optional comment
  3355.       echo \%1     ; optional comment
  3356.       echo \%2     ; optional comment
  3357.       echo \%3     ; optional comment
  3358.   }                ; optional comment
  3359.  
  3360. becomes:
  3361.  
  3362.   DEFINE OOFA { echo \%1, echo \%2, echo \%3 }
  3363.  
  3364. The same syntax may be used with FOR, WHILE, and XIF constructions:
  3365.  
  3366.   FOR \%i 1 \%n-1 1 {
  3367.       echo \%i
  3368.       if = \%i \%a break
  3369.   }
  3370.   xif = \%i 999 {
  3371.       echo \%i is 999
  3372.       define flag TRUE
  3373.   } else {
  3374.       echo \%i is not 999
  3375.       define flag FALSE
  3376.   }
  3377.       
  3378. Blocks may be nested to any reasonable level.  Example:
  3379.  
  3380.   for \%i 1 \%n-1 1 {
  3381.       for \%j \%i+1 \%n {
  3382.           xif \&a[\%j] < \&a[\%i] {
  3383.               asg \%t \&a[i]
  3384.               asg \&a[i] \&a[j]
  3385.               asg \&a[j] \%t
  3386.           }
  3387.       }
  3388.   }
  3389.  
  3390. The old notation still works, and in fact the two can be mixed and matched
  3391. in almost any conceivable way.
  3392.  
  3393. Another benefit of block construction is that a block can contain blank
  3394. lines as well as full-line comments without affecting the block structure:
  3395.  
  3396.   define OOFA {
  3397.  
  3398.   ; This is a macro that prints its first three arguments
  3399.  
  3400.       echo \%1
  3401.       echo \%2
  3402.       echo \%3
  3403.  
  3404.   }
  3405.  
  3406. Block structured notation is not recommended for commands other than DEFINE,
  3407. ASSIGN, FOR, SWITCH, WHILE, and XIF, but if you know what you are doing, you
  3408. can still use it.  Just remember what it does: it inserts a comma after every
  3409. line but the first.  So:
  3410.  
  3411.   echo {
  3412.      foo
  3413.      bar
  3414.      baz
  3415.   }
  3416.  
  3417. results in "echo {   foo,   bar,   baz,}", which prints "   foo,   bar,   baz,"
  3418.  
  3419. You can, by the way, also experiment with block structure at the
  3420. C-Kermit> prompt, but it is not guaranteed to work exactly the same way.
  3421.  
  3422. C-Kermit>define oofa {
  3423.   echo \%1
  3424.   echo \%2
  3425.   echo \%3
  3426. }
  3427. C-Kermit>oofa one two three
  3428. one
  3429. two
  3430. three
  3431. C-Kermit>
  3432.  
  3433. 7.10. Local variables
  3434.  
  3435. Beginning in edit 192, macros can have local ("automatic") variables.  First,
  3436. there is the argument vector array, \&_[], which contains copies of the
  3437. arguments that the macro was called with.  This makes it possible for the
  3438. first time for a macro to loop through its arguments:
  3439.  
  3440.   for \%i 0 \v(argc)-1 1 { echo \%i. \&_[\%i] }
  3441.  
  3442. Secondly, any variable declared LOCAL in a macro, or within a block (see
  3443. section 7.9) is local to that macro or block, and is inherited by those
  3444. "beneath" it.  The command for declaring local variables is:
  3445.  
  3446.   LOCAL name [ name [ name [ name [ name ... ] ] ] ]
  3447.  
  3448. If given inside a macro definition, makes the named variables local, meaning
  3449. that they hide the values of any global variables of the same name until the
  3450. macro exits, at which time the higher-level variables are restored.  The types
  3451. of variables that can be used as local variables are \%a..\%z and macros
  3452. (either macros to be executed, or macro names used as long variable names).
  3453. Nesting works to any level.  Example:
  3454.  
  3455.   define \%a TOP-LEVEL value   ; Global (top-level) value for \%a
  3456.  
  3457.   define XX {
  3458.     local \%a                  ; Declare a local variable with the same name
  3459.     define \%a XX value        ; Give it a different value
  3460.     echo \%a                   ; Display the value
  3461.     yy                         ; Execute another macro that changes it
  3462.     echo \%a                   ; See if it's the same
  3463.   }
  3464.   define YY {                  ; Second-level macro
  3465.     local \%a                  ; It has a local copy of \%a too
  3466.     define \%a YY value        ; Give it a unique value
  3467.     echo \%a                   ; Display it
  3468.   }
  3469.   echo \%a                     ; Display top-level \%a
  3470.   xx                           ; Do the xx macro (which does the yy macro)
  3471.   echo \%a                     ; See if it changed
  3472.  
  3473. You can also use array *elements* as local variables, but not entire arrays.
  3474. (No automatic arrays.)
  3475.  
  3476. Scope: If macro A invokes macro B, macro B inherits macro A's local variables;
  3477. it can read them and change them, or (of course) it can declare its own local
  3478. variables with the same names, which hide those of macro A.
  3479.  
  3480. Hints: Don't put LOCAL commands in loops -- you should only execute them once
  3481. in each macro.  Don't declare \%0..\%9 as LOCAL unless you really mean to wipe
  3482. out the parameters that were passed to the macro.
  3483.  
  3484. 7.11. More Uses for "Long Variable Names"
  3485.  
  3486. Prior to edit 192, although you could DEFINE or ASSIGN a macro and use the
  3487. macro definition as a long variable name:
  3488.  
  3489.   define Oofa This is the value of Oofa
  3490.   echo \m(Oofa)
  3491.  
  3492. you could not assign values to long variable names using other methods
  3493. like READ, GETC, INCREMENT, or DECREMENT.  This is now possible:
  3494.  
  3495.   ASSIGN NUMBER 1
  3496.   INCREMENT NUMBER
  3497.   READ FOO
  3498.   ECHO \m(number) \m(foo)
  3499.   etc.
  3500.  
  3501. 7.12. hh:mm:ss Time Notation in Selected Commands
  3502.  
  3503. PAUSE [ { seconds, time-of-day } ]
  3504. SLEEP [ { seconds, time-of-day } ]
  3505. WAIT  [ { seconds, time-of-day } ] [ <modem-signals> ]
  3506. INPUT [ { seconds, time-of-day } ] [ <text> ]
  3507. MINPUT, REINPUT, SET ALARM ...
  3508.  
  3509. As of edit 192, these commands accept not only a number of seconds, but also
  3510. a time of day expressed as hh:mm:ss in 24-hour clock notation, as the time to
  3511. PAUSE/WAIT/SLEEP until, or the time for INPUT or MINPUT to wait for the
  3512. requested text, or the alarm time.  If the time is in the past, this is taken
  3513. to mean the given time on the next day.
  3514.  
  3515. Using hh:mm:ss notation in these commands, you can schedule events for a
  3516. specific time in the future.  Note that in general, however, this feature
  3517. only works adequately on computers that have 32-bit integers (or greater).
  3518. "hh:mm:ss" notation is converted internally to seconds since midnight; there
  3519. are 86400 seconds in a day and a 16-bit word can't hold that many.
  3520.  
  3521. If you also need to indicate a specific time on a specific date, you can
  3522. use C-Kermit's arithmetic functions and its \ftod2secs() function.  For
  3523. example, to sleep until 11:15:00pm, two days from today, do:
  3524.  
  3525.   sleep 86400-\v(ntime)+2*86400+\ftod2secs(23:15:00)
  3526.  
  3527. where:
  3528.  
  3529.   86400-\v(ntime)      = seconds left in today (see \v(ntime) description)
  3530.   2*86400              = seconds in the next two full days
  3531.   \ftod2secs(23:15:00) = seconds from 00:00:00 to 23:15:00 on the last day
  3532.  
  3533. (Remember that when writing expressions in place of numbers, no spaces are
  3534. allowed -- see section 7.8.)
  3535.  
  3536. Here's another hint.  Suppose you want to specify a certain time, but you
  3537. do NOT want Kermit to cross midnight -- i.e. if the time is in the past, then
  3538. it should be treated as zero.  Do this:
  3539.  
  3540.   if < \v(ntime) \ftod2secs(12:30:01) pause 12:30:01
  3541.  
  3542. 7.13. The SWITCH Command
  3543.  
  3544. Added in edit 192, the SWITCH command lets you execute selected groups of
  3545. commands based on the value of a variable, similar to the switch() statement
  3546. in the C language.  The syntax is:
  3547.  
  3548.   SWITCH variable-name { case-list }
  3549.  
  3550. The variable name must be the type that starts with a backslash, e.g.
  3551. \%a, \%1, \&a[1], \m(foo), \v(day), and so on.
  3552.  
  3553. The case-list is a series of C-Kermit commands and labels.  The SWITCH
  3554. command searches for a label that matches the value of the variable, and
  3555. if it is found, executes all the statements after the label up to the
  3556. first BREAK command, or the end of the case-list, whichever comes first.
  3557. You may include a DEFAULT label for statements to be executed when no labels
  3558. match the variable's value.
  3559.  
  3560. If you leave the BREAK command off the end of a case, Kermit "falls through"
  3561. to the next case (as in case 2 in the example below).
  3562.  
  3563. Here's an example, in which we print the name of the current day of the week
  3564. in German (also using the new commaless, dashless syntax).
  3565.  
  3566.   switch \v(nday) {
  3567.     :0, echo Sonntag, break
  3568.     :1, echo Montag, break
  3569.     :2, echo Dienstag und zunaechst kommt...
  3570.     :3, echo Mittwoch, break
  3571.     :4, echo Donnerstag, break
  3572.     :5, echo Freitag, break
  3573.     :6, echo Samstag, break
  3574.     :default, echo Invalid day - \v(nday)!
  3575.   }
  3576.  
  3577. Notes:  Switch statments may be nested.  There should be no statements above
  3578. the first label -- if there are, they will not be executed.  The DEFAULT label
  3579. should be last.  Alphabetic case when matching the variable contents is
  3580. observed or ignored according to your INPUT CASE setting (SHOW SCRIPTS).
  3581. Switch labels need not be single characters; they can be strings of any length
  3582. up to about 50, but they must be constants, not variables -- that is, they
  3583. are interpreted literally.  
  3584.  
  3585. More notes: SWITCH is implemented internally as a macro.  Thus commas within
  3586. the case list delimit commands (and labels).  So be careful about using commas
  3587. for other purposes, as in ECHO command:
  3588.  
  3589.     :default, echo Sorry, Invalid day - \v(nday)!
  3590.  
  3591. This will cause Kermit to complain about an invalid command called "Invalid".
  3592. Instead use:
  3593.  
  3594.     :default, echo {Sorry, Invalid day - \v(nday)!}
  3595.  
  3596. (8) USING OTHER FILE TRANSFER PROTOCOLS
  3597.  
  3598. 8.0. Internal XYZMODEM Protocols
  3599.  
  3600. In Kermit 95 and OS/2 only (for other versions see section 8.3):
  3601.  
  3602. SET PROTOCOL { KERMIT, XMODEM, YMODEM, YMODEM-G, ZMODEM } [ <remote-commands> ]
  3603.   Choose the protocol you want to use.  SEND, RECEIVE, MSEND, MOVE, MMOVE,
  3604.   etc, use the specified protocol.  Protocol-related SET commands apply as
  3605.   much as possible to the specified protocol, including FILE TYPE, FILE
  3606.   NAMES, WINDOW SIZE, RECEIVE PACKET-LENGTH, etc.  Also see section 4.0.
  3607.  
  3608. The <remote-commands>, if given, are transmitted by C-Kermit prior to starting
  3609. an upload (SEND) operation.  This saves you the trouble of typing the command
  3610. yourself prior to escaping back to the Kermit prompt.  The first command is to
  3611. be sent when uploading in binary mode; the second one is to be sent when
  3612. uploading in text mode.  If the command contains any spaces, it must be
  3613. enclosed in braces.  Examples:
  3614.  
  3615.   SET PROTOCOL KERMIT {kermit -ir} {kermit -r}
  3616.   SET PROTOCOL ZMODEM rz rz
  3617.  
  3618. If you give a SET PROTOCOL <name> command without specifying a command
  3619. after the name, the current command for that protocol remains undisturbed:
  3620.  
  3621.   SET PROTOCOL KERMIT {kermit -ir} {kermit -r}
  3622.   SET PROTOCOL ZMODEM rz rz
  3623.   SET PROTOCOL KERMIT  
  3624.  
  3625. The Kermit upload commands are still "kermit -ir" and "kermit -r".  This
  3626. allows you to switch easily among protocols without having to respecify the
  3627. upload command.
  3628.  
  3629. If you want to remove the upload command for a particular protocol, so that no
  3630. command at all is sent automatically prior to uploading, use an empty pair of
  3631. braces to denote the null string:
  3632.  
  3633.   SET PROTOCOL KERMIT {} {}
  3634.  
  3635. The defaults are as follows:
  3636.  
  3637.               Binary       Text
  3638.   Protocol    Command      Command     Remarks
  3639.    KERMIT      kermit -ir   kermit -r   Depends on other Kermit program
  3640.    ZMODEM      rz           rz          Add -r for recovery
  3641.    YMODEM      rb           rb 
  3642.    XMODEM      rx %s        rx %s      
  3643.  
  3644. %s stands for the filename, which is filled in automatically by C-Kermit.
  3645.  
  3646. 8.1. The REDIRECT Command
  3647.  
  3648. Syntax:   REDIRECT command [ arguments... ]
  3649. Synonym:  <command [ arguments... ]
  3650.  
  3651. Edit 190.  This command, which is implemented only in operating systems that
  3652. provide the underlying mechanisms (primarily, certain versions of UNIX, and
  3653. partially in OS/2), allows you to run another program from the C-Kermit
  3654. prompt, and have its standard input and output redirected to the SET LINE or
  3655. SET HOST connection.
  3656.  
  3657. It is useful for running "external protocols" over the C-Kermit connection
  3658. when you have made a connection to a computer or service that does not support
  3659. the Kermit protocol.  REDIRECT works only with software that uses standard
  3660. input and output.  Here's an example showing how to transfer a file with a
  3661. pre-1989 version of UNIX Zmodem that allowed its standard input and output to
  3662. be redirected:
  3663.  
  3664. C-Kermit>connect   ; Connect to remote computer
  3665. $
  3666. $ rz               ; Start Zmodem receive process on remote computer
  3667.  
  3668. rz ready. To begin transfer, type "sz file ..." to your modem program
  3669.  
  3670. (Escape back to C-Kermit)
  3671.  
  3672.   C-Kermit>redirect sz oofa.zip  ; C-Kermit runs sz with stdio redirected
  3673.   24575 ZMODEM CRC-32    ...     ; File is transferred with Zmodem
  3674.   C-Kermit>                      ; Prompt returns
  3675.  
  3676. Note, the REDIRECT command in the above example could also have been entered
  3677. like this, using the "<" synonym:
  3678.  
  3679.   C-Kermit><sz oofa.txt
  3680.  
  3681. NOTE: A complete set of X/Y/Zmodem access macros for UNIX C-Kermit is provided
  3682. in the ckurzsz.ini file; please read the comments in this file for further
  3683. details.
  3684.  
  3685. Another use for the REDIRECT command is with the UNIX "term" program; see the
  3686. ckuker.bwr file for details.
  3687.  
  3688. You can use C-Kermit's CHECK REDIRECT command to find out if your version of
  3689. C-Kermit has the REDIRECT command.  If the REDIRECT command is present, it
  3690. still might not work, if:
  3691.  
  3692.  . The underlying operating system lacks certain facilities, in which case
  3693.    C-Kermit will respond with "?Missing pieces".
  3694.  . The process to be redirected does not allow redirection, such as recent
  3695.    releases of sz and rz.
  3696.  . In OS/2 C-Kermit, the REDIRECT command only works for serial, not network,
  3697.    connections.
  3698.  
  3699. 8.2. New Macros for External Protocols
  3700.  
  3701. New macro packages are available for running external protocols from the
  3702. C-Kermit command line (edit 190) (also see section 8.3, which for some
  3703. C-Kermit implementations makes these macros unnecessary).
  3704.  
  3705.   ckurzsz.ini - UNIX rz/sz/rb/sb/rx/sx.
  3706.   
  3707. Note: X-, Y-, and ZMODEM protocols are built into the Windows and OS/2
  3708. versions.
  3709.  
  3710. 8.3. Built-in Selection of External Protocols
  3711.  
  3712. In version 6.0.192, versions of C-Kermit that have REDIRECT capability now
  3713. also have built in commands to let you select and configure external file
  3714. transfer protocols.  The command is:
  3715.  
  3716.   SET PROTOCOL { KERMIT, ZMODEM, ... } s1 s2 s3 s4 s5 s6
  3717.  
  3718. If your version of C-Kermit has this feature, the command:
  3719.  
  3720.   CHECK XYZMODEM
  3721.  
  3722. will succeed.  In C-Kermit versions that have this feature, SEND, RECEIVE,
  3723. MSEND, MOVE, and similar commands will use the current protocol, even if it is
  3724. not Kermit.  Certain other commands, particularly SET FILE TYPE, will affect
  3725. the current protocol too, if it supports those notions.
  3726.  
  3727. If the SET PROTOCOL command ends with the protocol name, the protocol is
  3728. selected with all its previous protocol-specific settings.  If you include
  3729. anything after the protocol name, you have to include all six fields.  They
  3730. are:
  3731.  
  3732.   s1  Autoupload command for sending files in binary mode
  3733.   s2  Autoupload command for sending files in text mode
  3734.   s3  Send command for binary mode
  3735.   s4  Send command for text mode
  3736.   s5  Receive command for binary mode
  3737.   s6  Receive command for text mode
  3738.  
  3739. In each of these fields, you can include %s to be substituted by a filename,
  3740. and if the field contains any spaces, you must enclose it in braces, e.g.:
  3741.  
  3742.   set proto zmodem rz {rz -a} {sz %s} {sz -a %s} rz {rz -a}
  3743.  
  3744. To specify a blank field, use an empty pair of braces:
  3745.  
  3746.   set proto zmodem {} {} {sz %s} {sz -a %s} rz {rz -a}
  3747.  
  3748. You don't need to (and shouldn't) put carriage returns or linefeeds on the
  3749. ends of these strings -- these are supplied automatically for you, based on
  3750. the current connection type, terminal settings, and Telnet mode.
  3751.  
  3752.  . Sending Files...  
  3753.  
  3754. The autoupload command is sent to the remote computer when you give a SEND (or
  3755. MOVE, or MSEND, etc) command.  This spares you from having to give the command
  3756. yourself.  If the other computer is at its system prompt, this command should
  3757. start the appropriate program to receive a file with the selected protocol.
  3758. If the program is already started on the remote computer, the autoupload
  3759. command should be absorbed harmlessly.  In the first example above, the
  3760. autoupload command for binary Zmodem transfers is "rz", and so when you give a
  3761. SEND command to C-Kermit, it sends the "rz" command to the other computer
  3762. before it starts sending.  If C-Kermit's FILE TYPE were set to TEXT, it would
  3763. send "rz -a".
  3764.  
  3765.   NOTE: The rz, sz, and similar commands shown as examples in this document
  3766.   pertain to products of Omen Technology Inc., 17505-V NW Sauvie IS Road,
  3767.   Portland OR 97231 USA; Web: http://www.omen.com/, Phone: +1 (503) 621 3406.
  3768.  
  3769. After sending the autoupload string, if any, C-Kermit uses the binary-mode or
  3770. text-mode form of the protocol's send command to start the external protocol
  3771. on the local computer to send the file.  The file's name is substituted for
  3772. the "%s", and the program's standard input/output is redirected (if the
  3773. program allows this) over C-Kermit's communications connection.  To
  3774. illustrate:
  3775.  
  3776.   set protocol zmodem {rz} {rz -a} {sz %s} {sz -a %s} rz {rz -a}
  3777.   set file type binary
  3778.   send oofa.zip  
  3779.  
  3780. This results in sending the command "rz" to the other computer, which starts
  3781. the "Receive Zmodem" program, and then, since Kermit's file type is set to
  3782. binary, runs the local command "sz oofa.zip" ("oofa.zip" replaces "%s").
  3783.  
  3784. While the file is being transferred, the external program takes over your
  3785. screen, so the file transfer display (if any) is not Kermit's.  When the
  3786. transfer is completed, the C-Kermit> prompt reappears.
  3787.  
  3788.  . Receiving files...
  3789.  
  3790. This works like sending files, except the autoupload command is not used since
  3791. we are not uploading.  However, if the protocol is Zmodem or Kermit and your
  3792. version of C-Kermit has the autodownload feature, AND if SET TERMINAL
  3793. AUTODOWNLOAD is ON, then when C-Kermit is in CONNECT mode and you start a
  3794. download from the remote computer, C-Kermit will automatically go into
  3795. file-receive mode using the same protocol, Kermit or Zmodem, regardless of
  3796. your protocol setting.
  3797.  
  3798. If you do have the autodownload feature, you can enable it and disable it
  3799. with the command:
  3800.  
  3801.   SET TERMINAL AUTODOWNLOAD { ON, OFF }
  3802.  
  3803. It is ON (enabled) by default in the terminal-emulating versions (Windows 95,
  3804. Windows NT, OS/2), and OFF by default in UNIX, VMS, etc.
  3805.  
  3806. CAUTION: If you are using an autodownload-capable version of Kermit to connect
  3807. to another computer, and then using another autodownload-capable version of
  3808. Kermit to connect to yet another computer, and the remote(st) computer
  3809. initiates a file transfer, BOTH (or ALL) the Kermits that are in CONNECT mode
  3810. will go into RECEIVE mode at the same time.  So if you are hooking multiple
  3811. Kermits up in a chain, make sure only one of them (the desired one) has
  3812. autodownload enabled, and the rest have it disabled.
  3813.  
  3814. CAUTION #2: Suppose an autodownload fails for some reason.  C-Kermit CONNECTs
  3815. back immediately, as soon as it detects the failure.  But the remote Kermit
  3816. program might not even know about the failure yet and could still be spewing
  3817. packets out onto your screen.  No cause for alarm -- try typing several
  3818. Ctrl-C's in a row, or wait (perhaps a long while) for this to stop.
  3819.  
  3820.  . Defaults ...
  3821.  
  3822. Each protocol has built-in defaults for s1..s6 as follows:
  3823.  
  3824.       Protocol:           Kermit      Zmodem    Ymodem   Ymodem-g  Xmodem
  3825.   
  3826.   s1: Autoupload binary:  kermit -ir  rz        rb       rb        rx %s
  3827.   s2: Autoupload text:    kermit -r   rz -a     rb -a    rb -a     rx %s
  3828.   s3: Send binary:        (n/a)       sz %s     sb %s    sb %s     sx %s
  3829.   s4: Send text:          (n/a)       sz -a %s  sb -a %s sb -a %s  sx -a %s
  3830.   s5: Receive binary:     (n/a)       rz        rb       rb        rx %s
  3831.   s6: Receive text:       (n/a)       rz        rb       rb        rx %s
  3832.  
  3833. Note that when using XMODEM protocol, you must give the filename to both the
  3834. sender and the receiver, and only one file can be sent at a time.
  3835.  
  3836. Use SHOW PROTOCOL to show s1..s6 plus all the relevant settings for the
  3837. currently selected protocol.
  3838.  
  3839.  . When Your Protocol is Kermit...
  3840.  
  3841. Obviously, C-Kermit does not use an external protocol for Kermit transfers, so
  3842. s3..s6 are ignored for Kermit.  Note, however, the autoupload strings.  These
  3843. are designed assuming that C-Kermit is on the remote end.  "kermit -r" is the
  3844. normal system command to start C-Kermit in receive mode.  "kermit -ir" is the
  3845. same thing, but specifies binary mode, which is normally not necessary since
  3846. the file sender usually tells the file receiver what the transfer mode is.
  3847.  
  3848. What happens if C-Kermit has already been started and put into receive
  3849. mode?   Nothing at all -- the autoupload string is not in the form of a Kermit
  3850. packet, so Kermit ignores it -- it is absorbed harmlessly.
  3851.  
  3852. But what happens if C-Kermit is at its prompt, waiting for a command?  Prior
  3853. to version 6.0.192, this would cause an error and the transfer would not take
  3854. place, since "kermit -r" is not a valid interactive-mode Kermit command.
  3855. However, in 6.0.192, C-Kermit now accepts this form of command at the prompt
  3856. (see section 1.7).  It interprets the "kermit" command to mean that
  3857. command-line options follow, and it reads and acts upon the command-line
  3858. options, just as if a "kermit -r" (or whatever) command had been given at the
  3859. system prompt.  Thus, if C-Kermit 6.0.192 is on the remote end, your
  3860. autoupload command should always work.
  3861.  
  3862.  . External Protocols and Input/Output Redirection...
  3863.  
  3864. C-Kermit's built-in external protocol support works only with programs that
  3865. transfer files using "standard input" and "standard output".  The standard
  3866. input and output channels are redirected by C-Kermit to be its own
  3867. connection.  If C-Kermit is in remote mode, then standard i/o is used
  3868. directly.
  3869.  
  3870. However, not all external protocol programs work this way.  Some of them
  3871. obtain explicit, non-stdio file descriptors for the purpose of file transfer,
  3872. and these cannot be redirected, and therefore these programs cannot be used as
  3873. external protocols by Kermit.
  3874.  
  3875.  . Using External Protocols over Telnet Connections...
  3876.  
  3877. Even if they can be successfully redirected, protocols such XMODEM, YMODEM,
  3878. and ZMODEM are likely to fail over Telnet connections because of transparency
  3879. issues.  The external protocol programs themselves are unaware that they have
  3880. been redirected over a Telnet connection, and so even if they WOULD know what
  3881. to do in this case, they don't know they are supposed to do it.  If your
  3882. external protocol program has a command-line option to let you tell it to take
  3883. precautions (certain ZMODEM implementations let you "escape" certain
  3884. characters -- 0x0d and 0xff are the ones to watch out for), use it.
  3885.  
  3886.  . Using Other Protocols
  3887.  
  3888. Just because C-Kermit only has keywords for Kermit, ZMODEM, YMODEM, YMODEM-g,
  3889. and XMODEM doesn't mean you can't use other protocols too.  Just lie about
  3890. the protocol name.  For example, if you should happen to have a CompuServe
  3891. B+ protocol program at hand, say its name is "bplus", you can use
  3892. SET PROTOCOL XMODEM (or whatever), but substitute the appropriate "bplus"
  3893. commands in the s1..s6 commands.
  3894.  
  3895.   Restrictions ...
  3896.  
  3897. Built-in external protocols do not work with the ADD SEND-LIST feature.
  3898.  
  3899. As-Names (as in "send foo.bar oofa.txt") don't work -- the file is sent with
  3900. its orignal name.
  3901.  
  3902. MOVE does not delete the source-file afterwards.
  3903.  
  3904. SET DESTINATION does not work with external protocols.
  3905.  
  3906. The only Kermit setting that applies to external protocols is FILE TYPE
  3907. (text or binary), and it is up to you to pass this setting along by assigning
  3908. the appropriate commands to s1..s6.  No other settings are conveyed to
  3909. external protocols, since Kermit does not know their invocation syntax.
  3910. HOWEVER...  Since you DO know this, then you can easily write macros to
  3911. translate Kermit settings into command-line options (or whatever) for the
  3912. selected protocol.
  3913.  
  3914. (9) NEW COMMAND-LINE OPTIONS
  3915.  
  3916. Command-line options are commands that can be given to C-Kermit on the same
  3917. line with which you invoke it, for example:
  3918.  
  3919.   kermit -s oofa.txt -p s
  3920.  
  3921. Command-line help and error messages have been improved, and the following
  3922. command-line options or new features have been added:
  3923.  
  3924. -a name ("as-name" for a transferred file) now allows "name" to be a device
  3925.   or directory name, when used in conjunction with '-r' (RECEIVE), to specify
  3926.   a device and/or directory into which all incoming files are to be stored
  3927.   under the names they were sent with.  If "name" is not a device or directory
  3928.   name, the (first) incoming file is stored under the given name, as before.
  3929.   Edit 190.
  3930.  
  3931. -D n, where "n" is a number, is equivalent to the interactive command SET
  3932.   DELAY n, which specifies the number of seconds C-Kermit should wait before
  3933.   starting to send a file in remote mode (to give the user time to escape back
  3934.   and initiate the RECEIVE process at the local Kermit program).  Edit 190.
  3935.  
  3936. -M string, "My username" (equivalent to SET LOGIN USERNAME).
  3937.  
  3938. -N n, where "n" is a number, is the NETBIOS adapter number to be used with
  3939.   NETBIOS connections (OS/2 only).
  3940.   
  3941. -R advises C-Kermit that it will be used in remote mode only; that is, it
  3942.   will not be used to establish a connection by dialing, SET HOST, etc.  This
  3943.   option is advisory only; it does not prevent local-mode operations from
  3944.   taking place.  When the -R option is given, the IF REMOTE-ONLY command will
  3945.   succeed throughout the C-Kermit session.  This allows initialization and
  3946.   script files to skip dialing and service directory setup and similar
  3947.   time-consuming items when they will not be used.  Edit 190.
  3948.  
  3949. -8 sets up an 8-bit-clean connection (edit 192)
  3950.  
  3951. -T forces Text-mode file transfer (edit 192)
  3952.  
  3953. -j (network host), when used for TCP/IP connections, now accepts either
  3954.    one argument or two.  If two, then the second argument is interpreted as
  3955.    a service name or number, for example "kermit -j oofacorp.com 1234".
  3956.  
  3957. -j <number> -- the number is interpreted as an open file descriptor for a
  3958.    TCP/IP connection.
  3959.  
  3960. -j _<number> (Kermit 95 only) -- the number is interpreted as a socket handle
  3961.    for an open TCP/IP Winsock connection (edit 192).
  3962.  
  3963. -J is like -j, but when used to make Telnet connections, it allows you to
  3964.    escape back to the C-Kermit> prompt (e.g. to transfer files, change
  3965.    settings, etc) as many times as you like, but when you log out from the
  3966.    remote host, C-Kermit exits (unless you also included the -S (Stay) option).
  3967.    Thus -J makes Kermit behave like Telnet (edit 192).
  3968.  
  3969. ------------------------------
  3970. III. APPENDICES
  3971.  
  3972. APPENDIX 1: UNIX C-KERMIT
  3973.  
  3974. New features in UNIX C-Kermit since edit 188:
  3975.  
  3976. Correct handling of file date/time in POSIX, 4.4BSD, BSDI, etc
  3977. CONNECT-mode speedups, important when C-Kermit is "in the middle".
  3978. Incoming TCP/IP connections.
  3979. Autodownload.
  3980. Interfork-signaling in CONNECT module bulletproofed.
  3981. POSIX signal handling is now supported, for reliable signals.
  3982. APC support during CONNECT sessions.
  3983. New makefile entries and/or systems supported:
  3984.   Amdahl UTS + TCP/IP
  3985.   Bull DPX/2 BOS/X
  3986.   CONSENSYS System V R4 + TCP + curses
  3987.   DECstation 5000 MIPS3 CPU    
  3988.   FreeBSD
  3989.   HP-UX: many variations, big improvements in functionality
  3990.   Lynx
  3991.   NetBSD
  3992.   OSF/1 2.0
  3993.   QNX 4.2
  3994.   Solaris 2.x
  3995.   UnixWare 1.1 + curses + TCP/IP
  3996. System-wide initialization file is now an option.
  3997. TELNET window (i.e. screen) size negotiation, SIGWINCH trapping.
  3998. RTS/CTS flow control added for Linux, NetBSD, FreeBSD, OSF/1, SCO ODT 3.0,..
  3999. Support for higher serial speeds added for Linux, HP-UX, QNX, etc.
  4000. FIONREAD and select() support added for Linux.
  4001. (Optional) FSSTND (File System Standard) compliance for Linux.
  4002.  
  4003. APPENDIX 2: VMS C-KERMIT
  4004.   
  4005. New features in VMS C-Kermit since edit 188:
  4006.  
  4007. Autodownload.
  4008. APC support during CONNECT sessions.
  4009. Incoming TCP/IP connections.
  4010. New support for CMU/Tektronix TCP/IP.
  4011. Problems running from DCL procedures, SPAWN'd, in batch, etc - fixed.
  4012. Append-to-file operations now available.
  4013. SET SPEED problems fixed.
  4014. Higher serial speeds now supported (38400, 57600)
  4015. Console terminal flow-control fixed.
  4016. Automatic compensation for systems SYSGEN'd with small MAXBUFs, etc.
  4017. GNU CC compatibility.
  4018. TRANSMIT command fixed to handle VMS-specific file types sensibly.
  4019. Session-log record format fixed.
  4020. TELNET window (i.e. screen) size negotiation.
  4021. Completion codes for RUN, SPAWN, !, @, DIR, etc, fixed.
  4022. Autodownload.
  4023.  
  4024. APPENDIX 3: OS/2 C-KERMIT
  4025.  
  4026. (Removed, see separate .UPD or .INF file.)
  4027.  
  4028. APPENDIX 4: MACINTOSH KERMIT
  4029.  
  4030. New features in Mac Kermit:
  4031.  
  4032. Communications Tool Box support.
  4033. Now works with System 7.1 and later on Power Macs, etc:
  4034.   downloads files without crashing.
  4035. Many commands fixed or added that never worked before:
  4036.   CD, PWD, DIRECTORY
  4037.   OPEN READ / READ / CLOSE READ
  4038.   LOG { SESSION, TRANSACTION, PACKETS }
  4039.   Log files and other text files now in TeachText format
  4040.   LOG DEBUG goes to a window.
  4041.   SET FILE TYPE { TEXT, BINARY, MACBINARY }
  4042. File transfer display improved:
  4043.   Direction and mode shown correctly when transfer started from prompt.
  4044.   Current directory is shown.
  4045. Numerous bugs fixed.
  4046. Mac-specific modules can now be compiled with Think C as well as MPW C.
  4047.  
  4048. Please refer to the following files for more information:
  4049.  
  4050.   ckmker.fon -- Notes about the new Mac Kermit terminal emulation font
  4051.   ckmker.ps  -- PostScript version of user documentation for 0.9(40)
  4052.   ckmker.doc -- user documentation for 0.9(40), the previous release (1988)
  4053.   ckmker.bwr -- Notes about the current prerelease, FAQ's, etc
  4054.  
  4055. APPENDIX 5: STRATUS VOS
  4056.  
  4057. A full C-Kermit implementation, supporting serial, TCP/IP, and X.25
  4058. connections, lacking only the fullscreen file transfer display, is included
  4059. with edit 190.  VOS-specific files have the "CKL" prefix, including CKLKER.DOC
  4060. (user documentation), CKLKER.BWR (VOS-specific hints and tips), CKLINS.DOC
  4061. (VOS installation instructions).
  4062.  
  4063. ------------------------------
  4064. IV. ERRATA & CORRIGENDA
  4065.  
  4066. The following errors in "Using C-Kermit" (first edition, first printing)
  4067. have been noted, most of them by Gisbert W. Selke, while translating the
  4068. book into German:
  4069.  
  4070. PAGE    REMARKS
  4071.  xviii  Fridrik Skulason's name is spelled with an eth, not a d.
  4072.  xx     Ditto.
  4073.  13-14  The list of systems supported by C-Kermit is not exhaustive.
  4074.     New systems discovered since the printing date are listed in
  4075.     the file CKCxxx.UPD, where xxx is the current edit number, e.g. 189.
  4076.  46     The SET CARRIER description says that it doesn't take effect until the
  4077.         next SET LINE command.  In fact, it can have an effect at certain
  4078.         other times too, such as when you issue any communication-oriented
  4079.         command that changes the communication device modes.  The SET CARRIER
  4080.         AUTO description should say: "Requires carrier during CONNECT,
  4081.         TRANSMIT, INPUT, OUTPUT, and SCRIPT commands, but not during DIAL
  4082.         operations or file transfer."  These fine distinctions in SET CARRIER
  4083.         operation apply mainly to System-V or POSIX based UNIX C-Kermit
  4084.         implementations and OS/2 C-Kermit, but (in general) not to others.
  4085.  53     Table 3-2, HST-COURIER, contains extraneous typesetting information
  4086.     ("Courier10PitchBT-Roman").  (This probably happened because an
  4087.     error-correcting protocol was not used to download the final
  4088.     PostScript to the printer :-)  Two new modem types, COURIER and
  4089.     SPORTSTER have been added, which are the same as HST-COURIER.  The
  4090.     description should say "US Robotics modems".
  4091.  85     The command in the final line in the example, "send olga It's
  4092.     765-4321", should be underlined.
  4093.  91     SET KEY CLEAR added in 5A(190), restores default key mapping.
  4094.  93     The description of SET SESSION-LOG fails to mention that XON and
  4095.     XOFF are removed from a text-mode session log.
  4096. 101     In the HINT inset, the words SEND and RECEIVE should be exchanged.
  4097. 144     In REMOTE CD [ directory ] description, the brackets should be
  4098.         in italics.
  4099. 145     There should be no right parenthesis in REMOTE DIRECTORY [ filespec) ].
  4100. 150     "Now start C-Kermit on the VAX..." should say "Now start C-Kermit on
  4101.         the UNIX system..."
  4102. 164     The description of compression predates the new SET REPEAT command,
  4103.         described below.
  4104. 172     Table 9-2.  The text fails to mention that the Chinese Roman,
  4105.     Icelandic, and Japanese Roman sets are not used by C-Kermit.
  4106.     All nine occurrences of accent acute (') by itself in column 6/00
  4107.     should be accent grave (`).  Column 7/14 for Norwegian should show
  4108.     macron (overline) rather than vertical bar.
  4109. 174     Table 9-4, row 03, column 13 should be O-acute, not O-grave.
  4110. 178     Next-to-last paragraph: "rlogin -8", not "rsh -8".
  4111. 185     C-Kermit>set unknown-char-set (not "sent unknown-char-set").
  4112. 189     The description of JIS X 0201 says that it differs from a
  4113.     Latin Alphabet in that the right half has some empty positions.
  4114.     Some Latin Alphabets (e.g. Latin/Hebrew) also have empty positions.
  4115. 195     Second example: "type diab.asc" instead of "type diab.lat".
  4116. 197     6th line from bottom: MSCUSTOM.INI, not MSKERMIT.INI.
  4117. 203     Examples should say XM (XMIT) rather than XF (XFER).
  4118. 215     Example should say "duplex" rather than "duplux".
  4119. 226     \m() variables are really not like \%a-style global variables,
  4120.         in that the do not get recursively evaluated -- on the literal
  4121.         definition is returned.
  4122. 239     Line 3: "secret" should be "oofa".
  4123.         Middle paragraph, material beginning "In these commands, literal
  4124.         strings to be compared must not contain any spaces..."  As of version
  4125.         5A(190), this is no longer true.  Multiple words can be grouped
  4126.         together within braces, e.g. "if equal \%a {here are four words} ..."
  4127. 242     First line should have no comma at the end.
  4128. 246     Description of label syntax should state that in a macro definition,
  4129.         labels are set off by commas.
  4130. 249     In the syntax description of the FOR command, the words "initial",
  4131.     "final", and "increment" should be in italics, and there should be
  4132.     no right angle bracket (>) following the word "increment".  Also,
  4133.         the description of the FOR command fails to state explicitly that
  4134.         the increment can be negative for counting backwards, in which case
  4135.         the completion test is that the variable becomes less than the
  4136.         final value, not greater than the final value.  Also, the book
  4137.         does not mention that the value of the loop variable can be changed
  4138.         by the commands in the loop contents, and this will affect the
  4139.         execution of the loop.
  4140. 250     In the wakeup-call example, the tests should be "if llt" rather than
  4141.         "if not lgt".
  4142. 252     Comments on the example should say "third is smaller or equal".
  4143. 252     Text fails to mention that functions can not change their arguments
  4144.         (i.e. arguments are passed by value).
  4145. 254     \Flower() and \Fupper() functions only work correctly on 7-bit ASCII
  4146.         letters.
  4147. 258     Table 12-2, operator |.  Example should say \%a | 4 gives value 6.
  4148. 264     Table 12-3, entry "double width line" should be \27#6, not \27#4.
  4149. 264     Table 12-3, entry "set scrolling region" should refer to top row,
  4150.         bottom row; not to row, column.
  4151. 264     Table 12-3, entry "Stops transparent printing", Kermit Notation
  4152.         column, should say "\27[4i", not "\27[0i".
  4153. 264     Table 12-3, entry "Starts transparent printing", Kermit Notation
  4154.         column, should say "\27[5i", not "\27[0i".
  4155. 264     Table 12-3, entry "VT200 ID" should say "ESC [ 62c", not "ESC [ 6c".
  4156. 264     Table 12-3, entry "VT300 ID" should say "ESC [ 63c", not "ESC [ 6c".
  4157. 266-267 The section File Transfer Shortcuts does not apply to file transfer
  4158.     with MS-DOS Kermit 3.13 or later.  The escape sequences associated
  4159.     with the TERMINALR and TERMINALS macros in MS-DOS Kermit 3.12 and
  4160.     earlier are now used for changing screen-writing direction during
  4161.     terminal emulation, as on real DEC Hebrew VT terminals.  See the
  4162.     MS-DOS Kermit 3.13 update notes (KERMIT.UPD) for detailed information.
  4163. 267     The description of the RETURN command says it may not be used in the
  4164.         command list of a FOR, WHILE, or XIF command.  As of edit 190, this
  4165.         is no longer the case.
  4166. 268     Carl, not Karl, Friedrich Gauss.
  4167. 269     The OPEN !READ command example for VMS should use /EXCLUDE= rather
  4168.     than /EXCEPT=.
  4169. 272     Line 14 of example should say "if = \%n \%d", not "if = \%i \%d".
  4170. 275     Comma missing after closing brace of FOR loop in CALL macro.
  4171. 276     Line 13: When you give a SERIAL (not LINE), NET, or CALL command...
  4172. 286     The OUTPUT command in the middle of the page should say
  4173.         "\27[\?6c" rather than "\27[\?1c".
  4174. 287     SET INPUT TIMEOUT QUIT in the VMSLOGIN macro should be
  4175.         SET INPUT TIMEOUT PROCEED.  The continuation hyphen is missing from
  4176.         three lines.  The VMSLOGIN macro in the distributed CKERMIT.INI file
  4177.         corrects these errors.
  4178. 294     The CISLOGIN macro has several mistakes.  The following section:
  4179.       input 5 User ID:,-
  4180.       output \%2\13,-
  4181.       input Password:,-
  4182.       output \%3\13,-
  4183.       input 20 Enter Choice!,-
  4184.         Should be replaced by:
  4185.       input 5 User ID:,-
  4186.       output \%1\13,-
  4187.       input 5 Password:,-
  4188.       output \%2\13,-
  4189.       input 20 CompuServe Information Service,-
  4190. 299     Paragraph after "define ACCESS": "and assigned to the local temporary
  4191.         variable \%9" should be removed.  Towards the bottom of the page, the
  4192.         example and the last two paragraphs should be adjusted to discuss the
  4193.         ACCESS macro definition as it appears at the top of the page!  The
  4194.         \%9 variable is not used.  The example "if def \%9 doaccess { \%2} \%9"
  4195.         should read "if success doaccess { \%2} \v(return)".  In the first line
  4196.         of the last paragraph, "\%9" should be changed to "\v(return)".
  4197. 315     VMS examples:
  4198.         $ define compuserve $sys$system:kermit.exe sys$login:compuserve.cmd
  4199.         $ define sprintnet  $sys$system:kermit.exe sys$login:sprintnet.cmd
  4200.         Should be:
  4201.         $ compuserve :== $sys$system:kermit.exe sys$login:compuserve.cmd
  4202.         $ sprintnet  :== $sys$system:kermit.exe sys$login:sprintnet.cmd
  4203. 323-324 The description of C-Kermit program exit status codes fails to
  4204.     mention the special method used by (Open)VMS, in which these codes
  4205.     are assigned to the symbol CKERMIT_STATUS (see CKVKER.BWR).
  4206. 336     PRINT, PING, and similar commands work by running the corresponding
  4207.         system command (PRINT, lp, lpr, etc), which must be in the user's PATH
  4208.         with execute permission, otherwise an error message appears stating
  4209.         "command not found" or "permission denied", etc.
  4210. 346     SET KEY CLEAR added in 5A(190), restores default key mapping.
  4211. 352     The syntax of SET TELNET TERMINAL-TYPE should include italicized
  4212.     square brackets around "text" to indicate that the text is optional,
  4213.     and that if it is omitted, the TELNET TERMINAL-TYPE reverts to the
  4214.     default, usually the terminal type of your login session.
  4215. 352     The entries for SET TERMINAL ANSWERBACK, ARROW-KEYS, KEYPAD-MODE, and
  4216.     SCROLLBACK, etc, are missing.  These are OS/2-specific commands (all of
  4217.         these except those new to edits 189 and 190 -- are described in the
  4218.         OS/2 Appendix on page 432).  See the OS/2 updates file.
  4219. 353     The entries for SET TERMINAL TYPE and WRAP are missing.
  4220.     These are also OS/2-specific commands (described on page 432).
  4221. 354     SET TRANSMIT PAUSE description is inaccurate.  An accurate description
  4222.         appears on page 204.
  4223. 366     In Table II-2, "ATSO=0" should be "ATS0=1".
  4224. 402-403 "define sys$input" and "define sys$output" in the examples on these
  4225.         two pages should be "define /user_mode sys$input", etc.  This makes
  4226.         the definitions effective only for the next program invocation.  In
  4227.         that case the "deassign sys$input", "deassign sys$output" commands
  4228.         can be removed.
  4229. 403     The section "Running C-Kermit in DCL Command Procedures" fails to
  4230.     describe how to use C-Kermit's exit status codes (see CKVKER.BWR).
  4231. 409     The Backup date in the example at the top of the pages should not
  4232.         be earlier than the Created and Revised dates.  The maximum record
  4233.         length is 65534, not 32767.
  4234. 419     The "stepping-stone" at the beginning of the OS/2 Appendix fails
  4235.     to refer readers to the CKCKER.BWR and CKOKER.BWR files, and the
  4236.         OS/2 updates file CKOKER.UPD.
  4237. 420     Footnote.  The COMDMA driver, though discussed in the OS/2
  4238.     documentation, never actually existed.  The regular COM.SYS driver
  4239.     is used instead.
  4240. 425     The first paragraph in the Serial Communications section fails to
  4241.     mention that other serial-port device names are also acceptable.
  4242. 425     Bottom -- OS/2 C-Kermit now also supports VT100, VT220, and ANSI 
  4243.         terminal emulation.
  4244. 428-432 These pages are largely obsolete as of version 5A(190).  The CONNECT-
  4245.         mode actions shown in Table V-1, as well as the Arrow keys (Table V-2),
  4246.         Keypad keys (Table V-3), now have \Kverbs associated with them,
  4247.         exactly as in MS-DOS Kermit.  Additional \Kverbs are provided for
  4248.         VT220 (LK201) F keys and editing keys.  See the OS/2 updates file.
  4249. 430     Table V-3 fails to include the Num Lock key, and the accompanying
  4250.     text does not mention the fact the fact that it can be assigned
  4251.     with SET KEY.  See CKOKER.BWR, CKOVTK2.INI, and the OS/2 updates file
  4252.         for further information.
  4253. 431     Third paragraph.  "F1 through F4" should be "F1 through F10".
  4254.     Also, the Home key should be included in the list of keys that
  4255.     control screen rollback.
  4256. 432     The description of SET TERMINAL ANSWERBACK is missing.
  4257.         Also, numerous new SET TERMINAL commands have been added for OS/2;
  4258.         see the OS/2 updates file.
  4259. 435-439 Tables V-4 through V-9 need to be augmented with VT220 sequences.
  4260.         See the OS/2 updates file.
  4261. 438     No explanation of "nbits".  1=8-bit characters, 2=7-bit characters.
  4262.     "baud" should be "bps".
  4263. 440     Table V-10.  ESC W misplaced (alphabetically).
  4264. 447     "SET FILENAMES" should be "SET FILE NAMES".
  4265. 462     The text at the top of the page should say "ISO 8859", not "ISO 8858".
  4266. 463     Table VIII-3.  Same as for Table 9-2, page 172.  Plus: Fr-Canadian
  4267.         should be listed as Canadian-French.
  4268. 486     The Cyrillic expansion for "KOI" is misspelled.
  4269. 491     Reference [6].  The third Cyrillic word is misspelled.
  4270. 495     Reference [48].  "Unterschiessheim" should be "Unterschleissheim".
  4271.     Reference [50].  Second Cyrillic word misspelled.
  4272. ...     Hebrew character set tables need to be added.
  4273. Index   Needs entries for:
  4274.       Command-line options
  4275.       Delay
  4276.       Encryption
  4277.       Grouping of words in commands
  4278.       Commands, grouping of words in
  4279.       Length, of packets
  4280.       Length, of files
  4281.       Prompt, how to set
  4282.       Spaces, in commands
  4283.           Telenet (see SprintNet)
  4284.       Terminal servers, dialing out from
  4285.       umask
  4286.  
  4287. Please send reports of other errors to the authors, as well as suggestions for
  4288. improvements, additional index entries, and any other comments.
  4289.  
  4290. ------------------------------
  4291. END OF CKERMIT.UPD
  4292.