home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
k95
/
ckermit.upd
< prev
next >
Wrap
Text File
|
1996-11-21
|
189KB
|
4,292 lines
File CKERMIT.UPD, Supplement to "Using C-Kermit", 1st Edition. -*- text -*-
As of C-Kermit version: 6.0.192
and Kermit 95 version: 1.1.7
This file last updated: Wed Jul 17 09:40:31 1996
Authors: Frank da Cruz and Christine M. Gianone
Address: The Kermit Project
Watson Laboratory
Columbia University
612 West 115th Street, New York NY 10025-7799, USA.
Fax: +1 212 662-6442 -- or -- +1 212 663-8202
E-Mail: kermit@columbia.edu
Web: http://www.columbia.edu/kermit/
Copyright (C) 1992, 1996, Trustees of Columbia University in the City of
New York. All rights reserved.
------------------------------
WHAT IS IN THIS FILE
This file lists changes made to C-Kermit since version 5A(188) was released
and the first edition of the book "Using C-Kermit" was published in 1993.
Use this file as a supplement to "Using C-Kermit". If you have the second
edition of "Using C-Kermit" (1997), you don't need this file.
If the "most recent update" shown above is long ago, contact Columbia
University to see if there is a newer release.
For further information, also see the CKCKER.BWR ("C-Kermit beware") file for
hints, tips, tricks, restrictions, frequently asked questions, etc, plus the
system-specific "beware file", e.g. CKUKER.BWR for UNIX, CKVKER.BWR for VMS,
etc, and also any system-specific update files such as BUGS.DOC and
UPDATES.DOC for Windows 95 and NT.
------------------------------
NOTE TO KERMIT 95 USERS
This file concentrates on the aspects of C-Kermit that are common to all
versions: UNIX, VMS, OS/2, etc. Please refer to your Kermit 95 documentation:
the "Kermit 95" booklet, the UPDATES.DOC and BUGS.DOC files, and to all the
other files in the Kermit 95 DOCS directory for information that is specific
to Kermit 95. Also, please note that "Using C-Kermit" predates Kermit 95
altogether, and so please pardon the fact that it does not mention Windows 95
or NT; it is still the definitive reference for the C-Kermit command and
script programming language.
-----------------------------------------
A WORD ABOUT VERSIONS AND VERSION NUMBERS
"C-Kermit" refers to all the many programs that are compiled in whole or in
part from common C-language source code, comprising:
. A Kermit file transfer protocol module
. A command parser and script execution module
. A modem-dialing module
. A network support module
. A character-set translation module.
and several others. These "system-independent" modules are combined with
system-dependent modules for each platform to provide the required
input/output functions, and also in some cases overlaid with an alternative
user interface, such as Macintosh Kermit's point-and-click interface, and in
some cases also a terminal emulator, as in Macintosh Kermit, OS/2 C-Kermit, or
Kermit 95.
The C-Kermit version number started as 1.0, ... 3.0, 4.0, 4.1 and then
(because of confusion at the time with Berkeley UNIX 4.2), 4B, 4C, and so on,
with the specific edit number in parentheses, for example 4E(072) or 5A(188).
This scheme was used through 5A(191), but now we have gone back to the
traditional numbering scheme with decimal points: major.minor.edit; for
example 6.0.192.
Meanwhile, C-Kermit versions for some platforms might go through several
releases while C-Kermit itself remains the same. These versions have their
own platform-specific version numbers, such as Kermit 95 1.1.1, 1.1.2, and
so on, or Macintosh Kermit 0.993.
------------------------------
CONTENTS
I. C-KERMIT DOCUMENTATION: Information about the C-Kermit manual.
II. NEW FEATURES: Documentation for features added since 5A(188) --
(1) PROGRAM MANAGEMENT
1.0. Finding and Executing Command Files
1.1. Command Retry, Recall, and Typeahead
1.2. The System-Wide Initialization File
1.3. The SET EXIT Command
1.4. The SET BELL Command
1.5. Command-File Line Numbers
1.6. Disabling System Access
1.7. The "KERMIT" Command
1.8. Automatic CD
1.9. Improved ?-Menus
1.10. "More?" prompting
(2) MAKING AND USING CONNECTIONS
2.0. Modems and Dialing
2.1. Using the Services Directory
2.1.1. Login Macros
2.1.2. Connection Details
2.2. Incoming TCP/IP Connections
2.3. Controlling TCP Parameters
2.4. The Network Directory
2.5. Automatic Flow Control
(3) TERMINAL CONNECTION
3.0. Automatic File Transfer
3.1. The APC Escape Sequence
3.2. The CONNECT Command
3.3. The SET KEY Command
3.4. The SET TERMINAL Command
3.5. The SET TELNET Command
(4) FILE TRANSFER AND MANAGEMENT
4.0. New File Transfer Commands
4.0.1. Automatic Transfer Mode
4.0.2. Dynamic Packet Timeouts
4.0.3. The MOVE and MMOVE Commands
4.0.4. The BINARY and TEXT Commands
4.0.5. The FAST, CAUTIOUS, and ROBUST Macros
4.0.6. New Default Block Check Type
4.0.7. New Auto-up/download Feature
4.0.8. Packet Length Slow Start
4.0.9. Download Directory
4.0.10. The SEND List
4.0.11. The -Q Option
4.1. File Transfer Recovery
4.1.1. The RESEND and REGET Commands
4.1.2. Manual Recovery: The PSEND Command
4.2. Control-Character Unprefixing
4.3. Keyboard Cancellation of Packet Mode
4.4. New RECEIVE Command Features
4.5. Automatic Directory Creation
4.6. Pausing Between Packets
4.7. Fullscreen File Transfer Display Improvements
4.7.1. Thermometer
4.7.2. Repainting the Screen
4.8. Improved Status Codes
4.9. Managing Directories
4.10. Printing
4.11. Text-file Record-format Control
4.12. Incoming File Destination Control
(5) NEW CLIENT/SERVER FEATURES
5.0. REMOTE Command Redirection
5.1. New REMOTE Commands
5.2. "WHATAMI" -- Making Kermit GET more like FTP GET
5.3. Idle Timeout for Server
5.4. Internally Generated Directory Listings
5.5. Server GET Path
(6) INTERNATIONAL CHARACTER SETS
6.1. Hebrew File Transfer
6.2. Hebrew Terminal Emulation
6.3. The Hewlett Packard Roman8 Character Set
(7) SCRIPT PROGRAMMING
7.1. New IF Commands
7.2. New \v() Variables
7.3. New \f() functions
7.4. INPUT and OUTPUT Command Improvements
7.5. The New MINPUT Command
7.6. Other New or Improved Script Programming Commands
7.7. Arrays
7.8. Arithmetic
7.9. New Block Structure for Commands
7.10. Local Variables
7.11. More Uses for "Long Variable Names"
7.12. hh:mm:ss Time Notation in Selected Commands
7.13. The SWITCH Command
(8) USING OTHER FILE TRANSFER PROTOCOLS
8.0. Built-in XYZMODEM (Kermit 95 only)
8.1. The REDIRECT Command
8.2. New Macros for External Protocols
8.3. Built-in Selection for External Protocols
(9) NEW COMMAND-LINE OPTIONS
III. APPENDICES
Appendix 1: UNIX C-KERMIT
Appendix 2: VMS C-KERMIT
Appendix 3: OS/2 C-KERMIT
Appendix 4: MACINTOSH KERMIT
Appendix 5: STRATUS VOS C-KERMIT
IV. ERRATA & CORRIGENDA: Corrections to "Using C-Kermit"
------------------------------
I. C-KERMIT DOCUMENTATION
The user manual for C-Kermit is:
Frank da Cruz and Christine M. Gianone, "Using C-Kermit", Digital Press /
Butterworth-Heinemann, Woburn, MA, 1993, 514 pages, ISBN 1-55558-108-0
US single-copy price: $39.95; quantity discounts available. Available in
computer bookstores or directly from Columbia University:
The Kermit Project
Columbia University
612 West 115th Street
New York NY 10025-7799
USA
Telephone: +1 (212) 854-3703
Fax: +1 (212) 663-8202
Domestic and overseas orders accepted. Price: US $39.95 (US, Canada, and
Mexico), $50 elsewhere. Orders may be paid by MasterCard or Visa, or
prepaid by check in US dollars. Add $35 bank fee for checks not drawn on
a US bank. Price includes shipping. Do not include sales tax.
Inquire about quantity discounts.
You can also order by phone from the publisher, Digital Press /
Butterworth-Heinemann, with MasterCard, Visa, or American Express:
+1 800 366-2665 (Woburn, Massachusetts office for USA & Canada)
+44 1865 314627 (Oxford, England distribution centre for UK & Europe)
+61 03 9245 7111 (Melbourne, Vic, office for Australia & NZ)
+65 356-1968 (Singapore office for Asia)
+27 (31) 2683111 (Durban office for South Africa)
A German-language edition is also available:
Frank da Cruz and Christine M. Gianone, "C-Kermit - Einfuehrung und
Referenz", Verlag Heinz Heise, Hannover, Germany (1994).
ISBN 3-88229-023-4. Deutsch von Gisbert W. Selke. Price: DM 88,00.
Verlag Heinz Heise GmbH & Co. KG, Helstorfer Strasse 7, D-30625 Hannover.
Tel. +49 (05 11) 53 52-0, Fax. +49 (05 11) 53 52-1 29.
The Kermit file transfer protocol is specified in:
Frank da Cruz, "Kermit, A File Transfer Protocol", Digital Press,
Bedford, MA, 1987, 379 pages, ISBN 0-932376-88-6.
US single-copy price: $32.95. Availability as above.
Kermit for Windows 95 is documented in:
Christine M. Gianone and Frank da Cruz, "Kermit 95",
Manning Publications, Greenwich CT (1996), 88 pages, ISBN 1-884777-14-7.
US single-copy price: $14.95. Included in Kermit 95 shrink wrapped
package and available separately from Columbia University or direct
from the publisher:
Manning Publications Co.
3 Lewis Street
Greenwich CT 06830
USA
Fax: +1 (203) 661 9018
Email: 73150.1431@compuserve.com
News and articles about Kermit software and protocol are published
periodically in the journal, Kermit News. Subscriptions are free; contact
Columbia University at the address above.
Online news about Kermit is published in the comp.protocols.kermit.announce
and comp.protocols.kermit.misc newsgroups.
------------------------------
II. NEW FEATURES
Items are grouped together by major topic, roughly corresponding to the
chapters of "Using C-Kermit".
(1) PROGRAM MANAGEMENT
1.0. Finding and Executing Command Files
The recommended extension (filetype) for Kermit scripts is KSC (Kermit SCript).
This avoids conflicts other types of files that might have extensions like
SCR (e.g. in Windows this means "Screen Saver"), CMD (OS/2 Rexx file), etc.
When you give a TAKE command, specifying the name of a command file, C-Kermit
tries to find the file in the normal way and fails if it can't. As of edit
192, if it can't find the file, then, if the filename that you gave was not
"absolute" -- that is, it did not include a full path -- then Kermit looks in
either your home directory or your Kermit software installation area,
depending on the operating system. In OS/2, Windows NT or Windows 95, it
looks in the SCRIPTS subdirectory directory. In UNIX it looks in your home
(login) directory.
So, for example, in Windows 95, if your Kermit 95 directory is D:\K95, and you
keep all your Kermit 95 command files in D:\K95\SCRIPTS, then you can give
TAKE commands for them by name only, no matter what your current directory is:
[C:\TMP] K-95> take oofa.ksc
Starting in edit 192, error messages issued during execution of a command file
show the file name and line number at which the error occurred. This makes it
easier to debug scripts. If an error occurred during execution of a macro,
the line number indicates the file line where the macro was invoked, not the
line or command within the macro. Lines are numbered starting at 1.
Similarly, if you SET SET TAKE ECHO ON, the line numbers from the file are
shown.
1.1. Command Retry, Recall, and Typeahead
These features apply only when you are typing commands at the C-Kermit>
prompt, and not to command file or macro execution. They were added in
edit 190.
If you enter a command that contains a syntax error, C-Kermit now reprompts
you automatically with the portion of the command that was correct, so you
don't have to retype it. Example:
C-Kermit>set block-check oofa
?No keywords match - oofa
C-Kermit>set block-check _
"_" shows the position of the cursor after you are reprompted. At this
point, you can type question mark (?) to find out what is legal here, or you
can complete the command, or you can erase it with Ctrl-U, etc, just as if
you had retyped the initial words yourself. If you want to disable this
feature, tell C-Kermit to:
SET COMMAND RETRY OFF
C-Kermit versions that are built with the "DYNAMIC" memory allocation option
now support command recall (type "show features" and look for DYNAMIC and/or
CK_RECALL). C-Kermit saves your commands in a command recall (history)
buffer, which, by default, holds your last 10 commands. To recall your
previous command, type Ctrl-P (that is, hold down the Control or Ctrl key and
press the P or p key) or Ctrl-B. Type Ctrl-P (or Ctrl-B) again to recall the
command before that, and so on. If you try to go back too far, C-Kermit beeps
at you.
NOTE: In OS/2 and Windows you should use Ctrl-B rather than Ctrl-P because,
at least in certain kinds of sessions, depending on your system's
configuration, Ctrl-P is trapped by OS/2 or Windows itself as a "toggle
printer" command, as in MS-DOS.
Each time you recall a command, it appears before you as if you had typed it
up to, but not including, the Enter (Carriage Return) that actually causes it
to execute. If you want to execute the command, press the Enter (Carriage
Return) key. If you want to edit it, use the editing keys, including Ctrl-U
to erase it.
When you are viewing recalled commands, you can also go forwards in the
command recall buffer by typing Ctrl-N. This is handy in case (for example),
you typed too many Ctrl-P's, and went back too far.
NOTE: In general, arrow keys (and mice, etc) can not be used for command
recall. Why? Because C-Kermit would have to grow to twice its size to
include all the operating-system, version, hardware, keyboard, and terminal
dependent code to make these devices work uniformly on all (or even some) of
the computers where C-Kermit runs. EXCEPTION: The up- and down-arrow keys
can be used in Windows and OS/2 to scroll up and down in the command recall
buffer.
You can change the size of the command recall buffer to hold any number of
commands you like, subject to the memory limitations of your computer. The
command is:
SET COMMAND RECALL-BUFFER-SIZE number
where "number" is the number of commands you want to keep. The more you keep,
the more memory C-Kermit uses. If you enter a size of 0, the command recall
feature is disabled. Whenever you give the SET COMMAND RECALL-BUFFER-SIZE
command, your previous command history is lost. You can display the size of
your command recall buffer, as well as your COMMAND RETRY setting, with:
SHOW COMMAND
(Note: SET CMD and SHOW CMD are synonyms for SET COMMAND and SHOW COMMAND)
Typeahead is now permitted during entry of interactive commands. Typeahead is
not preserved, however, over execution of command files or macros, because
these might themselves require keyboard input, or might enter CONNECT or file
transfer protocol mode. Edit 190.
1.2. The System-Wide Initialization File
As of edit 190, C-Kermit can be configured to execute its initialization file
from a single system-wide directory, rather than requiring a copy in each
user's home directory. This is particularly important for UNIX; VMS C-Kermit
already had a facility for this. A common initialization file saves disk
space and management headaches. It is recommended that all the features of
the standard initialization file (dialing directory and services directory
setup, chaining to customization file, etc) be kept intact.
1.3. The SET EXIT Command
SET EXIT WARNING { ON, OFF, ALWAYS } tells whether C-Kermit should issue a
warning message and require confirmation if an EXIT command, or a SET LINE
(SET PORT), SET HOST, or TELNET command is given and a connection (dialed or
network) still appears to be open, since any of these commands would close the
currently open connection. The default is OFF, meaning no warnings. ALWAYS
means always warn.
If SET EXIT WARNING is ON, a warning is issued if a network connection appears
to be open:
C-Kermit>exit
A network connection to foo.bar.edu might still be active.
OK to exit?
at which point you can type Yes or No.
You will also get a warning if the serial SET LINE device has the carrier (CD,
DCD) signal and C-Kermit has not been told to SET CARRIER-WATCH OFF:
C-Kermit>set line /dev/acu
A serial connection might still be active on /dev/ttyh6.
OK to close?
Note that not all versions of C-Kermit have access to the carrier signal; if
your version of C-Kermit says "Modem signals not available" when you give a
SHOW COMM command, then SET EXIT WARNING ON will always warn you about a
possibly active serial connection when you try to exit after using a SET LINE
/ SET PORT connection.
SET EXIT STATUS <number> tells C-Kermit to use the given number as its program
exit (return) code. This lets the user set program return code without
actually having to exit; for example, the user can OR in various bits at
different times.
Display the SET EXIT values with SHOW EXIT. Edit 190.
1.4. SET BELL { AUDIBLE { BEEP, SYSTEM-SOUNDS }, VISIBLE, NONE }
This command applies only to OS/2 and Windows. It tells how bell (beep)
characters / noises should be sounded or displayed. VISIBLE means to
flash the screen rather than making a noise. AUDIBLE means to make a noise,
which can be either the standard "beep", or else "System sounds" that give
you three different noises for "information", "warning", and "error".
1.5. Command-File Line Numbers
Beginning in edit 192, any errors that occur during execution of a command
file display the offending line, the name of the file that it's in, and
its line number within the file. File line numbers are also shown during
command-file execution if you SET TAKE ECHO ON.
1.6. Disabling System Access
Many sites wish to install C-Kermit "behind a menu" in such a way that users
can only do things that the system administrator approves of. In many cases
the administrator does not want to let users "escape to the shell", which
is accomplished in C-Kermit using RUN, !, PUSH, REDIRECT, and similar
commands. There has long been a compile-time option, NOPUSH, to remove
these functions from C-Kermit, but beginning in edit 192, there is now also
a runtime option. If the command NOPUSH is given, all of these facilities
are disabled until the program exits. Thus NOPUSH can be included in a
system-wide initialization file, or on the command line (kermit -C nopush),
etc. Furthermore, if C-Kermit is started and the environment variable
(logical name in VMS) CK_NOPUSH is defined (to be anything at all), this is
equivalent to giving the NOPUSH command.
1.7. The "kermit" Command
Most versions of C-Kermit have two kinds of commands: command-line options
(like a traditional 1960s-vintage UNIX program) and interactive commands
and the two are completely different.
Beginning in edit 192, it is possible to give a C-Kermit command-line
invocation at the C-Kermit> interactive-mode prompt, and it will actually
work as expected, for example:
C-Kermit> kermit -r
Tells C-Kermit to receive a file, just as "kermit -r", when given at the
system prompt, starts Kermit in RECEIVE mode. Note, however, that you must
use C-Kermit's own grouping mechanism in these commands, not your shell's.
Example: kermit -C { command, command } rather than kermit -C " command,
command ".
1.8. Automatic CD
In the Windows and OS/2 versions, if you give a disk letter followed by
a colon, at the C-Kermit> prompt, C-Kermit will treat it the same way the
DOS prompt does -- it will change to the given disk. As an added bonus,
you may also include a directory name after the colon, which you can't
do at the DOS prompt.
1.9. Improved ?-Menus
In 6.0.192, context-sensitive help menus (the lists you get when you type
a question mark (?) in a command) are now organized maximally for your screen
or window size, rather than into fixed-size columns. Furthermore, if C-Kermit
knows your screen length, then rather than scrolling long lists right off the
screen, it gives you a "More?" prompt, described in the next section.
When using ? to view a file list, the list is now alphabetized, and in most
cases it is allowed to be significantly longer than in previous releases.
1.10. "More?" Prompting
In displays produced by a C-Kermit commands, such as the keyword or file lists
mentioned in 1.9, as well as the output of various SHOW commands, the HELP
command, etc, C-Kermit does its best to pause at the end of each screenful,
ask "More?", and wait for you to type something before displaying the next
screen.
The place where C-Kermit pauses is based upon its idea of your screen size,
which it obtains by asking the operating system. If the operating system
doesn't know, then 24 lines by 80 columns is assumed. You can change
C-Kermit's idea of your command-screen dimensions with the commands:
SET COMMAND HEIGHT <number-of-rows>
SET COMMAND WIDTH <number-of-columns>
In the Windows and OS/2 versions, these commands change the size of the
command screen size. In UNIX, VMS, and the other versions, they are used
to adjust C-Kermit to what the size actually is.
The "More?" prompt gives you time to read the material on the screen. At the
"More?" prompt you can reply "y" (or press the space bar) to see the next
screen, or "n" or "q" to cancel the list and return to the prompt.
Furthermore (in edit 192 and later), you can turn more-prompting on and off
with the command:
SET COMMAND MORE-PROMPTING { ON, OFF }
If you turn it off, long reports -- such as file lists produced by typing
a question mark in a filename field (such as "send ?") will scroll past
without pausing. This behavior might be preferred by those whose command
windows have vertical scroll bars.
NOTE: "More?" prompting presently does not work for listings produced by
system processes that are started by C-Kermit, e.g. by commands like RUN or
DIRECTORY. However, in most systems you can achieve it yourself; e.g. by
using "run dir /p" in Windows or OS/2 or "!ls -l | more" in UNIX (a good use
for macros).
(2) MAKING AND USING CONNECTIONS
2.0 Modems and Dialing
Dial and modem operations were totally overhauled in edit 192 to give you
total control over every aspect of modem setup and configuration, as well as
dialing procedures and phone number format. The dialing directory format
was changed to allow for "portable" phone numbers that can be dialed from
any location. All of these improvements -- hopefully all of them backwards
compatible so as not to break current setups -- are detailed in separate
files.
Also note that new modem types are being added all the time. To get a
current list, type "set modem type ?" at the C-Kermit> prompt.
2.1 Using The Services Directory
NOTE: The Services Directory is replaced in Kermit 95 by the
graphical Dialer. Kermit 95 users should skip this section.
Kermit 95's graphical Dialer is explained in the Kermit 95 manual.
In the original release of C-Kermit, 5A(188), the services directory feature
was provided mainly as an illustration of how C-Kermit's script programming
language can be used to build handy communications tools, and so it was not
presented or explained until Chapter 13 of "Using C-Kermit", and therefore was
probably missed by a lot of readers (and users).
Since then, the services directory feature has proven to be quite useful in
its own right, and has also been improved in one small but important way.
Here is a brief nontechnical explanation.
The services directory is a plain-text file in your home directory, containing
one line, or "entry", for each service that you want to access. Each service
listed in your services directory can be connected to and logged in to
automatically, no matter whether this involves dialing up a modem, making a
network connection, or any other type of connection that C-Kermit can handle.
The name of the services directory file is .ksd in UNIX and OS-9, and
CKERMIT.KSD in OS/2, VMS, and elsewhere.
The services directory can be used only if you are also using the standard
C-Kermit initialization file.
Each line in the services directory has the following parts:
<name-of-entry> <login-macro-name> <username> <connection-details>
For example:
HP9000 unixlogin olga net tcp/ip hp.xyzcorp.com
where "HP9000" is the entry name, "unixlogin" is the login macro name,
"olga" is the username, and "net tcp/ip hp.xyzcorp.com" are the connection
details.
To use this entry, you would give the following command at the C-Kermit
prompt:
access hp9000
or:
access hp9000 xxxxxx
where "xxxxxx" is your password on the computer you will be accessing.
C-Kermit's ACCESS macro (defined in your C-Kermit initialization file) handles
the connection details: "net" means it's a network connection; "tcp/ip" tells
which type of network, and "hp.xyzcorp.com" tells the name or address (in this
case, the name) of the computer or service on the network. If you don't
supply a password to the ACCESS command, you are prompted for it. You do not
(can not, and should not) include passwords in your services directory file.
Here's another example, in which the connection is made by dialing a modem:
COMPUSERVE cislogin 765,4321 call hayes /dev/cua 2400 93,876-5432
Here, "COMPUSERVE" is the entry name, "cislogin" is the name of the login
macro, "765,4321" is your CompuServe user ID, and the connection details are:
"call hayes /dev/cua 2400 93,876-5432". "Call" means we will be making a
phone call; "hayes" tells which type of modem, "/dev/cua" is the name of the
device that modem is connected to, "2400" tells the communication speed, and
"93,876-5432" is the phone number to dial.
2.1.1. Login Macros
Each login macro looks for the appropriate prompts from the host or service
and responds accordingly with your username, password, and/or other
information, and then waits until it sees the main prompt of the host or
service, or other indication that you have been logged in successfully.
The following login macros are available in the standard C-Kermit
initialization file (.kermrc on UNIX and OS-9, CKERMIT.INI elsewhere):
UNIXLOGIN
For logging in to all types of UNIX systems: Solaris, HP-UX, Linux, IRIX,
DG/UX, NeXTSTEP, OSF/1, SunOS, etc etc. The default system prompt
(explained below) is "\13\10$\32"; that is, carriage return, linefeed,
dollar sign, space.
VMSLOGIN
For logging in to DEC VAX/VMS or OpenVMS systems. The default system prompt
is "\10\13$\32"; that is, linefeed, carriage return, dollar sign, space.
This macro can also be used for logging in to DG AOS/VS systems if you
specify a different prompt ("\13\10)\32"). NOTE: The VMSLOGIN macro has
been updated to account for new procedures for use with VMS 6.0 and/or 6.1,
while retaining comptability with earlier VMS releases.
VMLINELOGIN
For logging into IBM mainframes with VM/CMS over linemode connections.
VMFULLOGIN
For logging into IBM mainframes with VM/CMS over fullscreen connections.
CISLOGIN
For logging in to CompuServe.
DOWLOGIN
For logging in to Dow Jones News/Retrieval.
DJNRSPRINT
For logging in to Dow Jones News/Retrieval over SprintNet.
NOLOGIN
For accessing computers or services that do not require logging in.
Each login macro name must be followed by a username, even NOLOGIN.
For NOLOGIN, just include a "dummy" name, like "xxxx", that will not be used.
Other login macros can be easily constructed, modeled on those above. Read
Chapters 11-13 of "Using C-Kermit" for full instructions. If you add or
modify login macros, you should put their definitions in your C-Kermit
customization file (.mykermrc in UNIX and OS-9, CKERMOD.INI elsewhere).
There was a problem with the login macros in C-Kermit 5A(188-189), namely that
the system prompt was hard-coded into the macro. For example, the UNIXLOGIN
macro assumed that the UNIX shell prompt was "$ " (dollar sign followed by
space), but in many cases it might be something else, and the only way to
allow for different prompts was to edit the macro itself. In C-Kermit 5A(190)
and later, you may include the system prompt in your services directory by
grouping it together in curly braces with the login macro name:
{macroname prompt}
For example:
CSHELL {unixlogin \13\10%\32} olga net tcp/ip bsd.xyzcorp.com
CHEMISTRY {vmslogin \10\13CHEM$} OLGA net tcp/ip chemlab.xyzcorp.com
DG {vmslogin \13\10)\32} olga net tcp/ip aosvs.xyzcorp.com
The first example specifies the C-Shell prompt, "% ", rather than using the
default UNIX (Bourne Shell, K-Shell) prompt of "$ ". The second example
accesses a system that has a custom prompt. The third uses the VMSLOGIN macro
to access a Data General AOS/VS system by specifying the AOS/VS prompt, ") ",
since otherwise the Username: and Password: prompts are the same as for VMS.
The "backslash-number" notation is a way of including special (usually
nonprintable) characters in C-Kermit commands and files, explained on pages
21-22 of "Using C-Kermit". The number is the ASCII character number, such as
10 for linefeed, 32 for space.
2.1.2. Connection Details
The Connection Details part of a services directory entry starts with one
of the following words:
CALL - The connection is made with a phone call through a modem.
SERIAL - The connection is a direct (dedicated) serial connection.
NET - The connection is made on a network.
The subsequent information depends on the type of connection.
CALL must be followed by the following information, in this order:
1. The modem type (a valid SET MODEM value).
2. The name of the device on your computer that the modem is connected to.
3. The speed, in bits per second, at which to use the device.
4. The telephone number to dial. This can also be the name of an entry
in your dialing directory.
SERIAL must be followed by the following information, in this order:
1. The serial device name.
2. The communication speed.
NET must be followed by:
1. The network type: TCP/IP, X.25, DECNET, etc (a valid SET NET TYPE value).
2. The name or address of the host or service you want to connect to.
3. Additional network-specific information, like a service or socket number.
For TCP/IP network connections, you can include a socket number by appending
to the IP name or address with a colon, for example:
WEATHER nologin xxxx net tcp/ip madlab.sprl.umich.edu:3000
Create your services directory file using a text editor, as a plain-text
(ASCII) file. If you are using a word processor, be sure to save your
services directory as a plain text (ASCII) file.
To use your services directory, just type "access" and the service name at the
C-Kermit prompt, for example:
C-Kermit> access hp9000
olga's password: __________
To list your services directory, type "list" at the C-Kermit prompt. To look
up a particular services directory entry, type "list" and then the name, for
example "list hp9000".
2.2. Incoming TCP/IP Connections
As of September 27, 1995, Kermit protocol has an official TCP Registered Port
Number from the Internet Assigned Numbers Authority (RFC 1340):
1649
We haven't quite decided what to do with it yet, so let's hold it in reserve.
In the OS/2, Windows NT, and Windows 95 versions of C-Kermit, which support
incoming TCP/IP connections, this is the default port number for "set host *".
You still can (and should) specify any other desired port after the "*",
e.g. "set host * 3333".
In edit 192 incoming TCP/IP connections were also added for UNIX and VMS,
as long as the underlying operating system or TCP/IP library provides the
select() function. You can tell if your version of Kermit supports this
feature by giving the command "SHOW FEATURES" and looking to see that
TCPSOCKET is listed and NOLISTEN is not listed -- or simply by trying it.
For the present, incoming connections can be used in the following ways:
. For chat sessions. This requires both Kermit programs to be in
CONNECT mode.
. For protocol operations. For this you would typically put the
listening Kermit in server mode after the connection came in.
. For "host mode", such as the one that comes with Kermit 95, which is
implemented as a script. This gives incoming clients a nice menu.
One good use for this feature is when you want to exchange files with someone
else on the Internet, and neither of you has a login ID on the other person's
computer. Anonymous ftp is often not a solution because (e.g. on UNIX) you
might not have write access to the /pub/ftp tree to put something there to be
picked up, and/or your site does not allow anonymous users write access. Or,
perhaps more to the point, the files to be transferred are of a private nature
and you might not want to trust them to email. In this case you can set up an
access point only for the intended person. See the example at the end of this
section.
Since the SET HOST * command blocks until a connection comes in (or until you
interrupt it with Ctrl-C), you would normally have to sit and wait for this to
happen before you type the next command (CONNECT, SERVER, etc). For this
reason, incoming connections are best set up from a command file or macro.
For example, to set up a server:
define be_a_server set host * 3333, if success serve
define lets_chat set host * 4444, if sucess connect
and so on.
In operating systems like UNIX and VMS, which have real user IDs, passwords,
groups, access controls, and so on, C-Kermit does not interface with those
mechanisms in any way (this might come in a later release). Instead, it runs
as the user who started it -- in the user's file space, name space, etc, with
all of the user's access rights in effect.
To achieve a measure of security, use the DISABLE and ENABLE commands
described in "Using C-Kermit", Chapter 7, page 148. For example, if you use
DISABLE CD in combination with SET FILE DOWNLOAD-DIRECTORY (see section 4.0),
you can restrict the client's read access to one directory and its write
access to a different directory.
The SET SERVER LOGIN command was also added in edit 192 for an additional
measure of protection:
SET SERVER LOGIN [ username [ password [ account ] ] ]
The maximum length for each field is 32. If you give this command prior to
putting C-Kermit in server mode, nobody will be able to issue any commands
until they use REMOTE LOGIN to supply a username (and password, if you
specified one) that match those from SET SERVER LOGIN exactly. Logins and
logouts are recorded in the transaction log ("log transactions").
Presently only one username/password combination can be set up; there is no
"password file" or user list by which the Kermit server supports multiple
users. WARNING: this command echoes like any other, so the password will be
visible when you type it; furthermore there is no encryption of any kind.
In short, use this feature at your own risk :-) And use your imagination...
Note: C-Kermit is not yet suitable for use as a system service or daemon, e.g.
for running under inetd, or like (say) ftpd is.
As to performance, measurements made on a fast and unloaded computer on a
fast an unloaded network showed file transfer speed improved over 90% when
the Kermit server was accessed directly on a socket as opposed to going
through an intermediate Telnet server and pseudoterminal driver.
Here's an example of setting up a TCP/IP Kermit server:
$ cd private
$ kermit
[/usr/olga/private] C-Kermit> log transactions
[/usr/olga/private] C-Kermit> disable cd
[/usr/olga/private] C-Kermit> set download directory ./incoming
[/usr/olga/private] C-Kermit> set server login olaf supersecret
[/usr/olga/private] C-Kermit> define xx set host * 4444, server
[/usr/olga/private] C-Kermit> xx
Binding to socket 4444 ...
Listening ...
Waiting to accept a TCP/IP connection on port 4444 ...
When the connection comes in, C-Kermit automatically enters server mode
(because of the xx macro), but whoever made the connection cannot use it for
anything until they log in with the proper username and password. Once they
do, they can get files from the "private" directory, and they can send files
to the "private/incoming" directory.
The user on the other end would do as follows (using Kermit 95, C-Kermit, or
MS-DOS Kermit):
Kermit> set host <olga's-host-name-or-address> 4444
(Note: in MS-DOS Kermit the above command would be "set port tcp" rather
than "set host".)
Kermit> remote login olaf supersecret
Logged in.
Kermit>
(Now any server commands can be issued -- SEND, GET, REMOTE xxx, etc)
Kermit> remote logout
Kermit> hangup
Hint: Pick a port number above 1000, but make sure nobody else is using the
same one. But how would you know? One way is to try connecting to the port
yourself. If Telnet (or Kermit) says "connection refused", that probably
means the port is not in use.
2.3. Controlling TCP Parameters
The following commands were added in 6.0.192 (Kermit 95 1.1.3):
SET TCP KEEPALIVE { ON, OFF }
Setting this ON might help to detect broken connections
more quickly. Default is ON.
SET TCP LINGER { ON [<timeout>], OFF }
Setting this ON ensures that a connection doesn't close before
all outstanding data has been transferred and acknowledged.
The optional <timeout> specifies how many 10th of a millisecond
we should wait for a close to succeed.
0 means no timeout, wait forever. Default is OFF.
SET TCP NODELAY { ON, OFF }
ON means send short TCP packets immediately rather than waiting
to accumulate a bunch of them before transmitting (Nagle Algorithm).
Default is OFF. Turning this ON can significantly degrade overall
network performance -- use it only if you have to.
SET TCP RECVBUF <number>
SET TCP SENDBUF <number>
TCP receive and send buffer sizes. The system default sizes are used
unless a specific size is specified.
These items are designed to let you tune TCP networking performance on a
per-connection basis by adjusting items that you normally would not have
access to. You should use these commands only if you feel that the TCP/IP
protocol stack that Kermit is using is giving you inadequate performance, and
then only if you understand the concepts (see, for example, the Comer TCP/IP
books), and then at your own risk. These settings are displayed by SHOW
NETWORK. Not all options are necessarily available in all C-Kermit versions;
it depends on the underlying TCP/IP services.
2.4. The Network Directory
Similar to the Dialing Directory (see DIALING.DOC).
SET NETWORK DIRECTORY [ file [ file [ file [ ... ] ] ] ]
Chooses zero, one, or more network directory files, which, together,
make up the network directory.
The standard C-Kermit initialization file assumes you have one network
directory file called .knd (UNIX or OS-9) or ckermit.knd (elsewhere) in
your home directory. This can be overridden by the environment variable
K_NET_DIRECTORY.
If you have a network directory, then SET HOST, RLOGIN, and TELNET commands
look up their argument there if it starts with a letter.
Directory format:
; Full-line command
entryname networktype address network-specific-items ; trailing comment
Full-line comments and blank lines are allowed; trailing comments must
begin with a semicolon preceded by at least one space.
"entryname" is the name of entry, must start with a letter.
"networktype" is one of the following:
tcp/ip x.25 decnet superlat netbios named-pipe
(type "set network type ?" for a list of types that are supported in your
version of C-Kermit.)
"address" is the host name or address you would use in a SET HOST command,
such as an IP hostname, and IP address, and X.121 address, a DECnet node name,
etc.
"network-specific-items" are optional.
For TCP/IP: TCP service port name or number, username.
For SuperLAT: Password (we do NOT recommend recording this).
For X.25 we use keyword parameters:
cug=<number> Closed user group, if any
cud=<string> Call user data, if any
rev=on (or) off Reverse charge on or off
pad=p:v,p:v,p:v,p:v,... PAD numeric parameter:value sequence
and can be given in any combination or any order.
2.5. Automatic Flow Control
As of 6.0.192, the default flow control setting is AUTOMATIC, meaning that
whenever you SET LINE, SET PORT, SET MODEM TYPE, SET MODEM CAPABILITIES, or
SET HOST (or TELNET), an appropriate type of flow control is chosen
automatically:
. In VMS C-Kermit, it is always set to Xon/Xoff, which actually means
/TTSYNC/HOSTSYNC, which should always be used. The rest apply to all
systems except VMS.
. For network connections (SET HOST or TELNET), flow control is set to NONE;
the underlying network protocols handle flow control themselves.
. For direct serial connections (SET MODEM TYPE NONE, SET PORT/LINE xxx),
FLOW is set to RTS/CTS if the C-Kermit implementation supports it,
otherwise to Xon/Xoff.
. For modem connections, FLOW is set to RTS/CTS if C-Kermit supports AND if
the modem supports it (as determined from the modem's capabilities list,
shown as HWFC by SHOW MODEM); otherwise to Xon/Xoff.
To override this behavior, SET FLOW to the desired specific value: NONE,
XON/XOFF, RTS/CTS, or other ("set flow ?" for list of the options available
in your version of C-Kermit).
(3) TERMINAL CONNECTION
3.0. Automatic File Transfer
If SET TERMINAL AUTODOWNLOAD is ON, and C-Kermit is in CONNECT mode, then the
terminal emulator automatically recognizes certain kinds of Kermit packets
(and, if external or internal ZMODEM protocol is supported, also incoming
ZMODEM transfers) and automatically goes into receive or server mode using the
appropriate protocol, and then returns to terminal emulation automatically
when the transfer is finished. Edit 192: Kermit 95, OS/2, VMS, UNIX.
Example: Tell C-Kermit to "set terminal autodownload on", then "connect".
Then while in CONNECT mode, to download a file to C-Kermit, just tell the
remote Kermit to "send" the file. To upload a file from C-Kermit to the
remote Kermit, tell the remote Kermit to "get" the file.
Also be sure to read section 8.3, subsection "Receiving files", about this,
and particularly the caution regarding multihop Kermit connections.
3.1. The APC Escape Sequence
Kermit 95 and, as of edit 190, also the OS/2, UNIX, and VMS versions of
C-Kermit are able to respond automatically to "autoupload", "autodownload",
or auto-anything-else directives from the remote computer during CONNECT
mode. These directives come in the form of an Application Program Command
escape sequence, or APC.
The APC is sent by a host application to a terminal emulator, containing one
or more commands to be executed by the terminal emulation program. This
mechanism lets the host application software control your communications
software, allowing an unprecedented degree of automation and convenience.
Good uses for this feature include: (a) automatic communications, protocol,
terminal, keyboard, or other setups by the host application; (b) automatic
initiation of file transfer by the host application.
The form of an APC is "<ESC>_text<ESC>\", where "<ESC>" is ASCII character 27
(Escape), and "text" is a command or a list of commands separated by commas.
The APC sequence was originally defined defined in ANSI X3.64 and first
implemented by Digital Equipment Corporation for its VT300-series and higher
terminals.
There are two "ends" to an APC operation, and you need to understand how
to control each end. Let's call the application which sends an APC escape
sequence the "APC sender", and the application that receives it, and which is
supposed to execute the commands it contains, the "APC receiver".
Any host application can be an APC sender. To send an APC, all it needs to do
is display the desired commands on your terminal screen, enclosed in <ESC>_
and <ESC>\. C-Kermit 5A(189) (and later) has a command for doing this:
APC text
where the "text" is a command (or commands) for the APC receiver. Leading and
trailing spaces are removed from the text unless it is enclosed in braces:
APC { text }
Here's an example that sets MS-DOS Kermit parameters from the C-Kermit command
line. It assumes that C-Kermit is being accessed from MS-DOS Kermit 3.13 or
later, which is in CONNECT mode:
C-Kermit>apc set receive packet-length 2000, set window 4
This command causes C-Kermit to send the following characters to the terminal
(i.e. MS-DOS Kermit's terminal emulator):
<ESC>_set receive packet-length 2000, set window 4<ESC>\
MS-DOS Kermit recognizes the APC sequence, extracts the commands from it,
and processes them automatically, according to the rules listed below.
Here's an example in which you define and then execute a C-Kermit macro to
send a file from C-Kermit, causing MS-DOS Kermit to receive it automatically
without your having to escape back and type "receive". You do not need to
CONNECT again after the transfer is done, either; this too happens
automatically.
C-Kermit>define autosend apc receive, send \%1
C-Kermit>autosend oofa.txt
A macro is used because if you type APC RECEIVE at the C-Kermit prompt, MS-DOS
Kermit goes immediately into RECEIVE mode and you have no way to give the SEND
command to C-Kermit. Conversely, if you type the SEND command first, C-Kermit
goes into SEND mode, and you have no opportunity to give it an APC command.
When the macro (or a TAKE command file) is the source of commands, the
"Catch-22" is avoided because the keyboard is out of the picture.
The APC receiver can be:
. MS-DOS Kermit 3.13 or later
. Kermit 95
. C-Kermit 5A(190) or later for OS/2
. C-Kermit 5A(190) or later for UNIX
. C-Kermit 5A(190) or later for VMS
When one of these Kermit programs is in CONNECT mode, and an APC escape
sequence arrives, the commands it contains are executed if:
1. Terminal emulation is VT100, VT102, VT220, VT320, ANSI-BBS,
SCOANSI, AT386, or Wyse370, and:
2. SET TERMINAL APC is ON and the commands are not "dangerous", or:
3. SET TERMINAL APC is UNCHECKED.
After processing the APC sequence, whether its commands are executed or not,
the APC receiver returns to CONNECT mode automatically.
The C-Kermit initialization file defines several macros to let you take
advantage of the APC feature. They are to be used at the C-Kermit> prompt,
when you are accessing C-Kermit through an APC receiver. They include:
PCSEND <filespec> [ <as-name> ]
Sends the file or files from C-Kermit to the "PC" that's on your desk.
(Of course, the PC might also be a UNIX workstation, etc). If the <filespec>
does not contain wildcard characters (that is, it is the name of a single
file), you can include the optional "as-name" to send it under a different
name. The file or files are sent according to C-Kermit's current FILE TYPE
setting, text or binary (except in VMS, where VMS C-Kermit determines the
file type and transfer automatically for each file). In other words, the
PCSEND macro is exactly like the SEND command, except it automatically puts
your local Kermit program into RECEIVE mode, and then back into CONNECT mode
again when the transfer is complete. This process is sometimes referred to
as "autodownloading".
PCGET <filespec> [ <as-name> ]
This tells C-Kermit to get the specified file or files from your "PC".
It puts your local Kermit program into server mode, GETs the specified
files from it, then sends it a FINISH command and puts it back in CONNECT
mode automatically. The transfer type is governed by C-Kermit's current
FILE TYPE setting.
This process can be called "autouploading".
C-Kermit's response to APC sequences is controlled by the following command:
SET TERMINAL APC { ON, OFF, UNCHECKED }
The default setting is OFF, meaning that C-Kermit ignores APC sequences unless
you tell it otherwise. In the OS/2 version, they are harmlessly absorbed and
not displayed. In the UNIX and VMS versions of C-Kermit, they are passed
through transparently, in case you want them acted upon by your actual
terminal or terminal emulator.
To activate the APC feature, use:
SET TERMINAL APC ON
This allows execution of all commands received in APC sequences except those
considered dangerous, such as: PUSH, RUN, !, REDIRECT, DELETE, RENAME, OUTPUT,
ENABLE, DISABLE, SCRIPT, and SET TERMINAL APC. With this setting, for
example, it would not be possible for someone to send you a "letter bomb" or
screen message that contained an APC sequence to execute a command on your
computer (because RUN and ! are disabled). The commands allowed by SET
TERMINAL APC ON are only the ones which affect Kermit itself, including the
initiation of Kermit file transfers.
Should you want to enable APC execution of ALL commands, which can be
dangerous and is therefore not recommended unless you know exactly what you
are doing, you can:
SET TERMINAL APC UNCHECKED
Use UNCHECKED at your own risk.
3.2. The CONNECT Command
The CONNECT command now has an optional "switch", /QUIETLY, to suppress the
verbose CONNECT message on versions of C-Kermit (such as UNIX, VMS, etc) that
normally give one:
C-Kermit>CONNECT /QUIETLY
or:
C-Kermit>C /Q
or even just:
C-Kermit C /
This switch has no effect on versions of C-Kermit that contain true terminal
emulators, such as the OS/2, Windows 95, and Macintosh versions.
3.3. The SET KEY Command
The SET KEY command now allows you to press the Return or Enter key after
the word KEY to be prompted for a keystroke and then a definition separately.
Using this form of the command lets you assign material to a key or key
combination without having to know its key code. After you press the key to
be assigned, you are shown its current definition, if any. You can cancel by
typing Ctrl-C, restore the default definition by pressing the Return or Enter
key, or enter a new definition. Example:
C-Kermit>set key
Press key:
Key code \16 => Character: \16 (self, no translation)
Definition: blah
C-Kermit>
NOTE: There are many changes and additions to the key mapping facility in the
OS/2 and Windows versions. Please refer to the platform-specific
documentation for details.
In version 6.0.192, C-Kermit allows you to save your current key map.
The command is:
SAVE KEYMAP [ <filename> [ { NEW, APPEND } ] ]
If you don't specify a filename, KEYMAP.INI is used. If you don't specify
NEW or APPEND after the filename, a new file is created. If you specify the
name of an existing file, and the APPEND, the material is written to the end
of the existing file. The keymap is written in the form of a series of SET
KEY commands, one for each key that has a non-default definition. Thus you
can TAKE a SAVE KEYMAP file to execute all of the SET KEY commands that are
in it.
3.4. The SET TERMINAL Command
SET TERMINAL DEBUG { ON, OFF }
SET TERMINAL DEBUG ON is a synonym for SET DEBUG SESSION.
SET TERMINAL DEBUG OFF turns off session debugging without interfering
with any other debugging that might be active (such as LOG DEBUG).
Session debugging status is displayed in the SHOW TERMINAL display.
Edit 190.
SET TERMINAL ESCAPE-CHARACTER { ENABLED, DISABLED }
ENABLED allows normal processing of the CONNECT-mode escape character.
DISABLED causes the CONNECT-mode escape character to be treated like any
other data character -- i.e. simply transmitted to the remote computer or
service, thus preventing you from being able to escape back or issue any of
the other <escape-char>? commands. On OS/2 and Windows you can still use
Alt-X (or whatever \Kexit is assigned to), but in UNIX, VMS, etc, there is
no way to get back except logging out from the remote host or service, but
only if that normally pops you back to the C-Kermit prompt anyway. DISABLED
is mainly intended for use on UNIX, VMS, AOS/VS, etc, when it is "in the
middle" and you need a totally transparent connection between the two end
systems, e.g. to transfer a file using XMODEM (in which case, also remember
to SET COMMAND BYTESIZE 8 and SET TERMINAL BYTESIZE 8).
NOTE: There are numerous other new SET TERMINAL commands for Kermit 95 and
OS/2 C-Kermit. Please refer to the Kermit 95 or OS/2-specific documentation
for details.
3.4. The SET TELNET Command
SET TELNET BINARY-MODE { ACCEPTED, REFUSED, REQUESTED }
This command tells C-Kermit how it should respond to requests to enter
Telnet Binary mode. The default Telnet connection type is Network
Virtual Terminal (NVT) mode. By negotiating Binary mode a cleaner 8-bit
connection is established which may allow XYZmodem transfers that were
not possible before. The default is ACCEPTED.
SET TELNET NEWLINE-MODE { ON, OFF, RAW }
This command tells C-Kermit what to send during CONNECT mode on a TELNET
connection when you type Carriage Return (Return or Enter key). ON (the
default) means to send Carriage Return and Linefeed (CRLF); OFF means to
send Carriage Return and NUL (ASCII 0). The TELNET protocol Network Virtual
Terminal specification says that Carriage Return must always be followed by
LF or NUL. However, certain TCP/IP services do not like CRLF or CR-NUL,
and so in edit 190, the RAW option was added, which means to send CR as
itself, i.e. a plain carriage return.
(4) FILE TRANSFER
4.0. New File Transfer Commands (edit 192).
4.0.1. Automatic Transfer Mode
Beginning in version 6.0.192, C-Kermit has a new capability to exchange
"system-type" information with the other Kermit, and to set its file transfer
mode accordingly, automatically. If the other Kermit also has this
capability, and indicates that it is on the same type of system (e.g. UNIX) as
we are, then C-Kermit performs the following commands implicitly:
SET FILE TYPE BINARY
SET FILE NAMES LITERAL
For VMS-to-VMS transfers, and for OS/2-to-OS/2 transfers, instead of BINARY,
we use LABELED, so that complex files can be transferred with all their
directory info and attributes and structure intact.
Like all features in C-Kermit, you can turn this one off and on if you want
to. The command is:
SET TRANSFER MODE { AUTOMATIC, MANUAL }
AUTOMATIC is the default.
Upon exit from protocol, the user's most recent SET FILE TYPE and SET FILE
NAMES settings are restored automatically.
4.0.2. Dynamic Packet Timeouts
Beginning in version 6.0.192, C-Kermit has the ability to adjust its packet
timeouts dynamically according to the observed packet arrival rate, and
in fact, does this unless you tell it otherwise:
SET SEND TIMEOUT <number> [ { DYNAMIC [ <min> [ <max> ] ], FIXED } ]
When the SEND TIMEOUT is FIXED (the old behavior), then the given <number> is
always used as the timeout (in seconds) when waiting for a packet to come in.
When it is DYNAMIC, the given <number> is the INITIAL timeout, which is
adjusted every time a packet arrives based upon a weighted average (in which
the most recent packets count the most) and standard deviation of the packet
arrival times (with a lower limit of one second and an upper limit of six
times <number>). This should result in faster and more robust error recovery.
It also should help prevent file transfer failures when timeouts have been set
too low by mistake, as was common in earlier versions when accessing
C-Kermit's host from a low-speed modem dialed up to a network terminal server.
In case dynamic timeouts become too short, resulting in spurious
retransmissions, or too long, resulting in overly long waits for packets that
don't show up, you can specify your own minimum and maximum dynamic timeout
values after the word DYNAMIC, e.g.:
set send timeout 10 dynamic 4 20
The minimum must be greater than 0. The maximum, if greater than 0, is taken
literally; if 0, it means to use the default of 6 times <number>, and if less
than 0 it means there should be no maximum at all. All numbers are in
seconds. These values are shown in the SHOW PROTOCOL display.
The fullscreen file transfer display has a new line, "RTT/Timeout", which
shows the average round-trip time (RTT -- the amount of time from when a
packet was sent until its acknowledgement is received), an indicator of the
amount of delay in the connection, and the current timeout, which is based on
the rate at which packets arrive, and may or may not be shorter than the RTT.
4.0.3. The MOVE and MMOVE Commands
MOVE is like SEND, except if (and only if) the file is sent successfully,
it is deleted. Thus MOVE really MOVEs the file from the sending system to
the receiving system.
MMOVE is like MSEND, but deletes the source files after they are successfully
sent.
4.0.4. The BINARY and TEXT Commands
BINARY is an "invisible" synonym for SET FILE TYPE BINARY. TEXT and ASCII are
invisible synonyms for SET FILE TYPE TEXT. Invisible means they don't show up
in the command list when you type ? at the C-Kermit> prompt, but you can still
give these commands as shorthands for the longer versions. Edit 192.
4.0.5. The FAST, CAUTIOUS, and ROBUST Macros
As of edit 192, there are also three new built-in "macros" (commands that
execute a group of commands) that you can use to switch among three levels
Kermit file-transfer protocol settings:
FAST is equivalent to:
SET WINDOW 20 ; or 4, depending on memory configuration
SET RECEIVE PACKET-LENGTH 4096 ; or 2200, depending on memory configuration
SET PREFIXING MINIMAL
CAUTIOUS is equivalent to:
SET WINDOW 4
SET RECEIVE PACKET-LENGTH 1000
SET PREFIXING CAUTIOUS
ROBUST is equivalent to:
SET WINDOW 1
SET RECEIVE PACKET-LENGTH 90
SET PREFIXING ALL
4.0.6. New Default Block Check Type
As of edit 192, the default block-check type is 3 -- the 16-bit CRC. If the
other Kermit does not support this, C-Kermit falls back to type 1
automatically.
4.0.7. New Auto-up/download Feature
SET TERMINAL AUTODOWNLOAD { ON, OFF }
When ON (which is the default), and Kermit is in CONNECT mode, Kermit
automatically goes into receive mode when the other Kermit sends a file to
it. Also works with ZMODEM. The feature works independent of your SET
PROTOCOL setting. Autodownloads switch the appropriate protocol (Kermit or
ZMODEM) temporarily for the transfer, and then back to the prevailing SET
PROTOCOL setting. Edit 192.
When your protocol is Kermit, autouploads are also possible. Just tell the
remote Kermit program to GET <filename>, and the local C-Kermit program goes
into server mode automatically, sends the file, exits server mode
automatically, and returns to CONNECT mode, also automatically. The same will
happen if you give any client command: REMOTE <anything>, MAIL, FINISH (though
there is not much point in that), BYE (ditto).
If you give a REMOTE command whose main purpose is to display something, like
REMOTE DIRECTORY, be sure to redirect it to a file or else the results won't
have anywhere to go (see section 5.0), e.g.:
remote directory > dirfile
4.0.8. Packet Length Slow Start
Beginning in 6.0.192, Kermit protocol sends use a "slow start" algorithm for
growing the packet length to the maximum negotiated length. If the negotiated
packet length is 500 or greater, C-Kermit begins with a packet of 244 bytes,
and then doubles the length each time an acknowledgement is received, until
the maximum negotiated length is reached or an error occurs. (Note that when
the window size is greater than 1, a whole window full of these shorter
packets might go out before the first acknowledgement comes back.)
The idea is to calibrate the best packet length for the connection, so in case
of transmission errors Kermit knows the best length to fall back to. In the
event that your connection is known to be relatively free of errors and
obstructions, you can turn off the slow-start procedure with:
SET TRANSFER SLOW-START OFF
4.0.9. Download Directory
SET FILE DOWNLOAD-DIRECTORY [ <directory-name> ]
Use this command to specify whether Kermit should place received files into
a special "download directory" rather than into its current directory. If
you specify a directory name, then all received files will go into that
directory, no matter what your current directory is (except that you can
override this on a per-file basis with "receive <filespec>" or "set receive
pathnames on"). If you omit the <directory-name>, then incoming files are
placed in Kermit's current directory in the absence of any other
instructions. Edit 192.
4.0.10. The SEND List
Version 6.0.192 also allows you to build up a list of files to be sent, in
which each file or group in the list can have its own text/binary transfer
mode and its own "as-name". All the files in the list are sent in a single
transaction; thus the other Kermit can receive them all with a single
RECEIVE command. The new commands are:
ADD SEND-LIST <filespec> [ <mode> [ <as-name> ] ]
SHOW SEND-LIST
CLEAR SEND-LIST
SEND
To start a new SEND-LIST, use CLEAR-SEND LIST. Use ADD to add files or
file groups to it, and SEND (by itself) to send all the files from the
list. Example:
CLEAR SEND-LIST
SET FILE TYPE TEXT
ADD SEND-LIST ck*.h ; Transfer mode defaults to TEXT
ADD SEND ck*.c text ; No as-name
ADD SEND wart binary ; Transfer mode forced to binary
ADD SEND wermit binary
ADD SEND ck*.o binary
ADD SEND makefile text ckuker.mak ; As-name given
SEND
The SEND-LIST stays put after the SEND command, in case you want to send it
again. To display it, use SHOW SEND-LIST. To get rid of it, use CLEAR
SEND-LIST. Even when a SEND list is defined, you can still SEND files in the
regular ways, by specifying their name(s) in a SEND or MSEND command, etc,
without disturbing the SEND-LIST.
The SEND list is intended mainly for use by programs or scripts that generate
file lists, although of course it can be used interactively too. For example,
a program might build up a list of files and determine whether each one was
text or binary depending on some criterion best known to itself, such as
whether its name ended in ".EXE".
4.0.11. The -Q Option
The -Q command-line option sets all of the file-transfer performance
features at once:
. 20 window slots
. 4K-byte packets (or less, depending on configured packet buffer size)
. "Cautious" control-character unprefixing
4.1. File Transfer Recovery
Beginning with version (190) the UNIX, Windows 95 and NT, OS/2, AOS/VS, and
Amiga versions of C-Kermit, and MS-DOS Kermit 3.14, have the ability to
continue interrupted binary-mode file transfers, and also allow you to
"manually" recover from certain other types of failures.
4.1.1. The RESEND and REGET Commands
The new RESEND command lets you continue a file transfer from the point where
it was interrupted (for example, because of a telephone disconnection) without
having to retransmit the data that was already successfully transmitted.
Imagine, for example, transferring a ten-megabyte file over a 2400-bps modem
connection when, after 9 megabytes have been sent, your call-waiting feature
kicks in and drops the modem connection. 9 megabytes at 240 cps takes about
11 hours. The remaining megabyte would take about 1.2 hours. The recovery
feature lets you complete the failed transfer in the amount of time it takes
to send the as-yet-untranmsitted part of the file, rather than sending the
entire file again from the beginning -- in this example, a savings of 11
hours.
Before seeing how to use this feature, let's look at the restrictions:
1. Recovery works only for binary-mode transfers between computers that have
Kermit programs that support this feature. It does not work with any
other transfer modes, including text or labeled. In other words, if you
want to be able to use the recovery feature, you must tell the file sender
to:
SET FILE TYPE BINARY
In VMS, C-Kermit will switch to binary mode automatically if the file
has a fixed record format. You can also force binary-mode transfer in
VMS via SET FILE TYPE IMAGE.
2. The original transfer must have been done with SET FILE INCOMPLETE KEEP
in effect at the receiver, meaning that incompletely received files are
kept rather than discarded. In C-Kermit 5A(190) and later, this is the
default, which is a change from previous releases.
3. Recovery only works between two Kermit programs that have this capability
and negotiate it successfully. As of this writing, these programs include
C-Kermit 5A(190) and later for UNIX, OS/2, VMS, VOS, and the Commodore
Amiga, and MS-DOS Kermit 3.14 and later for DOS and Windows. (But see
below for a way around this.)
4. You should never use SET FILE COLLISION RENAME if you intend to use the
recovery feature (see the CKCKER.BWR file for an explanation).
Hint: You can also resend text files as long as you transfer them in binary
mode. You can transfer text files in binary mode as long as (a) both
computers represent text files in stream-CRLF format, and (b) you do not
need character-set translation.
To recover a failed upload: reestablish the connection, access the same
account and directory to which you were sending the file previously, start
Kermit there and put it in RECEIVE or SERVER mode. Then escape back to the
local Kermit program and give it these commands:
SET FILE TYPE BINARY
RESEND filename [ as-name ]
The RESEND command should use exactly the same names (and SET FILE NAME
options) as the SEND command that was interrupted. When you RESEND a file,
the receiving Kermit, upon getting the filename, looks up the file and gets
its size; it sends the size back to the sending Kermit, and the sending Kermit
resumes sending from that point; the receiving Kermit appends incoming
material to the partial file rather than creating a new file.
You can recover a failed download in the same way. Just make sure you are
accessing the same directories as before, and the files have (or are being
sent with) the same names as before.
The RESEND command ignores your SET FILE COLLISION setting; thus you need not
change your FILE COLLISION setting when RESENDing, and you will not find it
altered afterwards either. (But please, as mentioned earlier, do not use SET
FILE COLLISION RENAME if you ever intend to use the RESEND command.)
If the RESEND command is used, but a partial file of the same name does not
exist on the receiving end, RESEND behaves just like SEND -- it sends the
whole file. If the file on the receiving is the same size as the sender's
copy, RESEND does nothing; both files are left alone (exception: when VMS
C-Kermit is receiving a resend, it will replace the file's final block).
These properties let you resume the interrupted transfer of a group of files.
Suppose you had originally done this:
Receiver: Sender:
SET FILE INCOMPLETE KEEP SET FILE TYPE BINARY
RECEIVE (or SERVER) SEND *.ZIP
and the phone hung up in the middle of one of the ZIP files. Just reestablish
the connection, and recover this way:
Receiver: Sender:
SET FILE INCOMPLETE KEEP SET FILE TYPE BINARY
RECEIVE (or SERVER) RESEND *.ZIP
The files that were already sent are skipped, the file that was partially
sent is recovered, and the files that were not sent yet are sent.
In order for the recovery feature feature to be useful at all, the default for
SET FILE INCOMPLETE was changed from DISCARD to KEEP when the RESEND command
was added in edit 190. Otherwise an interrupted transfer would leave no
partial file behind unless you had remembered to change the default. But now
you have to pay closer attention to Kermit's messages to know whether a
transfer succeeded or failed -- previously, if it failed, the file would not
show up on the receiving end at all; in edit 190 and later, you'll get a
partial file which could easily be mistaken for the complete file unless you
change the default back to DISCARD or read the screen messages, or keep a
transaction log.
Watch out for SET FILE COLLISION RENAME, especially when used in conjunction
with recovery. Recall that this option (which is NOT the default) renames
the incoming file if a file already exists with the same name (the default is
to rename the previously existing file, and store the incoming file with its
own name). It is strongly recommended that you do not use SET FILE COLLISION
RENAME if you ever intend to use the recovery feature:
. When the file is first received by C-Kermit, its name will be changed if
another file already has the same name. When you RESEND the same file
after a failure, C-Kermit will probably try to append the re-sent portion
to the wrong file.
. Assuming that you get RESEND to work with FILE COLLISION RENAME, C-Kermit,
when receiving the remainder of the file during a RESEND operation, will
report back the wrong name. Nothing can be done about this because the
name is reported back before the receiving Kermit program finds out that
it is a recovery operation.
Using RESEND, you can write a script program to REALLY, REALLY send a file.
Here is a sample, in which we dial up to a UNIX computer and send the MS-DOS
Kermit distribution ZIP file. This script program runs under C-Kermit 5A(190)
or later on OS/2 (and with a change in the dialout device name, under UNIX
too), and under MS-DOS Kermit 3.14 or later. If the transfer fails, we
reestablish the connection and restart the transfer from the point of failure,
as many times as it takes to get the file across.
---(cut here)---
ask \%u { username: }
askq \%p { \%u's password: }
;
; Settings for entire session.
;
define \%s 20 ; Seconds to pause between each try
define \%n 7654321 ; Phone number
set modem type hayes ; Modem type
set port com1 ; Communication port (use /dev/whatever for UNIX)
set speed 19200 ; Speed
set file type binary ; File transfer mode must be binary
set input timeout quit ; This is just to keep the script program short...
set count 50 ; Try up to 50 times to send the file
goto nomsg ; Skip message the first time
:LOOP ; Come here to redial
hangup ; Give the phone a rest
echo CONNECTION BROKEN.
echo Pausing for \%s seconds...
sleep \%s
Echo redialing...
:NOMSG
dial \%n ; Dial the phone number
if fail goto AGAIN ; Keep trying...
output \13 ; System answered, send a carriage return
input 15 login: ; Get login prompt
output \%u\13 ; Send user ID
input 8 Password: ; Get password prompt
output \%p\13 ; Send password
input 60 {$ } ; Get system prompt
cd /kermit ; CD to desired source directory
output cd mskermit\13 ; and destination directory
input 8 {$ } ; Get system prompt
out kermit -r\13 ; kermit -r(eceive) on remote system
input 10 KERMIT READY ; Wait for READY message
pause 1 ; Plus a second for safety
resend msvibm.zip ; RESEND the file
if success goto done ; Success means file is completely transferred
:AGAIN
if count goto LOOP ; Otherwise, try again.
Stop 1 Too many tries. ; Too many tries, give up.
:DONE
echo File transferred OK ; Success, give message
output exit\13 ; Log out from remote computer
pause 5 ; Give it time...
hangup ; Hang up
stop 0 Script succeeded ; Finished, the end.
---(cut here)---
The REGET Command allows the client of a Kermit server to request the server
to RESEND the given file.
4.1.2. Manual Recovery: The PSEND Command
The PSEND ("partial send") command is like the SEND command, but it begins
sending from a specified position in the file:
PSEND <filename> <position> [ <as-name> ]
<filename> must refer to a single file, not a file group. <position> is the
byte position in (offset into) the file; 0 means the beginning, 1000 means the
1001st byte. As with the SEND command, the file is sent under its own name
unless you specify an "as-name". Unlike RESEND, PSEND can be used for both
text and binary transfers, and no special capabilities are required of the
Kermit program on the receiving end. The PSEND command can be viewed as part
of a "do-it-yourself" recovery feature to be used when the other Kermit
program does not support recovery. For example, suppose you were sending a
file called OOFA when the connection hung up, and that the receiving Kermit
program had been instructed to keep incompletely received files (SET FILE
INCOMPLETE KEEP). If the transfer was in binary mode, you could note the
length of the partial file on the receiving end; let's say it was 123456.
Then tell the file receiver to:
SET FILE COLLISION APPEND
RECEIVE
and tell the sender to:
SET FILE TYPE BINARY
PSEND OOFA 123456
If the receiver does not support SET FILE COLLISION APPEND, you could just
use PSEND to create a new file:
SET FILE TYPE BINARY
PSEND OOFA 123456 OOFA.NEW
and then, after the transfer is complete, join the two pieces together on
the receiving end, using a system command or utility.
4.2. Control-Character Unprefixing
This feature allows you to improve C-Kermit's file transfer performance on
connections that you know are transparent to certain control characters. It
lets you tell C-Kermit exactly which control characters need to be prefixed
and encoded, and which ones can be transmitted "bare" when sending files.
SET { SEND, RECEIVE } CONTROL-PREFIX <code>
Sets the control-character prefix which C-Kermit uses to the ASCII character
represented by the numeric <code>. The <code> must be in the range 33-63 or
96-126. Normally it is 35 (#, number sign). SEND is the one that C-Kermit
should use in packets it is sending. RECEIVE should normally never be used,
except to override some kind of protocol negotiation foulup with a buggy
commercial or shareware Kermit implementation.
Synonym: SET { SEND, RECEIVE } QUOTE.
SET CONTROL-CHARACTER UNPREFIXED { <code>..., ALL }
Says you think it's safe to include the control character represented by
<code> without prefixing in packets which C-Kermit sends. The <code> is the
numeric ASCII code for a control character, 1-31, 127-159, or 255. For
example, linefeed (code 10) is normally sent as two printable characters,
#J. SET CONTROL UNPREFIXED 10 lets linefeed be sent literally. Include the
word ALL to unprefix all control characters (except 0). Or you can specify
a list of one or more numeric values, separated by spaces, e.g.:
SET CONTROL UNPREFIXED 2 4 5 18 20
If you can safely declare a lot of control characters to be UNPREFIXED, you
can send binary files (esp. precompressed ones) up to about 20-25% faster.
If you include a control character in this category that causes trouble,
however, the transfer will fail, so experimentation is necessary. This
command will not let you "unprefix" the NUL character (0), nor the following
characters if C-Kermit's current FLOW-CONTROL setting is XON/XOFF: 17, 19,
145, 147. Nor can you unprefix character 255 on a TELNET connection (if
C-Kermit *knows* it's a TELNET connection).
SET CONTROL-CHARACTER PREFIXED { <code>..., ALL }
Says that the given control character(s) must be prefixed in Kermit packets.
By default, all control characters, 0-31, 127-159, and 255, are prefixed.
SET PREFIXING { ALL, CAUTIOUS, MINIMAL, NONE } (edit 192)
This command gives you quick access to commonly-used control-character
(un)prefixing configurations:
NONE prefixes only 0.
MINIMAL prefixes the start- and end-of-packet characters, 0,
carriage return (13), and their 8-bit counterparts, and 255.
CAUTIOUS is like MINIMAL, plus 3, 16, 17, 19, 28, 29, 30
and their 8-bit counterparts.
ALL prefixes all control characters (= SET CONTROL PREFIX ALL)
SHOW CONTROL-PREFIXING
Displays the current control prefix and a table of all control-character
values, showing 1 for each one that will be prefixed and 0 for each one that
will not be prefixed.
SET REPEAT PREFIX <code>
Sets the repeat-count prefix to the ASCII character represented by the
numeric <code>. Normally it is 126 (tilde). The <code> must be in the
range 33-63 or 96-126.
SET REPEAT COUNTS { OFF, ON }
Turns the repeat-count compression mechanism off and on. REPEAT COUNTS are
ON by default. Turn them OFF in case they cause trouble when used against a
faulty Kermit implementation in a shareware or commercial communications
program. Or when transferring precompressed files (like .ZIP or .Z files),
since it is very rare to find runs of repeated characters, and disabling the
repeat-count mechanism frees another character from prefixing, thus
resulting in slightly more efficient transfers.
The purpose of the SET CONTROL UNPREFIX command is to UNILATERALLY configure
C-Kermit to skip prefixing and printable encoding of selected control
characters to achieve higher performance when sending files. This feature
takes advantage of the fact that most Kermit programs will accept control
characters within packet data-fields literally, provided they get through at
all, and provided they do not have a special meaning to the receiving Kermit
program (such as, in many cases, the packet-start and packet-end characters).
There is no protocol negotiation between the two Kermit programs to determine
a "safe set" of control characters, and in fact any such negotiation would be
largely meaningless, because in most cases the two Kermit programs don't have
all the needed information. For example, there might be a terminal server or
PAD between them that is sensitive to a particular control character, even
though the two Kermit programs are not.
If you include in your SET CONTROL UNPREFIXED list one or more control
characters that are unsafe, any of several things might happen:
1. Transfer of any file containing these characters will fail.
2. The receiving Kermit program might be interrupted or halted.
3. Your connection might become hung, stuck, or broken. For example because
a control character causes a PAD, terminal server, modem, or similar
device to go from online mode to command mode.
The set of safe control characters depends on the two Kermit programs, their
settings, the host operating systems and their settings, the communication and
flow control methods, and all the devices, drivers, and protocols that lie
between the two Kermit programs. Therefore, this feature is recommended only
for use on well-known and often-used connections, so the time invested in
finding an optimal unprefixed control-character set will pay off over many
file transfers.
You must be willing to experiment in order to achieve the optimal safe set.
Here is one way. Create a short file containing all 256 possible bytes in
sequence and also in pairs, as well as several text strings surrounded by
CRLFs; for example, compile and run the following program, redirecting its
output to a file:
---(cut here)---
#include <stdio.h>
main() {
int i;
puts("\r\n256-byte test pattern:\r\n");
for (i = 0; i < 256; i++) putchar(i); /* singles */
puts("\r\n256-double-byte test pattern:\r\n");
for (i = 0; i < 256; i++) { putchar(i); putchar(i); } /* in pairs */
puts("\r\nEnd of test patterns\r\n");
}
---(cut here)---
To send the file to MS-DOS Kermit from either C-Kermit or MS-DOS Kermit,
try the following settings:
SET CONTROL UNPREFIXED ALL ; Turn prefixing off for all but 0
SET CONTROL PREFIXED 1 ; Turn it back on for packet-start character
SET CONTROL PREFIXED 129 ; and 8-bit version thereof
(HINT: Abbreviate SET CON U and SET CON P)
Or to send the file from MS-DOS Kermit to C-Kermit, tell MS-DOS Kermit to:
SET CON U ALL ; Turn prefixing off for all
SET CON P 0 ; Turn it back on for NUL
SET CON P 3 ; and for Ctrl-C
SET CON P 131 ; as well as Ctrl-C + parity bit
NOTE 1: 3 and 131 normally need not be prefixed when sending to C-Kermit
5A(190) or later, nor to 5A(189) if you have SET TRANSFER CANCELLATION OFF.
NOTE 2: The start-of-packet character (normally 1 and 129) need not be
prefixed when sending files *to* C-Kermit, but must be prefixed when sending
files to MS-DOS Kermit. However, you should unprefix this character only on
connections that are very clean and fast, where you know there will be no
corruption or timeouts.
NOTE 3: 13 (carriage return, the customary packet terminator) normally need
not be prefixed when sending files to either C-Kermit or MS-DOS Kermit,
except on a TELNET connection (because TELNET servers are likely to change
CRLF into CR).
Try to send the test file in binary mode. If it works, fine. If not, try
prefixing some of the other likely control characters (see below). Once you
find the minimum set of prefixed control characters for the test file, it is
likely they will also work for any other file on the same connection. Try
sending a large precompressed (e.g. ZIP or .Z or GZIP) file. And, of course,
for maximum performance, also use a window size greater than 1 and a packet
length of 1000 or more.
Under ideal conditions (totally transparent and clean serial connection, no
Xon/Xoff, no TELNET, no parity, and C-Kermit has been told to SET TRANSFER
CANCELLATION OFF, see below), the minimum set of control characters that need
to be prefixed is:
SENDER RECEIVER PREFIXED CONTROLS
MS-DOS Kermit MS-DOS Kermit 1 129
MS-DOS Kermit C-Kermit 0
C-Kermit MS-DOS Kermit 0 1 129
C-Kermit C-Kermit 0
For example, to set up C-Kermit to unprefix the minimum set of prefixed
control characters for sending files to MS-DOS Kermit, tell C-Kermit to:
SET FLOW NONE ; Or SET FLOW RTS/CTS
SET CONTROL UNPREFIX ALL
SET CONTROL PREFIX 1 129 ; C-Kermit always prefixes character 0
When the mininum set doesn't work, consult this list of control characters
that are apt to cause trouble and are therefore likely candidates for
prefixing. In particular, note that unprefixing of the packet-start character
(normally 1 and 129), can cause problems when sending to C-Kermit if the
communication link (including device input buffers) is noisy or apt to lose
characters.
set con p 0 ; Ctrl-@ = NUL, internal string terminator in C-Kermit.
; Also, often discarded as padding.
set con p 1 ; Ctrl-A = Packet-start character.
set con p 3 ; Ctrl-C = Packet breakout for remote-mode C-Kermit,
; packet breakout for server-mode MS-DOS Kermit,
; likely to cause interruptions on other systems.
set con p 13 ; Ctrl-M = Carriage return, packet-end character.
; Always prefix on TELNET connections.
set con p 14 ; Ctrl-N = Shift Out
set con p 15 ; Ctrl-O = Shift In
set con p 16 ; Ctrl-P = Commonly-used X.25/X.3 PAD escape character
set con p 17 ; Ctrl-Q = XON, must be prefixed with Xon/Xoff flow control
set con p 19 ; Ctrl-S = XOFF, must be prefixed with Xon/Xoff flow control
set con p 27 ; Ctrl-[ = ESC, prefix if going through some kind of ANSI device
set con p 28 ; Ctrl-\ = CONNECT-mode escape for C-Kermit
set con p 29 ; Ctrl-] = CONNECT-mode escape for TELNET
set con p 30 ; Ctrl-^ = Cisco terminal server escape.
set con p 127 ; Ctrl-? = DEL, often discarded as padding.
; Also becomes TELNET IAC if parity bit is added.
set con p 128 ; = NUL + 128 (i.e. NUL + parity bit)
set con p 129 ; = Ctrl-A + 128
set con p 131 ; = Ctrl-C + 128
set con p 141 ; = CR + 128
set con p 145 ; = XON + 128
set con p 147 ; = XOFF + 128
set con p 255 ; 255 = TELNET IAC, must be prefixed on TCP/IP TELNET connections
INCLUDING TELNET connections through terminal servers!
Note, by the way, that nothing special need be done for SLIP connections,
since the four special SLIP characters are in the G1 printable range:
192 SLIP END character
219 SLIP ESC character
220 SLIP END quote
221 SLIP ESC quote
Here is a suggested (conservative) starting point for experimenting with
control-character unprefixing. Tell the file sender to:
SET CONTROL UNPREFIX ALL
SET CONTROL PREFIX 0 1 3 13 17 19 127 129 131 141 145 147 255
Perhaps some of these can be removed, depending on the connection, and maybe
others need to be added. If you are going through a terminal server or an
intermediate Kermit or TELNET program, also add the appropriate escape
character values (bare, and plus 128).
PREFIXING NOTES:
If C-Kermit or MS-DOS Kermit has initiated a TELNET connection, prefixing of
255 (TELNET IAC) is forced automatically.
IMPORTANT WARNING: When you have a TELNET connection through a
terminal server, neither one of the Kermit programs knows that
it's a TELNET connection, and in this case unprefixing of 255 is
NOT automatically disabled. This can cause file transfer failures.
When in doubt, do not unprefix 255.
Kermit will not let you unprefix XON (17), XOFF (19), XON+128 (145), or
XOFF+128 (147) if its FLOW-CONTROL setting is XON/XOFF. If you want to
unprefix these, make sure *both* Kermits have first been told to SET FLOW
NONE (or RTS/CTS), and that XON/XOFF flow control is not in effect anywhere
along the communication path between the two Kermits.
When sending files to C-Kermit 189 or earlier, and C-Kermit is in remote
mode, you should normally tell the file sender to SET CONTROL PREFIX 3 and
SET CONTROL PREFIX 131, because C-Kermit 189 and earlier (by default) takes
two Ctrl-C's (3 or 131) in a row as cancellation of packet-mode. However,
you can UNPREFIX these characters if you know your files do not contain two
Ctrl-C's in a row, or if you tell C-Kermit to SET TRANSFER CANCELLATION OFF,
or SET TRANSFER CANCELLATION ON <code> <number> when you know that <number>
copies of <code> do not occur in a row in the data. When sending files to
edit 190 of C-Kermit and later, you can leave 3 and 131 unprefixed unless you
have disabled repeat-count compression.
4.3. Keyboard Cancellation of Packet Mode
When C-Kermit is in remote mode and in packet mode, the user no longer has
normal control of the terminal. Characters typed at the keyboard do not
echo, commands have no effect, etc. This is because C-Kermit is trying to
read file-transfer protocol packets from your local Kermit program. If you
have put C-Kermit into packet mode by giving a SEND, RECEIVE, SERVER, BYE,
or similar command, but you did not mean to do this, or you do not have a
local Kermit handy to exchange packets with (for example, because you
neglected to give a SET LINE or SET HOST command first), you can force
C-Kermit back to its prompt by typing a special sequence of characters.
By default, the packet-mode interruption character is Control-C (ASCII 3). In
edits 189 and earlier, two consecutive copies of this character were required
to get out of packet mode, and the parity bit was always ignored. In edit 190
and later, three copies are required by default, and the parity bit is ignored
if C-Kermit's PARITY setting is not NONE.
On noisy connections, two or three Control-C's might show up as noise; or you
might want to allow C-Kermit to accept Control-C characters literally in data
packets during file transfer. The following command lets you control this
feature:
SET TRANSFER CANCELLATION { OFF, ON [ <code> [ <number ] ] }
OFF turns off the packet-mode cancellation feature, preventing escape from
packet mode except by normal protocol operations: completion, timeout, error
packet, etc. USE WITH CAUTION.
ON enables this feature. The optional <code> is the ASCII code for the
control character (0 through 31 or 127) to be used for interruption (the
default is 3 = Ctrl-C), and the optional <number> is the number
of consecutive copies of the character required to cause interruption. For
example, "SET XFER CANCEL ON 6 5" tells C-Kermit to break out of packet mode
upon receipt of 5 consecutive Ctrl-F (ASCII 6) characters. Note that the
parity bit is ignored for this purpose, so (for example) 3 and 131 are
treated the same.
If you SET TRANSFER CANCELLATION OFF, you might still need a manual method of
getting remote-mode C-Kermit out of packet mode. This can be accomplished by
escaping back to your local Kermit and giving a RECEIVE command, then typing E
(or Ctrl-E) to send an error packet. Or just type the following Kermit packet:
<Ctrl-A># E* <-- This is a "fatal error" packet.
If the remote Kermit is in server mode, you can send a FINISH command, or if
you don't have a local Kermit to escape back to, type:
<Ctrl-A>$ GF4 <-- This is a FINISH command packet, for the server.
The SET TRANSFER CANCELLATION command was installed for the UNIX, VMS, and DG
versions of C-Kermit 5A(189). Use SHOW PROTOCOL to find out the current
settings. It has affect only when C-Kermit is in remote mode; when C-Kermit
has been used to establish a connection to another computer (i.e. when
C-Kermit is in local mode), this feature is inactive -- there is no need for
it because you have control of the program via the file-transfer interruption
characters (X, Z, C, E, etc).
In edit 190, the default number of packet-mode cancellation characters was
raised from two to three. That is, if you are looking at a remote C-Kermit in
packet mode, and have no other way to get back to the C-Kermit> prompt, you'll
have to type three consecutive Control-C's (or whatever your transfer
cancellation character is), instead of two, by default. This was done to
allow SET CONTROL UNPREFIX n (where n = the ASCII code for the cancellation
character) to work, even with the default TRANSFER CANCELLATION settings;
three or more consecutive copies of any character are transformed by Kermit
protocol into a repeat count plus one copy of the character, thus preventing
three consecutive Control-C's from appearing as data in a Kermit packet,
provided the other Kermit supports repeat-count compression (all popular
Kermit implementations do) and it has been successfully negotiated (which it
will be unless you take special measures to prevent it; see SET REPEAT above).
4.4. New RECEIVE Command Features
In edit 190 and later, the RECEIVE command can accept a device or directory
name as an argument, and all incoming files will go into the specified device
or directory under the names they were sent with. If the argument is not
a device or directory name, it is treated as before: as a name under which to
store the (first) incoming file. This change also affects the '-a' ("as-name")
command-line option.
This feature depends on the symbol CK_TMPDIR being defined at compile time,
plus the supporting code for each operating system. Type SHOW FEATURES to see
if CK_TMPDIR is defined in your version. As of edit 190, this feature is
available in the UNIX, OS/2, and VMS versions of C-Kermit. And of course also
in Kermit 95.
4.5. Automatic Directory Creation
File names are treated according to the SET FILE NAMES command (see p.114 of
"Using C-Kermit"), CONVERTED (the default) or LITERAL. SET FILE NAMES LITERAL
means:
. When sending files, put the filespec into the outgoing file header packet
exactly as the user typed it. What happens on the receiving end is
entirely up to the receiver.
. When receiving files, use the file specification from the incoming file
header exactly as given, so if it happens to include a device or directory
specification, C-Kermit attempts to use it, and if the device and/or
directory does/do not exist or are not write-accessible, the transfer fails.
SET FILE NAMES CONVERTED, which is the default, transforms outgoing filenames
by (a) removing device, directory, and other "extraneous" information, (b)
uppercasing all lowercase letters, (c) making sure there is no more than one
period, and (d) translating all "uncommon" characters to X's.
NOTE: As of version 6.0.192, SET FILE NAMES CONVERTED is a bit more
liberal, at least on UNIX. Incoming names are lowercased only if they
contained NO lowercase letters. When sending, names that contain
multiple periods (like cku192.tar.gz) keep the LAST period rather than
the first, and change the other ones to underscores rather than X's.
A new command allows us to strike a compromise between these two methods:
SET { SEND, RECEIVE } PATHNAMES { ON, OFF }
SET SEND PATHNAMES ON means to leave pathnames ON outbound file names, which
is the default for compatibility with earlier behavior. Note, however, that
PATHNAMES are always stripped from outbound filenames when FILE NAMES are
CONVERTED, and in Windows and OS/2, disk letters are always stripped.
SET SEND PATHNAMES OFF means to strip OFF path information, leaving only the
file's name. SET SEND PATHNAME applies only to the filename given directly to
a SEND or MSEND command, and not to the "as-name", which is always sent
literally and without modification, regardless of SEND PATHNAME or FILE NAMES
settings.
SET RECEIVE PATHNAMES applies to the filenames in incoming file header
packets; ON means to leave the name alone and attempt to use it as-is, OFF
means to attempt to strip the path information ON THE ASSUMPTION that any path
information found there would be in the notation of the local file system, and
therefore recognizable. If not, the results are unpredictable; for example,
if a file called MYVAX::DUA0:[OLAF.PICS]MONA_LISA.GIF;17 arrives on a UNIX
system, UNIX C-Kermit can not be expected to distinguish the path information
from the name (it is a general principle of communication protocols that a
particular computer must not be expected to understand the conventions and
formats of some other kind of computer).
In VMS, UNIX, Windows, and OS/2, SET RECEIVE PATHNAMES has an additional
meaning: If the incoming file name contains directory information (such as
[.KERMIT]OOFA.TXT, kermit/oofa.txt, or C:\TEXT\LETTERS\ANGRY\OOFA.TXT) --
either absolute or relative -- then, if the named directory, or any of its
ancestors, does not exist, Kermit attempts to create it (or them) before
opening the output file.
For example, suppose your current directory (in UNIX) is /usr/olga/budget, and
a file arrives under the name "aaa/bbb/ccc/ddd/bankrupt.txt", and that the
/usr/olga/budget/aaa directory already exists, but it does not have a bbb
subdirectory. Then Kermit will create the bbb subdirectory, and then the ccc
subdirectory under bbb, and then the ddd subdirectory under ccc, and then it
will store the bankrupt.txt file in the /usr/olga/budget/aaa/bbb/ccc/ddd
directory.
In UNIX, tilde notation for usernames (like "~olga") is recognized, and any
directories that are created inherit the permissions of their parents, and the
owner and group of the user who is running the Kermit program. Naturally,
directory creation fails if the user lacks the appropriate permissions.
Directory creation fails in Windows or OS/2 if a disk letter is included for a
nonexistent or non-writable disk.
Use SHOW FILE to display the SEND/RECEIVE PATHNAME settings.
4.6. Pausing Between Packets
The new command:
SET { SEND, RECEIVE } PAUSE <number>
tells C-Kermit to pause the given number of milliseconds (thousandths of
seconds) before sending each packet. This might be necessary when
communicating with certain devices or over certain kinds of connections.
Don't use this except as a final resort, since it slows transfers down. SHOW
PROTOCOL displays the current setting. SET SEND PAUSE and SET RECEIVE PAUSE
do exactly the same thing. Edit 190.
4.7. Fullscreen File Transfer Display Improvements
As of version 6.0.192, the fullscreen file transfer display is the default
style in all C-Kermit versions that are capable of producing it; in all others
it is the CRT style.
4.7.1. Thermometer
Versions of Kermit that support SET FILE DISPLAY FULLSCREEN now are able to
show a file-transfer "thermometer" (percent bar-graph) to graphically
represent the progress of the file transfer. It can be explicitly selected or
deselected via the new trailing argument to this command:
SET FILE DISPLAY FULLSCREEN { THERMOMETER, NO-THERMOMETER }
A running display of the transfer speed in characters per second (CPS) is also
shown; it is computed once per second as the total actual file characters
transferred so far versus elapsed time.
4.7.2. Repainting the Screen
On multiuser operating systems like UNIX and VMS, it is possible for messages
to be sent to your terminal screen while Kermit is in the middle of
transferring a file. If you are using the fullscreen file transfer display,
this will jumble the formatting. C-Kermit has no way to know this has
happened. In edit 190 and later, however, you can make C-Kermit clear and
repaint the file transfer display screen by typing Ctrl-L (or L or R or r)
while the display is active. Control-W is also accepted for this purpose.
This will result in either a full or partial reconstruction of the display,
depending on the underlying operating system. Edit 190.
4.7.3. Round Trip Time and Timeout Value
As of edit 192, a field labeled "RTT/Timeout" is shown on the fullscreen file
transfer display. This is the average, or smoothed, observed round trip time
(the time between when a packet is sent and the same packet is acknowledged),
in seconds, followed by the current packet timeout, also in seconds, which is
calculated dynamically on a per-packet basis based upon the statistical
behavior of the round-trip time (approximately the current round-trip time
plus three standard deviations). See section 4.0 for details.
4.7.4. Protocol Name
In C-Kermit versions that support multiple protocols internally, the
fullscreen transfer display shows which protocol is being used.
4.8. Improved Status Codes
Like most other C-Kermit commands, file transfer commands such as SEND,
RECEIVE, GET, etc, return a status code for use with IF SUCCESS, IF FAILURE,
etc. Prior to edit 190, these codes were not always accurate. In particular,
if a file was rejected (for any reason at all) via the attribute refusal
mechanism, success was always indicated. In edit 190, the status codes have
been improved as follows:
. If the transfer completes successfully, the status is success.
. If a file is refused via the attribute refusal mechanism, the status
is failure UNLESS the reason was "date" or "name", in which case the
file was not transferred because it was already there (SET FILE
COLLISION UPDATE or DISCARD), and so the transfer is considered successful.
. If the transfer terminates with an error (E packet), loss of connection,
etc, the status is failure.
You can use SHOW STATUS after any command to test its success or failure.
Also, the \v(status) variable is set to 0 if the most recent command
succeeded, and to a nonzero value if it failed.
4.9. Managing Directories
MKDIR <string> creates a directory with the given name. The name may be
absolute or relative. In Windows and OS/2, forward slashes are allowed
as directory separators, which simplifies matters considerably for Kermit
script programs. This is in contrast to "run mkdir", which does not
accept forward slashes, and therefore requires the Kermit script programmer
to use doubled backslashes instead, and becomes even more complicated with
the use of variable names. It also differs from "run mkdir" in returning
an accurate status code (for IF SUCCESS / IF FAILURE).
RMDIR <string> removes the directory with the given name, if it is
empty. Same comments about directory separators as for MKDIR.
Synonym: RD.
4.10. Printing
The SET PRINTER command, added in 6.0.192, controls four things:
1. In C-Kermit versions that have terminal emulators (such as Windows
and OS/2), it determines where transparent-print and autoprint
material are directed. This does not apply to C-Kermit versions
for UNIX, VMS, etc.
2. When C-Kermit is in server mode, it determines where received
REMOTE PRINT material goes.
3. It determines where the PRINT command sends its files.
4. With SET DESTINATION PRINTER in effect (section 4.12), it controls
where incoming files go.
The syntax is:
SET PRINTER [ { devicename, filename, command } ]
If "set printer" is entered by itself, your default printer is restored, which
depends on your operating system and configuration. On systems such as VMS
and Windows, where a printer has a device name, you can specify a device name
such as LPT:, LPT1:, PRN, or NUL, using the syntax of your operating system
for device names to specify a real printer or other device, or the "null"
device in case you want all printer output to be discarded.
If you specify a filename, then printer output is appended to the given file.
To specify a command, use the "pipe" symbol, vertical bar (|), for example:
set printer |lpr (UNIX)
or:
set printer |textps.exe>\dev\lpt1 (Windows or OS/2)
If you need to include spaces, enclose the command in curly braces:
set printer { | lpr -Pmyprintername }
4.11. Text-File Record-Format Control
Edit 192. New command:
SET FILE EOL { CR, CRLF, LF }
Lets you choose one of three line terminators (Carriage Return only, Carriage
Return and Line Feed, or Line Feed only) for purposes of record-format
conversion during transfer of files in text mode. This is handy in case you
have a text file stored on your computer that is in some other computer's
format -- for example, a UNIX-format file on DOS, or vice versa.
CR is used on the Macintosh and in OS-9.
CRLF is used in DOS, Windows, OS/2, VMS, ...
LF is used in UNIX, AOS/VS, ...
4.12. Incoming File Destination Control
Added in version 6.0.192:
SET [ FILE ] DESTINATION { DISK, PRINTER, SCREEN }
This applies to files being received by Kermit protocol. The default is
DISK, meaning incoming files are stored on disk in the normal way. PRINTER
means they are sent to the current SET PRINTER device (or file, or command;
see section 4.10). SCREEN means they are displayed on the screen.
(5) NEW CLIENT/SERVER FEATURES
5.0. REMOTE Command Redirection
Prior to version 6.0.192, output from REMOTE commands always appeared on
the screen; there was no way to direct them elsewhere, such as to a file or
a printer. In 6.0.192 and later, any REMOTE command can be followed by
a UNIX-style "redirection indicator". Examples:
remote directory ; Displays on screen
remote directory > filename ; Goes to a (new) file
remote directory >> filename ; Appends to a file
remote directory | command ; Piped into a command
remote directory | command > filename ; .. whose output goes to a file
remote directory | command >> filename ; .. or is appended to a file
In REMOTE HOST commands, however, redirection indicators are ambiguous:
remote host ls -lt > filename
Does this mean the command "ls -lt" is to be executed on the host with its
output sent a file on the host, or with its output sent to a file on your
your local computer? In cases like this, you can "disambiguate" redirectors
using braces:
remote host blah blah > file ; File on this end
remote host { blah blah } > file ; File on this end
remote host { blah blah > file } ; File on that end
remote host { blah blah > file } > file ; Files on both ends
5.1. New REMOTE Commands
The following commands are all new to edit 190.
REMOTE PWD
Allows the client to ask for the server's current directory in
system-independent way. Formerly, this could only be done via system-
dependent REMOTE HOST commands. The response is displayed on the screen.
REMOTE SET FILE TYPE { TEXT, BINARY, LABELED }
The LABELED option has been added to this command in the VMS and OS/2
versions only. Also, the file type specified in this command also takes
effect locally. Previously, it was only sent to the server. Edit 190.
REMOTE QUERY { KERMIT, SYSTEM, USER } <name>
Asks the server to send the value of the variable of the given type that has
the given name. If the query succeeds, the value is displayed on your
screen and it is also stored in a local read-only Kermit variable, \v(query)
If the query fails, an error message is printed and the \v(query) variable
is set to the empty string.
In C-Kermit and MS-DOS Kermit, "KERMIT" variables are the \v(name) kind,
such as \v(time), \v(version), \v(date), etc, or \f...() functions.
"SYSTEM" variables are DOS or UNIX environment variables, such as PATH,
USER, HOME, or VMS logical names, etc. USER variables are everything else
-- \%a-z, \%1-9, and macro names used as long variable names.
The <name> of a KERMIT or SYSTEM variable must be given in an
implementation-independent format without special syntax, e.g. TIME, DATE,
VERSION, PATH, USER, etc, rather than (say) \v(time), \$(PATH). Similarly
for functions: "remote query kermit files(oofa.*)" rather than "remote
query \ffiles(oofa.*)"
However, in most cases, case matters in system variables. The <name> of a
USER variable is given in the syntax of the server, e.g. \%a.
Examples:
C-Kermit>remote query kermit time
13:25:18
C-Kermit>echo The server's time is: \v(query)
The server's time is: 13:25:18
C-Kermit>rem q k dir ; Note, abbreviations allowed.
/usr/olga/letters
C-Kermit>echo The server's current directory is: \v(query)
The server's current directory is: /usr/olga/letters
C-Kermit>rem q system USER
olga
C-Kermit>echo user = \v(query)
user = olga
C-Kermit>remote query kermit files(oofa.*)
REMOTE ASSIGN <name> [ <value> ]
Asks the server to assign the given <value> to the remote user variable
denoted by <name>. The <value> is fully evaluated LOCALLY before being sent
to the Kermit server. The maximum length for the value is governed by the
maximum negotiated packet length, i.e. the server's RECEIVE PACKET-LENGTH.
Synonym: REMOTE ASG.
Examples:
C-Kermit>remote assign \%a \v(time) ; Assign client's time to server's \%a
C-Kermit>remote query user \%a
13:41:18 ; This is the client's time
C-Kermit>rem asg myname Olga ; Assign my name to server's myname macro
C-Kermit>remote assign oofa \\ffiles(oofa.*)
C-Kermit>remote query user oofa
To force a string corresponding to a local variable name to be sent literally,
use two backslashes:
C-Kermit>remote assign \%a \\v(time) ; Assign "\v(time)" to server's \%a.
C-Kermit>remote query user \%a
13:41:18 ; This is the server's time.
C-Kermit>
You can disable and enable the server's handling of REMOTE QUERY and ASSIGN
with the commands:
DISABLE QUERY The server should not respond to REMOTE QUERY commands
DISABLE ASSIGN The server should not respond to REMOTE ASSIGN commands
ENABLE QUERY The server should respond to REMOTE QUERY commands
ENABLE ASSIGN The server should respond to REMOTE ASSIGN commands
By default, like all other ENABLE/DISABLE items, the initial state is ENABLEd.
5.2. "WHATAMI" -- Making Kermit GET more like FTP GET
Those who are accustomed to using client/server applications such as FTP
expect that certain kinds of commands, when given to the client, will affect
the server correspondingly. Most notable among these commands (in FTP's case)
are those that set the transfer mode: BINARY, ASCII, etc.
In Kermit, however, the transfer mode has always been determined by the file
sender, a concept totally unrelated to the client/server distinction, and less
than obvious to most people. Furthermore, Kermit programs do not always have
a client/server relationship -- there is also the send/receive arrangement.
C-Kermit 5A(190) (and later) and MS-DOS Kermit 3.14 (and later) implement
a new "What Am I" feature, which operates transparently to the user (i.e.
there are no commands to control it), and results in FTP-like operation when:
1. One Kermit program is in SERVER mode, the other is a client, AND:
2. Both Kermit programs support the WHATAMI feature. Currently, these are
limited to C-Kermit 5A(190), MS-DOS Kermit 3.14. A forthcoming release
of IBM Mainframe Kermit will support it too.
Presently, the WHATAMI feature affects only the GET command, and addresses the
following scenario:
1. User starts a Kermit server, giving it no special settings.
2. User tells the client to:
SET FILE TYPE BINARY
SET FILE NAMES LITERAL
GET cku190.tar.Z
3. The file is transferred in text mode when the user expected a binary
transfer, and the name was converted even though the user wanted it not
to be changed.
At the beginning of any protocol transaction, the two Kermits exchange "What
Am I" information as part of the S or I packet data. This information
includes (a) whether I am a client or server; (b) my transfer mode (text or
binary); and (c) my file name handling (literal or converted).
Then, when the server receives a GET-command packet from the client, AND if
WHATAMI information has been successfully exchanged, then the server switches
its file transfer mode and file name handling to the client's corresponding
modes. Nothing special happens when files are sent TO the server, since this
works right anyway, using the previous mechanisms.
Hopefully this change will result in more pleasant surprises than unpleasant
ones. One Beta tester (a seasoned Kermit user), however, was unpleasantly
surprised when he sent the following commands from a client to a server:
REMOTE SET FILE TYPE BINARY
GET OOFA.ZIP
The file arrived in text mode because the client was in text mode. The user
was relying of the old rule, by which the file sender informs the file
receiver of the transfer mode via the attribute packet, but since the WHATAMI
exchange took place after the REMOTE SET, it changed the server's mode back to
text. To cure this situation, REMOTE SET FILE TYPE now sets the local file
transfer mode too.
Should all this sound confusing, remember that the WHATAMI feature (and the
other mechanisms for reconciling file transfer mode) make a difference only
when the sender and receiver's file transfer modes do not agree. The rules
can be summarized like this:
1. To be certain of the file transfer mode, give the same SET FILE TYPE
command to both Kermits (exception: when VMS C-Kermit is sending a file,
it determines the transfer mode for each file automatically).
In case you did not do this, and the transfer modes of the two Kermit programs
disagree when the file transfer starts:
2. If the file sender is VMS C-Kermit, it determines the file type
automatically unless its file type has been set to IMAGE or LABELED.
Otherwise:
3. If both Kermits have the WHATAMI feature, the client program's transfer
mode prevails. Otherwise:
4. If both Kermit programs have Attribute-packet capability, the sender will
inform the receiver of the transfer mode, and the receiver will switch to
the sender's transfer mode automatically. Otherwise:
5. The transfer proceeds with each Kermit program using the transfer mode
that the user has told it to use. This can result in mismatches, which
are usually not what was intended.
Since not all Kermit implementations -- particularly those found in commercial
or shareware software packages -- implement the WHATAMI feature or Attribute
packets, it is always safest to inform both Kermit programs of the transfer
mode prior to file transfer.
5.3. Idle Timeout for Server
Edit 192; Windows 95, Windows NT, and OS/2 only. The new command:
SET SERVER IDLE-TIMEOUT [ <seconds> ]
Sets a limit on how long C-Kermit is to wait for a command to come in when it
is in server mode. The default idle-timeout is 0, which means there is no
limit. This feature allows a Kermit server to be set up for a specified
amount of time, and then to shut down automatically if it is not used within
that amount of time. It does not, however, impose any restriction on the
amount of time the server can be in use. After each use, the idle-time limit
is restarted. The idle timeout is ignored if Kermit has been told to
DISABLE FINISH.
5.4. Internally Generated Directory Listings
Beginning with version 6.0.192, C-Kermit, when in server mode and given REMOTE
DIRECTORY, REMOTE TYPE, and similar commands, generates the results itself,
rather than running a shell command to do it. This is more portable, more
secure, less consumptive of resources, and faster.
5.5. Server GET Path
The SET SERVER GET-PATH, command, added in edit 192, lets you specify a list
of directories for the server to look in when it receives a GET request for a
file whose name is not an absolute pathname. (In UNIX, an absolute pathname
starts with a slash; in DOS or Windows, with a backslash possibly after a disk
letter and colon, etc etc). Directory names are separated by spaces. If the
trailing directory separator is omitted, C-Kermit supplies it. Example
(UNIX):
SET SERVER GET-PATH /usr/olga/ ~olaf /tmp
results in:
/usr/olga/
/usr/olaf/ (assuming olaf's login directory is /usr/olaf)
/tmp/
If a SERVER GET-PATH is set, then it, and only it, is used for finding files
whose names are not absolute. The filename from the GET request is appended
to the first element in the GET-PATH and C-Kermit checks to see if the file
exists. If not, the process repeats for the second and subsequent GET-PATH
element until the file is located or the GET-PATH is exhausted.
The maximum number of elements in the GET-PATH varies with the C-Kermit
implementation, usually somewhere between 16 and 128. Use SHOW FEATURES
and look for "MAXGETPATH=".
If you want Kermit to look in its current directory when a GET-PATH is in
effect, the current directory must be included in the GET-PATH. If the client
sends an absolute (fully qualified) pathname, that takes precedence over the
GET-PATH. If it sends a relative pathname (or simply a filename), then the
directories in the GET-PATH are searched, in the order given, and the file is
sent from the first directory in which it is found; if it is not found in any
of them, a "File not found" error message is sent. The SERVER GET-PATH takes
precedence over DISABLE CD. The GET path, if any, is shown by SHOW SERVER.
(6) INTERNATIONAL CHARACTER SETS
Since "Using C-Kermit" was published:
. Edit 189 of C-Kermit added support for Hebrew character sets.
. Edit 190 added Hebrew terminal emulation to OS/2 C-Kermit.
. Edit 190 added support for the Hewlett-Packard Roman8 character set.
6.1. Hebrew File Transfer
C-Kermit 5A(189) has the following new commands for Hebrew file transfer:
SET TRANSFER CHARACTER-SET HEBREW-ISO = ISO 8859-8 Latin/Hebrew Alphabet
SET FILE CHARACTER-SET HEBREW-ISO = ISO 8859-8 Latin/Hebrew Alphabet
SET FILE CHARACTER-SET CP862 = Hebrew PC Code Page
SET FILE CHARACTER-SET HEBREW-7 = DEC 7-Bit (VT100) Hebrew
These commands work just like the corresponding commands for Cyrillic
character sets, described in Chapter 9 of "Using C-Kermit". When receiving
files, C-Kermit recognizes Hebrew files automatically if the file sender tags
the file as Hebrew in the Attribute packet, which the file sender should do if
it has been given the SET TRANSFER CHARACTER-SET HEBREW command; C-Kermit does
not, however, switch automatically to a Hebrew file character-set, so you must
choose one in advance if that's what you want. The tag is "I6/138" (these are
ISO registration numbers). When sending files in Hebrew mode, of course,
C-Kermit includes the same tag.
An invertible translation table between Latin/Hebrew and CP862 is used during
both terminal emulation and file transfer. The translation table between
Hebrew-7 and Latin/Hebrew, however, is not invertible because these character
sets are different sizes.
Here is an example of uploading a Hebrew file from a PC to UNIX. The PC
version is coded in the Hebrew PC code page, and the UNIX version is to be
stored in the 7-bit Hebrew character-set so it can be sent as network e-mail:
C-Kermit> set file character-set hebrew-7 ; I want a 7-bit version for email
C-Kermit> receive ; Wait for the file.
<Alt-X> ; Escape back to the PC
MS-Kermit> set file type text ; Make sure we are in text mode
MS-Kermit> set file character-set cp862 ; File coded in Hebrew PC code page
MS-Kermit> set xfer character-set hebrew ; Send using ISO Latin/Hebrew
MS-Kermit> send rab.oof ; Send the file
The file sender automatically tells the file receiver that the transfer
character-set is Hebrew.
The three Hebrew character sets are also available for use in C-Kermit's
TRANSLATE command, which translates a local file from one character-set to
another. Thus you can use C-Kermit to convert a local file from, say,
Latin/Hebrew to Hebrew-7.
C-Kermit's Hebrew file transfer features can be used in conjunction with
MS-DOS Kermit 3.13 and later (with which C-Kermit shares the same translation
tables to ensure consistent translations) and IBM Mainframe Kermit 4.2 or
later, which translates between Latin/Hebrew and IBM CECP 424 (the Hebrew
EBCDIC Country Extended Code Page).
6.2. Hebrew Terminal Emulation
NOTE: See the HEBREW.DOC file that accompanies OS/2 C-Kermit and Kermit 95
for information about Hebrew terminal emulation in OS/2 C-Kermit.
There is no support for right-to-left screen-writing direction or other
terminal emulation features in C-Kermit, since C-Kermit (except the OS/2 and
Macintosh versions) does not do terminal emulation itself, but just provides a
terminal-independent "pipe" to your terminal emulator. However, you can still
have C-Kermit provide the character translations during CONNECT mode:
SET TERMINAL CHARACTER-SET { HEBREW-ISO, HEBREW-7, CP862 } [ local-cset ]
The terminal character-set affects not only CONNECT mode, but also the session
log and the TRANSMIT command.
You can test for the presence of Hebrew support in your version of C-Kermit
using the CHECK HEBREW command or the SHOW FEATURES command.
6.3. The Hewlett Packard Roman8 Character Set
C-Kermit 5A(190) adds support for Hewlett Packard ROMAN8 as a file
character-set and a terminal character-set. This is an 8-bit character-set
roughly equivalent, but not identical, to Latin-1, and (of course) with
entirely different encoding. The translations between HP ROMAN8 and Latin-1
are invertible.
(7) SCRIPT PROGRAMMING
7.1. New IF Commands
Note that all IF conditions can also be used as WHILE conditions.
IF DIRECTORY <name> succeeds if <name> is the name of a directory or a
file-structured device, fails otherwise. Available, as of edit 190, in UNIX,
VMS, Windows 95 and NT, and OS/2.
IF FALSE never succeeds. Edit 192.
IF NEWER <file1> <file2> compares modification (or creation) date/times of two
files, succeeds if first file is newer than second file. Edit 190.
IF REMOTE-ONLY succeeds if C-Kermit was started with the -R (uppercase)
command-line option, fails otherwise. This lets you advise C-Kermit that you
only intend to use it in remote mode; the initialization and customization
files can (and the standard ones do) include IF REMOTE-ONLY commands to skip
over time-and-space-consuming items, such as the dialing and services
directories, that will not be used in remote mode. This allows Kermit to
start more quickly. For examples of use, see the standard initialization
file, ckermit.ini / .kermrc. Edit 190.
IF TRUE always succeeds. Edit 192.
IF EQUAL, IF LLT, IF LGT string comparison commands, as of edit 190, allow the
use of braces around comparands that contain imbedded spaces, for example:
IF EQUAL {\%a} {sentence with four words} echo They are equal.
Prior to edit 190, constructions like this would cause a parse error (see
p.239, "Using C-Kermit"). Be sure to use braces around both items.
7.2. New \v() Variables
\v(charset) C-Kermit's local character set. Use this (e.g.) in scripts
for deciding which character set to use when printing screen messages.
\v(connection) When C-Kermit has made a SET LINE or SET HOST connection, this
variable tells the connection type: "serial", "tcp/ip telnet", "decnet lat",
"decnet cterm", "x.25", etc. If C-Kermit is in remote mode -- i.e. it has
not made a connection to another computer -- the value of this variable is
"remote".
\v(cps) gives speed in characters (bytes) per second of the most recent
file transfer. If a group of files was transferred, the figure applies
to the whole group.
\v(dialnumber) the number (or directory entry name) given most recently to a
DIAL command.
\v(dialstatus) contains a numeric result code for the most recent DIAL command:
-1 No DIAL command given yet
0 DIAL succeeded
1 Modem type not specified
2 Communication device not specified
3 Device can't be opened
4 Communication speed not specified
5 Hangup failure
6 Internal error (memory allocation, etc)
7 Device input/output error
8 DIAL TIMEOUT expired
9 Dialing interrupted by user
10 Modem not ready
11-19 (reserved)
20 Modem command error
21 Failure to initialize modem
22 Phone busy
23 No carrier
24 No dialtone
25 Ring (incoming call)
26 No answer
27 Disconnected
28 Answered by voice
29 Access denied, forbidden call
30 Blacklisted
31 Delayed
32 Fax connection
98 Unknown error
99 Unspecified failure detected by modem
NOTE: The fact that these codes exist does not necessarily mean that Kermit
will ever return them. That depends upon (a) the modem being configured to
return the desired set of result codes (usually with the Xn command, where
n is a number; see your modem manual), and (b) Kermit being programmed to know
about each such response from each such modem. Example: Most Hayes-like
modems will say NO CARRIER if the phone doesn't answer, but can usually be
configured (with X4 or somesuch) to give a more specific reason, like BUSY
or NO ANSWER. If you don't get the required level of differential of failure
reasons, try using the SET MODEM DIAL-COMMAND command to add (say) X4 to
the dial command -- e.g. ATD<number> becomes ATX4D<number>.
\v(dialresult)
The actual text of the message from modem in response to the most recent
DIAL, REDIAL, or ANSWER command, e.g. "CONNECT 2400", "NO CARRIER", "NO
DIALTONE", "CONNECT 28800/LAPM/V34"
\v(download)
The SET FILE DOWNLOAD-DIRECTORY value. Edit 192.
\v(errno) = Value of the "errno" variable, usually the error returned
by the most recent system call. Not necessarily totally reliable, but
might aid in debugging scripts, especially commands that open or close
devices or files, or that do file or device input or output.
\v(errstring) = The error message, if any, associated with the current value
of \v(errno), from the system's error-message list.
\v(evaluate) = result of most recent EVALUATE command Edit 190.
\v(exedir) = The directory the C-Kermit executable is located in. Edit 192.
(K95 and OS/2).
\v(fsize) = Size of last transfered file. Edit 190.
\v(ftype) = current FILE TYPE setting: "text" or "binary". In OS/2 and VMS,
also "labeled". In VMS only, also "image".
\v(inidir) = directory the INI file is located in. (K95 and OS/2 only)
Edit 192.
\v(instatus) = result of the most recent INPUT command:
-1 = No INPUT command given yet
0 = Succeeded
1 = Timed out
2 = Interrupted by user (keystroke or SIGINT)
3 = Internal error
4 = I/O error or connection lost
\v(ipaddress)
The IP address of the computer that C-Kermit is running on. This variable
is set when you first make an IP connection; prior to that it is empty.
\v(keyboard) (K95 and OS/2 only), the keyboard model: "88", "101", "102",
or "122".
\v(minput) = number telling which MINPUT search string was matched: 0 = none
of them; 1 = the first one, etc. (see section on MINPUT below).
\v(modem) = current modem type (SET MODEM TYPE value).
Various modem setup strings. Edit 192:
\v(m_aa_off) = Command to turn Auto Answer Off.
\v(m_aa_on) = Command to turn Auto Answer On.
\v(m_dc_off) = Data Compression Off.
\v(m_dc_on) = Data Compression On.
\v(m_dial) = Dial a number.
\v(m_ec_off) = Error Correction Off.
\v(m_ec_on) = Error Correction On.
\v(m_fc_hw) = Flow Control Hardware.
\v(m_fc_no) = Flow Control None.
\v(m_fc_sw) = Flow Control Software.
\v(m_hup) = Hangup.
\v(m_init) = Initialization.
\v(m_pulse) = Pulse Dialing.
\v(m_tone) = Tone Dialing.
\v(newline) is the newline character or sequence appropriate to the operating
system where C-Kermit is running, for example linefeed (\10) for UNIX,
carriage return (\13) for OS-9, carriage-return linefeed (\13\10) for OS/2
and Windows.
\v(packetlen) = current RECEIVE PACKET-LENGTH.
\v(parity) = current PARITY setting: "even", "odd", "mark", "none", or "space".
\v(protocol)
The SET PROTOCOL value. Edit 192.
\v(rexx) (os/2 32-bit only) = the return value from the last Rexx command
issued.
\v(rows) = the number of rows (lines) on the console terminal / screen,
i.e. its length, -1 if unknown.
\v(cols) = the number of columns on the console terminal / screen,
i.e. its width, -1 if unknown..
\v(terminal) = terminal type, if known, otherwise "unknown".
\v(tmpdir) = directory for creating temporary files. Value is system-
dependent and can be hardwired (e.g. /tmp/ for UNIX), or come from
environment variables (e.g. TMP or TEMP in OS/2 or Windows), and in any
case can be overriden by the user with SET TEMP-DIRECTORY.
\v(query) = result of most recent REMOTE QUERY command.
\v(select) (OS/2 and Kermit 95 only)
Current (mouse) selection in terminal screen, if any.
\v(space) = number of free bytes on current storage device (OS/2 and K95 only).
\v(startup) (OS/2 & K95 only)
Disk:Directory from which C-Kermit was started.
\v(sysid) = Kermit system/OS code, from pp.275-278 of the Kermit book:
U8 = MS-DOS (and Windows)
U1 = UNIX
D7 = VMS
UD = OS-9
L3 = Amiga
A3 = Macintosh
UO = OS/2
F3 = AOS/VS
K2 = Atari ST
MV = Stratus VOS
UN = Kermit-95 (Windows 95 and Windows NT)
etc...
\v(userid) = Username as reported by the Operating System (K95). Or as
defined in the USER environment variable (OS/2), or as set by SET LOGIN
USERID, or by the last RLOGIN <host> <username> command. Edit 192.
\v(window) = Current SET WINDOW size.
\v(xversion) = The product-specific C-Kermit version number, for versions
that are given numbers other than the main C-Kermit version number, e.g.
115 for Kermit 95 1.1.5; otherwise 0 (for UNIX, VMS, etc).
\v(_line) = The current line number from the current command file,
if any; 1-based. If no command file is active, then 0.
Dialing-related (edit 192):
\v(d$ac) = SET DIAL AREA-CODE value.
\v(d$cc) = DIAL COUNTRY-CODE value.
\v(d$lp) = DIAL LD-PREFIX value.
\v(d$ip) = DIAL INTL-PREFIX value.
7.3. New \f() Functions
In edit 192, all numeric arguments are automatically treated as expressions,
so it is no longer necessary to enclose expressions in numeric function
argument fields within calls to \feval(). For example:
Pre-192: echo \findex(x,abcxyz,\feval(1+1))
192: echo \findex(x,abcxyz,1+1)
Functions affected include:
\fchar()
\findex()
\flpad()
\fmax()
\fmin()
\fmod()
\frepeat()
\fright()
\frindex()
\frpad()
\fsubstring()
\fverify()
Of course the old way still works too.
In edit 192, function argument processing was corrected to allow grouping
with braces, so that commas or parentheses can be included as part of a
function argument. Examples:
Value.....
Old New
\flength(abc) 3 3
\flength({abc}) 5 3
\flength(a{b}c) 5 3
\flength({{abc}}) 7 5
\flength(a,b,c) 1 1
\flength({a,b,c}) 2 5
\flength(a{,}b{,}c) 9 5
Note that only outermost braces are stripped, and inner ones are kept, so
whenever you need to include braces themselves, just double them up.
Note that \fliteral is an exception -- whatever goes in the parentheses is
returned literally.
\Fbreak(s,c)
Returns the left substring of the string s up until the first occurrence
of the character c, like the Snobol BREAK function. If the character c
does not occur in the string s, or is omitted, the entire string s is
returned. If the second argument contains more than one character, only
the first character is used.
\Fcapitalize(s)
Returns the string s with its initial letter uppercased and all subsequent
letters lowercased. Synonym: \Fcaps().
\Fdate(filename) returns the modification (or creation) date of the given
file in "yyyymmdd hh:mm:ss" format, or else the empty string upon failure.
As of edit 190, available in UNIX, VMS, and OS/2 versions.
\Fhexify(s)
Returns the hexadecimal representation of the argument string s.
\Fipaddr(s,n)
Finds and returns the first IP address in string s starting at position n
(= 1 by default). IP address must be four decimal numeric fields of 1-3
digits each, separated by periods. No range checking is done (i.e. for 255
or less). Use with \v(input) to parse IP addresses given, e.g., during
SLIP or PPP setup. Edit 192.
\Fltrim(s1[,s2])
"Left trim". Returns the string that is obtained by removing all characters
from the left of string s1 that are also in string s2, stopping with the
first character that is not in s2. If s2 is omitted, space and tab
("whitespace") are removed. Also see \Ftrim().
\Fmodulus(n1,n2)
Returns the remainder obtained after dividing n1 by n2. Equivalent to
\Feval(n1%n2).
\Freplace(s1,s2,s3). This function replaces all occurrences of the string s2
in the string s1 by the string s3. s1 and s2 must be at least one character
long. s3 can be omitted, in which case all occurrences of s2 are removed
from s1. If s2 is omitted, s1 is returned unchanged. Examples:
\freplace(oofa,o,O) = OOfa
\freplace(oofa,o,oo) = oooofa
\freplace(oofa,o) = fa
\freplace(oofa) = oofa
or (more practically for DOS, Windows, and OS/2):
\freplace(\v(cmdfile),\\,/) ; replace backslashes by forward slashes
\Frindex(s1,s2,n) - Right index. Searches for string s1 in string s2 starting
from the right. If the optional number n is included, the rightmost n
characters of s2 are ignored. Returns the index (position) of the rightmost
occurrence of string s2 in s1 (ignoring the rightmost n characters of s2).
\Fsize(filename) tells the size, in characters (bytes), of the given file.
\Fspan(s1,s2)
Returns the left substring of s1 that contains only characters from s2,
like the Snobol SPAN function.
\Ftod2secs(hh:mm:ss)
Converts a time of day, expressed in 24-hour clock notation, to seconds
since midnight. Example: \Ftod2secs(12:01:01) gives 43261.
Note: \ftod2secs(\v(time)) should be equal to \v(ntime).
\Ftrim(s1[,s2])
Returns the string that is obtained by removing all characters from the
right of s1 that are also in s2, stopping with the first character that
is not in s2. If s2 is omitted, space and tab ("whitespace") are removed.
Also see \Fltrim().
\Funhexify(string)
Converts a hexadecimal string to its normal representation. If the string
contains any non-hex characters (i.e. other than 0-9, a-f or A-F), or has
an odd length, the empty string is returned.
\Fverify(s1,s2,n) returns the index (position) of the first character in s2
that is not also in s1. If n is given, we only look at s2 beginning at
position n. Use for preverifying hex numbers, phone numbers, etc.
7.4. INPUT and OUTPUT Command Improvements
(Also see section 7.5, the MINPUT command.)
(Also see section 7.6, "wait until given time of day" feature.)
As of edit 192, in the Windows and OS/2 versions -- i.e. the version with
terminal emulators -- INPUT material is also passed through the terminal
emulator. Thus, even though Kermit is not in CONNECT mode, the virtual
screen is being updated correctly, and, perhaps more important, the terminal
emulator automatically responds to queries -- such as "What Are You?" and
"What Is Your Screen Size?" -- from the host. Thus it is no longer necessary
(or advisable :-) for script programs to look for query escape sequences and
send their own responses.
As of edit 190, the INPUT and OUPUT commands are buffered, which results
in greater speed of execution.
In edit 192, a new variable, \v(instatus) was added to hold the result of
the most recent INPUT command. So now, for example, it is possible to tell
whether an INPUT failed because it timed out or because the user interrupted
it by pressing a key. See section 7.2, New \v() Variables.
The new command:
SET INPUT BUFFER-LENGTH <number>
Lets you specify the size of the INPUT buffer, in bytes. Previously it was
a fixed size of 256 bytes. Normally this presents no particular problem,
since the INPUT and REINPUT commands handle wraparound and so forth just fine.
However, it prevents the REINPUT command from working when the search target
was more than 256 bytes "behind" the "front end" of the buffer. In cases like
this, you can SET INPUT BUFFER-LENGTH to be any size you want, within reason.
The new command:
SET OUTPUT PACING <number>
causes C-Kermit to pause for (at least) the indicated number of milliseconds
(thousandths of a second) between each character in the OUTPUT string. Use
this option when OUTPUT'ing characters to a device that can't receive
characters at the full communication speed without losing or garbling them.
The default OUTPUT PACING is 0, i.e. no pauses. Display with SHOW SCRIPTS.
Edit 189.
The OUTPUT command accepts three special notations for sending special signals
or characters:
\B or \b
Send a BREAK signal. On serial connections, this is a 250 millisecond
spacing condition. On network connections, it is a network-specific
BREAK protocol message, such as a TELNET BREAK.
\L or \l
Send a Long BREAK signal. On serial connections, this is a 1.5-second
spacing condition. On network connections, it is the same as \B (BREAK).
\N or \n
Send a NUL (ASCII 0) character. \0 can't be used for this because it is
the terminator for C-language strings. (\N is new to edit 190.)
If you need to send \B, \L, or \N literally (e.g. to configure certain kinds
of modems), you can use either:
OUTPUT \fliteral(\B) (or \fliteral(\L) or \fliteral(\N))
or:
OUTPUT \\B (or \\L or \\N)
Note: \fliteral() can be abbreviated, e.g. \flit(\N).
Or, you can SET COMMAND QUOTING OFF. NOTE: None of this worked quite right
prior to version 6.0.192.
7.5. The MINPUT Command
The MINPUT command ("multiple input"), added in version 5A(190), is a
variation on the INPUT command that looks for more than one string at a time.
Syntax:
MINPUT <sec> [ string1 [ string2 [ string2 [ ... ] ] ] ]
Strings are separated by spaces. If any of the search strings is encountered
within the timeout interval, the command succeeds and the \v(minput) variable
is set to the number of the string that was found: 1, 2, 3, etc. If none of
the search strings is found, the command times out, fails, and \v(minput) is
set to 0. All SET INPUT paramaters apply - SET INPUT CASE, etc. Example:
minput 30 Login: Username: Ready
if success goto LBL\v(minput)
end 1 Prompt didn't arrive.
looks for any of the three strings "Login:", "Username:", or "Ready" and
then goes to one of the labels "LBL1", "LBL2", or "LBL3", depending on which
string was matched.
To include a space in a string, enclose it in { braces }.
minput 20 {a b} c
This searches for either "a b" or "c".
As in the regular INPUT and REINPUT commands, leading and trailing spaces are
stripped from each search string unless it is enclosed in { braces }.
Example:
minput 20 { abc }, {{ def }}, ghi
searches for " abc ", "{ def }", or "ghi".
7.6. Other New or Improved Script Programming Commands
UNDEFINE <variable-or-macro-name>
Undefines the named variable or macro (edit 192). This is the same as
giving a DEFINE or ASSIGN command for it without a definition.
SET ALARM / IF ALARM / SHOW ALARM (edit 192)
These work as in MS-DOS Kermit and were added for compatibility. "SET
ALARM n" starts an n-second timer. "SET ALARM 22:30:00" sets a timer for
the indicated time. IF ALARM succeeds if the timer has expired, fails if
there is still some time left on the timer. SHOW ALARM shows the data/time
at which the timer expires. SET ALARM by itself (no "n" or "hh:mm:ss")
clears any pending alarm. Alarms cannot be nested.
SET TEMP-DIRECTORY [ <directory-name> ]
Lets you override the value of the \v(tmpdir) variable, which can be used
in scripts in a system-independent fashion to indicate the place for
creating temporary files.
EVALUATE <arithmetic-expression>
The new EVALUATE command evaluates arithmetic expressions for you, printing
the answer. It is exactly like the \feval() function described in the book,
but for interactive use: you can type the expression directly, and the
answer is printed, e.g.:
C-Kermit> evaluate 1+1
2
C-Kermit> eval 6!
720
C-Kermit> def \%a (7 + 8)
C-Kermit> ev (1 + 2) * (\%a - 3)
36
For convenience in typing, the EVALUATE command accepts some special
notation for the number base. If a number ends in "h" or "x", it is treated
as hexadecimal. If it ends in "o" or "q", it is treated as octal. If it
ends in "t", it is treated as binary, e.g.:
C-Kermit> eval ffh & 0101t
5
Of course you could also use "eval \xff & 5" (C-Kermit presently does not
have backslash notation for binary numbers). Note: This same special
notation can also be used in the \fevaluate() function:
C-Kermit> echo \feval(ffh & 0101t)
5
FORWARD <label>
Like GOTO, except the label search begins at the current position in
the macro or command file, rather than at the beginning. It will not find
labels that have already been passed. The major use for a command like
this would be to improve the performance of script programs that contain
a lot of forward GOTOs, especially when that program is a command file that
will be executed from a diskette. This is obviously not good programming
practice -- since such programs can easily break of blocks of code are
moved around -- but then neither are GOTOs themselves. If the FORWARD
label search fails in the current macro or TAKE file, the search continues
in the forward direction only in superior macros macros and TAKE files.
NOTE: The FORWARD command has been used extensively in the CKERMIT.INI
file for C-Kermit 5A(190), resulting in a dramatic decrease in startup
time.
GETC <variable-name> [ <prompt-string> ]
The new GETC command (edit 190) lets a script program prompt the user to
type a single character. Example:
GETC \%a Press any key to continue:
The character is stored in the given variable.
WRITE-LINE <file> <text>
This is exactly like the WRITE command, which is used to send text to the
specified file or log. The difference is that WRITE-LINE always formats the
output text as a line, or record, appropriate to the underlying operating
system's file format. This allows Kermit script programs to create text
files in a system-independent fashion. Synonym: WRITELN. WR, WRI, and WRIT
are still accepted as abbrevitions for WRITE. Also see the \v(newline)
variable. Edit 190.
RENAME <oldfilename> <newfilename>
In the UNIX, Windows, and OS/2 versions, the second argument (normally the
new name for the file) is allowed to be a directory name (or, in OS/2, a
device and directory name), in which case the file is moved to the given
(device and) directory, keeping its original name. Edit 190.
RETURN and END
These commands may now be given, with the expected results, from
within the command-lists of FOR, WHILE, or XIF commands. Edit 190.
ASK and ASKQ
These commands now allow question mark and backslash to be entered just like
any other text character. Prior to edit 190, question mark would make a
help message pop up, and backslash would fulfill its normal function of
introducting a variable or quoting a special character. However, these
commands are unlikely ever to be used by somebody who will reply to a
question with a Kermit variable name and expect it to be evaluated. Nor
should they be expected to "quote" question marks. This change makes for
smoother dialogs between Kermit scripts and users, and it also allows users
to type DOS-like filenames such as C:\TEMP\OOFA.TXT, which could not
otherwise be entered except by doubling each backslash. However, script
writers should note that the mere fact that a DOS path name can be entered
into a variable via:
ask \%f { Please type the DOS path name: }
Please type the DOS path name: c:\123\files\widgets.wks
does not mean that the resulting variable can be used bare and unprotected.
For example:
send foo.bar \%f
will not do what you think, because the SEND command will evaluate \%f "too
much" (in this case "\123" becomes becomes "{", i.e. ASCII character number
123, and \files looks like the beginning of a Kermit function, and results
in a syntax error). The needed protection comes from \fcontents():
send foo.bar \fcontents(\%f)
which evaluates to the variable's definition ("contents") but does not
evaluate it any further.
READ, ASK, ASKQ, and GETC
Modified in edit 192 to allow macro names to be used as the target
of the definition, whereas previously only \%x or \&x[] variables could
be used.
There is also a new command in edit 190 to turn the backslash and question-
mark features on and off for any commands at all:
SET COMMAND QUOTING { ON, OFF }
When ON (which is the default), backslash and question mark fulfill their
normal roles in C-Kermit commands. When OFF, backslash and question mark
are treated just like any other ordinary text characters by the command
reader.
You can display the current command quoting setting with:
SHOW COMMAND (synonym: SHOW CMD)
Before this feature was added to C-Kermit, users C-Kermit for UNIX, VMS, etc,
had to do something like this when referring to DOS files (because DOS uses
backslash as a directory separator and question mark as a wildcard character):
send foo.bar c:\\foo\\bar\\baz\\oofa.txt
get d:\\files\\\?\?\?.\?
Now it is possible to allow natural DOS notation:
set command quoting off
send foo.bar c:\foo\bar\baz\oofa.txt
get d:\files\???.?
set command quoting on
This feature is also handy on computers that have DOS-like files systems,
such as PCs with OS/2 or Windows 95:
set command quoting off
cd \
set port \\server\modem
directory e:\pictures\pic???.gif
set command quoting on
rather than:
cd \\
set port \\\\server\\modem
directory e:\\pictures\\pic\?\?\?.gif
set command quoting on
Caution: Expect unpleasant results if you try to run script programs with
COMMAND QUOTING OFF.
FOR loops, as of edit 192, evaluate their loop variables only at loop
entry, not each time through the loop. Also in edit 192, \v(argc) can
be used as a FOR-loop variable.
7.7. Arrays
Edit 192: Relaxed syntax on array references to allow spaces in them, as in
\&a[ 3 ] or \&a[ \feval( 1 + 1 ) ], as long as the context in which the array
reference appears is not constrained to a "single word" (but this can often,
though not always, be circumvented with { braces } ).
Also, \feval() is now implied around all array subscripts, so \&a[1+1]
evaluates automatically to \&a[2], so you no longer have to write
\&a[\feval(1+1)].
7.8. Arithmetic
There are many places where only a number is valid, including certain fields
of certain commands and numeric arguments to functions. In these places, it
is now permissible to put an arithmetic expression; e.g.:
\fmod(3+4,5-2)
rather than:
\fmod(\feval(3+4),\feval(5-2))
(of course variables can be used in place of the numbers). Similarly:
\fsubstring(\%s,\%a+1,\%b-1)
SET RETRY \%a+5
SET RECEIVE PACKET-LENGTH \v(packetlen)+1000
IF > \v(ntime)+60 (\%a-1)*3600 ...
FOR \%i \%n-1 \%m/2 -1 { ... }
And in some cases also implicitly:
DEFINE \%a \%b+1
INCREMENT \%a
In general there can be no imbedded spaces in the expression, but in some
cases you can use braces to get around this.
7.9. New Block Structure for Commands
A macro definition is a single Kermit command, and so, like all other
commands, it must be given on one line. The general form of a macro
definition is:
DEFINE name command, command, command, ...
in which comma separates the commands that compose the macro, e.g.:
DEFINE OOFA echo \%1, echo \%2, echo \%3
The definition can also be enclosed in curly braces, as discussed on page
218 of "Using C-Kermit":
DEFINE name { command, command, command, ... }
This doesn't change how the macro works at all.
It is often desirable to have macro definitions that don't fit on one line.
Thic can be done with the continuation character ("-"):
DEFINE OOFA -
echo \%1,-
echo \%2,-
echo \%3
Note that trailing comments can be put on continued lines, as long as the
comment comes AFTER the dash:
DEFINE OOFA - ; comment
echo \%1,- ; comment
echo \%2,-
echo \%3 ; comment
But this is ugly and also tends to result in errors that are hard to track
down when commas or dashes or omitted accidentally.
Beginning in version 6.0.192, there is an alternative syntax that is more
pleasant to look at and also more familiar to C programmers. The rules are
simple:
. If a line (not counting any trailing comment) ENDS with an opening
curly brace ("{"), this begins a "block".
. If a line (not counting any trailing comment) BEGINS with a closing
curly brace ("}"), this ends a block.
In a block, lines are significant. At the end of a line, Kermit supplies
a comma. Example:
DEFINE OOFA { ; optional comment
echo \%1 ; optional comment
echo \%2 ; optional comment
echo \%3 ; optional comment
} ; optional comment
becomes:
DEFINE OOFA { echo \%1, echo \%2, echo \%3 }
The same syntax may be used with FOR, WHILE, and XIF constructions:
FOR \%i 1 \%n-1 1 {
echo \%i
if = \%i \%a break
}
xif = \%i 999 {
echo \%i is 999
define flag TRUE
} else {
echo \%i is not 999
define flag FALSE
}
Blocks may be nested to any reasonable level. Example:
for \%i 1 \%n-1 1 {
for \%j \%i+1 \%n {
xif \&a[\%j] < \&a[\%i] {
asg \%t \&a[i]
asg \&a[i] \&a[j]
asg \&a[j] \%t
}
}
}
The old notation still works, and in fact the two can be mixed and matched
in almost any conceivable way.
Another benefit of block construction is that a block can contain blank
lines as well as full-line comments without affecting the block structure:
define OOFA {
; This is a macro that prints its first three arguments
echo \%1
echo \%2
echo \%3
}
Block structured notation is not recommended for commands other than DEFINE,
ASSIGN, FOR, SWITCH, WHILE, and XIF, but if you know what you are doing, you
can still use it. Just remember what it does: it inserts a comma after every
line but the first. So:
echo {
foo
bar
baz
}
results in "echo { foo, bar, baz,}", which prints " foo, bar, baz,"
You can, by the way, also experiment with block structure at the
C-Kermit> prompt, but it is not guaranteed to work exactly the same way.
C-Kermit>define oofa {
echo \%1
echo \%2
echo \%3
}
C-Kermit>oofa one two three
one
two
three
C-Kermit>
7.10. Local variables
Beginning in edit 192, macros can have local ("automatic") variables. First,
there is the argument vector array, \&_[], which contains copies of the
arguments that the macro was called with. This makes it possible for the
first time for a macro to loop through its arguments:
for \%i 0 \v(argc)-1 1 { echo \%i. \&_[\%i] }
Secondly, any variable declared LOCAL in a macro, or within a block (see
section 7.9) is local to that macro or block, and is inherited by those
"beneath" it. The command for declaring local variables is:
LOCAL name [ name [ name [ name [ name ... ] ] ] ]
If given inside a macro definition, makes the named variables local, meaning
that they hide the values of any global variables of the same name until the
macro exits, at which time the higher-level variables are restored. The types
of variables that can be used as local variables are \%a..\%z and macros
(either macros to be executed, or macro names used as long variable names).
Nesting works to any level. Example:
define \%a TOP-LEVEL value ; Global (top-level) value for \%a
define XX {
local \%a ; Declare a local variable with the same name
define \%a XX value ; Give it a different value
echo \%a ; Display the value
yy ; Execute another macro that changes it
echo \%a ; See if it's the same
}
define YY { ; Second-level macro
local \%a ; It has a local copy of \%a too
define \%a YY value ; Give it a unique value
echo \%a ; Display it
}
echo \%a ; Display top-level \%a
xx ; Do the xx macro (which does the yy macro)
echo \%a ; See if it changed
You can also use array *elements* as local variables, but not entire arrays.
(No automatic arrays.)
Scope: If macro A invokes macro B, macro B inherits macro A's local variables;
it can read them and change them, or (of course) it can declare its own local
variables with the same names, which hide those of macro A.
Hints: Don't put LOCAL commands in loops -- you should only execute them once
in each macro. Don't declare \%0..\%9 as LOCAL unless you really mean to wipe
out the parameters that were passed to the macro.
7.11. More Uses for "Long Variable Names"
Prior to edit 192, although you could DEFINE or ASSIGN a macro and use the
macro definition as a long variable name:
define Oofa This is the value of Oofa
echo \m(Oofa)
you could not assign values to long variable names using other methods
like READ, GETC, INCREMENT, or DECREMENT. This is now possible:
ASSIGN NUMBER 1
INCREMENT NUMBER
READ FOO
ECHO \m(number) \m(foo)
etc.
7.12. hh:mm:ss Time Notation in Selected Commands
PAUSE [ { seconds, time-of-day } ]
SLEEP [ { seconds, time-of-day } ]
WAIT [ { seconds, time-of-day } ] [ <modem-signals> ]
INPUT [ { seconds, time-of-day } ] [ <text> ]
MINPUT, REINPUT, SET ALARM ...
As of edit 192, these commands accept not only a number of seconds, but also
a time of day expressed as hh:mm:ss in 24-hour clock notation, as the time to
PAUSE/WAIT/SLEEP until, or the time for INPUT or MINPUT to wait for the
requested text, or the alarm time. If the time is in the past, this is taken
to mean the given time on the next day.
Using hh:mm:ss notation in these commands, you can schedule events for a
specific time in the future. Note that in general, however, this feature
only works adequately on computers that have 32-bit integers (or greater).
"hh:mm:ss" notation is converted internally to seconds since midnight; there
are 86400 seconds in a day and a 16-bit word can't hold that many.
If you also need to indicate a specific time on a specific date, you can
use C-Kermit's arithmetic functions and its \ftod2secs() function. For
example, to sleep until 11:15:00pm, two days from today, do:
sleep 86400-\v(ntime)+2*86400+\ftod2secs(23:15:00)
where:
86400-\v(ntime) = seconds left in today (see \v(ntime) description)
2*86400 = seconds in the next two full days
\ftod2secs(23:15:00) = seconds from 00:00:00 to 23:15:00 on the last day
(Remember that when writing expressions in place of numbers, no spaces are
allowed -- see section 7.8.)
Here's another hint. Suppose you want to specify a certain time, but you
do NOT want Kermit to cross midnight -- i.e. if the time is in the past, then
it should be treated as zero. Do this:
if < \v(ntime) \ftod2secs(12:30:01) pause 12:30:01
7.13. The SWITCH Command
Added in edit 192, the SWITCH command lets you execute selected groups of
commands based on the value of a variable, similar to the switch() statement
in the C language. The syntax is:
SWITCH variable-name { case-list }
The variable name must be the type that starts with a backslash, e.g.
\%a, \%1, \&a[1], \m(foo), \v(day), and so on.
The case-list is a series of C-Kermit commands and labels. The SWITCH
command searches for a label that matches the value of the variable, and
if it is found, executes all the statements after the label up to the
first BREAK command, or the end of the case-list, whichever comes first.
You may include a DEFAULT label for statements to be executed when no labels
match the variable's value.
If you leave the BREAK command off the end of a case, Kermit "falls through"
to the next case (as in case 2 in the example below).
Here's an example, in which we print the name of the current day of the week
in German (also using the new commaless, dashless syntax).
switch \v(nday) {
:0, echo Sonntag, break
:1, echo Montag, break
:2, echo Dienstag und zunaechst kommt...
:3, echo Mittwoch, break
:4, echo Donnerstag, break
:5, echo Freitag, break
:6, echo Samstag, break
:default, echo Invalid day - \v(nday)!
}
Notes: Switch statments may be nested. There should be no statements above
the first label -- if there are, they will not be executed. The DEFAULT label
should be last. Alphabetic case when matching the variable contents is
observed or ignored according to your INPUT CASE setting (SHOW SCRIPTS).
Switch labels need not be single characters; they can be strings of any length
up to about 50, but they must be constants, not variables -- that is, they
are interpreted literally.
More notes: SWITCH is implemented internally as a macro. Thus commas within
the case list delimit commands (and labels). So be careful about using commas
for other purposes, as in ECHO command:
:default, echo Sorry, Invalid day - \v(nday)!
This will cause Kermit to complain about an invalid command called "Invalid".
Instead use:
:default, echo {Sorry, Invalid day - \v(nday)!}
(8) USING OTHER FILE TRANSFER PROTOCOLS
8.0. Internal XYZMODEM Protocols
In Kermit 95 and OS/2 only (for other versions see section 8.3):
SET PROTOCOL { KERMIT, XMODEM, YMODEM, YMODEM-G, ZMODEM } [ <remote-commands> ]
Choose the protocol you want to use. SEND, RECEIVE, MSEND, MOVE, MMOVE,
etc, use the specified protocol. Protocol-related SET commands apply as
much as possible to the specified protocol, including FILE TYPE, FILE
NAMES, WINDOW SIZE, RECEIVE PACKET-LENGTH, etc. Also see section 4.0.
The <remote-commands>, if given, are transmitted by C-Kermit prior to starting
an upload (SEND) operation. This saves you the trouble of typing the command
yourself prior to escaping back to the Kermit prompt. The first command is to
be sent when uploading in binary mode; the second one is to be sent when
uploading in text mode. If the command contains any spaces, it must be
enclosed in braces. Examples:
SET PROTOCOL KERMIT {kermit -ir} {kermit -r}
SET PROTOCOL ZMODEM rz rz
If you give a SET PROTOCOL <name> command without specifying a command
after the name, the current command for that protocol remains undisturbed:
SET PROTOCOL KERMIT {kermit -ir} {kermit -r}
SET PROTOCOL ZMODEM rz rz
SET PROTOCOL KERMIT
The Kermit upload commands are still "kermit -ir" and "kermit -r". This
allows you to switch easily among protocols without having to respecify the
upload command.
If you want to remove the upload command for a particular protocol, so that no
command at all is sent automatically prior to uploading, use an empty pair of
braces to denote the null string:
SET PROTOCOL KERMIT {} {}
The defaults are as follows:
Binary Text
Protocol Command Command Remarks
KERMIT kermit -ir kermit -r Depends on other Kermit program
ZMODEM rz rz Add -r for recovery
YMODEM rb rb
XMODEM rx %s rx %s
%s stands for the filename, which is filled in automatically by C-Kermit.
8.1. The REDIRECT Command
Syntax: REDIRECT command [ arguments... ]
Synonym: <command [ arguments... ]
Edit 190. This command, which is implemented only in operating systems that
provide the underlying mechanisms (primarily, certain versions of UNIX, and
partially in OS/2), allows you to run another program from the C-Kermit
prompt, and have its standard input and output redirected to the SET LINE or
SET HOST connection.
It is useful for running "external protocols" over the C-Kermit connection
when you have made a connection to a computer or service that does not support
the Kermit protocol. REDIRECT works only with software that uses standard
input and output. Here's an example showing how to transfer a file with a
pre-1989 version of UNIX Zmodem that allowed its standard input and output to
be redirected:
C-Kermit>connect ; Connect to remote computer
$
$ rz ; Start Zmodem receive process on remote computer
rz ready. To begin transfer, type "sz file ..." to your modem program
(Escape back to C-Kermit)
C-Kermit>redirect sz oofa.zip ; C-Kermit runs sz with stdio redirected
24575 ZMODEM CRC-32 ... ; File is transferred with Zmodem
C-Kermit> ; Prompt returns
Note, the REDIRECT command in the above example could also have been entered
like this, using the "<" synonym:
C-Kermit><sz oofa.txt
NOTE: A complete set of X/Y/Zmodem access macros for UNIX C-Kermit is provided
in the ckurzsz.ini file; please read the comments in this file for further
details.
Another use for the REDIRECT command is with the UNIX "term" program; see the
ckuker.bwr file for details.
You can use C-Kermit's CHECK REDIRECT command to find out if your version of
C-Kermit has the REDIRECT command. If the REDIRECT command is present, it
still might not work, if:
. The underlying operating system lacks certain facilities, in which case
C-Kermit will respond with "?Missing pieces".
. The process to be redirected does not allow redirection, such as recent
releases of sz and rz.
. In OS/2 C-Kermit, the REDIRECT command only works for serial, not network,
connections.
8.2. New Macros for External Protocols
New macro packages are available for running external protocols from the
C-Kermit command line (edit 190) (also see section 8.3, which for some
C-Kermit implementations makes these macros unnecessary).
ckurzsz.ini - UNIX rz/sz/rb/sb/rx/sx.
Note: X-, Y-, and ZMODEM protocols are built into the Windows and OS/2
versions.
8.3. Built-in Selection of External Protocols
In version 6.0.192, versions of C-Kermit that have REDIRECT capability now
also have built in commands to let you select and configure external file
transfer protocols. The command is:
SET PROTOCOL { KERMIT, ZMODEM, ... } s1 s2 s3 s4 s5 s6
If your version of C-Kermit has this feature, the command:
CHECK XYZMODEM
will succeed. In C-Kermit versions that have this feature, SEND, RECEIVE,
MSEND, MOVE, and similar commands will use the current protocol, even if it is
not Kermit. Certain other commands, particularly SET FILE TYPE, will affect
the current protocol too, if it supports those notions.
If the SET PROTOCOL command ends with the protocol name, the protocol is
selected with all its previous protocol-specific settings. If you include
anything after the protocol name, you have to include all six fields. They
are:
s1 Autoupload command for sending files in binary mode
s2 Autoupload command for sending files in text mode
s3 Send command for binary mode
s4 Send command for text mode
s5 Receive command for binary mode
s6 Receive command for text mode
In each of these fields, you can include %s to be substituted by a filename,
and if the field contains any spaces, you must enclose it in braces, e.g.:
set proto zmodem rz {rz -a} {sz %s} {sz -a %s} rz {rz -a}
To specify a blank field, use an empty pair of braces:
set proto zmodem {} {} {sz %s} {sz -a %s} rz {rz -a}
You don't need to (and shouldn't) put carriage returns or linefeeds on the
ends of these strings -- these are supplied automatically for you, based on
the current connection type, terminal settings, and Telnet mode.
. Sending Files...
The autoupload command is sent to the remote computer when you give a SEND (or
MOVE, or MSEND, etc) command. This spares you from having to give the command
yourself. If the other computer is at its system prompt, this command should
start the appropriate program to receive a file with the selected protocol.
If the program is already started on the remote computer, the autoupload
command should be absorbed harmlessly. In the first example above, the
autoupload command for binary Zmodem transfers is "rz", and so when you give a
SEND command to C-Kermit, it sends the "rz" command to the other computer
before it starts sending. If C-Kermit's FILE TYPE were set to TEXT, it would
send "rz -a".
NOTE: The rz, sz, and similar commands shown as examples in this document
pertain to products of Omen Technology Inc., 17505-V NW Sauvie IS Road,
Portland OR 97231 USA; Web: http://www.omen.com/, Phone: +1 (503) 621 3406.
After sending the autoupload string, if any, C-Kermit uses the binary-mode or
text-mode form of the protocol's send command to start the external protocol
on the local computer to send the file. The file's name is substituted for
the "%s", and the program's standard input/output is redirected (if the
program allows this) over C-Kermit's communications connection. To
illustrate:
set protocol zmodem {rz} {rz -a} {sz %s} {sz -a %s} rz {rz -a}
set file type binary
send oofa.zip
This results in sending the command "rz" to the other computer, which starts
the "Receive Zmodem" program, and then, since Kermit's file type is set to
binary, runs the local command "sz oofa.zip" ("oofa.zip" replaces "%s").
While the file is being transferred, the external program takes over your
screen, so the file transfer display (if any) is not Kermit's. When the
transfer is completed, the C-Kermit> prompt reappears.
. Receiving files...
This works like sending files, except the autoupload command is not used since
we are not uploading. However, if the protocol is Zmodem or Kermit and your
version of C-Kermit has the autodownload feature, AND if SET TERMINAL
AUTODOWNLOAD is ON, then when C-Kermit is in CONNECT mode and you start a
download from the remote computer, C-Kermit will automatically go into
file-receive mode using the same protocol, Kermit or Zmodem, regardless of
your protocol setting.
If you do have the autodownload feature, you can enable it and disable it
with the command:
SET TERMINAL AUTODOWNLOAD { ON, OFF }
It is ON (enabled) by default in the terminal-emulating versions (Windows 95,
Windows NT, OS/2), and OFF by default in UNIX, VMS, etc.
CAUTION: If you are using an autodownload-capable version of Kermit to connect
to another computer, and then using another autodownload-capable version of
Kermit to connect to yet another computer, and the remote(st) computer
initiates a file transfer, BOTH (or ALL) the Kermits that are in CONNECT mode
will go into RECEIVE mode at the same time. So if you are hooking multiple
Kermits up in a chain, make sure only one of them (the desired one) has
autodownload enabled, and the rest have it disabled.
CAUTION #2: Suppose an autodownload fails for some reason. C-Kermit CONNECTs
back immediately, as soon as it detects the failure. But the remote Kermit
program might not even know about the failure yet and could still be spewing
packets out onto your screen. No cause for alarm -- try typing several
Ctrl-C's in a row, or wait (perhaps a long while) for this to stop.
. Defaults ...
Each protocol has built-in defaults for s1..s6 as follows:
Protocol: Kermit Zmodem Ymodem Ymodem-g Xmodem
s1: Autoupload binary: kermit -ir rz rb rb rx %s
s2: Autoupload text: kermit -r rz -a rb -a rb -a rx %s
s3: Send binary: (n/a) sz %s sb %s sb %s sx %s
s4: Send text: (n/a) sz -a %s sb -a %s sb -a %s sx -a %s
s5: Receive binary: (n/a) rz rb rb rx %s
s6: Receive text: (n/a) rz rb rb rx %s
Note that when using XMODEM protocol, you must give the filename to both the
sender and the receiver, and only one file can be sent at a time.
Use SHOW PROTOCOL to show s1..s6 plus all the relevant settings for the
currently selected protocol.
. When Your Protocol is Kermit...
Obviously, C-Kermit does not use an external protocol for Kermit transfers, so
s3..s6 are ignored for Kermit. Note, however, the autoupload strings. These
are designed assuming that C-Kermit is on the remote end. "kermit -r" is the
normal system command to start C-Kermit in receive mode. "kermit -ir" is the
same thing, but specifies binary mode, which is normally not necessary since
the file sender usually tells the file receiver what the transfer mode is.
What happens if C-Kermit has already been started and put into receive
mode? Nothing at all -- the autoupload string is not in the form of a Kermit
packet, so Kermit ignores it -- it is absorbed harmlessly.
But what happens if C-Kermit is at its prompt, waiting for a command? Prior
to version 6.0.192, this would cause an error and the transfer would not take
place, since "kermit -r" is not a valid interactive-mode Kermit command.
However, in 6.0.192, C-Kermit now accepts this form of command at the prompt
(see section 1.7). It interprets the "kermit" command to mean that
command-line options follow, and it reads and acts upon the command-line
options, just as if a "kermit -r" (or whatever) command had been given at the
system prompt. Thus, if C-Kermit 6.0.192 is on the remote end, your
autoupload command should always work.
. External Protocols and Input/Output Redirection...
C-Kermit's built-in external protocol support works only with programs that
transfer files using "standard input" and "standard output". The standard
input and output channels are redirected by C-Kermit to be its own
connection. If C-Kermit is in remote mode, then standard i/o is used
directly.
However, not all external protocol programs work this way. Some of them
obtain explicit, non-stdio file descriptors for the purpose of file transfer,
and these cannot be redirected, and therefore these programs cannot be used as
external protocols by Kermit.
. Using External Protocols over Telnet Connections...
Even if they can be successfully redirected, protocols such XMODEM, YMODEM,
and ZMODEM are likely to fail over Telnet connections because of transparency
issues. The external protocol programs themselves are unaware that they have
been redirected over a Telnet connection, and so even if they WOULD know what
to do in this case, they don't know they are supposed to do it. If your
external protocol program has a command-line option to let you tell it to take
precautions (certain ZMODEM implementations let you "escape" certain
characters -- 0x0d and 0xff are the ones to watch out for), use it.
. Using Other Protocols
Just because C-Kermit only has keywords for Kermit, ZMODEM, YMODEM, YMODEM-g,
and XMODEM doesn't mean you can't use other protocols too. Just lie about
the protocol name. For example, if you should happen to have a CompuServe
B+ protocol program at hand, say its name is "bplus", you can use
SET PROTOCOL XMODEM (or whatever), but substitute the appropriate "bplus"
commands in the s1..s6 commands.
Restrictions ...
Built-in external protocols do not work with the ADD SEND-LIST feature.
As-Names (as in "send foo.bar oofa.txt") don't work -- the file is sent with
its orignal name.
MOVE does not delete the source-file afterwards.
SET DESTINATION does not work with external protocols.
The only Kermit setting that applies to external protocols is FILE TYPE
(text or binary), and it is up to you to pass this setting along by assigning
the appropriate commands to s1..s6. No other settings are conveyed to
external protocols, since Kermit does not know their invocation syntax.
HOWEVER... Since you DO know this, then you can easily write macros to
translate Kermit settings into command-line options (or whatever) for the
selected protocol.
(9) NEW COMMAND-LINE OPTIONS
Command-line options are commands that can be given to C-Kermit on the same
line with which you invoke it, for example:
kermit -s oofa.txt -p s
Command-line help and error messages have been improved, and the following
command-line options or new features have been added:
-a name ("as-name" for a transferred file) now allows "name" to be a device
or directory name, when used in conjunction with '-r' (RECEIVE), to specify
a device and/or directory into which all incoming files are to be stored
under the names they were sent with. If "name" is not a device or directory
name, the (first) incoming file is stored under the given name, as before.
Edit 190.
-D n, where "n" is a number, is equivalent to the interactive command SET
DELAY n, which specifies the number of seconds C-Kermit should wait before
starting to send a file in remote mode (to give the user time to escape back
and initiate the RECEIVE process at the local Kermit program). Edit 190.
-M string, "My username" (equivalent to SET LOGIN USERNAME).
-N n, where "n" is a number, is the NETBIOS adapter number to be used with
NETBIOS connections (OS/2 only).
-R advises C-Kermit that it will be used in remote mode only; that is, it
will not be used to establish a connection by dialing, SET HOST, etc. This
option is advisory only; it does not prevent local-mode operations from
taking place. When the -R option is given, the IF REMOTE-ONLY command will
succeed throughout the C-Kermit session. This allows initialization and
script files to skip dialing and service directory setup and similar
time-consuming items when they will not be used. Edit 190.
-8 sets up an 8-bit-clean connection (edit 192)
-T forces Text-mode file transfer (edit 192)
-j (network host), when used for TCP/IP connections, now accepts either
one argument or two. If two, then the second argument is interpreted as
a service name or number, for example "kermit -j oofacorp.com 1234".
-j <number> -- the number is interpreted as an open file descriptor for a
TCP/IP connection.
-j _<number> (Kermit 95 only) -- the number is interpreted as a socket handle
for an open TCP/IP Winsock connection (edit 192).
-J is like -j, but when used to make Telnet connections, it allows you to
escape back to the C-Kermit> prompt (e.g. to transfer files, change
settings, etc) as many times as you like, but when you log out from the
remote host, C-Kermit exits (unless you also included the -S (Stay) option).
Thus -J makes Kermit behave like Telnet (edit 192).
------------------------------
III. APPENDICES
APPENDIX 1: UNIX C-KERMIT
New features in UNIX C-Kermit since edit 188:
Correct handling of file date/time in POSIX, 4.4BSD, BSDI, etc
CONNECT-mode speedups, important when C-Kermit is "in the middle".
Incoming TCP/IP connections.
Autodownload.
Interfork-signaling in CONNECT module bulletproofed.
POSIX signal handling is now supported, for reliable signals.
APC support during CONNECT sessions.
New makefile entries and/or systems supported:
Amdahl UTS + TCP/IP
Bull DPX/2 BOS/X
CONSENSYS System V R4 + TCP + curses
DECstation 5000 MIPS3 CPU
FreeBSD
HP-UX: many variations, big improvements in functionality
Lynx
NetBSD
OSF/1 2.0
QNX 4.2
Solaris 2.x
UnixWare 1.1 + curses + TCP/IP
System-wide initialization file is now an option.
TELNET window (i.e. screen) size negotiation, SIGWINCH trapping.
RTS/CTS flow control added for Linux, NetBSD, FreeBSD, OSF/1, SCO ODT 3.0,..
Support for higher serial speeds added for Linux, HP-UX, QNX, etc.
FIONREAD and select() support added for Linux.
(Optional) FSSTND (File System Standard) compliance for Linux.
APPENDIX 2: VMS C-KERMIT
New features in VMS C-Kermit since edit 188:
Autodownload.
APC support during CONNECT sessions.
Incoming TCP/IP connections.
New support for CMU/Tektronix TCP/IP.
Problems running from DCL procedures, SPAWN'd, in batch, etc - fixed.
Append-to-file operations now available.
SET SPEED problems fixed.
Higher serial speeds now supported (38400, 57600)
Console terminal flow-control fixed.
Automatic compensation for systems SYSGEN'd with small MAXBUFs, etc.
GNU CC compatibility.
TRANSMIT command fixed to handle VMS-specific file types sensibly.
Session-log record format fixed.
TELNET window (i.e. screen) size negotiation.
Completion codes for RUN, SPAWN, !, @, DIR, etc, fixed.
Autodownload.
APPENDIX 3: OS/2 C-KERMIT
(Removed, see separate .UPD or .INF file.)
APPENDIX 4: MACINTOSH KERMIT
New features in Mac Kermit:
Communications Tool Box support.
Now works with System 7.1 and later on Power Macs, etc:
downloads files without crashing.
Many commands fixed or added that never worked before:
CD, PWD, DIRECTORY
OPEN READ / READ / CLOSE READ
LOG { SESSION, TRANSACTION, PACKETS }
Log files and other text files now in TeachText format
LOG DEBUG goes to a window.
SET FILE TYPE { TEXT, BINARY, MACBINARY }
File transfer display improved:
Direction and mode shown correctly when transfer started from prompt.
Current directory is shown.
Numerous bugs fixed.
Mac-specific modules can now be compiled with Think C as well as MPW C.
Please refer to the following files for more information:
ckmker.fon -- Notes about the new Mac Kermit terminal emulation font
ckmker.ps -- PostScript version of user documentation for 0.9(40)
ckmker.doc -- user documentation for 0.9(40), the previous release (1988)
ckmker.bwr -- Notes about the current prerelease, FAQ's, etc
APPENDIX 5: STRATUS VOS
A full C-Kermit implementation, supporting serial, TCP/IP, and X.25
connections, lacking only the fullscreen file transfer display, is included
with edit 190. VOS-specific files have the "CKL" prefix, including CKLKER.DOC
(user documentation), CKLKER.BWR (VOS-specific hints and tips), CKLINS.DOC
(VOS installation instructions).
------------------------------
IV. ERRATA & CORRIGENDA
The following errors in "Using C-Kermit" (first edition, first printing)
have been noted, most of them by Gisbert W. Selke, while translating the
book into German:
PAGE REMARKS
xviii Fridrik Skulason's name is spelled with an eth, not a d.
xx Ditto.
13-14 The list of systems supported by C-Kermit is not exhaustive.
New systems discovered since the printing date are listed in
the file CKCxxx.UPD, where xxx is the current edit number, e.g. 189.
46 The SET CARRIER description says that it doesn't take effect until the
next SET LINE command. In fact, it can have an effect at certain
other times too, such as when you issue any communication-oriented
command that changes the communication device modes. The SET CARRIER
AUTO description should say: "Requires carrier during CONNECT,
TRANSMIT, INPUT, OUTPUT, and SCRIPT commands, but not during DIAL
operations or file transfer." These fine distinctions in SET CARRIER
operation apply mainly to System-V or POSIX based UNIX C-Kermit
implementations and OS/2 C-Kermit, but (in general) not to others.
53 Table 3-2, HST-COURIER, contains extraneous typesetting information
("Courier10PitchBT-Roman"). (This probably happened because an
error-correcting protocol was not used to download the final
PostScript to the printer :-) Two new modem types, COURIER and
SPORTSTER have been added, which are the same as HST-COURIER. The
description should say "US Robotics modems".
85 The command in the final line in the example, "send olga It's
765-4321", should be underlined.
91 SET KEY CLEAR added in 5A(190), restores default key mapping.
93 The description of SET SESSION-LOG fails to mention that XON and
XOFF are removed from a text-mode session log.
101 In the HINT inset, the words SEND and RECEIVE should be exchanged.
144 In REMOTE CD [ directory ] description, the brackets should be
in italics.
145 There should be no right parenthesis in REMOTE DIRECTORY [ filespec) ].
150 "Now start C-Kermit on the VAX..." should say "Now start C-Kermit on
the UNIX system..."
164 The description of compression predates the new SET REPEAT command,
described below.
172 Table 9-2. The text fails to mention that the Chinese Roman,
Icelandic, and Japanese Roman sets are not used by C-Kermit.
All nine occurrences of accent acute (') by itself in column 6/00
should be accent grave (`). Column 7/14 for Norwegian should show
macron (overline) rather than vertical bar.
174 Table 9-4, row 03, column 13 should be O-acute, not O-grave.
178 Next-to-last paragraph: "rlogin -8", not "rsh -8".
185 C-Kermit>set unknown-char-set (not "sent unknown-char-set").
189 The description of JIS X 0201 says that it differs from a
Latin Alphabet in that the right half has some empty positions.
Some Latin Alphabets (e.g. Latin/Hebrew) also have empty positions.
195 Second example: "type diab.asc" instead of "type diab.lat".
197 6th line from bottom: MSCUSTOM.INI, not MSKERMIT.INI.
203 Examples should say XM (XMIT) rather than XF (XFER).
215 Example should say "duplex" rather than "duplux".
226 \m() variables are really not like \%a-style global variables,
in that the do not get recursively evaluated -- on the literal
definition is returned.
239 Line 3: "secret" should be "oofa".
Middle paragraph, material beginning "In these commands, literal
strings to be compared must not contain any spaces..." As of version
5A(190), this is no longer true. Multiple words can be grouped
together within braces, e.g. "if equal \%a {here are four words} ..."
242 First line should have no comma at the end.
246 Description of label syntax should state that in a macro definition,
labels are set off by commas.
249 In the syntax description of the FOR command, the words "initial",
"final", and "increment" should be in italics, and there should be
no right angle bracket (>) following the word "increment". Also,
the description of the FOR command fails to state explicitly that
the increment can be negative for counting backwards, in which case
the completion test is that the variable becomes less than the
final value, not greater than the final value. Also, the book
does not mention that the value of the loop variable can be changed
by the commands in the loop contents, and this will affect the
execution of the loop.
250 In the wakeup-call example, the tests should be "if llt" rather than
"if not lgt".
252 Comments on the example should say "third is smaller or equal".
252 Text fails to mention that functions can not change their arguments
(i.e. arguments are passed by value).
254 \Flower() and \Fupper() functions only work correctly on 7-bit ASCII
letters.
258 Table 12-2, operator |. Example should say \%a | 4 gives value 6.
264 Table 12-3, entry "double width line" should be \27#6, not \27#4.
264 Table 12-3, entry "set scrolling region" should refer to top row,
bottom row; not to row, column.
264 Table 12-3, entry "Stops transparent printing", Kermit Notation
column, should say "\27[4i", not "\27[0i".
264 Table 12-3, entry "Starts transparent printing", Kermit Notation
column, should say "\27[5i", not "\27[0i".
264 Table 12-3, entry "VT200 ID" should say "ESC [ 62c", not "ESC [ 6c".
264 Table 12-3, entry "VT300 ID" should say "ESC [ 63c", not "ESC [ 6c".
266-267 The section File Transfer Shortcuts does not apply to file transfer
with MS-DOS Kermit 3.13 or later. The escape sequences associated
with the TERMINALR and TERMINALS macros in MS-DOS Kermit 3.12 and
earlier are now used for changing screen-writing direction during
terminal emulation, as on real DEC Hebrew VT terminals. See the
MS-DOS Kermit 3.13 update notes (KERMIT.UPD) for detailed information.
267 The description of the RETURN command says it may not be used in the
command list of a FOR, WHILE, or XIF command. As of edit 190, this
is no longer the case.
268 Carl, not Karl, Friedrich Gauss.
269 The OPEN !READ command example for VMS should use /EXCLUDE= rather
than /EXCEPT=.
272 Line 14 of example should say "if = \%n \%d", not "if = \%i \%d".
275 Comma missing after closing brace of FOR loop in CALL macro.
276 Line 13: When you give a SERIAL (not LINE), NET, or CALL command...
286 The OUTPUT command in the middle of the page should say
"\27[\?6c" rather than "\27[\?1c".
287 SET INPUT TIMEOUT QUIT in the VMSLOGIN macro should be
SET INPUT TIMEOUT PROCEED. The continuation hyphen is missing from
three lines. The VMSLOGIN macro in the distributed CKERMIT.INI file
corrects these errors.
294 The CISLOGIN macro has several mistakes. The following section:
input 5 User ID:,-
output \%2\13,-
input Password:,-
output \%3\13,-
input 20 Enter Choice!,-
Should be replaced by:
input 5 User ID:,-
output \%1\13,-
input 5 Password:,-
output \%2\13,-
input 20 CompuServe Information Service,-
299 Paragraph after "define ACCESS": "and assigned to the local temporary
variable \%9" should be removed. Towards the bottom of the page, the
example and the last two paragraphs should be adjusted to discuss the
ACCESS macro definition as it appears at the top of the page! The
\%9 variable is not used. The example "if def \%9 doaccess { \%2} \%9"
should read "if success doaccess { \%2} \v(return)". In the first line
of the last paragraph, "\%9" should be changed to "\v(return)".
315 VMS examples:
$ define compuserve $sys$system:kermit.exe sys$login:compuserve.cmd
$ define sprintnet $sys$system:kermit.exe sys$login:sprintnet.cmd
Should be:
$ compuserve :== $sys$system:kermit.exe sys$login:compuserve.cmd
$ sprintnet :== $sys$system:kermit.exe sys$login:sprintnet.cmd
323-324 The description of C-Kermit program exit status codes fails to
mention the special method used by (Open)VMS, in which these codes
are assigned to the symbol CKERMIT_STATUS (see CKVKER.BWR).
336 PRINT, PING, and similar commands work by running the corresponding
system command (PRINT, lp, lpr, etc), which must be in the user's PATH
with execute permission, otherwise an error message appears stating
"command not found" or "permission denied", etc.
346 SET KEY CLEAR added in 5A(190), restores default key mapping.
352 The syntax of SET TELNET TERMINAL-TYPE should include italicized
square brackets around "text" to indicate that the text is optional,
and that if it is omitted, the TELNET TERMINAL-TYPE reverts to the
default, usually the terminal type of your login session.
352 The entries for SET TERMINAL ANSWERBACK, ARROW-KEYS, KEYPAD-MODE, and
SCROLLBACK, etc, are missing. These are OS/2-specific commands (all of
these except those new to edits 189 and 190 -- are described in the
OS/2 Appendix on page 432). See the OS/2 updates file.
353 The entries for SET TERMINAL TYPE and WRAP are missing.
These are also OS/2-specific commands (described on page 432).
354 SET TRANSMIT PAUSE description is inaccurate. An accurate description
appears on page 204.
366 In Table II-2, "ATSO=0" should be "ATS0=1".
402-403 "define sys$input" and "define sys$output" in the examples on these
two pages should be "define /user_mode sys$input", etc. This makes
the definitions effective only for the next program invocation. In
that case the "deassign sys$input", "deassign sys$output" commands
can be removed.
403 The section "Running C-Kermit in DCL Command Procedures" fails to
describe how to use C-Kermit's exit status codes (see CKVKER.BWR).
409 The Backup date in the example at the top of the pages should not
be earlier than the Created and Revised dates. The maximum record
length is 65534, not 32767.
419 The "stepping-stone" at the beginning of the OS/2 Appendix fails
to refer readers to the CKCKER.BWR and CKOKER.BWR files, and the
OS/2 updates file CKOKER.UPD.
420 Footnote. The COMDMA driver, though discussed in the OS/2
documentation, never actually existed. The regular COM.SYS driver
is used instead.
425 The first paragraph in the Serial Communications section fails to
mention that other serial-port device names are also acceptable.
425 Bottom -- OS/2 C-Kermit now also supports VT100, VT220, and ANSI
terminal emulation.
428-432 These pages are largely obsolete as of version 5A(190). The CONNECT-
mode actions shown in Table V-1, as well as the Arrow keys (Table V-2),
Keypad keys (Table V-3), now have \Kverbs associated with them,
exactly as in MS-DOS Kermit. Additional \Kverbs are provided for
VT220 (LK201) F keys and editing keys. See the OS/2 updates file.
430 Table V-3 fails to include the Num Lock key, and the accompanying
text does not mention the fact the fact that it can be assigned
with SET KEY. See CKOKER.BWR, CKOVTK2.INI, and the OS/2 updates file
for further information.
431 Third paragraph. "F1 through F4" should be "F1 through F10".
Also, the Home key should be included in the list of keys that
control screen rollback.
432 The description of SET TERMINAL ANSWERBACK is missing.
Also, numerous new SET TERMINAL commands have been added for OS/2;
see the OS/2 updates file.
435-439 Tables V-4 through V-9 need to be augmented with VT220 sequences.
See the OS/2 updates file.
438 No explanation of "nbits". 1=8-bit characters, 2=7-bit characters.
"baud" should be "bps".
440 Table V-10. ESC W misplaced (alphabetically).
447 "SET FILENAMES" should be "SET FILE NAMES".
462 The text at the top of the page should say "ISO 8859", not "ISO 8858".
463 Table VIII-3. Same as for Table 9-2, page 172. Plus: Fr-Canadian
should be listed as Canadian-French.
486 The Cyrillic expansion for "KOI" is misspelled.
491 Reference [6]. The third Cyrillic word is misspelled.
495 Reference [48]. "Unterschiessheim" should be "Unterschleissheim".
Reference [50]. Second Cyrillic word misspelled.
... Hebrew character set tables need to be added.
Index Needs entries for:
Command-line options
Delay
Encryption
Grouping of words in commands
Commands, grouping of words in
Length, of packets
Length, of files
Prompt, how to set
Spaces, in commands
Telenet (see SprintNet)
Terminal servers, dialing out from
umask
Please send reports of other errors to the authors, as well as suggestions for
improvements, additional index entries, and any other comments.
------------------------------
END OF CKERMIT.UPD