temporarily readd docs not shipped with ckdaily
[ckermit.git] / debian / patches / 01_docs_not_shipped_with_ckdaily.patch
1 Description: Upstream changes introduced in version 301-1~b1
2  This patch has been created by dpkg-source during the package build.
3  Here's the last changelog entry, hopefully it gives details on why
4  those changes were made:
5  .
6  ckermit (301-1~b1) unstable; urgency=low
7  .
8    * New upstream release (Closes: #633156).
9    * Moved to main, ckermit is now DFSG-free!.
10    * Updated copyright, kermit is now under a BSD-like license.
11    * Being in main means we can finally enable crypto. This enables
12      us to close a 10 year old bug! (Closes: #95135).
13      + use make target linux+krb5+openssl.
14      + add ssl-dev and libkrb5-dev to Build-Depends.
15    * Removed socks support because:
16      + libsocks4 doesn't support socks5, and is orphaned.
17      + socks support causes problems with avahi.
18      + you can get the same functionality with 'tsocks kermit'.
19    * Removed all patches from debian/patches, all taken upstream.
20    * Temporarily use -O1 until segfault with -O2+krb5+iksd is fixed.
21    * debian/rules: use dh minimal rules file.
22    * Bump debhelper build depends to (>= 7.0.50~) for dh override support.
23    * Update PAM config, now just includes common-auth, common-account
24      and common-session.
25    * Propitiate lintian:
26      + remove ./ from override paths.
27      + add override unusual-interpreter #!/usr/bin/kermit.
28      + add spelling override. 'IF WRITEABLE' is a valid kermit
29        command, so we are stuck with that spelling.
30      + drop leading 'a' from Description.
31      + debian/watch: remove dh-make boilerplate.
32      + Standards-Version: 3.9.2 (no changes).
33  .
34  The person named in the Author field signed this changelog entry.
35 Author: Ian Beckwith <ianb@debian.org>
36 Bug-Debian: http://bugs.debian.org/95135
37 Bug-Debian: http://bugs.debian.org/633156
38
39 ---
40 The information above should follow the Patch Tagging Guidelines, please
41 checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
42 are templates for supplementary fields that you might want to add:
43
44 Origin: <vendor|upstream|other>, <url of original patch>
45 Bug: <url in upstream bugtracker>
46 Bug-Debian: http://bugs.debian.org/<bugnumber>
47 Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
48 Forwarded: <no|not-needed|url proving that it has been forwarded>
49 Reviewed-By: <name and email of someone who approved the patch>
50 Last-Update: <YYYY-MM-DD>
51
52 --- /dev/null
53 +++ ckermit-301/ckututor.txt
54 @@ -0,0 +1,1912 @@
55 +
56 +   [1]The Columbia Crown The Kermit Project | Columbia University
57 +   612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
58 +   ...since 1981
59 +   [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
60 +   [10]Support
61 +
62 +   C-KERMIT 9.0 UNIX MANUAL PAGE AND TUTORIAL
63 +
64 +     Frank da Cruz
65 +     [11]The Kermit Project, [12]Columbia University
66 +
67 +   [ [13]PDF version ] [ [14]Nroff version ]
68 +
69 +     This document is intended to give the beginner sufficient
70 +     information to make basic (if not advanced) use of C-Kermit 9.0.
71 +     Although it might be rather long for a Unix manual page (about 1600
72 +     lines), it's still far shorter than the [15]C-Kermit manual, which
73 +     should be consulted for advanced topics such as customization,
74 +     character-sets, scripting, etc. We also attempt to provide a clear
75 +     structural overview of C-Kermit's many capabilities, functional
76 +     areas, states, and modes and their interrelation, that should be
77 +     helpful to beginners and veterans alike, as well as to those
78 +     upgrading to the new release. Thanks to Christine Gianone for her
79 +     work on this document before she was laid off in 2005.
80 +
81 +   Most recent update: Tue Jun 28 09:02:45 2011
82 +
83 +CONTENTS
84 +
85 +     * [16]DESCRIPTION
86 +     * [17]SYNOPSIS
87 +     * [18]OPTIONS
88 +     * [19]COMMAND LANGUAGE
89 +     * [20]INITIALIZATION FILE
90 +     * [21]MODES OF OPERATION
91 +     * [22]MAKING CONNECTIONS
92 +     * [23]TRANSFERRING FILES WITH KERMIT
93 +     * [24]KERMIT CLIENT/SERVER CONNECTIONS
94 +
95 +     * [25]KERMIT'S BUILT-IN FTP AND HTTP CLIENTS
96 +     * [26]INTERNET KERMIT SERVICE
97 +     * [27]SECURITY
98 +     * [28]ALTERNATIVE COMMAND-LINE PERSONALITIES
99 +     * [29]LICENSE
100 +     * [30]OTHER TOPICS
101 +     * [31]DOCUMENTATION AND UPDATES
102 +     * [32]FILES
103 +     * [33]AUTHORS
104 +
105 +DESCRIPTION [34]Top   [35]Contents   [36]Next
106 +
107 +[37]C-Kermit is an all-purpose communications software package from the
108 +[38]Kermit Project at [39]Columbia University that:
109 +
110 +     * Is portable to many platforms, Unix and non-Unix alike.
111 +     * Can make both serial and network connections.
112 +     * Can conduct interactive terminal sessions over its connection.
113 +     * Can transfer text or binary files over the same connection.
114 +     * Can convert text-file character sets in terminal mode or file
115 +       transfer.
116 +     * Is customizable in every aspect of its operation.
117 +
118 +   C-Kermit is a modem program, a Telnet client, an Rlogin client, an FTP
119 +   client, an HTTP client, and on selected platforms, also an X.25 client.
120 +   It can make its own secure Internet connections using IETF-approved
121 +   security methods including Kerberos IV, Kerberos V, SSL/TLS, and SRP
122 +   and it can also make SSH (Secure Shell) connections through your
123 +   external SSH client application. It can be the far-end file-transfer or
124 +   client/server partner of your desktop Kermit client. It can also accept
125 +   incoming dialed and network connections. It can even be installed as an
126 +   Internet service on its own standard TCP socket, 1649 [[40]RFC2839,
127 +   [41]RFC2840].
128 +
129 +   And perhaps most important, everything you can do "by hand"
130 +   (interactively) with C-Kermit, can be "scripted" (automated) using its
131 +   built-in cross-platform transport-independent script programming
132 +   language, which happens to be identical to its interactive command
133 +   language.
134 +
135 +   This manual page offers an overview of C-Kermit 9.0 for Unix ("Unix" is
136 +   an operating system family that includes AIX, DG/UX, FreeBSD, HP-UX,
137 +   IRIX, Linux, Mac OS X, NetBSD, OpenBSD, Open Server, Open Unix, QNX,
138 +   Solaris, SunOS, System V R3, System V R4, Tru64 Unix, Unixware, Xenix,
139 +   and many others). For thorough coverage, please consult the published
140 +   C-Kermit manual and supplements (see [42]DOCUMENTATION below). For
141 +   further information about C-Kermit, Kermit software for other
142 +   platforms, and Kermit manuals, visit the Kermit Project website:
143 +
144 +  [43]http://www.columbia.edu/kermit/
145 +
146 +   This is a longer-than-average manual page, and yet it barely scratches
147 +   the surface. Don't be daunted. C-Kermit is a large and complex package,
148 +   evolving over decades of practice and experience, but that doesn't mean
149 +   it's hard to learn or use. Its most commonly used functions are
150 +   explained here with pointers to additional information elsewhere.
151 +
152 +   [44]Kermit Home [45]C-Kermit Home [46]C-Kermit FAQ
153 +
154 +SYNOPSIS [47]Top [48]Contents [49]Next [50]Previous
155 +
156 +Usage:  kermit [filename] [-x arg [-x arg]...[-yyy]..] [ {=,--,+} text ] ]
157 +Or:    kermit URL
158 +
159 +     * -x is an option requiring an argument;
160 +     * -y is an option with no argument.
161 +
162 +   If the first command-line argument is the name of a file,
163 +   interactive-mode commands are executed from the file. The '=' (or "--")
164 +   argument tells Kermit not to parse the remainder of the command line,
165 +   but to make the words following '=' available as \%1, \%2, ... \%9. The
166 +   "+" argument is like "=" but for use in "kerbang scripts" (explained
167 +   [51]below). A second command-line format allows the one and only
168 +   argument to be a [52]Telnet, FTP, HTTP, or IKSD URL.
169 +
170 +   Order of execution:
171 +
172 +    1. [53]The command file (if any).
173 +    2. [54]The initialization file, if any, unless suppressed with -Y.
174 +    3. [55]The customization file (if it is executed by the initialization
175 +       file).
176 +    4. [56]The command-line URL (if any, and if so, execution stops here).
177 +    5. [57]Command-line options (if any).
178 +    6. [58]Interactive commands.
179 +
180 +   Some command-line options can cause actions (such as -s to send a
181 +   file); others just set parameters. If any action options are included
182 +   on the command line, Kermit exits when finished unless also given the
183 +   -S ("stay") option. If no action options are given, no initialization
184 +   or command files contained an EXIT or QUIT command, and no fatal errors
185 +   occurred, Kermit issues its prompt and waits for you to type commands.
186 +
187 +     Bear in mind that C-Kermit can be built with selected features
188 +     disabled, and also that certain features are not available on all
189 +     platforms. For example, C-Kermit can't be built with TCP/IP support
190 +     on a platform that does not have TCP/IP header files and libraries
191 +     (and even if Kermit does include TCP/IP support, it can't be used to
192 +     make TCP/IP connections on a computer that does not have a TCP/IP
193 +     stack installed). If your version of C-Kermit lacks a feature
194 +     mentioned here, use its SHOW FEATURES command to see what might have
195 +     been excluded.
196 +
197 +   C-Kermit has three kinds of commands: regular single-letter
198 +   command-line options, extended-format command-line options, and
199 +   interactive commands.
200 +
201 +   [59]Kermit Home [60]C-Kermit Home [61]C-Kermit FAQ
202 +
203 +OPTIONS [62]Top [63]Contents [64]Next [65]Previous  <- (Most people should
204 +click Next to skip around this section...)
205 +
206 +Like most Unix commands, C-Kermit can be be given options on the command
207 +line. But C-Kermit also can be used interactively by giving it [66]commands
208 +composed of words, which are more intuitive than cryptic command-line
209 +options, and more flexible too. In other words, you don't have to use
210 +C-Kermit's command-line options, but they are available if you want to. (By
211 +the same token, you don't have to use its interactive commands either -- you
212 +can use either or both in any combination.)
213 +
214 +C-Kermit is generally installed in the PATH as "kermit", and therefore is
215 +invoked by typing the word "kermit" (lowercase) at the shell prompt, and then
216 +pressing the Return or Enter key. If you wish to include command-line
217 +options, put them after the word "kermit" but before pressing Return or
218 +Enter, separated by spaces, for example:
219 +
220 +  $ kermit -s ckermit.tar.gz
221 +
222 +   ('$' is the shell prompt; "kermit -s ckermit.tar.gz" is what you type,
223 +   followed by Return or Enter.)
224 +
225 +   Here is a list of C-Kermit's single-letter command-line options, which
226 +   start with a single dash (-), in ASCII ("alphabetical") order.
227 +   Alphabetic case is significant (-A is not the same as -a). The Action?
228 +   column contains Y for action options and N for non-action options.
229 +
230 +   Option Action? Description
231 +   -0 N (digit zero) 100% transparent Connect state for "in-the-middle"
232 +   operation: 8 bits, no parity, no escape character, everything passes
233 +   through.
234 +   -8 N (digit eight) Connection is 8-bit clean (this is the default in
235 +   C-Kermit 9.0). Equivalent to the EIGHTBIT command, which in turn is a
236 +   shortcut for SET TERMINAL BYTESIZE 8, SET COMMAND BYTESIZE 8, SET
237 +   PARITY NONE.
238 +   -9 arg N (digit nine) Make a connection to an FTP server. Equivalent to
239 +   the FTP OPEN command.
240 +   Argument: IP-address-or-hostname[:optional-TCP-port].
241 +   NOTE: C-Kermit also has a separate FTP command-line personality, with
242 +   regular FTP-like command-line syntax. [67]More about this below.
243 +   -A N Kermit is to be started as an Internet service (IKSD) (only from
244 +   inetd.conf).
245 +   -B N Kermit is running in Batch or Background (no controlling
246 +   terminal). To be used in case Kermit doesn't automatically sense its
247 +   background status. Equivalent to the SET BACKGROUND ON command.
248 +   -C arg N Interactive-mode Commands to be executed.
249 +   Argument: Commands separated by commas, list in doublequotes.
250 +   -D arg N Delay before starting to send in Remote mode. Equivalent to
251 +   the SET DELAY command.
252 +   Argument: Number of seconds.
253 +   -E N Exit automatically when connection closes. Equivalent to SET EXIT
254 +   ON-DISCONNECT ON.
255 +   -F arg N Use an open TCP connection.
256 +   Argument: Numeric file descriptor of open TCP connection.
257 +   Also see: -j, -J.
258 +   -G arg Y Get file(s) from server, send contents to standard output,
259 +   which normally would be piped to another process.
260 +   Argument: Remote file specification, in quotes if it contains
261 +   metacharacters.
262 +   Also see: -g, -k.
263 +   -H N Suppress program startup Herald and greeting.
264 +   -I N Tell Kermit it has a reliable connection, to force streaming to be
265 +   used where it normally would not be. Equivalent to the SET RELIABLE ON
266 +   command.
267 +   -J arg N "Be like Telnet." Like -j but implies -E.
268 +   Argument: IP hostname/address optionally followed by service.
269 +   NOTE: C-Kermit also has a separate Telnet command-line personality,
270 +   with regular Telnet-like command-line syntax. [68]More about this
271 +   below.
272 +   -L N Recursive directory descent for files in -s option.
273 +   -M arg N My user name (for use with Telnet, Rlogin, FTP, etc).
274 +   Equivalent to the SET LOGIN USER command.
275 +   Argument: Username string.
276 +   -O Y (Uppercase letter O) Be a server for One command only. Also see:
277 +   -x.
278 +   -P N Don't convert file (Path) names of transferred files. Equivalent
279 +   to SET FILE NAMES LITERAL.
280 +   -Q N Quick Kermit protocol settings. Equivalent to the FAST command.
281 +   This is the default in C-Kermit 7.0 and later.
282 +   -R N Remote-only (this just makes IF REMOTE true).
283 +   -S N Stay (enter command parser after action options).
284 +   -T N Force Text mode for file transfer; implies -V. Equivalent to SET
285 +   TRANSFER MODE MANUAL, SET FILE TYPE TEXT.
286 +   -V N Disable automatic per-file text/binary switching. Equivalent to
287 +   SET TRANSFER MODE MANUAL.
288 +   -Y N Skip (don't execute) the initialization file.
289 +   -a arg N As-name for file(s) in -s, -r, or -g.
290 +   Argument: As-name string (alternative filename). When receiving files,
291 +   this can be a directory name.
292 +   -b arg N Speed for serial device. Equivalent to SET SPEED.
293 +   Argument: Numeric Bits per second for serial connections.
294 +   -c Y Enter Connect state before transferring files.
295 +   -d N Create a debug.log file with detailed debugging information (a
296 +   second -d adds timestamps). Equivalent to LOG DEBUG but takes effect
297 +   sooner.
298 +   -e arg N Maximum length for incoming Kermit file-transfer packets.
299 +   Equivalent to SET RECEIVE PACKET-LENGTH.
300 +   Argument: Length in bytes.
301 +   -f Y Send a FINISH command to a Kermit server.
302 +   -g arg N Get file(s) from a Kermit server.
303 +   Argument: File specification on other computer, in quotes if it
304 +   contains metacharacters. Equivalent to GET.
305 +   Also see: -a, -G, -r.
306 +   -h Y Print Help text for single-letter command-line options (pipe thru
307 +   'more' to prevent scrolling).
308 +   -i N Force binary (Image) mode for file transfer; implies -V.
309 +   Equivalent to SET TRANSFER MODE MANUAL, SET FILE TYPE BINARY.
310 +   -j arg N Make a TCP/IP connection.
311 +   Argument: IP host name/address and optional service name or number.
312 +   Equivalent to the TELNET command.
313 +   Also see: -J, -F.
314 +   -k Y Receive file(s) to standard output, which normally would be piped
315 +   to another process.
316 +   Also see: -r, -G.
317 +   -l arg N (Lowercase letter L) Make a connection on the given serial
318 +   communications device. Equivalent to the SET LINE (SET PORT) command.
319 +   Argument: Serial device name, e.g. /dev/ttyS0.
320 +   -m arg N Modem type for use with the -l device. Equivalent to the SET
321 +   MODEM TYPE command.
322 +   Argument: Modem name as in SET MODEM TYPE command, e.g. "usrobotics".
323 +   -n Y Enter Connect state after transferring files (historical).
324 +   -p arg N Parity. Equivalent to the SET PARITY command.
325 +   Argument: One of the following: e(ven), o(dd), m(ark), n(one), s(pace).
326 +   -q N Quiet (suppress most messages). Equivalent to SET QUIET ON.
327 +   -r Y Receive file(s). Equivalent to the RECEIVE command.
328 +   Argument: (none, but see -a)
329 +   -s arg N Send file(s).
330 +   Argument: One or more local file specifications. Equivalent to the SEND
331 +   command.
332 +   Also see: -a.
333 +   -t N (Historical) Xon (Ctrl-Q) Turnaround character for half-duplex
334 +   connections (used on serial linemode connections to old mainframes).
335 +   Equivalent to SET DUPLEX HALF, SET HANDSHAKE XON.
336 +   -v arg N Window size for Kermit protocol (ignored when streaming).
337 +   Equivalanet to SET WINDOW-SIZE.
338 +   Argument: Number, 1 to 32.
339 +   -w N Incoming files Write over existing files. Equivalent to SET FILE
340 +   COLLISION OVERWRITE.
341 +   -x Y Enter server mode. Equivalent to the SERVER command. Also see: -O.
342 +   -y arg N Alternative initialization file.
343 +   Argument: Filename.
344 +   -z N Force foreground behavior. To be used in case Kermit doesn't
345 +   automatically sense its foreground status. Equivalent to the SET
346 +   BACKGROUND OFF command.
347 +
348 +   Extended command-line options (necessary because single-letter ones are
349 +   about used up) start with two dashes (--), with words rather than
350 +   single letters as option names. If an extended option takes an
351 +   argument, it is separated from the option word by a colon (:). Extended
352 +   options include:
353 +
354 +   Option
355 +   Description
356 +
357 +   --bannerfile:filename File to display upon startup or IKSD login.
358 +   --cdfile:filename File to be sent for display to the client when server
359 +   changes directory (filename is relative to the changed-to directory).
360 +   --cdmessage:{on,off} Enable/disable the server CD message feature.
361 +   --help Prints usage message for extended options.
362 +   --helpfile:filename Designates a file containing custom text to replace
363 +   the top-level HELP command.
364 +   --nointerrupts Disables keyboard interrupts.
365 +   --noperms Disables the Kermit protocol file Permissions attribute, to
366 +   prevent transmission of file permissions (protection) from sender to
367 +   receiver.
368 +
369 +   Plus several other [69]IKSD-Only options.
370 +
371 +   See the [70]file-transfer section for examples of command-line
372 +   invocation.
373 +
374 +  COMMAND LANGUAGE [71]Top [72]Contents [73]Next [74]Previous
375 +
376 +     * [75]Command Files, Macros, and Scripts
377 +     * [76]Command List
378 +
379 +   C-Kermit's interactive command language is the subject of a
380 +   [77]622-page book and another several hundred pages of updates, far too
381 +   much for a manual page. But it's not hard to get started. At the shell
382 +   prompt, just type "kermit" to get C-Kermit's interactive command
383 +   prompt:
384 +
385 +  $ kermit
386 +  (/current/directory) C-Kermit>
387 +
388 +   Begin by typing "help" (and then press the Return or Enter key) for a
389 +   top-level overview, read it, and go from there. Your second command
390 +   should probably be "intro" (introduction). Note the prompt shows your
391 +   current directory (unless you tell Kermit to prompt you with something
392 +   else).
393 +
394 +   Interactive commands are composed mainly of regular English words,
395 +   usually in the form of imperative sentences, such as:
396 +
397 +  send oofa.txt
398 +
399 +   which tells Kermit to send (transfer) the file whose name is oofa.txt,
400 +   or:
401 +
402 +  set transfer mode automatic
403 +
404 +   which sets Kermit's "transfer mode" to "automatic" (whatever that
405 +   means).
406 +
407 +   While typing commands, you can abbreviate, ask for help (by pressing
408 +   the "?" key anywhere in a command), complete keywords or filenames
409 +   (with the Tab or Esc key), and edit your typing with Backspace or
410 +   Delete, Ctrl-W, Ctrl-U, etc. You can also recall previous commands,
411 +   save your command history, and who knows what else. Give the INTRO
412 +   command for details.
413 +
414 +   C-Kermit has hundreds of commands, and they can be issued in infinite
415 +   variety and combinations, including commands for:
416 +
417 +     * Making connections (SET LINE, DIAL, TELNET, SSH, FTP, CONNECT, ...)
418 +     * Breaking connections (HANGUP, CLOSE)
419 +     * Transferring files (SEND, GET, RECEIVE, MOVE, RESEND, ...)
420 +     * Establishing preferences (SET)
421 +     * Displaying preferences (SHOW)
422 +     * Managing local files (CD, DELETE, MKDIR, DIRECTORY, RENAME, TYPE,
423 +       ...)
424 +     * Managing remote files (RCD, RDEL, RMKDIR, RDIR, ...)
425 +     * Using local files (FOPEN, FCLOSE, FREAD, FWRITE)
426 +     * Programming (TAKE, DEFINE, IF, FOR, WHILE, SWITCH, DECLARE, ...)
427 +     * Interacting with the user (ECHO, ASK, ...)
428 +     * Interacting with a remote computer (INPUT, OUTPUT, ...)
429 +     * Interacting with local programs (RUN, EXEC, PTY, ...)
430 +     * Logging things (LOG SESSION, LOG PACKETS, LOG DEBUG, ...)
431 +
432 +   And of course QUIT or EXIT to get out and HELP to get help, and for
433 +   programmers: loops, decision making, variables, arrays, associative
434 +   arrays, integer and floating point arithmetic, macros, built-in and
435 +   user-defined functions, string manipulation, pattern matching, block
436 +   structure, scoping, recursion, and all the rest. To get a list of all
437 +   C-Kermit's commands, type a question mark (?) at the prompt. To get a
438 +   description of any command, type HELP followed by the name of the
439 +   command, for example:
440 +
441 +  help send
442 +
443 +   The command interruption character is Ctrl-C (hold down the Ctrl key
444 +   and press the C key).
445 +
446 +   The command language "escape character", used to introduce variable
447 +   names, function invocations, and so on, is backslash (\). If you need
448 +   to include a literal backslash in a command, type two of them, e.g.:
449 +
450 +  get c:\\k95\\k95custom.ini
451 +
452 +  Command Files, Macros, and Scripts
453 +
454 +   A file containing Kermit commands is called a Kermit command file or
455 +   Kermit script. It can be executed with Kermit's TAKE command:
456 +
457 +  (/current/dir) C-Kermit> take commandfile
458 +
459 +   (where "commandfile" is the name of the command file). Please don't
460 +   pipe a command file into Kermit's standard input (which might or might
461 +   not work); if you have Kermit commands in a file, tell Kermit to TAKE
462 +   the file.
463 +
464 +   In Unix only, a Kermit command file can also be executed directly by
465 +   including a "kerbang" line as the first line of the file:
466 +
467 +  #!/usr/local/bin/kermit +
468 +
469 +   That is, a top line that starts with "#!", followed immediately by the
470 +   full path of the Kermit executable, and then, if the Kermit script is
471 +   to be given arguments on the command line, a space and a plus sign. The
472 +   script file must also have execute permission:
473 +
474 +  chmod +x commandfile
475 +
476 +   Except for the " +" part, this is exactly the same as you would do for
477 +   a shell script, a Perl script, etc. Here's a simple but useless example
478 +   script that regurgitates its arguments (up to three of them):
479 +
480 +  #!/usr/local/bin/kermit +
481 +  if defined \%1 echo "Argument 1: \%1"
482 +  if defined \%2 echo "Argument 2: \%2"
483 +  if defined \%3 echo "Argument 3: \%3"
484 +  if defined \%4 echo "etc..."
485 +  exit
486 +
487 +   If this file is stored in your current directory as "commandfile",
488 +   then:
489 +
490 +  ./commandfile one two three four five
491 +
492 +   prints:
493 +
494 +  Argument 1: one
495 +  Argument 2: two
496 +  Argument 3: three
497 +  etc...
498 +
499 +   This illustrates the basic structure of a standalone Kermit script: the
500 +   "kerbang line", then some commands. It should end with "exit" unless
501 +   you want the Kermit prompt to appear when it is finished. \%1 is the
502 +   first argument, \%2 the second, and so on.
503 +
504 +   You can also create your own commands by defining named macros composed
505 +   of other Kermit commands (or macros). Here's a simple example:
506 +
507 +  define mydial {
508 +      set modem type usrobotics
509 +      set port /dev/ttyS0
510 +      if fail end 1
511 +      set speed 57600
512 +      dial \%1
513 +      if success connect
514 +  }
515 +
516 +   This shows how you can combine many commands into one command, "mydial"
517 +   in this case (you can use any name you like, provided it does not clash
518 +   with the name of a built-in command). When this macro definition is in
519 +   effect, you can type commands like:
520 +
521 +  mydial 7654321
522 +
523 +   and it executes all the commands in macro definition, substituting the
524 +   first operand ("7654321") for the formal parameter ("\%1") in the
525 +   definition. This saves you from having to type lots of commands every
526 +   time you want to make a modem call.
527 +
528 +   One way to have the macro definition in effect is to type the
529 +   definition at the Kermit prompt. Another way is to store the definition
530 +   in a file and TAKE the file. If you want the the definition to be in
531 +   effect automatically every time you start Kermit, put the definition in
532 +   your initialization or customization file (explained [78]below).
533 +
534 +   Here's a somewhat more ambitious example:
535 +
536 +  define mydelete {
537 +      local trash
538 +      assign trash \v(home)trashcan/
539 +      if not defined \%1 end 1 "Delete what?"
540 +      if wild \%1 end 1 "Deleting multiple files is too scary"
541 +      if not exist \%1 end 1 "I can't find \%1"
542 +      if not directory \m(trash) {
543 +          mkdir \m(trash)
544 +          if fail end 1 "No trash can"
545 +      }
546 +      rename /list \%1 \m(trash)
547 +  }
548 +  define myundelete {
549 +      local trash
550 +      assign trash \v(home)trashcan/
551 +      if not defined \%1 end 1 "Undelete what?"
552 +      if wild \%1 end 1 "Undeleting multiple files is too hard"
553 +      if not directory \m(trash) end 1 "No trash can"
554 +      if not exist \m(trash)\%1 end 1 "I can't find \%1 in trash can"
555 +      rename /list \m(trash)\%1 .
556 +  }
557 +
558 +   These macros are not exactly production quality (they don't handle
559 +   filenames that include path segments, they don't handle multiple files,
560 +   etc), but you get the idea: you can pass arguments to macros, they can
561 +   check them and make other kinds of decisions, and the commands
562 +   themselves are relatively intuitive and intelligible.
563 +
564 +   If you put the above lines into your initialization or customization
565 +   file, you'll have MYDELETE and MYUNDELETE commands available every time
566 +   you start Kermit, at least as long as you don't suppress execution of
567 +   the initialization file. (Exercise for the reader: Make these macros
568 +   generally useful: remove limitations, add trashcan display, browsing,
569 +   emptying, etc.)
570 +
571 +   Kerbang scripts execute without the initialization file. This to keep
572 +   them portable and also to make them start faster. If you want to write
573 +   Kerbang scripts that depend on the initialization file, include the
574 +   command
575 +
576 +  take \v(home).kermrc
577 +
578 +   at the desired spot in the script. By the way, \v(xxx) is a built-in
579 +   variable (xxx is the variable name, "home" in this case). To see what
580 +   built-in variables are available, type "show variables" at the C-Kermit
581 +   prompt. To see what else you can show, type "show ?". \m(xxx) is a user
582 +   defined variable (strictly speaking, it is a macro used as a variable).
583 +
584 +  Command List
585 +
586 +   C-Kermit has more than 200 top-level commands, and some of these, such
587 +   as SET, branch off into hundreds of subcommands of their own, so it's
588 +   not practical to describe them all here. Instead, here's a concise list
589 +   of the most commonly used top-level commands, grouped by category. To
590 +   learn about each command, type "help" followed by the command name,
591 +   e.g. "help set". Terms such as Command state and Connect state are
592 +   explained in subsequent sections.
593 +
594 +   Optional fields are shown in [ italicized brackets ]. filename means
595 +   the name of a single file. filespec means a file specification that is
596 +   allowed to contain wildcard characters like '*' to match groups of
597 +   files. options are (optional) switches like /PAGE, /NOPAGE, /QUIET,
598 +   etc, listed in the HELP text for each command. Example:
599 +
600 +  send /recursive /larger:10000 /after:-1week /except:*.txt *
601 +
602 +   which can be read as "send all the files in this directory and all the
603 +   ones underneath it that are larger than 10000 bytes, no more than one
604 +   week old, and whose names don't end with ".txt".
605 +
606 +   Basic Commands
607 +
608 +   HELP Requests top-level help.
609 +   HELP command Requests help about the given command.
610 +   INTRODUCTION Requests a brief introduction to C-Kermit.
611 +   LICENSE Displays the C-Kermit software copyright and license.
612 +   VERSION Displays C-Kermit's version number.
613 +   EXIT [ number ] Exits from Kermit with the given status code. Synonyms:
614 +   QUIT, E, Q.
615 +   TAKE filename [ parameters... ] Executes commands from the given file.
616 +   LOG item [ filename ] Keeps a log of the given item in the given file.
617 +   [ DO ] macro [ parameters... ]    Executes commands from the given
618 +   macro.
619 +   SET parameter value Sets the given parameter to the given value.
620 +   SHOW category Shows settings in a given category.
621 +   STATUS Tells whether previous command succeeded or failed.
622 +   DATE [ date-and/or-time ] Shows current date-time or interprets given
623 +   date-time.
624 +   RUN [ extern-command [ parameters... ] Runs the given external command.
625 +   Synonym: !.
626 +   EXEC [ extern-command [ params... ] Kermit overlays itself with the
627 +   given command.
628 +   SUSPEND Stops Kermit and puts it in the background. Synonym: Z.
629 +
630 +   Local File Management
631 +
632 +   TYPE [ options ] filename Displays the contents of the given file.
633 +   MORE [ options ] filename Equivalent to TYPE /PAGE (pause after each
634 +   screenful).
635 +   CAT [ options ] filename Equivalent to TYPE /NOPAGE.
636 +   HEAD [ options ] filename Displays the first few lines of a given file.
637 +   TAIL [ options ] filename Displays the last few lines of a given file.
638 +   GREP [ options ] pattern filespec Displays lines from files that match
639 +   the pattern. Synonym: FIND.
640 +   DIRECTORY [ options ] [ filespec ] Lists files (built-in, many
641 +   options).
642 +   LS [ options ] [ filespec ] Lists files (runs external "ls" command).
643 +   DELETE [ options ] [ filespec ] Deletes files. Synonym: RM.
644 +   PURGE [ options ] [ filespec ] Removes backup (*.~n~) files.
645 +   COPY [ options ] [ filespecs... ] Copies files. Synonym: CP.
646 +   RENAME [ options ] [ filespecs... ] Renames files. Synonym: MV.
647 +   CHMOD [ options ] [ filespecs... ] Changes permissions of files.
648 +   TRANSLATE filename charsets filename ] Converts file's character set.
649 +   Synonym: XLATE.
650 +   CD Changes your working directory to your home directory.
651 +   CD directory Changes your working directory to the one given.
652 +   CDUP Changes your working directory one level up.
653 +   PWD Displays your working directory.
654 +   BACK Returns to your previous working directory.
655 +   MKDIR [ directory ] Creates a directory.
656 +   RMDIR [ directory ] Removes a directory.
657 +
658 +   Making Connections
659 +
660 +   SET LINE [ options ] devicename        Opens the named serial port.
661 +   Synonym: SET PORT.
662 +   OPEN LINE [ options ] devicename Same as SET LINE. Synonym: OPEN PORT.
663 +   SET MODEM TYPE [ name ] Tells Kermit what kind of modem is on the port.
664 +   DIAL [ number ] Tells Kermit to dial the given phone number with the
665 +   modem.
666 +   REDIAL Redials the most recently dialed phone number.
667 +   ANSWER
668 +   Waits for and answers an incoming call on the modem.
669 +   AUTHENTICATE [ parameters... ] Performs secure authentication on a
670 +   TCP/IP connection.
671 +   SET NETWORK TYPE { TCP/IP, X.25, ... } Selects network type for
672 +   subsequent SET HOST commands.
673 +   SET HOST [ options ] host [ port ] Opens a network connection to the
674 +   given host and port.
675 +   SET HOST [ options ] * port Waits for an incoming TCP/IP connection on
676 +   the given port.
677 +   TELNET [ options ] host Opens a Telnet connection to the host and
678 +   enters Connect state.
679 +   RLOGIN [ options ] host Opens an Rlogin connection to the host and
680 +   enters Connect state.
681 +   IKSD [ options ] host Opens a connection to an Internet Kermit Service.
682 +   SSH [ options ] host Opens an SSH connection to the host and enters
683 +   Connect state.
684 +   FTP OPEN host [ options ] Opens an FTP connection to the host.
685 +   HTTP [ options ] OPEN host Opens an HTTP connection to the host.
686 +   PTY external-command Runs the command on a pseudoterminal as if it were
687 +   a connection.
688 +   PIPE external-command Runs the command through a pipe as if it were a
689 +   connection.
690 +
691 +   Using Connections
692 +
693 +   CONNECT [ options ]                    Enters Connect (terminal) state.
694 +   Synonym: C.
695 +   REDIRECT command Redirects the given external command over the
696 +   connection.
697 +   TELOPT command Sends a Telnet protocol command (Telnet connections
698 +   only).
699 +   Ctrl-\C "Escapes back" from Connect state to Command state.
700 +   Ctrl-\B (In Connect state) Sends a BREAK signal (serial or Telnet).
701 +   Ctrl-\! (In Connect state) Enters inferior shell; "exit" to return.
702 +   Ctrl-\? (In Connect state) Shows a menu of other escape-level options.
703 +   Ctrl-\Ctrl-\ (In Connect state) Type two Ctrl-Backslashes to send one
704 +   of them.
705 +   SET ESCAPE [ character ] Changes Kermit's Connect-state escape
706 +   character.
707 +
708 +   Closing Connections
709 +
710 +   HANGUP Hangs up the currently open serial-port or network connection.
711 +   CLOSE Closes the currently open serial-port or network connection.
712 +   SET LINE (with no devicename)          Closes the currently open
713 +   serial-port or network connection.
714 +   SET HOST (with no hostname) Closes the currently open serial-port or
715 +   network connection.
716 +   FTP CLOSE Closes the currently open FTP connection.
717 +   HTTP CLOSE Closes the currently open HTTP connection.
718 +   EXIT Also closes all connections. Synonym: QUIT.
719 +   SET EXIT WARNING OFF Suppresses warning about open connections on exit
720 +   or close.
721 +
722 +   File Transfer
723 +
724 +   SEND [ options ] filename [ as-name ]  Sends the given file. Synonym:
725 +   S.
726 +   SEND [ options ] filespec Sends all files that match.
727 +   RESEND [ options ] filespec Resumes an interupted SEND from the point
728 +   of failure.
729 +   RECEIVE [ options ] [ as-name ] Waits passively for files to arrive.
730 +   Synonym: R.
731 +   LOG TRANSACTIONS [ filename ] Keeps a record of file transfers.
732 +   FAST Use fast file-transfer settings (default).
733 +   CAUTIOUS Use cautious and less fast file-transfer settings.
734 +   ROBUST Use ultra-conservative and slow file-transfer settings.
735 +   STATISTICS [ options ] Gives statistics about the most recent file
736 +   transfer.
737 +   WHERE After transfer: "Where did my files go?".
738 +   TRANSMIT [ options ] [ filename ] Sends file without protocol. Synonym:
739 +   XMIT.
740 +   LOG SESSION [ filename ] Captures remote text or files without
741 +   protocol.
742 +   SET PROTOCOL [ name... ] Tells Kermit to use an external file-transfer
743 +   protocol.
744 +   FTP { PUT, MPUT, GET, MGET, ... } FTP client commands.
745 +   HTTP { PUT, GET, HEAD, POST, ... } HTTP client commands.
746 +
747 +   Kermit Server
748 +
749 +   ENABLE, DISABLE                        Controls which features can be
750 +   used by clients.
751 +   SET SERVER Sets parameters prior to entering Server state.
752 +   SERVER Enters Server state.
753 +
754 +   Client of Kermit or FTP Server
755 +
756 +   [ REMOTE ] LOGIN [ user password ] Logs in to a Kermit server or IKSD
757 +   that requires it.
758 +   [ REMOTE ] LOGOUT Logs out from a Kermit server or IKSD.
759 +   SEND [ options ] filename [ as-name ]  Sends the given file to the
760 +   server. Synonyms: S, PUT.
761 +   SEND [ options ] filespec Sends all files that match.
762 +   RESEND [ options ] filespec Resumes an interupted SEND from the point
763 +   of failure.
764 +   GET [ options ] remote-filespec Asks the server to send the given
765 +   files. Synonym: G.
766 +   REGET [ options ] remote-filespec Resumes an interrupted GET from the
767 +   point of failure.
768 +   REMOTE CD [ directory ] Asks server to change its working directory.
769 +   Synonym: RCD.
770 +   REMOTE PWD [ directory ] Asks server to display its working directory.
771 +   Synonym: RPWD.
772 +   REMOTE DIRECTORY [ filespec... ] Asks server to send a directory
773 +   listing. Synonym: RDIR.
774 +   REMOTE DELETE [ filespec... ] Asks server to delete files. Synonym:
775 +   RDEL.
776 +   REMOTE [ command... ] (Many other commands: "remote ?" for a list).
777 +   MAIL [ options ] filespec Sends file(s) to be delivered as e-mail
778 +   (Kermit only).
779 +   FINISH Asks the server to exit server state (Kermit only).
780 +   BYE Asks the server to log out and close the connection.
781 +
782 +   Script Programming
783 +          DEFINE, DECLARE, UNDEFINE, UNDECLARE, ASSIGN, EVALUATE,
784 +          SEXPRESSION, ARRAY, SORT, INPUT, OUTPUT, IF, FOR, WHILE, SWITCH,
785 +          GOTO, ECHO, ASK, GETC, GETOK, ASSERT, WAIT, SLEEP, FOPEN, FREAD,
786 +          FWRITE, FCLOSE, STOP, END, RETURN, LEARN, SHIFT, TRACE, VOID,
787 +          INCREMENT, DECREMENT, ... For these and many more you'll need to
788 +          consult the [79]manual and supplements, and/or visit the
789 +          [80]Kermit Script Library, which also includes a brief tutorial.
790 +          Hint: HELP LEARN to find out how to get Kermit to write simple
791 +          scripts for you.
792 +
793 +   Many of Kermit's commands have synonyms, variants, relatives, and so
794 +   on. For example, MSEND is a version of SEND that accepts a list of file
795 +   specifications to be sent, rather than just one file specification, and
796 +   MPUT is a synonym of MSEND. MOVE means to SEND and then DELETE the
797 +   source file if successful. MMOVE is like MOVE, but accepts a list of
798 +   filespecs, and so on. These are described in the [81]full
799 +   documentation.
800 +
801 +   Use question mark to feel your way through an unfamiliar command, as in
802 +   this example (the part you type is underlined):
803 +
804 +  C-Kermit> remote ? One of the following:
805 +   assign     delete     help       login      print      rename     space
806 +   cd         directory  host       logout     pwd        rmdir      type
807 +   copy       exit       kermit     mkdir      query      set        who
808 +  C-Kermit> remote set ? One of the following:
809 +   attributes   file         retry        transfer
810 +   block-check  receive      server       window
811 +  C-Kermit> remote set file ? One of the following:
812 +   character-set  incomplete     record-length
813 +   collision      names          type
814 +  C-Kermit> remote set file names ? One of the following:
815 +   converted  literal
816 +  C-Kermit> remote set file names literal
817 +  C-Kermit>
818 +
819 +   This is called menu on demand: you get a menu when you want one, but
820 +   menus are not forced on you even when know what you're doing. Note that
821 +   you can also abbreviate most keywords, and you can complete them with
822 +   the Tab or Esc key. Also note that ? works for filenames too, and that
823 +   you can use it in the middle of a keyword or filename, not just at the
824 +   beginning. For example, "send x?" lists all the files in the current
825 +   directory whose names start with 'x'.
826 +
827 +   [82]Kermit Home [83]C-Kermit Home [84]C-Kermit FAQ
828 +
829 +  INITIALIZATION FILE [85]Top [86]Contents [87]Next [88]Previous
830 +
831 +  In its default configuration, C-Kermit executes commands from a file called
832 +  .kermrc in your home directory when it starts, unless it is given the -Y or -y
833 +  command-line option. Custom configurations might substitute a shared
834 +  system-wide initialization file. The SHOW FILE command tells what
835 +  initialization file, if any, was used. The standard initialization file
836 +  "chains" to an individual customization file, .mykermc, in the home directory,
837 +  in which each user can establish her/his own preferences, define macros, and
838 +  so on.
839 +
840 +  Since execution of the initialization file (at least the standard one) makes
841 +  C-Kermit take longer to start, it might be better not to have an
842 +  initialization file, especially now that Kermit's default startup
843 +  configuration is well attuned to modern computing and networking -- in other
844 +  words, you no longer have do anything special to make Kermit transfers go
845 +  fast. So instead of having an initialization file that is executed every time
846 +  Kermit starts, you might consider making one or more kerbang scripts (with
847 +  names other that .kermrc) that do NOT include an "exit" command, and invoke
848 +  those when you need the settings, macro definitions, and/or scripted actions
849 +  they contain, and invoke C-Kermit directly when you don't.
850 +
851 +  To put it another way... We still distribute the standard initialization file
852 +  since it's featured in the manual and backwards compatibility is important to
853 +  us. But there's no harm in not using it if you don't need the stuff that's in
854 +  it (services directory, dialing directory, network directory, and associated
855 +  macro definitions). On the other hand, if there are settings or macros you
856 +  want in effect EVERY time you use Kermit, the initialization file (or the
857 +  customization file it chains to) is the place to put them, because that's the
858 +  only place Kermit looks for them automatically each time you start it.
859 +
860 +  [89]Kermit Home [90]C-Kermit Home [91]C-Kermit FAQ
861 +  MODES OF OPERATION [92]Top [93]Contents [94]Next [95]Previous
862 +
863 +  Kermit is said to be in Local mode if it has made a connection to another
864 +  computer, e.g. by dialing it or establishing a Telnet connection to it. The
865 +  other computer is remote, so if you start another copy of Kermit on the remote
866 +  computer, it is said to be in Remote mode (as long as it has not made any
867 +  connections of its own). The local Kermit communicates over the communications
868 +  device or network connection, acting as a conduit between the the remote
869 +  computer and your keyboard and screen. The remote Kermit is the file-transfer
870 +  partner to the local Kermit and communicates only through its standard input
871 +  and output.
872 +
873 +  At any moment, a Kermit program can be in any of the following states. It's
874 +  important to know what they are and how to change from one to the other.
875 +
876 +   Command state
877 +
878 +          In this state, Kermit reads commands from:
879 +
880 +          + Your keyboard; or:
881 +          + A file, or:
882 +          + A macro definition.
883 +
884 +          You can exit from Command state back to Unix with the EXIT or
885 +          QUIT command (same thing). You can enter Connect state with any
886 +          of various commands (CONNECT, DIAL, TELNET, etc). You can enter
887 +          file transfer state with commands like SEND, RECEIVE, and GET.
888 +          You can enter Server state with the SERVER command. The TAKE
889 +          command tells Kermit to read and execute commands from a file.
890 +          The (perhaps implied) DO command tells Kermit to read and
891 +          execute commands from a macro definition. While in Command
892 +          state, you can interrupt any command, macro, or command file by
893 +          typing Ctrl-C (hold down the Ctrl key and press the C key); this
894 +          normally brings you back to the prompt.
895 +
896 +   Shell state
897 +
898 +          You can invoke an inferior shell or external command from the
899 +          Kermit command prompt by using the PUSH, RUN (!), EDIT, or
900 +          BROWSE command. While the inferior shell or command is active,
901 +          Kermit is suspended and does nothing. Return to Kermit Command
902 +          state by exiting from the inferior shell or application.
903 +
904 +   Connect state
905 +
906 +          In this state, which can be entered only when in Local mode
907 +          (i.e. when Kermit has made a connection to another computer),
908 +          Kermit is acting as a terminal to the remote computer. Your
909 +          keystrokes are sent to the remote computer and characters that
910 +          arrive over the communication connection are displayed on your
911 +          screen. This state is entered when you give a CONNECT, DIAL,
912 +          TELNET, RLOGIN, or IKSD command. You can return to command state
913 +          by logging out of the remote computer, or by typing:
914 +
915 +  Ctrl-\c
916 +
917 +          That is: Hold down the Ctrl key and press the backslash key,
918 +          then let go of the Ctrl key and press the C key. This is called
919 +          escaping back. Certain other escape-level commands are also
920 +          provided; type Ctrl-\? for a list. For example, you can enter
921 +          Shell state with:
922 +
923 +  Ctrl-\!
924 +
925 +          To send a Ctrl-\ to the host while in Connect state, type two of
926 +          them in a row. See HELP CONNECT and HELP SET ESCAPE for more
927 +          info.
928 +
929 +   Local file-transfer state
930 +
931 +          In this state, Kermit is sending packets back and forth with the
932 +          other computer in order to transfer a file or accomplish some
933 +          other file-related task. And at the same time, it is displaying
934 +          its progress on your screen and watching your keyboard for
935 +          interruptions. In this state, the following single-keystroke
936 +          commands are accepted:
937 +
938 +      X        Interrupt the current file and go on to the next (if any).
939 +      Z        Interrupt the current file and skip all the rest.
940 +      E        Like Z but uses a "stronger" protocol (use if X or Z don't work).
941 +      Ctrl-C   Interrupt file-transfer mode (use if Z or E don't work).
942 +
943 +          Kermit returns to its previous state (Command or Connect) when
944 +          the transfer is complete or when interrupted successfully by X,
945 +          Z, E, or Ctrl-C (hold down the Ctrl key and press the C key).
946 +
947 +   Remote file-transfer state
948 +
949 +          In this state, Kermit is exchanging file-transfer packets with
950 +          its local partner over its standard i/o. It leaves this state
951 +          automatically when the transfer is complete. In case you find
952 +          your local Kermit in Connect state and the remote one in
953 +          File-transfer state (in which it seems to ignore your
954 +          keystrokes), you can usually return it to command state by
955 +          typing three Ctrl-C's in a row. If that doesn't work, return
956 +          your local Kermit to Command state (Ctrl-\ C) and type
957 +          "e-packet" and then press the Return or Enter key; this forces a
958 +          fatal Kermit protocol error.
959 +
960 +   Remote Server state
961 +
962 +          This is like Remote File-transfer state, except it never returns
963 +          automatically to Command state. Rather, it awaits further
964 +          instructions from the client program; that is, from your Local
965 +          Kermit program. You can return the Remote Server to its previous
966 +          state by issuing a "finish" command to the client, or if you are
967 +          in Connect state, by typing three Ctrl-C's in a row. You can
968 +          tell the server job to log out and break the connection by
969 +          issuing a "bye" command to the client.
970 +
971 +   Local Server state
972 +
973 +          Like Remote-Server state, but in local mode, and therefore with
974 +          its file-transfer display showing, and listening for single-key
975 +          commands, as in Local File-transfer state. Usually this state is
976 +          entered automatically when a remote Kermit program gives a GET
977 +          command.
978 +
979 +  C-Kermit, Kermit 95, and MS-DOS Kermit all can switch automatically from
980 +  Connect state to Local File-transfer state when you initiate a file transfer
981 +  from the remote computer by starting Kermit and telling it to send or get a
982 +  file, in which case, Connect state is automatically resumed after the file
983 +  transfer is finished.
984 +
985 +  Note that C-Kermit is not a terminal emulator. It is a communications
986 +  application that you run in a terminal window (e.g. console or Xterm). The
987 +  specific emulation, such as VT100, VT220, Linux Console, or Xterm, is provided
988 +  by the terminal window in which you are running C-Kermit. Kermit 95 and MS-DOS
989 +  Kermit, on the other hand, are true terminal emulators. Why is C-Kermit not a
990 +  terminal emulator? [96]CLICK HERE to read about it.
991 +
992 +  [97]Kermit Home [98]C-Kermit Home [99]C-Kermit FAQ
993 +  MAKING CONNECTIONS [100]Top [101]Contents [102]Next [103]Previous
994 +
995 +  Here is how to make different kinds of connections using interactive Kermit
996 +  commands (as noted above, you can also make connections with command-line
997 +  options). Note that you don't have to make connections with Kermit. It can
998 +  also be used on the far end of a connection as the remote file transfer and
999 +  management partner of your local communications software.
1000 +
1001 +   Making a Telnet Connection
1002 +
1003 +          At the C-Kermit command prompt, simply type:
1004 +
1005 +  telnet foo.bar.com         ; Substitute desired host name or address.
1006 +  telnet xyzcorp.com 3000    ; You can also include a port number.
1007 +
1008 +          If the connection is successful, Kermit automically enters
1009 +          Connect state. When you logout from the remote host, Kermit
1010 +          automatically returns to its prompt. More info: HELP TELNET,
1011 +          HELP SET TELNET, HELP SET TELOPT. Also see the [104]IKSD section
1012 +          below.
1013 +
1014 +   Making an Rlogin connection
1015 +
1016 +          This is just like Telnet, except you have to be root to do it
1017 +          because Rlogin uses a privileged TCP port:
1018 +
1019 +  rlogin foo.bar.com         ; Substitute desired host name or address.
1020 +
1021 +          More info: HELP RLOGIN.
1022 +
1023 +   Making an SSH Connection
1024 +
1025 +          Unlike Telnet and Rlogin, SSH connections are not built-in, but
1026 +          handled by running your external SSH client through a
1027 +          pseudoterminal. Using C-Kermit to control the SSH client gives
1028 +          you all of Kermit's features (file transfer, character-set
1029 +          conversion, scripting, etc) over SSH.
1030 +
1031 +  ssh foo.bar.com            ; Substitute desired host name or address.
1032 +
1033 +          More info: HELP SSH, HELP SET SSH.
1034 +
1035 +   Dialing with a Modem
1036 +
1037 +          If it's an external modem, make sure it is connected to a usable
1038 +          serial port on your computer with a regular (straight-through)
1039 +          [105]modem cable, and to the telephone jack with a telephone
1040 +          cable, and that it's turned on. Then use these commands:
1041 +
1042 +  set modem type usrobotics  ; Or other supported type
1043 +  set line /dev/ttyS0        ; Specify device name
1044 +  set speed 57600            ; Or other desired speed
1045 +  set flow rts/cts           ; Most modern modems support this
1046 +  set dial method tone       ; (or pulse)
1047 +  dial 7654321               ; Dial the desired number
1048 +
1049 +          Type "set modem type ?" for a list of supported modem types. If
1050 +          you omit the SET MODEM TYPE command, the default type is
1051 +          "generic-high-speed", which should work for most modern
1052 +          AT-command-set modems. If the line is busy, Kermit redials
1053 +          automatically. If the call does not succeed, use "set dial
1054 +          display on" and try it again to watch what happens. If the call
1055 +          succeeds, Kermit enters Connect state automatically and returns
1056 +          to its prompt automatically when you log out from the remote
1057 +          computer or the connection is otherwise lost.
1058 +
1059 +          You can also dial from a modem that is accessible by Telnet,
1060 +          e.g. to a reverse terminal server. In this case the command
1061 +          sequence is:
1062 +
1063 +  set host ts.xxx.com 2000   ; Terminal-server and port
1064 +  set modem type usrobotics  ; Or other supported type
1065 +  set dial method tone       ; (or pulse)
1066 +  dial 7654321               ; Dial the desired number
1067 +
1068 +          If the terminal server supports the Telnet Com Port Option,
1069 +          [106]RFC 2217, you can also give serial-port related commands
1070 +          such as SET SPEED, SET PARITY, and so on, and Kermit relays them
1071 +          to the terminal server using the protocol specified in the RFC.
1072 +
1073 +          More info: HELP SET MODEM, HELP SET LINE, HELP SET SPEED, HELP
1074 +          SET FLOW, HELP DIAL, HELP SET DIAL, HELP SET MODEM, HELP SET
1075 +          CARRIER-WATCH, SHOW COMMUNICATIONS, SHOW MODEM, SHOW DIAL.
1076 +
1077 +   Direct Serial Port
1078 +
1079 +          Connect the two computers, A and B, with a [107]null modem cable
1080 +          (or two modem cables interconnected with a null-modem adapter or
1081 +          modem eliminator). From Computer A:
1082 +
1083 +  set modem type none        ; There is no modem
1084 +  set line /dev/ttyS0        ; Specify device name
1085 +  set carrier-watch off      ; If DTR and CD are not cross-connected
1086 +  set speed 57600            ; Or other desired speed
1087 +  set flow rts/cts           ; If RTS and CTS are cross-connected
1088 +  set flow xon/xoff          ; If you can't use RTS/CTS
1089 +  set parity even            ; (or "mark" or "space", if necessary)
1090 +  set stop-bits 2            ; (rarely necessary)
1091 +  connect                    ; Enter Connect (terminal) state
1092 +
1093 +          This assumes Computer B is set up to let you log in. If it
1094 +          isn't, you can run a copy of Kermit on Computer B and follow
1095 +          approximately the same directions. More info: As above plus HELP
1096 +          CONNECT.
1097 +
1098 +  With modems or direct serial connections, you might also have to "set parity
1099 +  even" (or "mark" or "space") if it's a 7-bit connection.
1100 +
1101 +  Of the connection types listed above, only one can be open at a time. However,
1102 +  any one of these can be open concurrently with an [108]FTP or HTTP session.
1103 +  Each connection type can be customized to any desired degree, scripted,
1104 +  logged, you name it. See the manual.
1105 +
1106 +  NOTE: On selected platforms, C-Kermit also can make X.25 connections. See the
1107 +  manual for details.
1108 +
1109 +  [109]Kermit Home [110]C-Kermit Home [111]C-Kermit FAQ
1110 +  TRANSFERRING FILES WITH KERMIT [112]Top [113]Contents [114]Next [115]Previous
1111 +
1112 +     * [116]Downloading Files
1113 +     * [117]Uploading Files
1114 +     * [118]Kermit Transfers the Old-Fashioned Way
1115 +     * [119]If File Transfer Fails
1116 +     * [120]Advanced Kermit File Transfer Features
1117 +     * [121]Non-Kermit File Transfer
1118 +
1119 +  There is a [122]widespread and persistent belief that Kermit is a slow
1120 +  protocol. This is because, until recently, it used conservative tuning by
1121 +  default to make sure file transfers succeeded, rather than failing because
1122 +  they overloaded the connection. Some extra commands (or command-line options,
1123 +  like -Q) were needed to make it go fast, but nobody bothered to find out about
1124 +  them. Also, it takes two to tango: most non-Kermit-Project Kermit protocol
1125 +  implementations really ARE slow. The best file-transfer partners for C-Kermit
1126 +  are: another copy of [123]C-Kermit (7.0 or later) and [124]Kermit 95. These
1127 +  combinations work well and they work fast by default. MS-DOS Kermit is good
1128 +  too, but you have to tell it to go fast (by giving it the FAST command).
1129 +
1130 +  Furthermore, all three of these Kermit programs support "autodownload" and
1131 +  "autoupload", meaning that when they are in Connect state and a Kermit packet
1132 +  comes in from the remote, they automatically switch into file transfer mode.
1133 +
1134 +  And plus, C-Kermit and K95 also switch automatically between text and binary
1135 +  mode for each file, so there is no need to "set file type binary" or "set file
1136 +  type text", or to worry about files being corrupted because they were
1137 +  transferred in the wrong mode.
1138 +
1139 +  What all of these words add up to is that now, when you use up-to-date Kermit
1140 +  software from the Kermit Project, file transfer is not only fast, it's
1141 +  ridiculously easy. You barely have to give any commands at all.
1142 +
1143 +   Downloading Files
1144 +
1145 +          Let's say you have [125]Kermit 95, [126]C-Kermit, or [127]MS-DOS
1146 +          Kermit on your desktop computer, with a connection to a Unix
1147 +          computer that has C-Kermit installed as "kermit". To download a
1148 +          file (send it from Unix to your desktop computer), just type the
1149 +          following command at your Unix shell prompt:
1150 +
1151 +  kermit -s oofa.txt
1152 +
1153 +          (where oofa.txt is the filename). If you want to send more than
1154 +          one file, you can put as many filenames as you want on the
1155 +          command line, and they can be any combination of text and
1156 +          binary:
1157 +
1158 +  kermit -s oofa.txt oofa.zip oofa.html oofa.tar.gz
1159 +
1160 +          and/or you can use wildcards to send groups of files:
1161 +
1162 +  kermit -s oofa.*
1163 +
1164 +          If you want to send a file under an assumed name, use:
1165 +
1166 +  kermit -s friday.txt -a today.txt
1167 +
1168 +          This sends the file friday.txt but tells the receiving Kermit
1169 +          that its name is today.txt. In all cases, as noted, when the
1170 +          file transfer is finished, your desktop Kermit returns
1171 +          automatically to Connect state. No worries about escaping back,
1172 +          re-connecting, text/binary mode switching. Almost too easy,
1173 +          right?
1174 +
1175 +   Uploading Files
1176 +
1177 +          To upload files (send them from your desktop computer to the
1178 +          remote Unix computer) do the same thing, but use the -g (GET)
1179 +          option instead of -s:
1180 +
1181 +  kermit -g oofa.txt
1182 +
1183 +          This causes your local Kermit to enter server mode; then the
1184 +          remote Kermit program requests the named file and the local
1185 +          Kermit sends it and returns automatically to Connect state when
1186 +          done.
1187 +
1188 +          If you want to upload multiple files, you have have use shell
1189 +          quoting rules, since these aren't local files:
1190 +
1191 +  kermit -g "oofa.txt oofa.zip oofa.html oofa.tar.gz"
1192 +  kermit -g "oofa.*"
1193 +
1194 +          If you want to upload a file but store it under a different
1195 +          name, use:
1196 +
1197 +  kermit -g friday.txt -a today.txt
1198 +
1199 +   Kermit Transfers the Old-Fashioned Way
1200 +
1201 +          If your desktop communications software does not support
1202 +          autoupload or autodownload, or it does not include Kermit server
1203 +          mode, the procedure requires more steps.
1204 +
1205 +          To download a file, type:
1206 +
1207 +  kermit -s filename
1208 +
1209 +          on the host as before, but if nothing happens automatically in
1210 +          response to this command, you have to switch your desktop
1211 +          communications software into Kermit Receive state. This might be
1212 +          done by escaping back using keyboard characters or hot keys
1213 +          (Alt-x is typical) and/or with a command (like RECEIVE) or a
1214 +          menu. When the file transfer is complete, you have to go back to
1215 +          Connect state, Terminal emulation, or whatever terminology
1216 +          applies to your desktop communications software.
1217 +
1218 +          To upload a file, type:
1219 +
1220 +  kermit -r
1221 +
1222 +          on the host (rather than "kermit -g"). This tells C-Kermit to
1223 +          wait passively for a file to start arriving. Then regain the
1224 +          attention of your desktop software (Alt-x or whatever) and
1225 +          instruct it to send the desired file(s) with Kermit protocol.
1226 +          When the transfer is finished, return to the Connect or Terminal
1227 +          screen.
1228 +
1229 +   If File Transfer Fails
1230 +
1231 +          Although every aspect of Kermit's operation can be finely tuned,
1232 +          there are also three short and simple "omnibus tuning" commands
1233 +          you can use for troubleshooting:
1234 +
1235 +        FAST
1236 +                Use fast file-transfer settings. This has been the default
1237 +                since C-Kermit 7.0 now that most modern computers and
1238 +                connections support it. If transfers fail with fast
1239 +                settings, try . . .
1240 +
1241 +        CAUTIOUS
1242 +                Use cautious but not paranoid settings. File transfers, if
1243 +                they work, will go at medium speed. If not, try . . .
1244 +
1245 +        ROBUST
1246 +                Use the most robust, resilient, conservative, safe, and
1247 +                reliable settings. File transfers will almost certainly
1248 +                work, but they will be quite slow (of course this is a
1249 +                classic tradeoff; ROBUST was C-Kermit's default tuning in
1250 +                versions 6.0 and earlier, which made everybody think
1251 +                Kermit protocol was slow). If ROBUST doesn't do the trick,
1252 +                try again with SET PARITY SPACE first in case it's not an
1253 +                8-bit connection.
1254 +
1255 +          Obviously the success and performance of a file transfer also
1256 +          depends on C-Kermit's file transfer partner. Up-to-date, real
1257 +          [128]Kermit Project partners are recommended because they
1258 +          contain the best Kermit protocol implementations and because
1259 +          [129]we can support them in case of trouble.
1260 +
1261 +          If you still have trouble, consult Chapter 10 of [130]Using
1262 +          C-Kermit, or send email to [131]kermit-support@columbia.edu.
1263 +
1264 +   Advanced Kermit File-Transfer Features
1265 +
1266 +          Obviously there is a lot more to Kermit file transfer, including
1267 +          all sorts of interactive commands, preferences, options,
1268 +          logging, debugging, troubleshooting, and anything else you can
1269 +          imagine but that's what the [132]manual and updates are for.
1270 +          Here are a few topics you can explore if you're interested by
1271 +          Typing HELP for the listed commands:
1272 +
1273 +        Logging transfers:
1274 +                LOG TRANSACTIONS (HELP LOG)
1275 +
1276 +        Automatic per-file text/binary mode switching:
1277 +                SET TRANSFER MODE { AUTOMATIC, MANUAL } (HELP SET
1278 +                TRANSFER).
1279 +
1280 +        Cross-platform recursive directory tree transfer:
1281 +                SEND /RECURSIVE, GET /RECURSIVE (HELP SEND, HELP GET).
1282 +
1283 +        File collision options:
1284 +                SET FILE COLLISION { OVERWRITE, BACKUP, DISCARD, ... }
1285 +                (HELP SET FILE).
1286 +
1287 +        Update mode (only transfer files that changed since last time):
1288 +                SET FILE COLLISION UPDATE (HELP SET FILE).
1289 +
1290 +        Filename selection patterns:
1291 +                (HELP WILDCARD).
1292 +
1293 +        Flexible file selection:
1294 +                SEND (or GET) /BEFORE /AFTER /LARGER /SMALLER /TYPE
1295 +                /EXCEPT, ...
1296 +
1297 +        Character-set conversion:
1298 +                SET { FILE, TRANSFER } CHARACTER-SET, ASSOCIATE, ...
1299 +
1300 +        File/Pathname control:
1301 +                SET { SEND, RECEIVE } PATHNAMES, SET FILE NAMES.
1302 +
1303 +        Atomic file movement:
1304 +                SEND (or GET) /DELETE /RENAME /MOVE-TO
1305 +
1306 +        Transferring to/from standard i/o of other commands:
1307 +                SEND (or GET) /COMMAND
1308 +
1309 +        Recovery of interrupted transfer from point of failure:
1310 +                RESEND, REGET (HELP RESEND, HELP REGET).
1311 +
1312 +   Non-Kermit File Transfer
1313 +
1314 +          You can also use C-Kermit to transfer files with FTP or HTTP
1315 +          Internet protocols; [133]see below.
1316 +
1317 +          On a regular serial or Telnet connection where the other
1318 +          computer doesn't support Kermit protocol at all, you have
1319 +          several options. For example, if your desktop communications
1320 +          software supports Zmodem, use "rz" and "sz" on the host rather
1321 +          than Kermit. But if Kermit is your desktop software, and you are
1322 +          using it to make calls or network connections to other computers
1323 +          that don't support Kermit protocol (or that don't have a good
1324 +          implementation of it), then if your computer also has external
1325 +          X, Y, or Zmodem programs that are redirectable, Kermit can use
1326 +          them as external protocols. HELP SET PROTOCOL for details.
1327 +
1328 +          You can also capture "raw" data streams from the other computer
1329 +          with LOG SESSION (HELP LOG and HELP SET SESSION-LOG for
1330 +          details), and you can upload files without any protocol at all
1331 +          with TRANSMIT (HELP TRANSMIT, HELP SET TRANSMIT).
1332 +
1333 +   [134]Kermit Home [135]C-Kermit Home [136]C-Kermit FAQ
1334 +
1335 +  KERMIT CLIENT/SERVER CONNECTIONS [137]Top [138]Contents [139]Next
1336 +  [140]Previous
1337 +
1338 +  On any kind of connection you can make with Kermit -- serial, TCP/IP, X.25,
1339 +  etc -- you can set up a convenient client/server relationship between your
1340 +  Kermit client (the one that made the connection) and the Kermit program on the
1341 +  far end of the connection (the remote Kermit) by putting the remote Kermit in
1342 +  server mode. This is normally done by giving it a SERVER command, or by
1343 +  starting it with the -x command-line option. In some cases ([141]Internet
1344 +  Kermit Service, SSH connections to a Kermit subsystem, or specially configured
1345 +  hosts), there is already a Kermit server waiting on the far end. Here is a
1346 +  quick synopsis of the commands you can give to the client for interacting with
1347 +  the server:
1348 +
1349 +   SEND [ switches ] filename
1350 +          Sends the named file to the server. The filename can include
1351 +          wildcards. Lots of switches are available for file selection,
1352 +          etc. Type HELP SEND at the client prompt for details.
1353 +
1354 +   GET [ switches ] filename
1355 +          Asks the server to send the named file. The filename can include
1356 +          wildcards. Type HELP GET at the client prompt for details.
1357 +
1358 +   BYE
1359 +          Terminates the server and closes your connection to it.
1360 +
1361 +   FINISH
1362 +          Terminates the server. If you started the server yourself, this
1363 +          leaves the remote host at its shell prompt. If it was a
1364 +          dedicated server (such as IKSD or an SSH subsystem), FINISH is
1365 +          equivalent to BYE.
1366 +
1367 +   SET LOCUS { LOCAL, REMOTE, AUTO }
1368 +          (C-Kermit 8.0.201 and later, K95 1.1.21 and later) This tells
1369 +          the client whether file-management commands like CD, PWD,
1370 +          DIRECTORY, DELETE, MKDIR, etc, should be executed locally or by
1371 +          the server. In this type of connection, the default is LOCAL.
1372 +          Use SET LOCUS REMOTE if you want Kermit to behave like an FTP
1373 +          client, in which case these commands are executed remotely, and
1374 +          their local versions must have an L prefix: LCD, LPWD,
1375 +          LDIRECTORY, etc. When LOCUS is LOCAL, then the remote versions
1376 +          must have an R prefix: RCD, RPWD, RDIRECTORY, etc. HELP SET
1377 +          LOCUS for details. SHOW COMMAND to see current locus.
1378 +
1379 +  The following commands are affected by SET LOCUS:
1380 +
1381 +   CD, LCD, RCD
1382 +   Change (working, current) directory. HELP CD for details.
1383 +
1384 +   CDUP, LCDUP, RCDUP
1385 +   CD one level up.
1386 +
1387 +   DIRECTORY, LDIRECTORY, RDIRECTORY
1388 +   Produce a directory listing. Many options are available for local
1389 +   listings. HELP DIRECTORY for details.
1390 +
1391 +   DELETE, LDELETE, RDELETE
1392 +   Deletes files or directories. Many options available, HELP DELETE.
1393 +
1394 +   RENAME, LRENAME, RRENAME
1395 +   Renames files or directories. Many options available, HELP RENAME.
1396 +
1397 +   MKDIR, LMKDIR, RMKDIR
1398 +   Creates a directory. HELP MKDIR.
1399 +
1400 +   RMDIR, LRMDIR, RRMDIR
1401 +   Removes a directory. HELP RMDIR. There are dozens -- maybe hundreds --
1402 +   of other commands, described in the built-in help, on the website,
1403 +   and/or in the published or online manuals. But even if you don't have
1404 +   access to documentation, you can "set locus remote" and then use pretty
1405 +   much the same commands you would use with any FTP client.
1406 +
1407 +   [142]Kermit Home [143]C-Kermit Home [144]C-Kermit FAQ
1408 +
1409 +  KERMIT'S BUILT-IN FTP AND HTTP CLIENTS [145]Top [146]Contents [147]Next
1410 +  [148]Previous
1411 +
1412 +  Kermit's FTP client is like the regular Unix FTP client that you're used to,
1413 +  but with some differences:
1414 +
1415 +     * It has lots more commands and features.
1416 +     * You can have an FTP session and a regular Kermit serial or Telnet
1417 +       session open at the same time.
1418 +     * FTP sessions can be fully automated.
1419 +
1420 +   By default Kermit's FTP client tries its best to present the same user
1421 +   interface as a regular FTP client: PUT, GET, DIR, CD, BYE, etc, should
1422 +   work the same, even though some of these commands have different
1423 +   meaning in Kermit-to-Kermit connections; for example, CD, DIR, RENAME,
1424 +   etc, in Kermit act locally, whereas in FTP they are commands for the
1425 +   server. This might cause some confusion, but as in all things Kermit,
1426 +   you have total control:
1427 +
1428 +     * The [149]SET LOCUS command lets you specify where file management
1429 +       commands should be executed -- locally or remotely -- for any kind
1430 +       of connection.
1431 +     * Any FTP command can be prefixed with the word "FTP" to remove any
1432 +       ambiguity.
1433 +
1434 +   Pending publication of the next edition of the manual, the Kermit FTP
1435 +   client is thoroughly documented at the Kermit Project website:
1436 +
1437 +  [150]http://www.columbia.edu/kermit/ftpclient.html
1438 +
1439 +   You also can use HELP FTP and HELP SET FTP to get descriptions of
1440 +   Kermit's FTP-related commands.
1441 +
1442 +   The HTTP client is similar to the FTP one, except you prefix each
1443 +   command with HTTP instead of FTP: HTTP OPEN, HTTP GET, HTTP PUT, HTTP
1444 +   CLOSE, etc. Type HELP HTTP for details, or visit the to view the
1445 +   [151]manual supplements. HTTP connections can be open at the same time
1446 +   as regular serial or Telnet connections and FTP connections. So Kermit
1447 +   can manage up to three types connections simultaneously.
1448 +
1449 +   [152]Kermit Home [153]C-Kermit Home [154]C-Kermit FAQ [155]FTP Client
1450 +   [156]HTTP Client
1451 +
1452 +  INTERNET KERMIT SERVICE [157]Top [158]Contents [159]Next [160]Previous
1453 +
1454 +  C-Kermit can be configured and run as an Internet service (called IKSD),
1455 +  similar to an FTP server (FTPD) except you can (but need not) interact with it
1456 +  directly, plus it does a lot more than an FTP server can do. The TCP port for
1457 +  IKSD is 1649. It uses Telnet protocol. C-Kermit can be an Internet Kermit
1458 +  Server, or it can be a client of an IKSD. You can make connections from
1459 +  C-Kermit to an IKSD with any of the following commands:
1460 +
1461 +  telnet foo.bar.edu 1649
1462 +  telnet foo.bar.edu kermit   ; if "kermit" is listed in /etc/services
1463 +  iksd foo.bar.edu
1464 +
1465 +   The IKSD command is equivalent to a TELNET command specifying port
1466 +   1649. For more information about making and using connections to an
1467 +   IKSD, see:
1468 +
1469 +  [161]http://www.columbia.edu/kermit/cuiksd.html
1470 +
1471 +   You can run an Internet Kermit Service on your own computer too (if you
1472 +   are the system administrator). For instructions, see:
1473 +
1474 +  [162]http://www.columbia.edu/kermit/iksd.html
1475 +
1476 +   [163]Kermit Home [164]C-Kermit Home [165]C-Kermit FAQ
1477 +
1478 +  SECURITY [166]Top [167]Contents [168]Next [169]Previous
1479 +
1480 +  All of C-Kermit's built-in TCP/IP networking methods (Telnet, Rlogin, IKSD,
1481 +  FTP, and HTTP) can be secured by one or more of the following IETF-approved
1482 +  methods:
1483 +
1484 +     * MIT Kerberos IV
1485 +     * MIT Kerberos V
1486 +     * SSL/TLS
1487 +     * Stanford SRP
1488 +
1489 +   For complete instructions see:
1490 +
1491 +  [170]http://www.columbia.edu/kermit/security.html
1492 +
1493 +   And as noted previously, you can also make SSH connections with
1494 +   C-Kermit if you already have an SSH client installed.
1495 +
1496 +   [171]Kermit Home [172]C-Kermit Home [173]C-Kermit FAQ
1497 +
1498 +  ALTERNATIVE COMMAND-LINE PERSONALITIES [174]Top [175]Contents [176]Next
1499 +  [177]Previous
1500 +
1501 +  When invoked as "kermit" or any other name besides any of the special ones,
1502 +  C-Kermit has the command-line options described above in the [178]OPTIONS
1503 +  section. However, if you invoke C-Kermit using any of the following names:
1504 +
1505 +    telnet  Telnet client
1506 +    ftp     FTP client
1507 +    http    HTTP client
1508 +    https   Secure HTTP client
1509 +
1510 +  Kermit's command-line personality changes to match. This can be done (among
1511 +  other ways) with symbolic links (symlinks). For example, if you want C-Kermit
1512 +  to be your regular Telnet client, or the Telnet helper of your Web browser,
1513 +  you can create a link like the following in a directory that lies in your PATH
1514 +  ahead of the regular telnet program:
1515 +
1516 +  ln -s /usr/local/bin/kermit telnet
1517 +
1518 +   Now when you give a "telnet" command, you are invoking Kermit instead,
1519 +   but with its Telnet command-line personality so, for example:
1520 +
1521 +  telnet xyzcorp.com
1522 +
1523 +   Makes a Telnet connection to xyzcorp.com, and Kermit exits
1524 +   automatically when the connection is closed (just like the regular
1525 +   Telnet client). Type "telnet -h" to get a list of Kermit's
1526 +   Telnet-personality command-line options, which are intended to be as
1527 +   compatible as possible with the regular Telnet client.
1528 +
1529 +   Similarly for FTP:
1530 +
1531 +  ln -s /usr/local/bin/kermit ftp
1532 +
1533 +   And now type "ftp -h" to see its command-line options, and use command
1534 +   lines just like you would give your regular FTP client:
1535 +
1536 +  ftp -n xyzcorp.com
1537 +
1538 +   but with additional options allowing an entire session to be specified
1539 +   on the command line, as explained in the C-Kermit [179]FTP client
1540 +   documentation.
1541 +
1542 +   And similarly for HTTP:
1543 +
1544 +  ln -s /usr/local/bin/kermit http
1545 +  ./http -h
1546 +  ./http www.columbia.edu -g kermit/index.html
1547 +
1548 +   Finally, if Kermit's first command-line option is a Telnet, FTP, IKSD,
1549 +   or HTTP URL, Kermit automatically makes the appropriate kind of
1550 +   connection and, if indicated by the URL, takes the desired action:
1551 +
1552 +  kermit telnet:xyzcorp.com                            ; Opens a Telnet session
1553 +  kermit telnet://olga@xyzcorp.com                     ; Ditto for user olga
1554 +  kermit ftp://olga@xyzcorp.com/public/oofa.zip        ; Downloads a file
1555 +  kermit kermit://kermit.columbia.edu/kermit/f/READ.ME ; Ditto for IKSD
1556 +  kermit iksd://kermit.columbia.edu/kermit/f/READ.ME   ; (This works too)
1557 +  kermit http://www.columbia.edu/kermit/index.html     ; Grabs a web page
1558 +  kermit https://wwws.xyzcorp.com/secret/plan.html     ; Grabs a secure web page
1559 +
1560 +   [180]Kermit Home [181]C-Kermit Home [182]C-Kermit FAQ
1561 +
1562 +  LICENSE [183]Top [184]Contents [185]Next [186]Previous
1563 +
1564 +  On or before 30 June 2011, barring unforeseen circumstances, [187]C-Kermit 9.0
1565 +  will be released with the [188]Revised 3-Clause BSD License. This is a
1566 +  certifed [189]Open Source license, and it means that C-Kermit no longer needs
1567 +  to be licensed for commercial redistribution. Technical support for Kermit
1568 +  software will not be available from Columbia University after June 30th.
1569 +
1570 +  [190]Kermit Home [191]C-Kermit Home [192]C-Kermit FAQ
1571 +  OTHER TOPICS [193]Top [194]Contents [195]Next [196]Previous
1572 +
1573 +  There's way more to C-Kermit than we've touched on here -- troubleshooting,
1574 +  customization, character sets, dialing directories, sending pages, script
1575 +  writing, and on and on, all of which are covered in the manual and updates and
1576 +  supplements. For the most up-to-date information on documentation (or updated
1577 +  documentation itself) visit the Kermit Project website:
1578 +
1579 +  [197]http://www.columbia.edu/kermit/
1580 +
1581 +  There you will also find [198]Kermit software packages for other platforms:
1582 +  different Unix varieties, Windows, DOS, VMS, IBM mainframes, and many others:
1583 +  20+ years' worth.
1584 +
1585 +  [199]Kermit Home [200]C-Kermit Home [201]C-Kermit FAQ
1586 +  DOCUMENTATION AND UPDATES [202]Top [203]Contents [204]Next [205]Previous
1587 +
1588 +  The manual for C-Kermit is:
1589 +
1590 +    1. Frank da Cruz and Christine M. Gianone, [206]Using C-Kermit, Second
1591 +       Edition, Digital Press / Butterworth-Heinemann, Woburn, MA, 1997,
1592 +       622 pages, ISBN 1-55558-164-1. This is a printed book. It covers
1593 +       C-Kermit 6.0.
1594 +    2. The C-Kermit 7.0 Supplement:
1595 +       [207]http://www.columbia.edu/kermit/ckermit70.html
1596 +    3. The C-Kermit 8.0 Supplement:
1597 +       [208]http://www.columbia.edu/kermit/ckermit80.html
1598 +    4. The C-Kermit 9.0 Supplement:
1599 +       [209]http://www.columbia.edu/kermit/ckermit90.html
1600 +
1601 +  The C-Kermit home page is here:
1602 +
1603 +  [210]http://www.columbia.edu/kermit/ckermit.html
1604 +
1605 +   Visit this page to learn about new versions, Beta tests, and other
1606 +   news; to read case studies and tutorials; to download source code,
1607 +   install packages, and [211]prebuilt binaries for many platforms. Also
1608 +   visit:
1609 +
1610 +   [212]http://www.columbia.edu/kermit/scriptlib.html
1611 +          The Kermit script library and tutorial
1612 +
1613 +   [213]http://www.columbia.edu/kermit/newfaq.html
1614 +          The Kermit FAQ (Frequently Asked Questions about Kermit)
1615 +
1616 +   [214]http://www.columbia.edu/kermit/ckfaq.html
1617 +          The C-Kermit FAQ (Frequently Asked Questions about C-Kermit)
1618 +
1619 +   [215]http://www.columbia.edu/kermit/security.html
1620 +          The Kermit security reference.
1621 +
1622 +   [216]http://www.columbia.edu/kermit/telnet.html
1623 +          C-Kermit Telnet client documentation.
1624 +
1625 +   [217]http://www.columbia.edu/kermit/studies.html
1626 +          Case studies.
1627 +
1628 +   [218]http://www.columbia.edu/kermit/ckcbwr.html
1629 +          General C-Kermit Hints and Tips.
1630 +
1631 +   [219]http://www.columbia.edu/kermit/ckubwr.html
1632 +          Unix C-Kermit Hints and Tips.
1633 +
1634 +   [220]http://www.columbia.edu/kermit/ckvbwr.html
1635 +          VMS C-Kermit Hints and Tips.
1636 +
1637 +   [221]http://www.columbia.edu/kermit/ckuins.html
1638 +          Unix C-Kermit Installation Instructions
1639 +
1640 +   [222]http://www.columbia.edu/kermit/ckvins.html
1641 +          VMS C-Kermit Installation Instructions
1642 +
1643 +   [223]http://www.columbia.edu/kermit/support.html
1644 +          Technical support.
1645 +
1646 +   [224]http://www.columbia.edu/kermit/k95tutorial.html
1647 +          Kermit 95 tutorial (this document).
1648 +
1649 +   [225]comp.protocols.kermit.misc
1650 +          The Kermit newsgroup (unmoderated).
1651 +
1652 +   [226]Kermit Home [227]C-Kermit Home [228]C-Kermit FAQ
1653 +
1654 +  FILES [229]Top [230]Contents [231]Next [232]Previous
1655 +
1656 +   [233]The Revised 3-Clause License
1657 +          C-Kermit license.
1658 +
1659 +   [234]~/.kermrc
1660 +          Initialization file.
1661 +
1662 +   [235]~/.mykermrc
1663 +          Customization file.
1664 +
1665 +   ~/.kdd
1666 +          Kermit dialing directory (see manual).
1667 +
1668 +   ~/.knd
1669 +          Kermit network directory (see manual).
1670 +
1671 +   ~/.ksd
1672 +          Kermit services directory (see manual).
1673 +
1674 +   [236]ckuins.html
1675 +          Installation instructions for Unix.
1676 +
1677 +   [237]ckcbwr.html
1678 +          General C-Kermit bugs, hints, tips.
1679 +
1680 +   [238]ckubwr.html
1681 +          Unix-specific C-Kermit bugs, hints, tips.
1682 +
1683 +   [239]ckcplm.html
1684 +          C-Kermit program logic manual.
1685 +
1686 +   [240]ckccfg.html
1687 +          C-Kermit compile-time configuration options.
1688 +
1689 +   ssh
1690 +          (in your PATH) SSH connection helper.
1691 +
1692 +   rz, sz, etc.
1693 +          (in your PATH) external protocols for XYZmodem.
1694 +
1695 +   /var/spool/locks (or whatever)
1696 +          UUCP lockfile for dialing out (see [241]installation
1697 +          instructions).
1698 +
1699 +   [242]Kermit Home [243]C-Kermit Home [244]C-Kermit FAQ
1700 +
1701 +  AUTHORS [245]Top [246]Contents [247]Previous
1702 +
1703 +     Frank da Cruz and Jeffrey E Altman
1704 +     The Kermit Project - Columbia Univerity
1705 +     612 West 115th Street
1706 +     New York NY 10025-7799
1707 +     USA
1708 +
1709 +   1985-present, with contributions from hundreds of others all over the
1710 +   world.
1711 +     __________________________________________________________________
1712 +
1713 +
1714 +    C-Kermit 9.0 Unix Manual Page and Tutorial / [248]kermit@columbia.edu
1715 +    / 30 June 2011
1716 +
1717 +References
1718 +
1719 +   1. http://www.columbia.edu/
1720 +   2. mailto:kermit@columbia.edu
1721 +   3. http://www.columbia.edu/kermit/index.html
1722 +   4. http://www.columbia.edu/kermit/k95.html
1723 +   5. http://www.columbia.edu/kermit/ckermit.html
1724 +   6. http://www.columbia.edu/kermit/ckscripts.html
1725 +   7. http://www.columbia.edu/kermit/current.html
1726 +   8. http://www.columbia.edu/kermit/whatsnew.html
1727 +   9. http://www.columbia.edu/kermit/ckfaq.html
1728 +  10. http://www.columbia.edu/kermit/support.html
1729 +  11. http://www.columbia.edu/kermit/
1730 +  12. http://www.columbia.edu/
1731 +  13. http://www.columbia.edu/kermit/ckututor.pdf
1732 +  14. ftp://kermit.columbia.edu/kermit/test/text/ckuker.nr
1733 +  15. http://www.amazon.com/gp/product/1555581641?ie=UTF8&tag=aleidmoreldom-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=1555581641
1734 +  16. http://www.columbia.edu/kermit/ckututor.html#description
1735 +  17. http://www.columbia.edu/kermit/ckututor.html#synopsis
1736 +  18. http://www.columbia.edu/kermit/ckututor.html#options
1737 +  19. http://www.columbia.edu/kermit/ckututor.html#commands
1738 +  20. http://www.columbia.edu/kermit/ckututor.html#initfile
1739 +  21. http://www.columbia.edu/kermit/ckututor.html#modes
1740 +  22. http://www.columbia.edu/kermit/ckututor.html#connections
1741 +  23. http://www.columbia.edu/kermit/ckututor.html#transfer
1742 +  24. http://www.columbia.edu/kermit/ckututor.html#server
1743 +  25. http://www.columbia.edu/kermit/ckututor.html#ftp
1744 +  26. http://www.columbia.edu/kermit/ckututor.html#iksd
1745 +  27. http://www.columbia.edu/kermit/ckututor.html#security
1746 +  28. http://www.columbia.edu/kermit/ckututor.html#personae
1747 +  29. http://www.columbia.edu/kermit/ckututor.html#license
1748 +  30. http://www.columbia.edu/kermit/ckututor.html#other
1749 +  31. http://www.columbia.edu/kermit/ckututor.html#documentation
1750 +  32. http://www.columbia.edu/kermit/ckututor.html#files
1751 +  33. http://www.columbia.edu/kermit/ckututor.html#authors
1752 +  34. http://www.columbia.edu/kermit/ckututor.html#top
1753 +  35. http://www.columbia.edu/kermit/ckututor.html#contents
1754 +  36. http://www.columbia.edu/kermit/ckututor.html#synopsis
1755 +  37. http://www.columbia.edu/kermit/ckermit.html
1756 +  38. http://www.columbia.edu/kermit/
1757 +  39. http://www.columbia.edu/
1758 +  40. ftp://ftp.isi.edu/in-notes/rfc2839.txt
1759 +  41. ftp://ftp.isi.edu/in-notes/rfc2840.txt
1760 +  42. http://www.columbia.edu/kermit/ckututor.html#documentation
1761 +  43. http://www.columbia.edu/kermit/
1762 +  44. http://www.columbia.edu/kermit/
1763 +  45. http://www.columbia.edu/kermit/ckermit.html
1764 +  46. http://www.columbia.edu/kermit/ckfaq.html
1765 +  47. http://www.columbia.edu/kermit/ckututor.html#top
1766 +  48. http://www.columbia.edu/kermit/ckututor.html#contents
1767 +  49. http://www.columbia.edu/kermit/ckututor.html#options
1768 +  50. http://www.columbia.edu/kermit/ckututor.html#synopsis
1769 +  51. http://www.columbia.edu/kermit/ckututor.html#kerbang
1770 +  52. http://www.columbia.edu/kermit/ckututor.html#personae
1771 +  53. http://www.columbia.edu/kermit/ckututor.html#kerbang
1772 +  54. http://www.columbia.edu/kermit/ckututor.html#initfile
1773 +  55. http://www.columbia.edu/kermit/ckututor.html#initfile
1774 +  56. http://www.columbia.edu/kermit/ckututor.html#personae
1775 +  57. http://www.columbia.edu/kermit/ckututor.html#options
1776 +  58. http://www.columbia.edu/kermit/ckututor.html#commands
1777 +  59. http://www.columbia.edu/kermit/
1778 +  60. http://www.columbia.edu/kermit/ckermit.html
1779 +  61. http://www.columbia.edu/kermit/ckfaq.html
1780 +  62. http://www.columbia.edu/kermit/ckututor.html#top
1781 +  63. http://www.columbia.edu/kermit/ckututor.html#contents
1782 +  64. http://www.columbia.edu/kermit/ckututor.html#commands
1783 +  65. http://www.columbia.edu/kermit/ckututor.html#description
1784 +  66. http://www.columbia.edu/kermit/ckututor.html#commands
1785 +  67. http://www.columbia.edu/kermit/ckututor.html#personae
1786 +  68. http://www.columbia.edu/kermit/ckututor.html#personae
1787 +  69. http://www.columbia.edu/kermit/ckututor.html#iksd
1788 +  70. http://www.columbia.edu/kermit/ckututor.html#transfer
1789 +  71. http://www.columbia.edu/kermit/ckututor.html#top
1790 +  72. http://www.columbia.edu/kermit/ckututor.html#contents
1791 +  73. http://www.columbia.edu/kermit/ckututor.html#initfile
1792 +  74. http://www.columbia.edu/kermit/ckututor.html#options
1793 +  75. http://www.columbia.edu/kermit/ckututor.html#kerbang
1794 +  76. http://www.columbia.edu/kermit/ckututor.html#cmdlist
1795 +  77. http://www.columbia.edu/kermit/ckututor.html#documentation
1796 +  78. http://www.columbia.edu/kermit/ckututor.html#initfile
1797 +  79. http://www.columbia.edu/kermit/ckututor.html#documentation
1798 +  80. http://www.columbia.edu/kermit/ckscripts.html
1799 +  81. http://www.columbia.edu/kermit/ckututor.html#documentation
1800 +  82. http://www.columbia.edu/kermit/
1801 +  83. http://www.columbia.edu/kermit/ckermit.html
1802 +  84. http://www.columbia.edu/kermit/ckfaq.html
1803 +  85. http://www.columbia.edu/kermit/ckututor.html#top
1804 +  86. http://www.columbia.edu/kermit/ckututor.html#contents
1805 +  87. http://www.columbia.edu/kermit/ckututor.html#modes
1806 +  88. http://www.columbia.edu/kermit/ckututor.html#commands
1807 +  89. http://www.columbia.edu/kermit/
1808 +  90. http://www.columbia.edu/kermit/ckermit.html
1809 +  91. http://www.columbia.edu/kermit/ckfaq.html
1810 +  92. http://www.columbia.edu/kermit/ckututor.html#top
1811 +  93. http://www.columbia.edu/kermit/ckututor.html#contents
1812 +  94. http://www.columbia.edu/kermit/ckututor.html#connections
1813 +  95. http://www.columbia.edu/kermit/ckututor.html#initfile
1814 +  96. http://www.columbia.edu/kermit/ckfaq.html#term
1815 +  97. http://www.columbia.edu/kermit/
1816 +  98. http://www.columbia.edu/kermit/ckermit.html
1817 +  99. http://www.columbia.edu/kermit/ckfaq.html
1818 + 100. http://www.columbia.edu/kermit/ckututor.html#top
1819 + 101. http://www.columbia.edu/kermit/ckututor.html#contents
1820 + 102. http://www.columbia.edu/kermit/ckututor.html#transfer
1821 + 103. http://www.columbia.edu/kermit/ckututor.html#modes
1822 + 104. http://www.columbia.edu/kermit/ckututor.html#iksd
1823 + 105. http://www.columbia.edu/kermit/cable.html
1824 + 106. ftp://ftp.isi.edu/in-notes/rfc2217.txt
1825 + 107. http://www.columbia.edu/kermit/cable.html
1826 + 108. http://www.columbia.edu/kermit/ckututor.html#ftp
1827 + 109. http://www.columbia.edu/kermit/
1828 + 110. http://www.columbia.edu/kermit/ckermit.html
1829 + 111. http://www.columbia.edu/kermit/ckfaq.html
1830 + 112. http://www.columbia.edu/kermit/ckututor.html#top
1831 + 113. http://www.columbia.edu/kermit/ckututor.html#contents
1832 + 114. http://www.columbia.edu/kermit/ckututor.html#server
1833 + 115. http://www.columbia.edu/kermit/ckututor.html#connections
1834 + 116. http://www.columbia.edu/kermit/ckututor.html#download
1835 + 117. http://www.columbia.edu/kermit/ckututor.html#upload
1836 + 118. http://www.columbia.edu/kermit/ckututor.html#oldfashioned
1837 + 119. http://www.columbia.edu/kermit/ckututor.html#trouble
1838 + 120. http://www.columbia.edu/kermit/ckututor.html#advanced
1839 + 121. http://www.columbia.edu/kermit/ckututor.html#nonkermit
1840 + 122. http://www.columbia.edu/kermit/kermit.html#notslow
1841 + 123. http://www.columbia.edu/kermit/ckermit.html
1842 + 124. http://www.columbia.edu/kermit/k95.html
1843 + 125. http://www.columbia.edu/kermit/k95.html
1844 + 126. http://www.columbia.edu/kermit/ckermit.html
1845 + 127. http://www.columbia.edu/kermit/mskermit.html
1846 + 128. http://www.columbia.edu/kermit/
1847 + 129. http://www.columbia.edu/kermit/support.html
1848 + 130. http://www.columbia.edu/kermit/ckmanual.html
1849 + 131. mailto:kermit-support@columbia.edu
1850 + 132. http://www.columbia.edu/kermit/ckututor.html#documentation
1851 + 133. http://www.columbia.edu/kermit/ckututor.html#ftp
1852 + 134. http://www.columbia.edu/kermit/
1853 + 135. http://www.columbia.edu/kermit/ckermit.html
1854 + 136. http://www.columbia.edu/kermit/ckfaq.html
1855 + 137. http://www.columbia.edu/kermit/ckututor.html#top
1856 + 138. http://www.columbia.edu/kermit/ckututor.html#contents
1857 + 139. http://www.columbia.edu/kermit/ckututor.html#ftp
1858 + 140. http://www.columbia.edu/kermit/ckututor.html#transfer
1859 + 141. http://www.columbia.edu/kermit/ckututor.html#iksd
1860 + 142. http://www.columbia.edu/kermit/
1861 + 143. http://www.columbia.edu/kermit/ckermit.html
1862 + 144. http://www.columbia.edu/kermit/ckfaq.html
1863 + 145. http://www.columbia.edu/kermit/ckututor.html#top
1864 + 146. http://www.columbia.edu/kermit/ckututor.html#contents
1865 + 147. http://www.columbia.edu/kermit/ckututor.html#iksd
1866 + 148. http://www.columbia.edu/kermit/ckututor.html#transfer
1867 + 149. http://www.columbia.edu/kermit/ckututor.html#server
1868 + 150. http://www.columbia.edu/kermit/ftpclient.html
1869 + 151. http://www.columbia.edu/kermit/ckututor.html#documentation
1870 + 152. http://www.columbia.edu/kermit/
1871 + 153. http://www.columbia.edu/kermit/ckermit.html
1872 + 154. http://www.columbia.edu/kermit/ckfaq.html
1873 + 155. http://www.columbia.edu/kermit/ckermit3.html#x3
1874 + 156. http://www.columbia.edu/kermit/ckermit3.html#x2.2
1875 + 157. http://www.columbia.edu/kermit/ckututor.html#top
1876 + 158. http://www.columbia.edu/kermit/ckututor.html#contents
1877 + 159. http://www.columbia.edu/kermit/ckututor.html#security
1878 + 160. http://www.columbia.edu/kermit/ckututor.html#ftp
1879 + 161. http://www.columbia.edu/kermit/cuiksd.html
1880 + 162. http://www.columbia.edu/kermit/iksd.html
1881 + 163. http://www.columbia.edu/kermit/
1882 + 164. http://www.columbia.edu/kermit/ckermit.html
1883 + 165. http://www.columbia.edu/kermit/ckfaq.html
1884 + 166. http://www.columbia.edu/kermit/ckututor.html#top
1885 + 167. http://www.columbia.edu/kermit/ckututor.html#contents
1886 + 168. http://www.columbia.edu/kermit/ckututor.html#personae
1887 + 169. http://www.columbia.edu/kermit/ckututor.html#iksd
1888 + 170. http://www.columbia.edu/kermit/security.html
1889 + 171. http://www.columbia.edu/kermit/
1890 + 172. http://www.columbia.edu/kermit/ckermit.html
1891 + 173. http://www.columbia.edu/kermit/ckfaq.html
1892 + 174. http://www.columbia.edu/kermit/ckututor.html#top
1893 + 175. http://www.columbia.edu/kermit/ckututor.html#contents
1894 + 176. http://www.columbia.edu/kermit/ckututor.html#license
1895 + 177. http://www.columbia.edu/kermit/ckututor.html#iksd
1896 + 178. http://www.columbia.edu/kermit/ckututor.html#options
1897 + 179. http://www.columbia.edu/kermit/ckermit3.html#x3.1.2
1898 + 180. http://www.columbia.edu/kermit/
1899 + 181. http://www.columbia.edu/kermit/ckermit.html
1900 + 182. http://www.columbia.edu/kermit/ckfaq.html
1901 + 183. http://www.columbia.edu/kermit/ckututor.html#top
1902 + 184. http://www.columbia.edu/kermit/ckututor.html#contents
1903 + 185. http://www.columbia.edu/kermit/ckututor.html#other
1904 + 186. http://www.columbia.edu/kermit/ckututor.html#personae
1905 + 187. http://www.columbia.edu/kermit/ck90.html
1906 + 188. http://www.columbia.edu/kermit/cu-bsd-license.html
1907 + 189. http://www.opensource.org/
1908 + 190. http://www.columbia.edu/kermit/
1909 + 191. http://www.columbia.edu/kermit/ckermit.html
1910 + 192. http://www.columbia.edu/kermit/ckfaq.html
1911 + 193. http://www.columbia.edu/kermit/ckututor.html#top
1912 + 194. http://www.columbia.edu/kermit/ckututor.html#contents
1913 + 195. http://www.columbia.edu/kermit/ckututor.html#documentation
1914 + 196. http://www.columbia.edu/kermit/ckututor.html#license
1915 + 197. http://www.columbia.edu/kermit/
1916 + 198. http://www.columbia.edu/kermit/howtoget.html
1917 + 199. http://www.columbia.edu/kermit/
1918 + 200. http://www.columbia.edu/kermit/ckermit.html
1919 + 201. http://www.columbia.edu/kermit/ckfaq.html
1920 + 202. http://www.columbia.edu/kermit/ckututor.html#top
1921 + 203. http://www.columbia.edu/kermit/ckututor.html#contents
1922 + 204. http://www.columbia.edu/kermit/ckututor.html#files
1923 + 205. http://www.columbia.edu/kermit/ckututor.html#other
1924 + 206. http://www.columbia.edu/kermit/ckmanual.html
1925 + 207. http://www.columbia.edu/kermit/ckermit70.html
1926 + 208. http://www.columbia.edu/kermit/ckermit80.html
1927 + 209. http://www.columbia.edu/kermit/ckermit90.html
1928 + 210. http://www.columbia.edu/kermit/ckermit.html
1929 + 211. http://www.columbia.edu/kermit/ck80binaries.html
1930 + 212. http://www.columbia.edu/kermit/scriptlib.html
1931 + 213. http://www.columbia.edu/kermit/newfaq.html
1932 + 214. http://www.columbia.edu/kermit/ckfaq.html
1933 + 215. http://www.columbia.edu/kermit/security.html
1934 + 216. http://www.columbia.edu/kermit/telnet.html
1935 + 217. http://www.columbia.edu/kermit/studies.html
1936 + 218. http://www.columbia.edu/kermit/ckcbwr.html
1937 + 219. http://www.columbia.edu/kermit/ckubwr.html
1938 + 220. http://www.columbia.edu/kermit/ckvbwr.html
1939 + 221. http://www.columbia.edu/kermit/ckuins.html
1940 + 222. http://www.columbia.edu/kermit/ckvins.html
1941 + 223. http://www.columbia.edu/kermit/support.html
1942 + 224. http://www.columbia.edu/kermit/k95tutorial.html
1943 + 225. news:comp.protocols.kermit.misc
1944 + 226. http://www.columbia.edu/kermit/
1945 + 227. http://www.columbia.edu/kermit/ckermit.html
1946 + 228. http://www.columbia.edu/kermit/ckfaq.html
1947 + 229. http://www.columbia.edu/kermit/ckututor.html#top
1948 + 230. http://www.columbia.edu/kermit/ckututor.html#contents
1949 + 231. http://www.columbia.edu/kermit/ckututor.html#authors
1950 + 232. http://www.columbia.edu/kermit/ckututor.html#documentation
1951 + 233. http://www.columbia.edu/kermit/cu-bsd-license.html
1952 + 234. ftp://kermit.columbia.edu/kermit/c-kermit/ckermit.ini
1953 + 235. ftp://kermit.columbia.edu/kermit/c-kermit/ckermod.ini
1954 + 236. http://www.columbia.edu/kermit/ckuins.html
1955 + 237. http://www.columbia.edu/kermit/ckcbwr.html
1956 + 238. http://www.columbia.edu/kermit/ckubwr.html
1957 + 239. http://www.columbia.edu/kermit/ckcplm.html
1958 + 240. http://www.columbia.edu/kermit/ckccfg.html
1959 + 241. http://www.columbia.edu/kermit/ckuins.html
1960 + 242. http://www.columbia.edu/kermit/
1961 + 243. http://www.columbia.edu/kermit/ckermit.html
1962 + 244. http://www.columbia.edu/kermit/ckfaq.html
1963 + 245. http://www.columbia.edu/kermit/ckututor.html#top
1964 + 246. http://www.columbia.edu/kermit/ckututor.html#contents
1965 + 247. http://www.columbia.edu/kermit/ckututor.html#files
1966 + 248. mailto:kermit@columbia.edu
1967 --- /dev/null
1968 +++ ckermit-301/ckuins.txt
1969 @@ -0,0 +1,3575 @@
1970 +
1971 +   [1]The Columbia Crown The Kermit Project | Columbia University
1972 +   612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
1973 +   ...since 1981
1974 +   [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
1975 +   [10]Support
1976 +
1977 +C-Kermit 9.0 Installation Instructions and Options for Unix
1978 +
1979 +   [ [11]Contents ] [ [12]C-Kermit ] [ [13]Kermit Home ]
1980 +
1981 +   Frank da Cruz
1982 +   The Kermit Project
1983 +   Columbia University
1984 +
1985 +      As of C-Kermit version: 9.0.300, 30 June 2011
1986 +      This file last updated: Tue Jun 28 08:28:08 2011 (New York City
1987 +   time)
1988 +
1989 +   IF YOU ARE READING A PLAIN-TEXT version of this document, it is a
1990 +   plain-text copy of a Web page. You can visit the original (and possibly
1991 +   more up-to-date) Web page here:
1992 +
1993 +[14]http://www.columbia.edu/kermit/ckuins.html
1994 +
1995 +CONTENTS
1996 +
1997 +   [15]OVERVIEW
1998 +    1. [16]INTERNET QUICK START
1999 +    2. [17]INSTALLING FROM PACKAGES
2000 +    3. [18]INSTALLING PREBUILT BINARIES
2001 +    4. [19]BUILDING FROM SOURCE CODE
2002 +    5. [20]INSTALLING THE KERMIT FILES
2003 +    6. [21]INSTALLING UNIX C-KERMIT FROM DOS-FORMAT DISKETTES
2004 +    7. [22]CHECKING THE RESULTS
2005 +    8. [23]REDUCING THE SIZE OF THE EXECUTABLE PROGRAM IMAGE
2006 +    9. [24]UNIX VERSIONS
2007 +   10. [25]DIALING OUT AND COORDINATING WITH UUCP
2008 +   11. [26]RUNNING UNIX C-KERMIT SETUID OR SETGID
2009 +   12. [27]CONFIGURING UNIX WORKSTATIONS
2010 +   13. [28]BIZARRE BEHAVIOR AT RUNTIME
2011 +   14. [29]CRASHES AND CORE DUMPS
2012 +   15. [30]SYSLOGGING
2013 +   16. [31]BUILDING SECURE VERSIONS OF C-KERMIT 9.0
2014 +   17. [32]INSTALLING C-KERMIT AS AN SSH SERVER SUBSYSTEM
2015 +
2016 +OVERVIEW
2017 +
2018 +   [ [33]Top ] [ [34]Contents ] [ [35]Next ]
2019 +
2020 +     WARNING: This document contains notes that have been accumulating
2021 +     since the mid 1980s. Many of the products and Unix versions
2022 +     mentioned here have not been heard of in a long while, but that does
2023 +     not necessarily mean they are not still running in some obscure
2024 +     nook.
2025 +
2026 +   This file contains Unix-specific information. A lot of it. Unlike most
2027 +   other packages, C-Kermit tries very hard to be portable to every Unix
2028 +   variety (and every release of each one) known to exist, including many
2029 +   that are quite old, as well as to other platforms like VMS, AOS/VS,
2030 +   VOS, OS-9, the BeBox, the Amiga, etc.
2031 +
2032 +   Since C-Kermit gets so deeply into the file system, i/o system, and
2033 +   other areas that differ radically from one Unix platform to the next,
2034 +   this means that a lot can go wrong when you try to install C-Kermit on
2035 +   (for example) a new release of a particular variety of Unix, in which
2036 +   certain things might have changed that C-Kermit depended upon.
2037 +
2038 +   This file concentrates on installation. For a description of general
2039 +   configuration options for C-Kermit, please read the [36]Configurations
2040 +   Options document. For troubleshooting after installation, see the
2041 +   [37]General Hints and Tips and [38]Unix-Specific Hints and Tips
2042 +   documents. The latter, in particular, contains lots of information on
2043 +   lots of specific Unix platforms. If you want to work on the source
2044 +   code, see the [39]C-Kermit Program Logic Manual
2045 +
2046 +   You may install C-Kermit:
2047 +
2048 +     * From an "[40]install package", if one is available.
2049 +     * As a [41]prebuilt binary, if available, plus accompanying text
2050 +       files.
2051 +     * By building from [42]source code.
2052 +
2053 +1. INTERNET QUICK START
2054 +
2055 +   [ [43]Top ] [ [44]Contents ] [ [45]Next ] [ [46]Previous ]
2056 +
2057 +   If your Unix computer is on the Internet and it has a C compiler,
2058 +   here's how to download, build, and install C-Kermit directly from the
2059 +   "tarballs" or Zip archives:
2060 +
2061 +    1. Make a fresh directory and cd to it.
2062 +    2. Download the C-Kermit source code:
2063 +       [47]ftp://www.columbia.edu/kermit/archives/cku211.tar.Z (compress
2064 +       format) or [48]ftp://www.columbia.edu/kermit/archives/cku211.tar.gz
2065 +       (gunzip format). If those links don't work, FTP transfers are being
2066 +       blocked; try these HTTP links instead:
2067 +       [49]http://kermit.columbia.edu/ftp/archives/cku211.tar.Z (compress
2068 +       format) or
2069 +       [50]http://kermit.columbia.edu/ftp/archives/cku211.tar.gz (gunzip
2070 +       format).
2071 +    3. Uncompress the compressed tar file with "uncompress" or "gunzip",
2072 +       according to which type of compressed file you downloaded. (If you
2073 +       don't understand this, you could download a (much larger)
2074 +       uncompressed tar archive directly:
2075 +       [51]ftp://www.columbia.edu/kermit/archives/cku211.tar or
2076 +       [52]http://kermit.columbia.edu/ftp/archives/cku211.tar
2077 +    4. Now type "tar xvf cku211.tar" to unpack the individual files from
2078 +       the tar archive.
2079 +    5. Type "rm cku211.tar" to get rid of the tar archive, which is no
2080 +       longer needed.
2081 +    6. Read the comments at the top of the makefile to find out which
2082 +       target to use and then type the appropriate "make" command, such as
2083 +       "make linux", "make solaris8", etc.
2084 +    7. This produces a binary in your current directory called "wermit".
2085 +       Start it by typing "./wermit" and [53]try it out to make sure it
2086 +       works. Then read [54]Section 5 for how to install it, or simply
2087 +       copy the wermit binary to the desired public directory, rename it
2088 +       to kermit, and give it the needed permissions (and, if it is going
2089 +       to be used to dial out, give it the same group and owner and
2090 +       permissions as the cu, tip, or minicom program).
2091 +
2092 +   For secure installations, see [55]Sections 5 and [56]16.
2093 +
2094 +2. INSTALLING FROM PACKAGES
2095 +
2096 +   [ [57]Top ] [ [58]Contents ] [ [59]Next ] [ [60]Previous ]
2097 +
2098 +   Various Unix varieties -- Linux, Solaris, AIX, etc -- now incorporate
2099 +   the idea of "install packages", and many users expect to find all new
2100 +   applications in this format. A selection of install packages might be
2101 +   available for any given release of C-Kermit, but there is a tradeoff
2102 +   between convenience and safety. Unix presents several notable problems
2103 +   to the builder of install packages:
2104 +
2105 +    a. Since C-Kermit is portable to many non-Unix platforms (VMS, VOS,
2106 +       AOS/VS, etc), some of the files in the C-Kermit distribution do not
2107 +       fit into the Unix application model. In particular, C-Kermit
2108 +       includes some plain text files (described in [61]Section 5) and
2109 +       Unix has no standard place to put such files. Typical Unix package
2110 +       managers do not allow for them. Where should they go, and how will
2111 +       the user know where to find them?
2112 +    b. Installation of any program that will be used to make modem calls
2113 +       requires some important decisions from the installer regarding
2114 +       security and privilege.
2115 +
2116 +   Item (b) is discussed at length in [62]Sections 10 and [63]11 of this
2117 +   document, but the package-related aspects are also given here. The
2118 +   basic problem is that Unix dialout devices and the UUCP "lock files"
2119 +   that regulate contention for them (described in [64]Section 10) are
2120 +   usually protected against "world". Therefore, the install procedure
2121 +   must either run as root in order to give the Kermit binary the required
2122 +   permissions, group, and/or owner, or else the dialout devices and
2123 +   associated directories must be open for group or world reading and
2124 +   writing. Otherwise, the Kermit program just installed WILL NOT WORK for
2125 +   dialing out.
2126 +
2127 +   Thus, a well-crafted installation procedure should present the options
2128 +   and allow the installer to choose the method, if any, for regulating
2129 +   access to the dialout devices:
2130 +
2131 +    a. Check the permissions of the lockfile directory and the dialout
2132 +       devices. If they do not allow group or world R/W access, then:
2133 +    b. "Your UUCP lockfile directory and/or dialout devices require
2134 +       privilege to access. You must either change their permissions or
2135 +       install Kermit with privileges."
2136 +    c. "If you wish to install Kermit with privileges, it will be given
2137 +       the same owner, group, and permissions as the cu program so it can
2138 +       use the dialout devices." (This is increasingly problematic as some
2139 +       newer Unix systems like Mac OS X don't have a cu program, or even a
2140 +       serial port!)
2141 +    d. If they choose (c) but the user is not root, give a message that
2142 +       the install procedure can be run only by root and then quit.
2143 +
2144 +   It should go without saying, of course, that any binaries that are to
2145 +   be included in an install package should be built fresh on the exact
2146 +   platform (e.g. Red Hat 8.0 on Intel) for which the package is targeted;
2147 +   prebuilt binaries ([65]next section) from other sites are likely to
2148 +   have library mismatches. [66]CLICK HERE for more about building
2149 +   C-Kermit install packages.
2150 +
2151 +   The Kermit Project does not have the resources or the expertise to make
2152 +   install packages for every platform. Most install packages, therefore,
2153 +   are contributed by others, and they do not necessarily follow the
2154 +   guidelines given above. Pay attention to what they do.
2155 +
2156 +   If you are an end user who has obtained a C-Kermit install package for
2157 +   a particular platform, you should be aware that some additional steps
2158 +   might needed if you want to use Kermit to dial out. Read [67]Section 10
2159 +   for details.
2160 +
2161 +3. INSTALLING PREBUILT BINARIES
2162 +
2163 +   [ [68]Top ] [ [69]Contents ] [ [70]Next ] [ [71]Previous ]
2164 +
2165 +   Hundreds of prebuilt C-Kermit binaries are available on the CDROM in
2166 +   the BINARY tree [NOTE: The C-Kermit CDROM is still for version 7.0],
2167 +   and at our ftp site in the [72]kermit/bin area (with names starting
2168 +   with "ck"), also accessible on the [73]C-Kermit website. To install a
2169 +   prebuilt binary:
2170 +
2171 +    a. Rename the binary to "wermit".
2172 +    b. Make sure it works; some tests are suggested in [74]Section 7.
2173 +    c. Follow steps (b) through (e) in [75]Section 4.
2174 +    d. Install related files as described in [76]Section 5.
2175 +
2176 +   But first... Please heed the following cautions:
2177 +
2178 +    a. If you pick the wrong binary, it won't work (or worse).
2179 +    b. Even when you pick the appropriate binary, it still might not work
2180 +       due to shared-library mismatches, etc. (see [77]Section 4.0).
2181 +    c. Don't expect a binary built on or for version n of your OS to work
2182 +       on version n - x (where x > 0). However, it is supposed to be safe
2183 +       to run a binary built on (or for) an older OS release on a newer
2184 +       one (but is [78]increasingly less so as time-honored principles of
2185 +       stability and backwards compatibility go fading into obscurity).
2186 +
2187 +   Therefore, it is always better to build your own binary from source
2188 +   code ([79]next section) if you can. But since it is increasingly common
2189 +   for Unix systems (not to mention VMS and other OS's) to be delivered
2190 +   without C compilers, it is sometimes not possible. In such cases, try
2191 +   the most appropriate prebuilt binary or binaries, and if none of them
2192 +   work, [80]contact us and we'll see what we can do to help.
2193 +
2194 +4. BUILDING FROM SOURCE CODE
2195 +
2196 +   [ [81]Top ] [ [82]Contents ] [ [83]Next ] [ [84]Previous ]
2197 +
2198 +   Also see: [85]Section 8 and [86]Section 9.
2199 +
2200 +   C-Kermit is designed to be built and used on as many platforms as
2201 +   possible: Unix and non-Unix, old and new (and ancient), ANSI C and K&R.
2202 +   The Unix version does not use or depend on any external tools for
2203 +   building except the "make" utility, the C compiler, the linker, and the
2204 +   shell. It does not use any external automated configuration tools such
2205 +   as configure, autoconf, automake, libtool, etc. Everything in C-Kermit
2206 +   has been built by hand based on direct experience or reports or
2207 +   contributions from users of each platform.
2208 +
2209 +   The [87]C-Kermit makefile contains the rules for building the program
2210 +   for each of the hundreds of different kinds of Unix systems that
2211 +   C-Kermit attempts to support. It covers all Unix variations since about
2212 +   1980 -- pretty much everything after Unix V6. Separate makefiles are
2213 +   used for [88]Plan 9 and [89]2.x BSD.
2214 +
2215 +   Prerequisites:
2216 +
2217 +     * The C compiler, linker, and make program must be installed.
2218 +     * The C libraries and header files must be installed (*).
2219 +     * The C-Kermit source code and makefile in your current directory.
2220 +     * The C-Kermit text files ([90]Section 5) in your current directory.
2221 +
2222 +     * This is becoming problematic in this new age of "selective
2223 +       installs" e.g. of Linux packages. C-Kermit builds will often fail
2224 +       because replying "no" to some obscure Linux installation option
2225 +       will result in missing libraries or header files. Ditto on
2226 +       platforms like AIX and Solaris that don't come with C compilers,
2227 +       and then later have gcc installed, but are still missing crucial
2228 +       libraries, like libm (math).
2229 +
2230 +   Plus:
2231 +
2232 +     * For TCP/IP networking support, the sockets library and related
2233 +       header files must be installed.
2234 +     * The math library for floating-point arithmetic support (can be
2235 +       deselected by adding -DNOFLOAT to CFLAGS and removing -lm from
2236 +       LIBS).
2237 +     * Many and varied security libraries for building a secure version
2238 +       (Kerberos, SSL/TLS, SRP, Zlib,...) These are required only if you
2239 +       select a secure target.
2240 +     * For the curses-based fullscreen file-ransfer display, the curses or
2241 +       ncurses header file(s) and library, and probably also the termcap
2242 +       and/or termlib library. Note that the names and locations of these
2243 +       files and libraries are likely to change capriciously with every
2244 +       new release of your Unix product. If you discover that the C-Kermit
2245 +       build procedure fails because your curses and/or termxxx headers or
2246 +       libraries are not named or located as expected, please [91]let us
2247 +       know. In the meantime, work around by installing symlinks.
2248 +     * IMPORTANT: Modern Linux distributions might give you the choice
2249 +       during installation of whether to install the "ncurses development
2250 +       package" (perhaps called "ncurses-devel"). If you did not install
2251 +       it, you won't be able to build C-Kermit with curses support
2252 +       included. In this case, either go back and install ncurses, or else
2253 +       choose (or create) a non-curses makefile target for your platform.
2254 +       To install the ncurses developers tools in Red Hat Linux, do
2255 +       "apt-get install ncurses-developer" or if you have the CD:
2256 +
2257 +mount redhat cdrom
2258 +goto RedHat/RPMS
2259 +rpm -ivh ncurses-devel*.rpm
2260 +or to have the exact name ls ncurse* and load as
2261 +rpm -ivh filename
2262 +then leave the cdrom and unmount it.
2263 +
2264 +     * In AIX you might have to go back and install any or all of:
2265 +
2266 +bos.adt.base
2267 +bos.adt.include
2268 +bos.adt.lib
2269 +bos.adt.libm
2270 +bos.adt.utils
2271 +
2272 +       from the first installation CD.
2273 +
2274 +   Depending on where you got it, the makefile might need to be renamed
2275 +   from ckuker.mak to makefile. Directions:
2276 +
2277 +    a. Type "make xxx" where xxx is the name of the makefile target most
2278 +       appropriate to your platform, e.g. "make linux", "make aix43", etc.
2279 +       Read the [92]comments at the top of the makefile for a complete
2280 +       list of available targets (it's a long list).
2281 +    b. Test the resulting 'wermit' file (see [93]Section 7 for
2282 +       suggestions). If it's OK, proceed; otherwise [94]notify us.
2283 +
2284 +     NOTE: steps (c) through (e) can be accomplished using the
2285 +     [95]makefile 'install' target as described in [96]Section 5.4.
2286 +    c. Rename the 'wermit' file to 'kermit', copy it to the desired binary
2287 +       directory (such as /usr/local/bin or /opt/something), and if it is
2288 +       to be used for dialing out, give it the same owner, group, and
2289 +       permissions as the 'cu' program (IMPORTANT: read [97]Sections 10
2290 +       and [98]11 for details).
2291 +    d. Install the man page, ckuker.nr, with your other man pages.
2292 +    e. Install the accompanying text files (see [99]Section 5).
2293 +    f. If you want C-Kermit to also offer a Telnet command-line
2294 +       personality, make a symbolic link as follows:
2295 +
2296 +cd directory-where-kermit-binary-is
2297 +ln -s kermit telnet
2298 +
2299 +       If you want C-Kermit to be the default Telnet client, make sure the
2300 +       directory in which you created the symlink is in the PATH ahead of
2301 +       the where the regular Telnet client is.
2302 +    g. If you want C-Kermit to also offer an FTP command-line personality,
2303 +       make a symlink called "ftp" as in (f).
2304 +    h. If you want C-Kermit to also offer an FTTP command-line
2305 +       personality, make a symlink called "http" as in (f).
2306 +    i. If you want to offer an Internet Kermit Service, follow the
2307 +       directions in the [100]IKSD Administrator's Guide.
2308 +
2309 +4.0. Special Considerations for C-Kermit 8.0-9.0
2310 +
2311 +   [ [101]Top ] [ [102]Contents ] [ [103]Next ]
2312 +
2313 +   Also see: [104]C-Kermit Configuration Options
2314 +
2315 +   SECTION CONTENTS
2316 +
2317 +4.1. [105]The Unix Makefile
2318 +4.2. [106]The C-Kermit Initialization File
2319 +4.3. [107]The 2.x BSD Makefile
2320 +4.4. [108]The Plan 9 Makefile
2321 +4.5. [109]Makefile Failures
2322 +
2323 +   (Also see the [110]Configurations Options document, [111]Section 8).
2324 +
2325 +   Lots of new features have been added in versions 7.0 and 8.0 that
2326 +   require access to new symbols, APIs, libraries, etc, and this will no
2327 +   doubt cause problems in compiling, linking, or execution on platforms
2328 +   where 6.0 and earlier built without incident. This section contains
2329 +   what we know as of the date of this file.
2330 +
2331 +   The first category concerns the new Kermit Service Daemon (IKSD; see
2332 +   the [112]IKSD Administrator's Guide for details):
2333 +
2334 +   The wtmp File
2335 +          When C-Kermit is started as an IKSD (under inetd), it makes
2336 +          syslog and wtmp entries, and also keeps its own ftpd-like log.
2337 +          The code assumes the wtmp log is /var/log/wtmp on Linux and
2338 +          /usr/adm/wtmp elsewhere. No doubt this assumption will need
2339 +          adjustment. Use -DWTMPFILE=path to override at compile time
2340 +          (there is also a runtime override). See [113]iksd.html for
2341 +          details.
2342 +
2343 +   UTMP, utsname(), etc
2344 +          C-Kermit 7.0 gets as much info as it can about its job -- mainly
2345 +          for IKSD logging -- from utmp. But of course utmp formats and
2346 +          fields differ, and for that matter, there can be two different
2347 +          header files, <utmp.h> and <utmpx.h>. Look for HAVEUTMPX and
2348 +          HAVEUTHOST in [114]ckufio.c and let me know of any needed
2349 +          adjustments.
2350 +
2351 +   Password lookup
2352 +          IKSD needs to authenticate incoming users against the password
2353 +          list. In some cases, this requires the addition of -lcrypt (e.g.
2354 +          in Unixware 2.x). In most others, the crypt functions are in the
2355 +          regular C library. If you get "crypt" as an unresolved symbol at
2356 +          link time, add -lcrypt to LIBS. If your site has local
2357 +          replacement libraries for authentication, you might need a
2358 +          special LIBS clause such as "LIBS=-L/usr/local/lib -lpwent".
2359 +
2360 +          These days most Unix systems take advantage of shadow password
2361 +          files or Pluggable Authentication Modules (PAM). If your system
2362 +          uses shadow passwords you must add -DCK_SHADOW to the CFLAGS
2363 +          list. If your system requires PAM you must add -DCK_PAM to the
2364 +          CFLAGS and -lpam -ldl to LIBS.
2365 +
2366 +   getusershell()
2367 +          This is called by the IKSD at login time to see if a user has
2368 +          been "turned off". But many Unix platforms lack this function.
2369 +          In that case, you will get unresolved symbol reports at link
2370 +          time for _getusershell, _endusershell; to work around, add
2371 +          -DNOGETUSERSHELL.
2372 +
2373 +   initgroups()
2374 +          This is called by IKSD after successful authentication. But some
2375 +          platforms do not have this function, so obviously it can't be
2376 +          called there, in which case add -DNOINITGROUPS.
2377 +
2378 +   setreuid(), setreuid(), setregid() not found or "deprecated"
2379 +          Find out what your Unix variety wants you to use instead, and
2380 +          make appropriate substitutions in routine zvpass(), module
2381 +          [115]ckufio.c, and [116]let us know.
2382 +
2383 +   printf()
2384 +          IKSD installs a printf() substitute to allow redirection of
2385 +          printf-like output to the connection. However, this can conflict
2386 +          with some curses libraries. In this case, separate binaries must
2387 +          be built for IKSD and non-IKSD use.
2388 +
2389 +   If you encounter difficulties with any of the above, and you are not
2390 +   interested in running C-Kermit as an IKSD, then simply add NOIKSD to
2391 +   CFLAGS and rebuild. Example:
2392 +
2393 +make sco286
2394 +(get lots of errors)
2395 +make clean
2396 +make sco286 "KFLAGS=-DNOIKSD"
2397 +
2398 +   Some non-IKSD things to watch out for:
2399 +
2400 +   Return type of main()
2401 +          The main() routine is in [117]ckcmai.c. If you get complaints
2402 +          about "main: return type is not blah", define MAINTYPE on the CC
2403 +          command line, e.g.:
2404 +
2405 +make xxx "KFLAGS=-DMAINTYPE=blah
2406 +
2407 +          (where blah is int, long, or whatever). If the complaint is
2408 +          "Attempt to return a value from a function of type void" then
2409 +          add -DMAINISVOID:
2410 +
2411 +make xxx "KFLAGS=-DMAINISVOID=blah
2412 +
2413 +   DNS Service Records
2414 +          This feature allows a remote host to redirect C-Kermit to the
2415 +          appropriate socket for the requested service; e.g. if C-Kermit
2416 +          requests service "telnet" and the host offers Telnet service on
2417 +          port 999 rather than the customary port 23. If you get
2418 +          compile-time complaints about not being able to find <resolv.h>,
2419 +          <netdb.h>, or <arpa/nameser.h>, add -DNO_DNS_SRV to CFLAGS. If
2420 +          you get link-time complaints about unresolved symbols res_search
2421 +          or dn_expand, try adding -lresolve to LIBS.
2422 +
2423 +   \v(ipaddress)
2424 +          If "echo \v(ipaddress)" shows an empty string rather than your
2425 +          local IP address, add -DCKGHNLHOST to CFLAGS and rebuild.
2426 +
2427 +   <sys/wait.h>
2428 +          If this file can't be found at compile time, add -DNOREDIRECT to
2429 +          CFLAGS. This disables the REDIRECT and PIPE commands and
2430 +          anything else that needs the wait() system service.
2431 +
2432 +   syslog()
2433 +          C-Kermit can now write syslog records. Some older platforms
2434 +          might not have the syslog facility. In that case, add
2435 +          -DNOSYSLOG. Others might have it, but require addition of
2436 +          -lsocket to LIBS (SCO OSR5 is an example). See [118]Section 15.
2437 +
2438 +   putenv()
2439 +          If "_putenv" comes up as an undefined symbol, add -DNOPUTENV to
2440 +          CFLAGS and rebuild.
2441 +
2442 +   "Passing arg1 of 'time' from incompatible pointer"
2443 +          This is a mess. See the mass of #ifdefs in the appropriate
2444 +          module, [119]ckutio.c or [120]ckufio.c.
2445 +
2446 +   gettimeofday()
2447 +          Wrong number of arguments. On most platforms, gettimeofday()
2448 +          takes two arguments, but on a handful of others (e.g. Motorola
2449 +          System V/88 V4, SNI Reliant UNIX 5.43, etc) it takes one. If
2450 +          your version of gettimeofday() is being called with two args but
2451 +          wants one, add -DGTODONEARG.
2452 +
2453 +   "Assignment makes pointer from integer without a cast"
2454 +          This warning might appear in [121]ckutio.c or [122]ckufio.c. (or
2455 +          elsewhere), and usually can be traced to the use of a system or
2456 +          library function that returns a pointer but that is not declared
2457 +          in the system header files even though it should be. Several
2458 +          functions are commonly associated with this error:
2459 +
2460 +          + getcwd(): Add -DDCLGETCWD to CFLAGS and rebuild.
2461 +          + popen() : Add -DDCLPOPEN to CFLAGS and rebuild.
2462 +          + fdopen(): Add -DDCLFDOPEN to CFLAGS and rebuild.
2463 +
2464 +   "Operands of = have incompatible types"
2465 +   "Incompatible types in assignment"
2466 +          If this comes from [123]ckcnet.c and comes from a statement
2467 +          involving inet_addr(), try adding -DINADDRX to CFLAGS. If that
2468 +          doesn't help, then try adding -DNOMHHOST.
2469 +
2470 +   Complaints about args to get/setsockopt(), getpeername(), getsockname()
2471 +          These are all in [124]ckcnet.c. Different platforms and OS's and
2472 +          versions of the same OS change this all the time: int, size_t,
2473 +          unsigned long, etc. All the affected variables are declared
2474 +          according to #ifdefs within ckcnet.c, so find the declarations
2475 +          and adjust the #ifdefs accordingly.
2476 +
2477 +   size_t
2478 +          In case of complaints about "unknown type size_t", add
2479 +          -DSIZE_T=int (or other appropriate type) to CFLAGS.
2480 +
2481 +   'tz' undefined
2482 +   Use of undefined enum/struct/union 'timezone'
2483 +          Left of 'tv_sec' specifies undefined struct/union 'timeval' And
2484 +          similar complaints in [125]ckutio.c: Add -DNOGFTIMER and/or
2485 +          -DNOTIMEVAL.
2486 +
2487 +   Symlinks
2488 +          The new built-in DIRECTORY command should show symlinks like "ls
2489 +          -l" does. If it does not, check to see if your platform has the
2490 +          lstat() and readlink() functions. If so, add -DUSE_LSTAT and
2491 +          -DCKSYMLINK to CFLAGS and rebuild. On the other hand, if lstat()
2492 +          is unresolved at link time, add -DNOLSTAT to CFLAGS. If
2493 +          readlink() is also unresolved, add -DNOSYMLINK.
2494 +
2495 +   realpath()
2496 +          Link-time complains about realpath() -- find the library in
2497 +          which it resides and add it to LIBS (example for Unixware 7.1:
2498 +          "-lcudk70") or add -DNOREALPATH to CFLAGS and rebuild. If built
2499 +          with realpath() but debug log file is truncated or mangled,
2500 +          ditto (some realpath() implementations behave differently from
2501 +          others). If built with realpath() and seemingly random core
2502 +          dumps occur during file path resolution, ditto.
2503 +
2504 +   Failure to locate header file <term.h>
2505 +          Usually happens on Linux systems that have the C compiler
2506 +          installed, but not the ncurses package (see comments about
2507 +          selective installs above). Go back and install ncurses, or use
2508 +          "make linuxnc" (Linux No Curses).
2509 +
2510 +   "Can't find shared library libc.so.2.1"
2511 +   "Can't find shared library libncurses.so.3.0", etc...
2512 +          You are trying to run a binary that was built on a computer that
2513 +          has different library versions than your computer, and your
2514 +          computer's loader is picky about library version numbers.
2515 +          Rebuild from source on your computer.
2516 +
2517 +   Time (struct tm) related difficulties:
2518 +          Errors like the following:
2519 +
2520 +"ckutio.c", line 11994: incomplete struct/union/enum tm: _tm
2521 +"ckutio.c", line 11995: error: cannot dereference non-pointer type
2522 +"ckutio.c", line 11995: error: assignment type mismatch
2523 +"ckutio.c", line 11997: warning: using out of scope declaration: localtime
2524 +"ckutio.c", line 11997: error: unknown operand size: op "="
2525 +"ckutio.c", line 11997: error: assignment type mismatch
2526 +"ckutio.c", line 11998: error: undefined struct/union member: tm_year
2527 +"ckutio.c", line 12000: error: undefined struct/union member: tm_mon
2528 +"ckutio.c", line 12001: error: undefined struct/union member: tm_mday
2529 +"ckutio.c", line 12002: error: undefined struct/union member: tm_hour
2530 +"ckutio.c", line 12003: error: undefined struct/union member: tm_min
2531 +"ckutio.c", line 12004: error: undefined struct/union member: tm_sec
2532 +
2533 +          are due to failure to include the appropriate time.h header
2534 +          files. Unix platforms generally have one or more of the
2535 +          following: <time.h>, <sys/time.h>, and <sys/timeb.h>. Any
2536 +          combination of these might be required. Defaults are set up for
2537 +          each makefile target. The defaults can be corrected on the CC
2538 +          command line by adding the appropriate definition from the
2539 +          following list to CFLAGS:
2540 +
2541 +-DTIMEH         Include <time.h>
2542 +-DNOTIMEH       Don't include <time.h>
2543 +-DSYSTIMEH      Include <sys/time.h>
2544 +-DNOSYSTIMEH    Don't include <sys/time.h>
2545 +-DSYSTIMEBH     Include <sys/timeb.h>
2546 +-DNOSYSTIMEBH   Don't include <sys/timeb.h>
2547 +
2548 +          Note that <sys/timeb.h> is relatively scarce in the System V and
2549 +          POSIX environments; the only platform of recent vintage where it
2550 +          was/is used is OSF/1 and its derivatives (Digital Unix and Tru64
2551 +          Unix).
2552 +
2553 +   Struct timeval and/or timezone not declared:
2554 +          In some cases, merely including the appropriate time.h header
2555 +          files is still not enough. POSIX.1 does not define the timeval
2556 +          struct, and so the items we need from the header are protected
2557 +          against us by #ifndef _POSIX_SOURCE or somesuch. In this case,
2558 +          we have to declare the timeval (and timezone) structs ourselves.
2559 +          To force this, include -DDCLTIMEVAL in CFLAGS.
2560 +
2561 +   Warnings about dn_expand() Argument #4
2562 +          WARNING: argument is incompatible with prototyp. It's the old
2563 +          char versus unsigned char stupidity again. Try to find a
2564 +          compiler switch like GCC's "-funsigned-char". Failing that, add
2565 +          -DCKQUERYTYPE=xxx to CFLAGS, where xxx is whatever 'man
2566 +          dn_expand' tells you the type of the 4th argument should be
2567 +          (presumably either char or unsigned char; in the latter case use
2568 +          CHAR to avoid confusion caused by multiple words.
2569 +
2570 +   Switch Table Overflow (in [126]ckcuni.c)
2571 +          Add -DNOUNICODE to CFLAGS.
2572 +
2573 +   Compile-time warnings about ck_out() or tgetstr() or tputs():
2574 +          Easy solution: Add -DNOTERMCAP to CFLAGS. But then you lose the
2575 +          SCREEN function. Real solution: Try all different combinations
2576 +          of the following CFLAGS:
2577 +
2578 +-DTPUTSARGTYPE=char    -DTPUTSFNTYPE=int
2579 +-DTPUTSARGTYPE=int     -DTPUTSFNTYPE=void
2580 +
2581 +          Until the warnings go away, except maybe "ck_outc: return with a
2582 +          value in a function returning void", and in that case also add
2583 +          -DTPUTSISVOID.
2584 +
2585 +   "Passing arg 1 of to tputs() makes pointer from integer without a
2586 +          cast":
2587 +          Add -DTPUTSARG1CONST to CFLAGS.
2588 +
2589 +   "Undefined symbol: dup2"
2590 +          Add -DNOZEXEC to CFLAGS.
2591 +
2592 +   "header file 'termcap.h' not found"
2593 +          Add -DNOHTERMCAP to CFLAGS.
2594 +
2595 +   Other difficulties are generally of the "where is curses.h and what is
2596 +   it called this week?" variety (most easily solved by making symlinks in
2597 +   the include and lib directories), or overzealous complaints regarding
2598 +   type mismatches in function calls because of the totally needless and
2599 +   silly signed versus unsigned char conflict (*), etc. In any case,
2600 +   please send any compilation or linking warnings or errors to the
2601 +   author, preferably along with fixes.
2602 +
2603 +     * C-Kermit does not use the signed property of chars at all anywhere,
2604 +       ever. So if all chars and char *'s can be made unsigned at compile
2605 +       time, as they can in gcc with "-funsigned-char", they should be.
2606 +
2607 +   IMPORTANT: If you find any of these hints necessary for a particular
2608 +   make target (or you hit upon others not listed here), PLEASE SEND A
2609 +   REPORT TO:
2610 +
2611 +[127]kermit-support@columbia.edu
2612 +
2613 +4.1. The Unix Makefile
2614 +
2615 +   [ [128]Top ] [ [129]Contents ] [ [130]Section Contents ] [ [131]Next ]
2616 +   [ [132]Previous ]
2617 +
2618 +   If your distribution does not contain a file with the name "makefile"
2619 +   or "Makefile", then rename the file called ckuker.mak to makefile:
2620 +
2621 +mv ckuker.mak makefile
2622 +
2623 +   Then type "make xxx", where xxx is the platform you want to build
2624 +   C-Kermit for. These are listed in the [133]comments at the top of the
2625 +   makefile. For example, to build C-Kermit for Linux, type:
2626 +
2627 +make linux
2628 +
2629 +   Here are some typical examples:
2630 +
2631 +     Target    Description
2632 +     linux     Linux, any version on any hardware platform
2633 +     openbsd   OpenBSD, any version on any hardware platform
2634 +     aix43     AIX 4.3
2635 +     aix43g    AIX 4.3, built with gcc
2636 +     solaris9  Solaris 9
2637 +     solaris9g Solaris 9 built with gcc
2638 +     hpux1100  HP-UX 11-point-anything
2639 +
2640 +   The makefile is quite long, and at least two versions of Unix, SCO
2641 +   Xenix/286 and 2.x BSD, cannot cope with its length. An attempt to "make
2642 +   sco286" gives the message "Make: Cannot alloc mem for env.. Stop".
2643 +   Solution: edit away some or all of the nonrelevant material from the
2644 +   makefile. (A separate version of the makefile is provided for BSD 2.x:
2645 +   ckubs2.mak but C-Kermit 8.0 can't be built for BSD 2.x -- it has simply
2646 +   grown too large.)
2647 +
2648 +   Some make programs reportedly cannot handle continued lines (lines
2649 +   ending in backslash (\)). If you have a problem with the makefile, try
2650 +   editing the makefile to join the continued lines (remove the
2651 +   backslashes and the following linefeed).
2652 +
2653 +   Other makefile troubles may occur because tabs in the makefile have
2654 +   somehow been converted to spaces. Spaces and tabs are distinct in Unix
2655 +   makefiles.
2656 +
2657 +   Similarly, carriage returns might have been added to the end of each
2658 +   line, which also proves confusing to most Unix versions of make.
2659 +
2660 +   Check to see if there are comments about your particular version in its
2661 +   makefile target itself. In a text editor such as EMACS or VI, search
2662 +   for the make entry name followed by a colon, e.g. "linux:" (if you
2663 +   really are building C-Kermit for Linux, do this now).
2664 +
2665 +   Check to see if there are comments about your particular version in the
2666 +   [134]ckubwr.txt file ([135]CLICK HERE for the Web version).
2667 +
2668 +   If you have trouble with building [136]ckwart.c, or running the
2669 +   resulting wart preprocessor program on [137]ckcpro.w:
2670 +
2671 +    1. Just "touch" the [138]ckcpro.c file that comes in the distribution
2672 +       and then give the "make" command again, or:
2673 +    2. Compile ckwart.c "by hand": cc -o wart ckwart.c, or:
2674 +    3. Try various other tricks. E.g. one Linux user reported that that
2675 +       adding the "static" switch to the rule for building wart fixed
2676 +       everything:
2677 +
2678 +wart: ckwart.$(EXT)
2679 +        $(CC) -static -o wart ckwart.$(EXT) $(LIBS)
2680 +
2681 +   If your compiler supports a compile-time option to treat ALL chars (and
2682 +   char *'s, etc) as unsigned, by all means use it -- and send me email to
2683 +   let me know what it is (I already know about gcc -funsigned-char).
2684 +
2685 +   To add compilation options (which are explained later in this document)
2686 +   to your makefile target without editing the makefile, include
2687 +   "KFLAGS=..." on the make command line, for example:
2688 +
2689 +make linux KFLAGS=-DNODEBUG
2690 +make bsd "KFLAGS=-DKANJI -DNODEBUG -DNOTLOG -DDYNAMIC -UTCPSOCKET"
2691 +
2692 +   Multiple options must be separated by spaces. Quotes are necessary if
2693 +   the KFLAGS= clause includes spaces. The KFLAGS are added to the end of
2694 +   the CFLAGS that are defined in the selected makefile target. For
2695 +   example, the "bsd" entry includes -DBSD4 -DTCPSOCKET, so the second
2696 +   example above compiles Kermit with the following options:
2697 +
2698 +-DBSD4 -DTCPSOCKET -DKANJI -DNODEBUG -DNOTLOG -DDYNAMIC -UTCPSOCKET
2699 +
2700 +   (Notice how "-UTCPSOCKET" is used to negate the effect of the
2701 +   "-DTCPSOCKET" option that is included in the makefile target.)
2702 +
2703 +   WARNING: Be careful with KFLAGS. If you build C-Kermit, change some
2704 +   files, and then run make again using the same make entry but specifying
2705 +   different KFLAGS than last time, make won't detect it and you could
2706 +   easily wind up with inconsistent object modules, e.g. some of them
2707 +   built with a certain option, others not. When in doubt, "make clean"
2708 +   first to make sure all your object files are consistent. Similarly, if
2709 +   you change CFLAGS, LIBS, or any other items in the makefile, or you
2710 +   rebuild using a different makefile target, "make clean" first.
2711 +
2712 +   If you create a new makefile target, use static linking if possible.
2713 +   Even though this makes your C-Kermit binary bigger, the resulting
2714 +   binary will be more portable. Dynamically linked binaries tend to run
2715 +   only on the exact configuration and version where they were built; on
2716 +   others, invocation tends to fail with a message like:
2717 +
2718 +Can't find shared library "libc.so.2.1"
2719 +
2720 +4.2. The C-Kermit Initialization File
2721 +
2722 +   [ [139]Top ] [ [140]Contents ] [ [141]Section Contents ] [ [142]Next ]
2723 +   [ [143]Previous ]
2724 +
2725 +   (This section is obsolete.) Read [144]Section 5 about the
2726 +   initialization file.
2727 +
2728 +4.3. The 2.x BSD Makefile
2729 +
2730 +   [ [145]Top ] [ [146]Contents ] [ [147]Section Contents ] [ [148]Next ]
2731 +   [ [149]Previous ]
2732 +
2733 +     This section is obsolete. C-Kermit 6.0 was the last release that
2734 +     could be built on PDP-11 based BSD versions.
2735 +
2736 +4.4. The Plan 9 Makefile
2737 +
2738 +   [ [150]Top ] [ [151]Contents ] [ [152]Section Contents ] [ [153]Next ]
2739 +   [ [154]Previous ]
2740 +
2741 +   Use the separate makefile [155]ckpker.mk. NOTE: The Plan 9 version of
2742 +   C-Kermit 8.0 has not yet been built. There should be no impediment to
2743 +   building it. However, even when built successfully, certain key
2744 +   features are missing, notably TCP/IP networking.
2745 +
2746 +4.5. Makefile Failures
2747 +
2748 +   [ [156]Top ] [ [157]Contents ] [ [158]Section Contents ] [
2749 +   [159]Previous ]
2750 +
2751 +   First, be sure the source files are stored on your current disk and
2752 +   directory with the right names (in lowercase). Second, make sure that
2753 +   the makefile itself does not contain any lines with leading spaces:
2754 +   indented lines must all start with horizontal TAB, and no spaces.
2755 +
2756 +   Then make sure that your Unix PATH is defined to find the appropriate
2757 +   compiler for your makefile target. For example, on SunOS systems, "make
2758 +   sunos41" builds C-Kermit for the BSD environment, and assumes that
2759 +   /usr/ucb/cc will be used for compilation and linking. If your PATH has
2760 +   /usr/5bin ahead of /usr/ucb, you can have problems at compile or link
2761 +   time (a commonly reported symptom is the inability to find "ftime"
2762 +   during linking). Fix such problems by redefining your Unix PATH, or by
2763 +   specifying the appropriate "cc" in CC= and CC2= statements in your
2764 +   makefile target.
2765 +
2766 +   During edits 166-167, considerable effort went into making C-Kermit
2767 +   compilable by ANSI C compilers. This includes prototyping all of
2768 +   C-Kermit's functions, and including the ANSI-defined system header
2769 +   files for system and library functions, as defined in K&R, second
2770 +   edition: <string.h>, <stdlib.h>, <unistd.h> (except in NeXTSTEP this is
2771 +   <libc.h>), and <sys/stdtypes.h>. If you get warnings about any of these
2772 +   header files not being found, or about argument mismatches involving
2773 +   pid_t, uid_t, or gid_t, look in ckcdeb.h and make amendments. C-Kermit
2774 +   assumes it is being compiled by an ANSI-compliant C compiler if
2775 +   __STDC__ is defined, normally defined by the compiler itself. You can
2776 +   force ANSI compilation without defining __STDC__ (which some compilers
2777 +   won't let you define) by including -DCK_ANSIC on the cc command line.
2778 +
2779 +   On the other hand, if your compiler defines __STDC__ but still
2780 +   complains about the syntax of Kermit's function prototypes, you can
2781 +   disable the ANSI-style function prototyping by including -DNOANSI on
2782 +   the command line.
2783 +
2784 +   For SCO OpenServer, UNIX, ODT, and XENIX compilations, be sure to pick
2785 +   the most appropriate [160]makefile target, and be sure you have
2786 +   installed an SCO development system that is keyed to your exact SCO
2787 +   operating system release, down to the minor version (like 2.3.1).
2788 +
2789 +   Also note that SCO distributes some of its libraries in encrypted form,
2790 +   and they must be decrypted before C-Kermit can be linked with them. If
2791 +   not, you might see a message like:
2792 +
2793 +ld: file /usr/lib/libsocket.a is of unknown type: magic number = 6365
2794 +
2795 +   To decrypt, you must supply a key (password) that came with your
2796 +   license. Call SCO for further info.
2797 +
2798 +   If your compiler uses something other than int for the pid (process id)
2799 +   data type, put -DPID_T=pid_t or whatever in your CFLAGS.
2800 +
2801 +   If you get complaints about unknown data types uid_t and gid_t, put
2802 +   -DUID_T=xxx -DGID_T=yyy in your CFLAGS, where xxx and yyy are the
2803 +   appropriate types.
2804 +
2805 +   If your compilation fails because of conflicting or duplicate
2806 +   declarations for sys_errlist, add -DUSE_STRERROR or -DNDSYSERRLIST to
2807 +   CFLAGS.
2808 +
2809 +   If your compilation dies because getpwnam() is being redeclared (or
2810 +   because of "conflicting types for getwpnam"), add -DNDGPWNAM to your
2811 +   CFLAGS. If that doesn't work, then add -DDCGPWNAM to your CFLAGS (see
2812 +   ckufio.c around line 440).
2813 +
2814 +   If the compiler complains about the declaration of getpwnam() during an
2815 +   ANSI C compilation, remove the declaration from ckufio.c or change the
2816 +   argument in the prototype from (char *) to (const char *).
2817 +
2818 +   If you get complaints that getpwuid() is being called with an improper
2819 +   type, put -DPWID_T=xx in your CFLAGS.
2820 +
2821 +   If you get compile-time warnings that t_brkc or t_eofc (tchars
2822 +   structure members, used in BSD-based versions) are undefined, or
2823 +   structure-member- related warnings that might be traced to this fact,
2824 +   add -DNOBRKC to CFLAGS.
2825 +
2826 +   If you get a linker message to the effect that _setreuid or _setregid
2827 +   is not defined, add -DNOSETREU to CFLAGS, or add -DCKTYP_H=blah to
2828 +   CFLAGS to make C-Kermit read the right <types.h>-kind-of-file to pick
2829 +   up these definitions.
2830 +
2831 +   If you get a message that _popen is undefined, add -DNOPOPEN to CFLAGS.
2832 +
2833 +   If you get a complaint at compile time about an illegal pointer-integer
2834 +   combination in ckufio.c involving popen(), or at link time that _popen
2835 +   is an undefined symbol, add the declaration "FILE *popen();" to the
2836 +   function zxcmd() in ckufio.c (this declaration is supposed to be in
2837 +   <stdio.h>). If making this change does not help, then apparently your
2838 +   Unix does not have the popen() function, so you should add -DNOPOPEN to
2839 +   your make entry, in which case certain functions involving "file" i/o
2840 +   to the standard input and output of subprocesses will not be available.
2841 +
2842 +   If your linker complains that _getcwd is undefined, you can add a
2843 +   getcwd() function to ckufio.c, or add it to your libc.a library using
2844 +   ar:
2845 +
2846 +#include <stdio.h>
2847 +
2848 +char *
2849 +getcwd(buf,size) char *buf; int size; {
2850 +#ifndef NOPOPEN
2851 +#ifdef DCLPOPEN
2852 +    FILE *popen();
2853 +#endif
2854 +    FILE *pfp;
2855 +
2856 +    if (!buf) return(NULL);
2857 +    if (!(pfp = popen("pwd","r"))) return(NULL);
2858 +    fgets(buf,size-2,pfp);
2859 +    pclose(pfp);
2860 +    buf[strlen(buf)-1] = '\0';
2861 +    return((char *)buf);
2862 +#else
2863 +    buf[0] = '\0';
2864 +    return(NULL);
2865 +#endif /* NOPOPEN */
2866 +}
2867 +
2868 +#ifdef NOPOPEN
2869 +FILE *popen(s,t) char *s,*t; {
2870 +    return(NULL);
2871 +}
2872 +#endif /* NOPOPEN */
2873 +
2874 +   If you get complaints about NPROC having an invalid value, add a valid
2875 +   definition for it (depends on your system), as in the cray entry.
2876 +
2877 +   If you get some symbol that's multiply defined, it probably means that
2878 +   a variable name used by Kermit is also used in one of your system
2879 +   libraries that Kermit is linked with. For example, under PC/IX some
2880 +   library has a variable or function called "data", and the variable
2881 +   "data" is also used extensively by Kermit. Rather than edit the Kermit
2882 +   source files, just put a -D in the make entry CFLAGS to change the
2883 +   Kermit symbol at compile time. In this example, it might be
2884 +   -Ddata=xdata.
2885 +
2886 +   Some symbol is defined in your system's header files, but it produces
2887 +   conflicts with, or undesired results from, Kermit. Try undefining the
2888 +   symbol in the makefile target's CFLAGS, for example -UFIONREAD.
2889 +
2890 +   Some well-known symbol is missing from your system header files. Try
2891 +   defining in the makefile target's CFLAGS, for example -DFREAD=1.
2892 +
2893 +   You get many warnings about pointer mismatches. This probably means
2894 +   that Kermit is assuming an int type for signal() when it should be
2895 +   void, or vice-versa. Try adding -DSIG_I (for integer signal()) or
2896 +   -DSIG_V (for void) to CFLAGS. Or just include KFLAGS=-DSIG_V (or
2897 +   whatever) in your "make" command, for example:
2898 +
2899 +make bsd KFLAGS=-DSIG_V
2900 +
2901 +   You get many messages about variables that are declared and/or set but
2902 +   never used. It is difficult to avoid these because of all the
2903 +   conditional compilation in the program. Ignore these messages.
2904 +
2905 +   Some of C-Kermit's modules are so large, or contain so many character
2906 +   string constants, or are so offensive in some other way, that some C
2907 +   compilers give up and refuse to compile them. This is usually because
2908 +   the -O (optimize) option is included in the make entry. If this happens
2909 +   to you, you can (a) remove the -O option from the make entry, which
2910 +   will turn off the optimizer for ALL modules; or (b) compile the
2911 +   offending module(s) by hand, including all the switches from make entry
2912 +   except for -O, and then give the appropriate "make" command again; or
2913 +   (c) increase the value of the -Olimit option, if your compiler supports
2914 +   this option; or (d) change the [161]makefile target to first compile
2915 +   each offending module explicitly without optimization, then compile the
2916 +   others normally (with optimization), for example:
2917 +
2918 +#Fortune 32:16, For:Pro 2.1 (mostly like 4.1bsd)
2919 +ft21:
2920 +        @echo 'Making C-Kermit $(CKVER) for Fortune 32:16 For:Pro 2.1...'
2921 +        $(MAKE) ckuusx.$(EXT) "CFLAGS= -DNODEBUG -DBSD4 -DFT21 -DNOFILEH \
2922 +        -SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short"
2923 +        $(MAKE) ckuxla.$(EXT) "CFLAGS= -DNODEBUG -DBSD4 -DFT21 -DNOFILEH \
2924 +        -SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short"
2925 +        $(MAKE) ckudia.$(EXT) "CFLAGS= -DNODEBUG -DBSD4 -DFT21 -DNOFILEH \
2926 +        -SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short"
2927 +        $(MAKE) wermit "CFLAGS= -O -DNODEBUG -DBSD4 -DFT21 -DNOFILEH -SYM 800 \
2928 +        -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short" \
2929 +        "LNKFLAGS= -n -s" "LIBS= -lcurses -ltermcap -lv -lnet"
2930 +
2931 +   As an extreme example, some compilers (e.g. gcc on the DG AViiON) have
2932 +   been known to dump core when trying to compile ckwart.c with
2933 +   optimization. So just do this one "by hand":
2934 +
2935 +cc -o wart ckwart.c
2936 +
2937 +   or:
2938 +
2939 +touch ckcpro.c
2940 +
2941 +   and then give the "make" command again.
2942 +
2943 +   Speaking of wart, it is unavoidable that some picky compilers might
2944 +   generate "statement unreachable" messages when compiling ckcpro.c.
2945 +   Unreachable statements can be generated by the wart program, which
2946 +   generates ckcpro.c automatically from [162]ckcpro.w, which translates
2947 +   lex-like state/input constructions into a big switch/case construction.
2948 +
2949 +   Some function in Kermit wreaks havoc when it is called. Change all
2950 +   invocations of the function into a macro that evaluates to the
2951 +   appropriate return code that would have been returned by the function
2952 +   had it been called and failed, for example: -Dzkself()=0. Obviously not
2953 +   a good idea if the function is really needed.
2954 +
2955 +   If you have just installed SunOS 4.1.2 or 4.1.3, you might find that
2956 +   C-Kermit (and any other C program) fails to link because of unresolved
2957 +   references from within libc. This is because of a mistake in Sun's
2958 +   /usr/lib/shlib.etc files for building the new libc. Change the libc
2959 +   Makefile so that the "ld" lines have "-ldl" at the end. Change the
2960 +   README file to say "mv xccs.multibyte. xccs.multibyte.o" and follow
2961 +   that instruction.
2962 +
2963 +5. INSTALLING THE KERMIT FILES
2964 +
2965 +   [ [163]Top ] [ [164]Contents ] [ [165]Next ] [ [166]Previous ]
2966 +
2967 +   SECTION CONTENTS
2968 +
2969 +5.1. [167]The C-Kermit Initialization File
2970 +5.2. [168]Text Files
2971 +5.3. [169]Installing the Kermit Files
2972 +5.4. [170]The Makefile Install Target
2973 +
2974 +   The C-Kermit executable does not need any external files to run.
2975 +   Unlike, say, the cu program, which on most platforms is useless unless
2976 +   you (as root) edit the /usr/spool/uucp/Systems and
2977 +   /usr/spool/uucp/Devices files to supply whatever obscure and
2978 +   undocumented syntax is required to match some supposedly user-friendly
2979 +   mnemonic to the real pathname of whatever device you want to use,
2980 +   Kermit runs on its own without needing any external configuration
2981 +   files, and lets you refer to device (and network hosts and services) by
2982 +   their own natural undisguised names.
2983 +
2984 +   Nevertheless, a number of external files can be installed along with
2985 +   the C-Kermit executable if you wish. These include configuration and
2986 +   customization files that are read by Kermit as well as documentation
2987 +   files to be read by people. All of this material is (a) optional, and
2988 +   (b) available on the Kermit website:
2989 +
2990 +[171]http://www.columbia.edu/kermit/
2991 +
2992 +   and usually in a more pleasant form, perhaps also with updated content.
2993 +   So if your computer is on the Internet, there is no need to install
2994 +   anything but the Kermit executable if users know how to find the Kermit
2995 +   website (and if they don't, Kermit's "help" command tells them).
2996 +
2997 +5.1. The C-Kermit Initialization File
2998 +
2999 +   In C-Kermit 7.0 and earlier, the standard initialization file was a key
3000 +   C-Kermit component because:
3001 +
3002 +    a. It "loaded" the dialing and network directories.
3003 +    b. It defined all the macros and variables for the services directory.
3004 +    c. It defined macros for quickly changing Kermit's file-transfer
3005 +       performance tuning.
3006 +
3007 +   The standard initialization file is quite long (more than 600 lines)
3008 +   and requires noticeable processing time (the slower the computer, the
3009 +   more noticeable), yet few people actually use the services directory,
3010 +   whose definition takes up most of its bulk. Meanwhile, in C-Kermit 8.0,
3011 +   many of the remaining functions of the standard initialization file are
3012 +   now built in; for example, the FAST, CAUTIOUS, and ROBUST commands.
3013 +
3014 +   More to the point, many of the settings that could be made only in the
3015 +   initialization and customization files can now be picked up from
3016 +   environment variables. The first group identifies initialization and
3017 +   directory files:
3018 +
3019 +   CKERMIT_INI
3020 +          The path of your Kermit initialization file, if any. This
3021 +          overrides the built-in search for $HOME/.kermrc.
3022 +
3023 +   K_CHARSET
3024 +          The character set used for encoding local text files. Equivalent
3025 +          to SET FILE CHARACTER-SET.
3026 +
3027 +   K_DIAL_DIRECTORY
3028 +          The full pathname of one or more Kermit dialing directory files.
3029 +          Equivalent to SET DIAL DIRECTORY.
3030 +
3031 +   K_NET_DIRECTORY
3032 +          The full pathname of one or more Kermit network directory files.
3033 +          Equivalent to SET NETWORK DIRECTORY.
3034 +
3035 +   K_INFO_DIRECTORY
3036 +   K_INFO_DIR
3037 +          The full pathname of a directory containing Kermit (if any)
3038 +          containing ckubwr.txt and other Kermit text files. Overrides
3039 +          Kermit's built-in search for this directory.
3040 +
3041 +   The next group is related to dialing modems:
3042 +
3043 +   K_COUNTRYCODE
3044 +          The telephonic numeric country code for this location, e.g. 1
3045 +          for North America or 39 for Italy. It is recommended that this
3046 +          one be set for all users, system-wide. Not only is it used to
3047 +          process portable-format dialing directory entries, but it is
3048 +          also compared against Kermit's built-in list of "tone countries"
3049 +          to see if tone dialing can be used. Equivalent to Kermit's SET
3050 +          DIAL COUNTRY-CODE command.
3051 +
3052 +   K_AREACODE
3053 +          The telephonic numeric area code for this location, e.g. 212 for
3054 +          Manhattan, New York, USA. Recommend this one also be set
3055 +          system-wide, so shared portable-format dialing directories will
3056 +          work automatically for everybody. Equivalent to Kermit's SET
3057 +          DIAL AREA-CODE command.
3058 +
3059 +   K_DIAL_METHOD
3060 +          TONE or PULSE. Equivalent to Kermit's SET DIAL METHOD command.
3061 +          If a dial method is not set explicitly (or implicitly from the
3062 +          country code), Kermit does not specify a dialing method, and
3063 +          uses the modem's default method, which tends to be pulse.
3064 +
3065 +   K_INTL_PREFIX
3066 +          The telephonic numeric international dialing prefix for this
3067 +          location. Equivalent to Kermit's SET DIAL INTL-PREFIX command.
3068 +
3069 +   K_LD_PREFIX
3070 +          The telephonic numeric long-distance dialing prefix for this
3071 +          location. Equivalent to Kermit's SET DIAL LD-PREFIX command.
3072 +
3073 +   K_PBX_ICP
3074 +          The telephonic numeric PBX internal call prefix for this
3075 +          location. Equivalent to Kermit's SET DIAL PBX-INSIDE-PREFIX
3076 +          command.
3077 +
3078 +   K_PBX_OCP
3079 +          The telephonic numeric PBX external call prefix for this
3080 +          location. Equivalent to Kermit's SET DIAL PBX-OUTSIDE-PREFIX
3081 +          command.
3082 +
3083 +   K_PBX_XCH
3084 +          The telephonic numeric PBX exchange (first part of the
3085 +          subscriber number). Equivalent to Kermit's SET DIAL PBX-EXCHANGE
3086 +          command.
3087 +
3088 +   K_TF_AREACODE
3089 +          A list of one or more telephonic numeric toll-free area codes.
3090 +
3091 +   K_TF_PREFIX
3092 +          The telephonic numeric toll-free dialing prefix, in case it is
3093 +          different from the long-distance prefix. Equivalent to Kermit's
3094 +          SET DIAL TF-PREFIX command.
3095 +
3096 +   The final group includes well-known environment variables that are also
3097 +   used by Kermit:
3098 +
3099 +   CDPATH
3100 +          Where the CD command should look for relative directory names.
3101 +
3102 +   SHELL
3103 +          The path of your Unix shell. Used by the RUN (!) command to
3104 +          choose the shell to execute its arguments.
3105 +
3106 +   USER
3107 +          Your Unix username.
3108 +
3109 +   EDITOR
3110 +          The name or path of your preferred editor (used by the EDIT
3111 +          command). Equivalent to SET EDITOR.
3112 +
3113 +   BROWSER
3114 +          The name or path of your preferred web browser (used by the
3115 +          BROWSE command). Equivalent to Kermit's SET BROWSER command.
3116 +
3117 +   Does this mean the initialization file can be abolished? I think so.
3118 +   Here's why:
3119 +
3120 +     * Kermit already does everything most people want it to do without
3121 +       one.
3122 +     * Important site-specific customizations can be done with global
3123 +       environment variables.
3124 +     * There is no longer any need for everybody to have to use the
3125 +       standard initialization file.
3126 +     * This means that your initialization file, if you want one, can
3127 +       contain your own personal settings, definitions, and preferences,
3128 +       rather than 600 lines of "standard" setups.
3129 +     * If you still want the services directory, you can either TAKE the
3130 +       standard initialization file (which must be named anything other
3131 +       than $HOME/.kermrc to avoid being executed automatically every time
3132 +       you start Kermit), or you can make it a kerbang script and execute
3133 +       it "directly" (the [172]makefile install target does this for you
3134 +       by putting ckermit.ini in the same directory as the Kermit binary,
3135 +       adding the appropriate Kerbang line to the top, and giving it
3136 +       execute permission).
3137 +
3138 +   In fact, you can put any number of kerbang scripts in your PATH to
3139 +   start up C-Kermit in different ways, to have it adopt certain settings,
3140 +   make particular connections, execute complicated scripts, whatever you
3141 +   want.
3142 +
3143 +5.2. Text Files
3144 +
3145 +   These are entirely optional. Many of them are to be found at the Kermit
3146 +   website in HTML form (i.e. as Web pages with clickable links, etc), and
3147 +   very likely also more up to date. Plain-text files that correspond to
3148 +   Web pages were simply "dumped" by Lynx from the website to plain ASCII
3149 +   text. The format is whatever Lynx uses for this purpose. If you wish,
3150 +   you can install them on your computer as described in the [173]next
3151 +   section.
3152 +
3153 +   [174]COPYING.TXT
3154 +          Copyright notice, permissions, and disclaimer.
3155 +
3156 +   [175]ckermit.ini
3157 +          The standard initialization file, intended more for reference
3158 +          (in most cases) than actual use; see [176]Section 5.1.
3159 +
3160 +   [177]ckermod.ini
3161 +          A sample customization file.
3162 +
3163 +   [178]ckermit70.txt
3164 +          Supplement to [179]Using C-Kermit for version 7.0. Available on
3165 +          the Kermit website as:
3166 +          [180]http://www.columbia.edu/kermit/ckermit70.html
3167 +
3168 +   [181]ckermit80.txt
3169 +          Supplement to [182]Using C-Kermit for version 8.0. Available on
3170 +          the Kermit website as:
3171 +          [183]http://www.columbia.edu/kermit/ckermit80.html
3172 +
3173 +   [184]ckcbwr.txt
3174 +          The general C-Kermit hints and tips ("beware") file. Available
3175 +          on the Kermit website as:
3176 +          [185]http://www.columbia.edu/kermit/ckcbwr.html
3177 +
3178 +   [186]ckubwr.txt
3179 +          The Unix-specific C-Kermit hints and tips file. Available on the
3180 +          Kermit website as:
3181 +          [187]http://www.columbia.edu/kermit/ckubwr.html
3182 +
3183 +   [188]ckuins.txt
3184 +          Unix C-Kermit Installation Instructions (this file). Available
3185 +          on the Kermit website as:
3186 +          [189]http://www.columbia.edu/kermit/ckuins.html
3187 +
3188 +   [190]ckccfg.txt
3189 +          C-Kermit compile-time configuration options. Available on the
3190 +          Kermit website as:
3191 +          [191]http://www.columbia.edu/kermit/ckccfg.html
3192 +
3193 +   [192]ckcplm.txt
3194 +          The C-Kermit program logic manual. Available on the Kermit
3195 +          website as:
3196 +          [193]http://www.columbia.edu/kermit/ckcplm.html
3197 +
3198 +   [194]ca_certs.pem
3199 +          Certificate Authority certificates for secure connections (see
3200 +          [195]Section 16).
3201 +
3202 +5.3. Installing the Kermit Files
3203 +
3204 +   There is an "install" target in the [196]makefile that you can use if
3205 +   you wish. However, since every site has its own layout and
3206 +   requirements, it is often better to install the Kermit files by hand.
3207 +   You don't have to use the makefile install target to install C-Kermit.
3208 +   This is especially true since not all sites build C-Kermit from source,
3209 +   and therefore might not even have the makefile. But you should read
3210 +   this section in any case.
3211 +
3212 +     If your computer already has an older version of C-Kermit installed,
3213 +     you should rename it (e.g. to "kermit6" or "kermit7") so in case you
3214 +     have any trouble with the new version, the old one is still
3215 +     available.
3216 +
3217 +   In most cases, you need to be root to install C-Kermit, if only to gain
3218 +   write access to directories in which the binary and manual page are to
3219 +   be copied. The C-Kermit binary should be installed in a directory that
3220 +   is in the users' PATH, but that is not likely to be overwritten when
3221 +   you install a new version of the operating system. A good candidate
3222 +   would be the /usr/local/bin/ directory, but the specific choice is site
3223 +   dependent. Example (assuming the appropriate Kermit binary is stored in
3224 +   your current directory as "wermit", e.g. because you just built it from
3225 +   source and that's the name the makefile gave it):
3226 +
3227 +mv wermit /usr/local/bin/kermit
3228 +chmod 755 /usr/local/bin/kermit
3229 +
3230 +   or (only after you finish reading this section!) simply:
3231 +
3232 +make install
3233 +
3234 +   IMPORTANT: IF C-KERMIT IS TO BE USED FOR DIALING OUT, you must also do
3235 +   something to give it access to the dialout devices and lockfile
3236 +   directories. The 'install' target does not attempt to set Kermit's
3237 +   owner, group, and permissions to allow dialing out. This requires
3238 +   privileges, open eyes, and human decision-making. Please read
3239 +   [197]Sections 10 and [198]11 below, make the necessary decisions, and
3240 +   then implement them by hand as described in those sections.
3241 +
3242 +   You should also install the man page, which is called ckuker.nr, in the
3243 +   man page directory for local commands, such as /usr/man/man1/, renamed
3244 +   appropriately, e.g. to kermit.1. This is also taken care of by "make
3245 +   install".
3246 +
3247 +   Optionally, the text files listed in the [199]previous section can be
3248 +   placed in a publicly readable directory. Suggested directory names are:
3249 +
3250 +/usr/local/doc/kermit/
3251 +/usr/local/lib/kermit/
3252 +/usr/share/lib/kermit/
3253 +/opt/kermit/doc/
3254 +
3255 +   (or any of these without the "/kermit"). Upon startup, C-Kermit checks
3256 +   the following environment variables whose purpose is to specify the
3257 +   directory where the C-Kermit text files are, in the following order:
3258 +
3259 +K_INFO_DIRECTORY
3260 +K_INFO_DIR
3261 +
3262 +   If either of these is defined, C-Kermit checks for the existence of the
3263 +   ckubwr.txt file (Unix C-Kermit Hints and Tips). If not found, it checks
3264 +   the directories listed above (both with and without the "/kermit") plus
3265 +   several others to see if they contain the ckubwr.txt file. If found,
3266 +   various C-Kermit messages can refer the user to this directory.
3267 +
3268 +   Finally, if you want to put the source code files somewhere for people
3269 +   to look at, you can do that too.
3270 +
3271 +5.4. The Makefile Install Target
3272 +
3273 +   The makefile "install" target does almost everything for you if you
3274 +   give it the information it needs by setting the variables described
3275 +   below. You can use this target if:
3276 +
3277 +     * You downloaded the [200]complete C-Kermit archive and built
3278 +       C-Kermit from source; or:
3279 +     * You downloaded an [201]individual C-Kermit binary and the
3280 +       [202]C-Kermit text-file archive, and your computer has a "make"
3281 +       command.
3282 +
3283 +   Here are the parameters you need to know:
3284 +
3285 +   BINARY
3286 +          Name of the binary you want to install as "kermit". Default:
3287 +          "wermit".
3288 +
3289 +   prefix
3290 +          (lower case) If you define this variable, its value is prepended
3291 +          to all the following xxxDIR variables (8.0.211 and later).
3292 +
3293 +   DESTDIR
3294 +          If you want to install the Kermit files in a directory structure
3295 +          like /opt/kermit/bin/, /opt/kermit/doc/, /opt/kermit/src/, then
3296 +          define DESTIR as the root of this structure; for example,
3297 +          /opt/kermit. The DESTDIR string should not end with a slash. By
3298 +          default, DESTDIR is not defined. If it is defined, but the
3299 +          directory does not exist, the makefile attempts to create it,
3300 +          which might require you to be root. Even so, this can fail if
3301 +          any segments in the path except the last one do not already
3302 +          exist. WARNING: If the makefile creates any directories, it
3303 +          gives them a mode of 755, and the default owner and group.
3304 +          Modify these by hand if necessary.
3305 +
3306 +   BINDIR
3307 +          Directory in which to install the Kermit binary (and the
3308 +          standard C-Kermit initialization file, if it is found, as a
3309 +          Kerbang script). If DESTDIR is defined, BINDIR must start with a
3310 +          slash. BINDIR must not end with a slash. If DESTDIR is defined,
3311 +          BINDIR is a subdirectory of DESTDIR. If BINDIR does not exist,
3312 +          the makefile attempts to create it as with DESTDIR. Default:
3313 +          /usr/local/bin.
3314 +
3315 +   MANDIR
3316 +          Directory in which to install the C-Kermit manual page as
3317 +          "kermit" followed by the manual-chapter extension (next item).
3318 +          Default: /usr/man/man1. If MANDIR is defined, the directory must
3319 +          already exist.
3320 +
3321 +   MANEXT
3322 +          Extension for the manual page. Default: 1 (digit one).
3323 +
3324 +   SRCDIR
3325 +          Directory in which to install the C-Kermit source code. If
3326 +          DESTDIR is defined, this is a subdirectory of DESTDIR. Default:
3327 +          None.
3328 +
3329 +   CERTDIR
3330 +          For secure builds only: Directory in which to install the
3331 +          ca_certs.pem file. This must be the verification directory used
3332 +          by programs that use the SSL libraries at your site. Default:
3333 +          none. Possibilities include: /usr/local/ssl, /opt/ssl,
3334 +          /usr/lib/ssl, . . .     If CERTDIR is defined, the directory
3335 +          must already exist.
3336 +
3337 +   INFODIR
3338 +          Directory in which to install the C-Kermit text files. If
3339 +          DESTDIR is defined, this is a subdirectory of DESTDIR. Default:
3340 +          None. If INFODIR is defined but does not exist, the makefile
3341 +          attempts to create it, as with DESTDIR.
3342 +
3343 +   Examples:
3344 +
3345 +   make install
3346 +          Installs "wermit" as /usr/local/bin/kermit with permissions 755,
3347 +          the default owner and group, and no special privileges. The
3348 +          manual page is installed as /usr/man/man1/kermit.1. Text files
3349 +          are not copied anywhere, nor are the sources.
3350 +
3351 +   make MANDIR= install
3352 +          Just like "make install" but does not attempt to install the
3353 +          manual page.
3354 +
3355 +   make DESTDIR=/opt/kermit BINDIR=/bin SRCDIR=/src INFODIR=/doc install
3356 +          Installs the Kermit binary "wermit" as /opt/kermit/bin/kermit,
3357 +          puts the source code in /opt/kermit/src, and puts the text files
3358 +          in /opt/kermit/doc, creating the directories if they don't
3359 +          already exist, and puts the man page in the default location.
3360 +
3361 +   make BINDIR=/usr/local/bin CERTDIR=/usr/local/ssl install
3362 +          Installs the Kerberized Kermit binary "wermit" as
3363 +          /usr/local/bin/kermit, puts the CA Certificates file in
3364 +          /usr/local/ssl/, and the man page in the normal place.
3365 +
3366 +   For definitive information, see the makefile. The following is
3367 +   excerpted from the 8.0.211 makefile:
3368 +
3369 +# The following symbols are used to specify library and header file locations
3370 +# Redefine them to the values used on your system by:
3371 +# . editing this file
3372 +# . defining the values on the command line
3373 +# . defining the values in the environment and use the -e option
3374 +#
3375 +prefix  = /usr/local
3376 +srproot = $(prefix)
3377 +sslroot = $(prefix)
3378 +manroot = $(prefix)
3379 +
3380 +K4LIB=-L/usr/kerberos/lib
3381 +K4INC=-I/usr/kerberos/include
3382 +K5LIB=-L/usr/kerberos/lib
3383 +K5INC=-I/usr/kerberos/include
3384 +SRPLIB=-L$(srproot)/lib
3385 +SRPINC=-I$(srproot)/include
3386 +SSLLIB=-L$(sslroot)/ssl/lib
3387 +SSLINC=-I$(sslroot)/ssl/include
3388 +...
3389 +WERMIT = makewhat
3390 +BINARY = wermit
3391 +DESTDIR =
3392 +BINDIR = $(prefix)/bin
3393 +MANDIR = $(manroot)/man/man1
3394 +MANEXT = 1
3395 +SRCDIR =
3396 +INFODIR =
3397 +CERTDIR =
3398 +
3399 +6. INSTALLING UNIX C-KERMIT FROM DOS-FORMAT DISKETTES
3400 +
3401 +   [ [203]Top ] [ [204]Contents ] [ [205]Next ] [ [206]Previous ]
3402 +
3403 +     This section is obsolete. We don't distribute C-Kermit on diskettes
3404 +     any more because (a)there is no demand, and (b) it no longer fits.
3405 +
3406 +   If you received a DOS-format diskette containing a binary executable
3407 +   C-Kermit program plus supporting text files, be sure to chmod +x the
3408 +   executable before attempting to run it.
3409 +
3410 +   In version 5A(190) and later, all the text files on the C-Kermit
3411 +   DOS-format diskettes are in Unix format: LF at the end of each line
3412 +   rather than CRLF. This means that no conversions are necessary when
3413 +   copying to your Unix file system, and that all the files on the
3414 +   diskette, text and binary, can be copied together. The following
3415 +   comments apply to the DOS-format diskettes furnished with version
3416 +   5A(189) and earlier or to other DOS-format diskettes you might have
3417 +   obtained from other sources.
3418 +
3419 +   If you have received C-Kermit on MS-DOS format diskettes (such as those
3420 +   distributed by Columbia University), you should make sure that your
3421 +   DOS-to-Unix conversion utility (such as "dosread") both: (1) changes
3422 +   line terminators in all files from carriage-return linefeed (CRLF) to
3423 +   just linefeed (LF) (such as "dosread -a") and remove any Ctrl-Z's, and
3424 +   (2) that all filenames are converted from uppercase to lowercase. If
3425 +   these conversions were not done, you can use the following shell script
3426 +   on your Unix system to do them:
3427 +
3428 +---(cut here)---
3429 +#!/bin/sh
3430 +#
3431 +# Shell script to convert C-Kermit DOS-format files into Unix format.
3432 +# Lowercases the filenames, strips out carriage returns and Ctrl-Z's.
3433 +#
3434 +x=$1 # the name of the source directory
3435 +y=$2 # the name of the target directory if [ $# -lt 2 ]; then
3436 +  echo "usage: $0 source-directory target-directory"
3437 +  exit 1
3438 +fi
3439 +if cd $1 ; then
3440 +  echo "Converting files from $1 to $2"
3441 +else
3442 +  echo "$0: cannot cd to $1"
3443 +  exit 1
3444 +fi
3445 +for i in *; do
3446 +  j=`echo $i | tr 'A-Z' 'a-z'`
3447 +  echo $x/$i =\> $y/$j
3448 +  tr -d '\015\032' < $i > $y/$j
3449 +done
3450 +---(cut here)---
3451 +
3452 +   Cut out this shell script, save it as "convert.sh" (or any other name
3453 +   you prefer), then "chmod +x convert.sh". Then, create a new, empty
3454 +   directory to put the converted files in, and then "convert.sh /xxx
3455 +   /yyy" where /xxx is the name of the directory where the PC-format files
3456 +   are, and /yyy is the name of the new, empty directory. The converted
3457 +   files will appear in the new directory.
3458 +
3459 +7. CHECKING THE RESULTS
3460 +
3461 +   [ [207]Top ] [ [208]Contents ] [ [209]Next ] [ [210]Previous ]
3462 +
3463 +   First some quick checks for problems that can be easily corrected by
3464 +   recompiling with different options:
3465 +
3466 +   DIRECTORY listing is garbage
3467 +          Permissions, size, and date are random garbage (but the
3468 +          filenames are correct) in a C-Kermit DIRECTORY listing. On some
3469 +          platforms, the lstat() function is present but simply doesn't
3470 +          work; try adding -DNOLSTAT to CFLAGS and rebuild. If that
3471 +          doesn't fix it, also add -DNOLINKBITS. If it's still not fixed,
3472 +          remove -DNOLSTAT and -DNOLINKBITS and add -DNOSYMLINK.
3473 +
3474 +   curses
3475 +          When you make a connection with C-Kermit and transfer files
3476 +          using the fullscreen (curses) file-transfer display, and then
3477 +          get the C-Kermit> prompt back afterwards, do characters echo
3478 +          when you type them? If not, the curses library has altered the
3479 +          buffering of /dev/tty. Try rebuilding with KFLAGS=-DCK_NEWTERM.
3480 +          If it already has -DCK_NEWTERM in CFLAGS, try removing it. If
3481 +          that doesn't help, then rebuild with -DNONOSETBUF (yes, two
3482 +          NO's). If none of this works (and you can't fix the code), then
3483 +          either don't use the fullscreen display, or rebuild with
3484 +          -DNOCURSES.
3485 +
3486 +   Ctrl-L or any SCREEN command crashes C-Kermit:
3487 +          Rebuild with -DNOTERMCAP.
3488 +
3489 +   No prompt after CONNECT:
3490 +          After escaping back from CONNECT mode, does your C-Kermit>
3491 +          prompt disappear? (Yet, typing "?" still produces a command
3492 +          list, etc) In that case, add -DCKCONINTB4CB to CFLAGS and
3493 +          rebuild.
3494 +
3495 +   Here is a more thorough checklist can use to tell whether your version
3496 +   of C-Kermit was built correctly for your Unix system, with hints on how
3497 +   to fix or work around problems:
3498 +
3499 +    a. Start C-Kermit (usually by typing "./wermit" in the directory where
3500 +       you ran the makefile). Do you see the C-Kermit> prompt? If not,
3501 +       C-Kermit incorrectly deduced that it was running in the background.
3502 +       The test is in conbgt() in [211]ckutio.c. If you can fix it for
3503 +       your system, please send in the fix (Hint: read about "PID_T"
3504 +       below). Otherwise, you can force C-Kermit to foreground mode by
3505 +       starting it with the -z command line option, as in "kermit -z", or
3506 +       giving the interactive command SET BACKGROUND OFF.
3507 +    b. When you type characters at the C-Kermit prompt, do they echo
3508 +       immediately? If not, something is wrong with concb() and probably
3509 +       the other terminal mode settings routines in [212]ckutio.c. Be sure
3510 +       you have used the most appropriate make entry.
3511 +    c. At the C-Kermit> prompt, type "send ./?". C-Kermit should list all
3512 +       the files in the current directory. If not, it was built for the
3513 +       wrong type of Unix file system. Details below. In the meantime, try
3514 +       SET WILDCARD-EXPANSION SHELL as a workaround.
3515 +    d. CD to a directory that contains a variety of files, symlinks, and
3516 +       subdirectories and give a DIRECTORY command at the C-Kermit>
3517 +       prompt. Do the permissions, size, and date appear correct? If not
3518 +       see [213]Section 4.0.
3519 +    e. Assuming your platform supports long file names, create a file with
3520 +       a long name in your current directory, e.g.:
3521 +
3522 +$ touch thisisafilewithaveryveryveryveryveryveryveryverylooooooooongname
3523 +
3524 +       (you might need to make it longer than this, perhaps as long as 257
3525 +       or even 1025 characters).
3526 +       Check with ls to see if your version of Unix truncated the name.
3527 +       Now start C-Kermit and type "send thisis<ESC>". Does Kermit
3528 +       complete the name, showing the same name as ls did? If not, wrong
3529 +       filesystem. Read on.
3530 +    f. Make sure that Kermit has the maximum path length right. Just type
3531 +       SHOW FILE and see what it says about this. If it is too short,
3532 +       there could be some problems at runtime. To correct, look in
3533 +       [214]ckcdeb.h to see how the symbol CKMAXPATH is set and make any
3534 +       needed adjustments.
3535 +    g. Send a file to your new Kermit program from a different Kermit
3536 +       program that is known to work. Is the date/timestamp of the new
3537 +       file identical to the original? If not, adjustments are needed in
3538 +       zstrdt() in [215]ckufio.c.
3539 +    h. Go to another computer (Computer B) from which you can send files
3540 +       to C-Kermit. Connect Computer B to the computer (A) where you are
3541 +       testing C-Kermit. Then:
3542 +    i. Send a file from B to A. Make sure it transferred OK and was
3543 +       created with the the right name.
3544 +    j. Send a file from B to A, specifying an "as-name" that is very, very
3545 +       long (longer than the maximum name length on computer A). Check to
3546 +       make sure that the file was received OK and that its name was
3547 +       truncated to Computer A's maximum length. If not, check the
3548 +       MAXNAMLEN definition in [216]ckufio.c.
3549 +    k. Tell C-Kermit on Computer A to "set receive pathnames relative" and
3550 +       then send it a file from Computer B specifying an as-name that
3551 +       contains several directory segments:
3552 +
3553 +send foo dir1/dir2/dir3/foo
3554 +
3555 +       Check to make sure that dir1/dir2/dir3/foo was created in Computer
3556 +       A's current directory (i.e. that three levels of directories were
3557 +       created).
3558 +    l. Repeat step k, but make each path segment in the pathname longer
3559 +       than Computer A's maximum name length. Make sure each directory
3560 +       name, and the final filename, were truncated properly.
3561 +    m. Type Ctrl-C (or whatever your Unix interrupt character is) at the
3562 +       prompt. Do you get "^C..." and a new prompt? If instead, you get a
3563 +       core dump (this shouldn't happen any more) "rm core" and then
3564 +       rebuild with -DNOCCTRAP added to your CFLAGS. If it did work, then
3565 +       type another Ctrl-C. If this does the same thing as the first one,
3566 +       then Ctrl-C handling is OK. Otherwise, the SIGINT signal is either
3567 +       not getting re-armed (shouldn't happen) or is being masked off
3568 +       after the first time it is caught, in which case, if your Unix is
3569 +       POSIX-based, try rebuilding C-Kermit with -DCK_POSIX_SIG.
3570 +    n. Type Ctrl-Z (or whatever your Unix suspend character is) to put
3571 +       C-Kermit in the background. Did it work? If nothing happened, then
3572 +       (a)your version of Unix does not support job control, or (b) your
3573 +       version of C-Kermit was probably built with -DNOJC. If your session
3574 +       became totally frozen, then you are probably running C-Kermit on a
3575 +       Unix version that supports job control, but under a shell that
3576 +       doesn't. If that's not the case, look in the congm() and psuspend()
3577 +       routines in [217]ckutio.c and see if you can figure out what's
3578 +       wrong. If you can't, rebuild with -DNOJC.
3579 +    o. Give a SET LINE command for a dialout device, e.g. "set line
3580 +       /dev/tty00". If you got some kind of permission or access denied
3581 +       message, go read [218]Section 10 and then come back here.
3582 +    p. After giving a successful SET LINE command, type "show comm" to see
3583 +       the communication parameters. Do they make sense?
3584 +    q. Type "set speed ?" and observe the list of available speeds. Is it
3585 +       what you expected? If not, see [219]Section 2) of the
3586 +       [220]Configurations Options document.
3587 +    r. Give a SET SPEED command to change the device's speed. Did it work?
3588 +       (Type "show comm" again to check.)
3589 +    s. Try dialing out: SET MODEM TYPE , SET LINE , SET SPEED , DIAL . If
3590 +       it doesn't work, keep reading. After dialing, can you REDIAL?
3591 +    t. If your version was built with TCP/IP network support, try the
3592 +       TELNET command.
3593 +    u. Transfer some files in remote mode on incoming asynchronous serial
3594 +       (direct or modem) connections, and on incoming network (telnet,
3595 +       rlogin, terminal server) connections. If you get lots of errors,
3596 +       try different SET FLOW settings on the remote Kermit program.
3597 +    v. Establish a serial connection from C-Kermit to another computer
3598 +       (direct or dialed) and transfer some files. If you have network
3599 +       support, do the same with a network connection.
3600 +    w. If your version was built with fullscreen file transfer display
3601 +       support, check that it works during local-mode file transfer. Also,
3602 +       check C-Kermit's operation afterwards: is the echoing funny? etc
3603 +       etc. If there are problems, see [221]Section 4.
3604 +    x. If your version was built with script programming language support,
3605 +       TAKE the ckedemo.ksc file to give it a workout.
3606 +    y. Does C-Kermit interlock correctly with UUCP-family programs (cu,
3607 +       tip, uucp, etc)? If not, read the section [222]DIALING OUT AND
3608 +       COORDINATING WITH UUCP below.
3609 +    z. Modem signals... Give a SET LINE command to a serial device and
3610 +       then type the SHOW MODEM command. If it says "Modem signals
3611 +       unavailable in this version of Kermit", then you might want to look
3612 +       at the ttgmdm() routine in [223]ckutio.c and add the needed code --
3613 +       if indeed your version of Unix provides a way to get modem signals
3614 +       (some don't; e.g. modem signals are a foreign concept to POSIX,
3615 +       requiring politically incorrect workarounds).
3616 +   aa. If it says "Modem signals unavailable", then it is likely that the
3617 +       API for getting modem signals is provided, but it doesn't actually
3618 +       do anything (e.g. ioctl(ttyfd,TIOCMGET,&x) returns EINVAL).
3619 +   ab. In any case, it still should be able to manipulate the DTR signal.
3620 +       To test, SET LINE , SET MODEM NONE, and HANGUP. The DTR light
3621 +       should go out momentarily. If it doesn't, see if you can add the
3622 +       needed code for your system to the tthang() routine in
3623 +       [224]ckutio.c.
3624 +   ac. If your version of Kermit has the SET FLOW RTS/CTS command, check
3625 +       to see if it works: give Kermit this command, set your modem for
3626 +       RTS/CTS, transfer some files (using big packet and window sizes)
3627 +       and watch the RTS and CTS lights on the modem. If they go on and
3628 +       off (and Kermit does not get packet errors), then it works. If your
3629 +       version of Kermit does not have this command, but your version of
3630 +       Unix does support hardware flow control, take a look at the
3631 +       tthflow() command in [225]ckutio.c and see if you can add the
3632 +       needed code (see the section on [226]HARDWARE FLOW CONTROL below).
3633 +       (And please [227]send back any added code, so that others can
3634 +       benefit from it and it can be carried forward into future
3635 +       releases.)
3636 +   ad. If C-Kermit starts normally and issues its prompt, echoing is
3637 +       normal, etc, but then after returning from a CONNECT session, the
3638 +       prompt no longer appears, try rebuilding with -DCKCONINTB4CB.
3639 +   ae. (8.0.206 or later) Type some commands at the C-Kermit prompt. Can
3640 +       you use the Up-arrow and Down-arrow keys on your keyboard to access
3641 +       Kermit's command history? If not, and you're a programmer, take a
3642 +       look at the USE_ARROWKEYS sections of ckucmd.c.
3643 +
3644 +8. REDUCING THE SIZE OF THE EXECUTABLE PROGRAM IMAGE
3645 +
3646 +   [ [228]Top ] [ [229]Contents ] [ [230]Next ] [ [231]Previous ]
3647 +
3648 +   Also see: [232]C-Kermit Configuration Options
3649 +
3650 +    a. Many of C-Kermit's options and features can be deselected at
3651 +       compile time. The greatest savings at the least sacrifice in
3652 +       functionality is to disable the logging of debug information by
3653 +       defining NODEBUG during compilation. See the [233]Configurations
3654 +       Options document for further information.
3655 +    b. Use shared libraries rather than static linking. This is the
3656 +       default on many Unix systems anyway. However, executables built for
3657 +       dynamic linking with shared libraries are generally not portable
3658 +       away from the machine they were built on, so this is recommended if
3659 +       the binary is for your use only.
3660 +    c. Most Unix systems have a "strip" command to remove symbol table
3661 +       information from an executable program image. "man strip" for
3662 +       further information. The same effect can be achieved by including
3663 +       "-s" among the link flags when building C-Kermit.
3664 +    d. SCO, Interactive, and some other Unix versions have an "mcs"
3665 +       command. "mcs -d wermit" can be used to delete the contents of the
3666 +       ".comment" section from the executable program image.
3667 +    e. Many modern optimizers can be instructed to optimize for space
3668 +       rather than execution efficiency. Check the CFLAGS in the makefile
3669 +       target, adjust as desired.
3670 +
3671 +9. UNIX VERSIONS
3672 +
3673 +   [ [234]Top ] [ [235]Contents ] [ [236]Next ] [ [237]Previous ]
3674 +
3675 +   SECTION CONTENTS
3676 +
3677 +9.1 [238]Standards
3678 +     9.1.1. [239]POSIX
3679 +     9.1.2. [240]ANSI C
3680 +     9.1.3. [241]Other Standards
3681 +9.2. [242]Library Issues
3682 +9.3. [243]Unix File System Peculiarities
3683 +9.4. [244]Hardware Flow Control
3684 +9.5. [245]Terminal Speeds
3685 +9.6. [246]Millisecond Sleeps
3686 +9.7. [247]Nondestructive Input Buffer Peeking
3687 +9.8. [248]Other System-Dependent Features
3688 +9.9. [249]Terminal Interruption
3689 +
3690 +   There are several major varieties of Unix: Bell Laboratories Seventh
3691 +   Edition, AT&T System V, Berkeley Standard Distribution (BSD), and
3692 +   POSIX. Each has many, many subvarieties and descendents, and there are
3693 +   also hybrids that exhibit symptoms of two or more varieties, plus
3694 +   special quirks of their own.
3695 +
3696 +   Seventh edition versions of C-Kermit include the compile-time option
3697 +   -DV7 in the CFLAGS string in the makefile target. Various V7-based
3698 +   implementations are also supported: -DCOHERENT, -DMINIX, etc.
3699 +
3700 +   AT&T-based versions of Unix Kermit include the compile-time option
3701 +   -DATTSV (standing for AT&mp;T Unix System V). This applies to System
3702 +   III and to System V up to and including Release 2. For System V Release
3703 +   3, the flag -DSVR3 should be used instead (which also implies -DATTSV).
3704 +   This is because the data type of signal() and several other functions
3705 +   was changed between SVR2 and SVR3. For System V Release 4, include
3706 +   -DSVR4 because of changes in UUCP lockfile conventions; this also
3707 +   implies -DSVR3 and -DATTSV.
3708 +
3709 +   For BSD, the flag -BSDxx must be included, where xx is the BSD version
3710 +   number, for example BSD4 (for version 4.2 or later, using only 4.2
3711 +   features), -DBSD41 (for BSD 4.1 only), -DBSD43 (for 4.3), -DBSD29 (BSD
3712 +   2.9 for DEC PDP-11s). -DBSD44 is for 4.4BSD, which is the basis of
3713 +   FreeBSD, NetBSD, OpenBSD, BSDI, and Mac OS X, and which contains many
3714 +   POSIX features, and has little relation to 4.3BSD and earlier.
3715 +
3716 +   For POSIX, include the flag -DPOSIX. POSIX defines a whole new set of
3717 +   terminal i/o functions that are not found in traditional AT&T or
3718 +   Berkeley implementations, and also defines the symbol _POSIX_SOURCE,
3719 +   which is used in many system and library header files, mainly to
3720 +   disable non-POSIX (i.e. useful) features.
3721 +
3722 +   Note (circa 1997): In order to enable serial speeds higher than 38400
3723 +   bps, it is generally necessary to add -DPOSIX (among other things),
3724 +   since the older terminal APIs can not accommodate the new speeds -- out
3725 +   o' bits. But this often also means wholesale conversion to POSIX APIs.
3726 +   In general, just try adding -DPOSIX and then see what goes wrong. Be
3727 +   wary of features disappearing: when _POSIX_SOURCE is defined, all sorts
3728 +   of things that were perfectly OK before suddenly become politically
3729 +   incorrect -- like reading modem signals, doing hardware flow control,
3730 +   etc. POSIX was evidently not designed with serial communication in
3731 +   mind!
3732 +
3733 +   Case in point: In UnixWare 7.0, #define'ing POSIX causes strictness
3734 +   clauses in the header files to take effect. These prevent <sys/time.h>
3735 +   from defining the timeval and timezone structs, which are needed for
3736 +   all sorts of things (like select()). Thus, if we want the high serial
3737 +   speeds, we have to circumvent the POSIX clauses.
3738 +
3739 +   Similarly in SCO OpenServer R5.0.4 where, again, we must use the POSIX
3740 +   APIs to get at serial speeds higher than 38400, but then doing so
3741 +   removes hardware flow control -- just when we need it most! In cases
3742 +   like this, dirty tricks are the only recourse (search for SCO_OSR504 in
3743 +   [250]ckutio.c for examples).
3744 +
3745 +   For reasons like this, Unix implementations tend to be neither pure
3746 +   AT&T nor pure BSD nor pure POSIX, but a mixture of two or more of
3747 +   these, with "compatibility features" allowing different varieties of
3748 +   programs to be built on the same computer. In general, Kermit tries not
3749 +   to mix and match but to keep a consistent repertoire throughout.
3750 +   However, there are certain Unix implementations that only work when you
3751 +   mix and match. For example, the Silicon Graphics IRIX operating system
3752 +   (prior to version 3.3) is an AT&T Unix but with a BSD file system. The
3753 +   only way you can build Kermit successfully for this configuration is to
3754 +   include -DSVR3 plus the special option -DLONGFN, meaning "pretend I was
3755 +   built with -DBSDxx when it's time to compile file-related code". See
3756 +   the "iris" makefile target.
3757 +
3758 +9.1. Standards
3759 +
3760 +   [ [251]Top ] [ [252]Section Contents ] [ [253]Contents ] [ [254]Next ]
3761 +
3762 +   SUBSECTION CONTENTS
3763 +
3764 +9.1.1. [255]POSIX
3765 +9.1.2. [256]ANSI C
3766 +9.1.3. [257]Other Standards
3767 +
3768 +   In edits 166-167 (1988-89), C-Kermit was heavily modified to try to
3769 +   keep abreast of new standards while still remaining compatible with old
3770 +   versions of C and Unix. There are two new standards of interest: ANSI C
3771 +   (as described in Kernighan and Ritchie, "The C Programming Language",
3772 +   Second Edition, Prentice Hall, 1988) and POSIX.1 (IEEE Standard 1003.1
3773 +   and ISO/IEC 9945-1, 1990, "Portable Operating System Interface"). These
3774 +   two standards have nothing to do with each other: you can build
3775 +   C-Kermit with a non-ANSI compiler for a POSIX system, or for a
3776 +   non-POSIX system with with an ANSI compiler.
3777 +
3778 +9.1.1. POSIX
3779 +
3780 +   POSIX.1 defines a repertoire of system functions and header files for
3781 +   use by C language programs. Most notably, the ioctl() function is not
3782 +   allowed in POSIX; all ioctl() functions have been replaced by
3783 +   device-specific functions like tcsetattr(), tcsendbreak(), etc.
3784 +
3785 +   Computer systems that claim some degree of POSIX compliance have made
3786 +   some attempt to put their header files in the right places and give
3787 +   them the right names, and to provide system library functions with the
3788 +   right names and calling conventions. Within the header files,
3789 +   POSIX-compliant functions are supposed to be within #ifdef
3790 +   _POSIX_SOURCE..#endif conditionals, and non-POSIX items are not within
3791 +   these conditionals.
3792 +
3793 +   If Kermit is built with neither -D_POSIX_SOURCE nor -DPOSIX, the
3794 +   functions and header files of the selected version of Unix (or VMS,
3795 +   etc) are used according to the CFLAGS Kermit was built with.
3796 +
3797 +   If Kermit is built with -D_POSIX_SOURCE but not -DPOSIX, then one of
3798 +   the -DBSD or -DATTSV flags (or one that implies them) must also be
3799 +   defined, but it still uses only the POSIX features in the system header
3800 +   files. This allows C-Kermit to be built on BSD or AT&T systems that
3801 +   have some degree of POSIX compliance, but still use BSD or AT&T
3802 +   specific features.
3803 +
3804 +   The dilimma is this: it is often necessary to define _POSIX_SOURCE to
3805 +   get at new or modern features, such as high serial speeds and the APIs
3806 +   to deal with them. But defining _POSIX_SOURCE also hides other APIs
3807 +   that Kermit needs, for example the ones dealing with modem signals
3808 +   (others are listed just below). Thus all sorts of hideous contortions
3809 +   are often required to get a full set of features.
3810 +
3811 +   The POSIX standard does not define anything about uucp lockfiles. "make
3812 +   posix" uses NO (repeat, NO) lockfile conventions. If your
3813 +   POSIX-compliant Unix version uses a lockfile convention such as HDBUUCP
3814 +   (see below), use the "posix" entry, but include the appropriate
3815 +   lockfile option in your KFLAGS on the "make" command line, for example:
3816 +
3817 +make posix "KFLAGS=-DHDBUUCP"
3818 +
3819 +   POSIX.1 also lacks certain other features that Kermit needs. For
3820 +   example:
3821 +
3822 +     * There is no defined way for an application to do wildcard matching
3823 +       of filenames. Kermit uses the inode in the directory structure, but
3824 +       POSIX.1 does not include this concept. (Later POSIX revisions
3825 +       include functions named (I think) glob() and fnmatch(), but these
3826 +       functions are not yet in Kermit, and might not be appropriate in
3827 +       any case.)
3828 +     * There is no POSIX mechanism for sensing or controlling modem
3829 +       signals, nor to enable RTS/CTS or other hardware flow control.
3830 +     * There is no select() for multiplexing i/o, and therefore no TCP/IP.
3831 +     * There is no way to check if characters are waiting in a
3832 +       communications device (or console) input buffer, short of trying to
3833 +       read them -- no select(), ioctl(fd,FIONREAD,blah), rdchk(), etc.
3834 +       This is bad for CONNECT mode and bad for sliding windows.
3835 +     * No way to do a millisecond sleep (no nap(), usleep(), select(),
3836 +       etc).
3837 +     * There is no popen().
3838 +
3839 +   So at this point, there cannot be one single fully functional POSIX
3840 +   form of C-Kermit unless it also has "extensions", as do Linux, QNX,
3841 +   etc.
3842 +
3843 +   More on POSIX (quoting from a newsgroup posting by Dave Butenhof):
3844 +
3845 +     Standards tend to look at themselves as "enabling". So POSIX
3846 +     standards say that, in order to use POSIX functions, a program must
3847 +     define some macro that will put the development environment in
3848 +     "POSIX mode". For the ancient POSIX 1003.1-1990, the symbol is
3849 +     _POSIX_SOURCE. For recent revisions, it's _POSIX_C_SOURCE with an
3850 +     appropriate value. POSIX 1003.1-1996 says that, to use its features
3851 +     in a portable manner, you must define _POSIX_C_SOURCE=199506L before
3852 +     including any header files.
3853 +
3854 +     But for Solaris, or Digital Unix, the picture is different. POSIX is
3855 +     one important but small part of the universe. Yet POSIX
3856 +     unconditionally and unambiguously REQUIRES that, when
3857 +     _POSIX_C_SOURCE=199506L, ALL of the functions and definitions
3858 +     required by the standard, and NO others (except in specific
3859 +     restricted namespaces, specifically "_" followed by an uppercase
3860 +     letter or "__" followed by a lowercase letter) shall be visible.
3861 +     That kinda puts a cramp on BSD and SVID support, because those
3862 +     require names that are not in the "protected" POSIX namespaces. It's
3863 +     ILLEGAL to make those symbols visible, unless you've done something
3864 +     else that's beyond the scope of POSIX to allow the system to infer
3865 +     that you didn't really mean it.
3866 +
3867 +     In most cases, you should just compile, with no standards-related
3868 +     macros defined. The system will make available every interface and
3869 +     definition that isn't incompatible with the "main stream". There may
3870 +     indeed be cases where two standards cross, and you really can't use
3871 +     both together. But, in general, they play nicely together as long as
3872 +     you don't do anything rash -- like telling the system that it's not
3873 +     allowed to let them.
3874 +
3875 +     In the area of threads, both Solaris and Digital Unix support
3876 +     incompatible thread APIs. We have POSIX and DCE, they have POSIX and
3877 +     UI. The nasty areas are in the _r routines and in some aspects of
3878 +     signal behavior. You cannot compile a single source file that uses
3879 +     both semantics. That's life. It sounds as if Solaris defaults to the
3880 +     UI variants, but allows you to define this _POSIX_THREAD_SEMANTICS
3881 +     to get around it. We default to POSIX, and allow you to define
3882 +     _PTHREAD_USE_D4 (automatically defined by the cc "-threads" switch)
3883 +     to select the DCE thread variants. That default, because you're
3884 +     operating outside of any individual standard, is really just a
3885 +     marketing decision.
3886 +
3887 +9.1.2. ANSI C
3888 +
3889 +   [ [258]Top ] [ [259]Contents ] [ [260]Section Contents ] [
3890 +   [261]Subsection Contents ] [ [262]Next ] [ [263]Previous ]
3891 +
3892 +   The major difference between ANSI C and earlier C compilers is function
3893 +   prototyping. ANSI C allows function arguments to be checked for type
3894 +   agreement, and (when possible) type coercion in the event of a
3895 +   mismatch. For this to work, functions and their arguments must be
3896 +   declared before they are called. The form for function declarations is
3897 +   different in ANSI C and non-ANSI C (ANSI C also accepts the earlier
3898 +   form, but then does not do type checking).
3899 +
3900 +   As of edit 167, C-Kermit tries to take full advantage of ANSI C
3901 +   features, especially function prototyping. This removes many bugs
3902 +   introduced by differing data types used or returned by the same
3903 +   functions on different computers. ANSI C features are automatically
3904 +   enabled when the symbol __STDC__ is defined. Most ANSI C compilers,
3905 +   such as GNU CC and the new DEC C compiler define this symbol
3906 +   internally.
3907 +
3908 +   On the downside, ANSI C compilation increases the
3909 +   administrative/bureacratic burden, spewing out countless unneeded
3910 +   warnings about mismatched types, especially when we are dealing with
3911 +   signed and unsigned characters, requiring casts everywhere to shut up
3912 +   the mindless complaints -- there is no use for signed chars in Kermit
3913 +   (or probably anywhere else). Some compilers, mercifully, include a
3914 +   "treat all chars as unsigned" option, and when available it should be
3915 +   used -- not only to stop the warnings, but also to avoid unhelpful sign
3916 +   extension on high-bit characters.
3917 +
3918 +   To force use of ANSI C prototypes, include -DCK_ANSIC on the cc command
3919 +   line. To disable the use of ANSI prototypes, include -DNOANSI.
3920 +
3921 +9.1.3. Other Standards
3922 +
3923 +   [ [264]Top ] [ [265]Contents ] [ [266]Section Contents ] [
3924 +   [267]Subsection Contents ] [ [268]Next ] [ [269]Previous ]
3925 +
3926 +   As the years go by, standards with-which-all-must-comply continue to
3927 +   pile up: AES, XPG2, XPG3, XPG4, FIPS 151-2, successive generations of
3928 +   POSIX, OSF/1, X/Open, Spec 1170, UNIX95, Open Group UNIX98, ISO/IEC
3929 +   9945 parts 1-4, ISO 9899, 88Open, OS 99, Single Unix Specification
3930 +   (SUS, [270]IEEE 1003.1-2001, not to mention "mature standards" like V7,
3931 +   4.2/4.3BSD, System V R3 and R4 (SVID2 and SVID3), 4.4BSD (the basis for
3932 +   BSDI, OpenBSD, NetBSD, FreeBSD, Mac OS X etc), /usr/group, plus
3933 +   assorted seismic pronouncements of the neverending series of ephemeral
3934 +   corporate consortia, not to mention the libc-vs-glibc turmoil in the
3935 +   Linux arena and who knows what else.
3936 +
3937 +   None of these standards simplifies life for portable applications like
3938 +   C-Kermit -- each one is simply one more environment to support (or
3939 +   circumvent, as in many cases these standards do more harm than good by
3940 +   denying access to facilities we need, e.g. as noted in above in
3941 +   [271]9.1.1).
3942 +
3943 +9.2. Library Issues
3944 +
3945 +   [ [272]Top ] [ [273]Contents ] [ [274]Section Contents ] [
3946 +   [275]Subsection Contents ] [ [276]Next ] [ [277]Previous ]
3947 +
3948 +   On most modern platforms, applications are -- and often must be --
3949 +   dynamically linked. This has numerous advantages (smaller executables,
3950 +   ability to patch a library and thereby patch all applications that use
3951 +   it, etc), but also causes some headaches: most commonly, the library ID
3952 +   built into the executable at link time does not match the ID of the
3953 +   corresponding library on the target system, and so the loader refuses
3954 +   to let the application run.
3955 +
3956 +   This problem only gets worse over time. In the Linux and *BSD world, we
3957 +   also have totally different libraries (each with their own names and
3958 +   numbering systems) that cover the same territory; for example, curses
3959 +   vs ncurses, libc versus glibc. Combinations proliferate and any given
3960 +   Unix computer might have any combination. For this reason it is
3961 +   becoming increasingly difficult to produce a "Linux binary" for a given
3962 +   architecture (e.g. PC or Alpha). There has to be a separate binary for
3963 +   (at least) every combination of curses vs ncurses and libc vs glibc.
3964 +
3965 +   In such cases, the best advice is for every user to build C-Kermit from
3966 +   source code on the system where it will run. Too bad most commercial
3967 +   Unix vendors have stopped including C compilers with the operating
3968 +   system!
3969 +
3970 +9.3. Unix File System Peculiarities
3971 +
3972 +   [ [278]Top ] [ [279]Contents ] [ [280]Section Contents ] [ [281]Next ]
3973 +   [ [282]Previous ]
3974 +
3975 +   Normally, including a BSD, System-V, POSIX, or DIRENT flag in the make
3976 +   entry selects the right file system code. But some versions of Unix are
3977 +   inconsistent in this regard, and building in the normal way either
3978 +   gives compiler or linker errors, or results in problems at runtime,
3979 +   typically failure to properly expand wildcard file specifications when
3980 +   you do something like "send *.*", or failure to recognize long
3981 +   filenames, as in "send filewithaveryveryveryveryverylongname".
3982 +
3983 +   C-Kermit is supposed to know about all the various styles of Unix file
3984 +   systems, but it has to be told which one to use when you build it,
3985 +   usually in the makefile target CFLAGS as shown below, but you might
3986 +   also have to add something like -I/usr/include/bsd to CFLAGS, or
3987 +   something like -lbsd to LIBS.
3988 +
3989 +   C-Kermit gives you the following CFLAGS switches to adapt to your file
3990 +   system's peculiarities:
3991 +
3992 +-DDIRENT   - #include <dirent.h>
3993 +-DSDIRENT  - #include <sys/dirent.h>
3994 +-DNDIR     - #include <ndir.h>
3995 +-DXNDIR    - #include <sys/ndir.h>
3996 +-DRTU      - #include "/usr/lib/ndir.h", only if NDIR and XNDIR not defined.
3997 +-DSYSUTIMH - #include <sys/utime.h> for setting file creation dates.
3998 +-DUTIMEH   - #include <utime.h> for setting file creation dates.
3999 +
4000 +   (Note, RTU should only be used for Masscomp RTU systems, because it
4001 +   also selects certain other RTU-specific features.)
4002 +
4003 +   If none of these is defined, then <sys/dir.h> is used. IMPORTANT: If
4004 +   your system has the file /usr/include/dirent.h then be sure to add
4005 +   -DDIRENT to your makefile target's CFLAGS. "dirent" should be used in
4006 +   preference to any of the others, because it supports all the features
4007 +   of your file system, and the others probably don't.
4008 +
4009 +   Having selected the appropriate directory header file, you might also
4010 +   need to tell Kermit how to declare the routines and variables it needs
4011 +   to read the directory. This happens most commonly on AT&T System-V
4012 +   based UNIXes, particularly System V R3 and earlier, that provide long
4013 +   file and directory names (longer than 14 characters). Examples include
4014 +   certain releases of HP-UX, DIAB DNIX, older versions of Silicon
4015 +   Graphics IRIX, and perhaps also MIPS. In this case, try adding -DLONGFN
4016 +   to your makefile target.
4017 +
4018 +   Another problem child is <sys/file.h>. Most Unix C-Kermit versions need
4019 +   to #include this file from within [283]ckufio.c and [284]ckutio.c, but
4020 +   some not only do not need to include it, but MUST not include it
4021 +   because (a) it doesn't exist, or (b) it has already been included by
4022 +   some other header file and it doesn't protect itself against multiple
4023 +   inclusion, or (c) some other reason that prevents successful
4024 +   compilation. If you have compilation problems that seem to stem from
4025 +   including this file, then add the following switch to CFLAGS in your
4026 +   makefile target:
4027 +
4028 +-DNOFILEH
4029 +
4030 +   There are a few odd cases where <sys/file.h> must be included in one of
4031 +   the cku[ft]io.c files, but not the other. In that case, add the
4032 +   aforementioned switch, but go into the file that needs <sys/file.h> and
4033 +   add something like this:
4034 +
4035 +#ifdef XXX       /* (where XXX is a symbol unique to your system) */
4036 +#undef NOFILEH
4037 +#endif /* XXX */
4038 +
4039 +   before the section that includes <sys/file.h>.
4040 +
4041 +   Kermit's SEND command expands wildcard characters "?" and "*" itself.
4042 +   Before version 5A, commands like "send *" would send all regular
4043 +   (non-directory) files, including "hidden files" (whose names start with
4044 +   "."). In version 5A, the default behavior is to match like the Bourne
4045 +   shell or the ls command, and not include files whose names start with
4046 +   dot. Such files can still be sent if the dot is included explicitly in
4047 +   the SEND command: "send .oofa, send .*". To change back to the old way
4048 +   and let leading wildcard characters match dot files, include the
4049 +   following in your CFLAGS:
4050 +
4051 +-DMATCHDOT
4052 +
4053 +   (In C-Kermit 6.0, there is also a command to control this at runtime.)
4054 +
4055 +   Complaints about data-type mismatches:
4056 +
4057 +     * If you get compile-time complaints about data type mismatches for
4058 +       process-ID related functions like getpid(), add -DPID_T=pid_t.
4059 +     * If you get compile-time complaints about data type mismatches for
4060 +       user ID related functions like getuid(), add -DUID_T=uid_t.
4061 +     * If you get compile-time complaints about data type mismatches for
4062 +       user-ID related functions like getgid(), add -DGID_T=gid_t.
4063 +     * If you get compile-time complaints about data type mismatches for
4064 +       getpwuid(), add -DPWID_T=uid_t (or whatever it should be).
4065 +
4066 +   File creation dates: C-Kermit attempts to set the creation date/time of
4067 +   an incoming file according to the date/time given in the file's
4068 +   attribute packet, if any. If you find that the dates are set
4069 +   incorrectly, you might need to build Kermit with the -DSYSUTIMEH flag,
4070 +   to tell it to include <sys/utime.h>. If that doesn't help, look at the
4071 +   code in zstrdt() in [285]ckufio.c.
4072 +
4073 +9.4. Hardware Flow Control
4074 +
4075 +   [ [286]Top ] [ [287]Contents ] [ [288]Section Contents ] [ [289]Next ]
4076 +   [ [290]Previous ]
4077 +
4078 +   Hardware flow control is a problematic concept in many popular Unix
4079 +   implementations. Often it is lacking altogether, and when available,
4080 +   the application program interface (API) to it is inconsistent from
4081 +   system to system. Here are some examples:
4082 +
4083 +    a. POSIX does not support hardware flow control.
4084 +    b. RTS/CTS flow control support MIGHT be available for System V R3 and
4085 +       later if /usr/include/termiox.h exists (its successful operation
4086 +       also depends on the device driver, and the device itself, not to
4087 +       mention the [291]cable, etc, actually supporting it). If your
4088 +       SVR3-or-later Unix system does have this file, add:
4089 +
4090 +-DTERMIOX
4091 +
4092 +       to your CFLAGS. If the file is in /usr/include/sys instead, add:
4093 +
4094 +-DSTERMIOX
4095 +
4096 +       Note that the presence of this file does not guarantee that RTS/CTS
4097 +       will actually work -- that depends on the device-driver
4098 +       implementation (reportedly, many Unix versions treat
4099 +       hardware-flow-control related ioctl's as no-ops).
4100 +    c. Search ("grep -i") through /usr/include/*.h and
4101 +       /usr/include/sys/*.h for RTS or CTS and see what turns up. For
4102 +       example, in SunOS 4.x we find "CRTSCTS". Figuring out how to use it
4103 +       is another question entirely! In IBM AIX RS/6000 3.x, we have to
4104 +       "add" a new "line discipline" (and you won't find uppercase RTS or
4105 +       CTS symbols in the header files).
4106 +    d. NeXTSTEP and IRIX, and possibly others, support hardware flow
4107 +       control, but do not furnish an API to control it, and thus on these
4108 +       systems Kermit has no command to select it -- instead, a special
4109 +       device name must be used. (NeXTSTEP: /dev/cufa instead of /dev/cua;
4110 +       IRIX: /dev/ttyf00)
4111 +
4112 +   See the routine tthflow() in [292]ckutio.c for details. If you find
4113 +   that your system offers hardware flow control selection under program
4114 +   control, you can add this capability to C-Kermit as follows:
4115 +
4116 +    a. See if it agrees with one of the methods already used in tthflow().
4117 +       if not, add new code, appropriately #ifdef'd.
4118 +    b. Add -DCK_RTSCTS to the compiler CFLAGS in your makefile target or
4119 +       define this symbol within the appropriate #ifdefs in [293]ckcdeb.h.
4120 +
4121 +   To illustrate the difficulties with RTS/CTS, here is a tale from Jamie
4122 +   Watson <jw@adasoft.ch>, who added the RTS/CTS code for the RS/6000,
4123 +   about his attempts to do the same for DEC ULTRIX:
4124 +
4125 +     "The number and type of hardware signals available to/from a serial
4126 +     port vary between different machines and different types of serial
4127 +     interfaces on each machine. This means that, for example, there are
4128 +     virtually no hardware signals in or out available on the DECsystem
4129 +     3000/3100 series; on the DECsystem 5000/2xx series all modem signals
4130 +     in/out are present on both built-in serial ports; on the DECsystem
4131 +     5100 some ports have all signals and some only have some; and so
4132 +     on... It looks to me as if this pretty well rules out any attempt to
4133 +     use hardware flow control on these platforms, even if we could
4134 +     figure out how to do it. The confusion on the user level about
4135 +     whether or not it should work for any given platform or port would
4136 +     be tremendous. And then it isn't clear how to use the hardware
4137 +     signals even in the cases where the device supports them."
4138 +
4139 +  9.5. Terminal Speeds
4140 +
4141 +   [ [294]Top ] [ [295]Contents ] [ [296]Section Contents ] [ [297]Next ]
4142 +   [ [298]Previous ]
4143 +
4144 +   The allowable speeds for the SET SPEED command are defined in
4145 +   [299]ckcdeb.h. If your system supports speeds that are not listed in
4146 +   "set speed ?", you can add definitions for them to ckcdeb.h.
4147 +
4148 +   Then if the speed you are adding is one that was never used before in
4149 +   Kermit, such as 921600, you'll also need to add the appropriate
4150 +   keywords to spdtab[] in [300]ckuus3.c, and the corresponding case to
4151 +   ttsspd() in [301]ckutio.c.
4152 +
4153 +  9.6. Millisecond Sleeps
4154 +
4155 +   [ [302]Top ] [ [303]Contents ] [ [304]Section Contents ] [ [305]Next ]
4156 +   [ [306]Previous ]
4157 +
4158 +   There is no standard for millisecond sleeps, but at least five
4159 +   different functions have appeared in various Unix versions that can be
4160 +   used for this purpose: nap() (mostly in System V), usleep() (found at
4161 +   least in SunOS and NeXT OS), select() (found in 4.2BSD and later, and
4162 +   part of any TCP/IP sockets library), nanosleep(), and sginap(). If you
4163 +   have any of these available, pick one (in this order of preference, if
4164 +   you have more than one):
4165 +
4166 +-DSELECT: Include this in CFLAGS if your system has the select() function.
4167 +-DNAP:    Include this in CFLAGS if your system has the nap() function.
4168 +-USLEEP:  Include this in CFLAGS if your system has the usleep() function.
4169 +
4170 +   NOTE: The nap() function is assumed to be a function that puts the
4171 +   process to sleep for the given number of milliseconds. If your system's
4172 +   nap() function does something else or uses some other units of time
4173 +   (like the NCR Tower 32, which uses clock-ticks), do not include -DNAP.
4174 +
4175 +   Reportedly, all versions of System V R4 for Intel-based computers, and
4176 +   possibly also SVR3.2, include nap() as a kernel call, but it's not in
4177 +   the library. To include code to use it via syscall(3112,x), without
4178 +   having to include Xenix compatibility features, include the following
4179 +   compile-time option:
4180 +
4181 +-DNAPHACK
4182 +
4183 +  9.7. Nondestructive Input Buffer Peeking
4184 +
4185 +   [ [307]Top ] [ [308]Contents ] [ [309]Section Contents ] [ [310]Next ]
4186 +   [ [311]Previous ]
4187 +
4188 +   Some AT&T Unix versions have no way to check if input is waiting on a
4189 +   tty device, but this is a very important feature for Kermit. Without
4190 +   it, sliding windows might not work very well (or at all), and you also
4191 +   have to type your escape character to get Kermit's attention in order
4192 +   to interrupt a local-mode file transfer. If your system offers an
4193 +   FIONREAD ioctl, the build procedure should pick that up automatically
4194 +   and use it, which is ideal.
4195 +
4196 +   If your system lacks FIONREAD but has a select() function, this can be
4197 +   used instead. If the build procedure fails to include it (SHOW FEATURES
4198 +   will list SELECT), then you can add it to your CFLAGS:
4199 +
4200 +-DSELECT
4201 +
4202 +   Conversely, if the build procedure tries to use select() when it really
4203 +   is not there, add:
4204 +
4205 +-DNOSELECT
4206 +
4207 +   Note: select() is not part of System V nor of POSIX, but it has been
4208 +   added to various System-V- and POSIX-based systems as an extension.
4209 +
4210 +   Some System-V variations (SCO Xenix/UNIX/ODT and DIAB DNIX) include a
4211 +   rdchk() function that can be used for buffer peeking. It returns 0 if
4212 +   no characters are waiting and 1 if characters are waiting (but unlike
4213 +   FIONREAD, it does not tell the actual number). If your system has
4214 +   rdchk(), add:
4215 +
4216 +-DRDCHK:  Include this in CFLAGS if your system has the rdchk() function.
4217 +
4218 +   Otherwise, if your version of Unix has the poll() function (and the
4219 +   /usr/include/poll.h file) -- which appears to be a standard part of
4220 +   System V going back to at least SVR3, include:
4221 +
4222 +-DCK_POLL
4223 +
4224 +  9.8. Other System-Dependent Features
4225 +
4226 +   [ [312]Top ] [ [313]Contents ] [ [314]Section Contents ] [ [315]Next ]
4227 +   [ [316]Previous ]
4228 +
4229 +   Systems with <termios.h> might have the symbol IEXTEN defined. This is
4230 +   used to turn "extended features" in the tty device driver on and off,
4231 +   such as Ctrl-O to toggle output flushing, Ctrl-V to quote input
4232 +   characters, etc.
4233 +
4234 +   In most Unix implementations, it should be turned off during Kermit
4235 +   operation, so if [317]ckutio.c finds this symbol, it uses it. This is
4236 +   necessary, at least, on BSDI. On some systems, however, IEXTEN is
4237 +   either misdefined or misimplemented. The symptom is that CR, when typed
4238 +   to the command processor, is echoed as LF, rather than CRLF. This
4239 +   happens (at least) on Convex/OS 9.1. The solution is to add the
4240 +   following symbol to the makefile target's CFLACS:
4241 +
4242 +-DNOIEXTEN
4243 +
4244 +   However, in at least one Unix implementation, QNX 4.21, IEXTEN must be
4245 +   set before hardware flow control can be used.
4246 +
4247 +   In edits 177 and earlier, workstation users noticed a "slow screen
4248 +   writing" phenomenon during interactive command parsing. This was traced
4249 +   to a setbuf() call in [318]ckutio.c that made console (stdout) writes
4250 +   unbuffered. This setbuf() call has been there forever, and could not be
4251 +   removed without some risk. Kermit's operation was tested on the NeXT in
4252 +   edit 178 with the setbuf() call removed, and the slow-writing symptom
4253 +   was cured, and everything else (command parsing, proper wakeup on ?,
4254 +   ESC, Ctrl-U, and other editing characters, terminal emulation,
4255 +   remote-mode and local-mode file transfer, etc) seemed to work as well
4256 +   as or better than before. In subsequent edits, this change was made to
4257 +   many other versions too, with no apparent ill effects. To remove the
4258 +   setbuf() call for your version of Kermit, add:
4259 +
4260 +-DNOSETBUF
4261 +
4262 +   Later reports indicate that adding -DNOSETBUF has other beneficial
4263 +   effects, like cutting down on swapping when Kermit is run on
4264 +   workstations with small memories. But BEWARE: on certain small Unix
4265 +   systems, notably the AT&T 6300 and 3B1 (the very same ones that benefit
4266 +   from NOSETBUF), NOSETBUF seems to conflict with CK_CURSES. The program
4267 +   builds and runs OK, but after once using the curses display, echoing is
4268 +   messed up. In this case, we use a System-V specific variation in the
4269 +   curses code, using newterm() to prevent System V from altering the
4270 +   buffering. See makefile entries for AT&T 6300 and 3B1.
4271 +
4272 +   The Unix version of C-Kermit includes code to switch to file descriptor
4273 +   zero (stdin) for remote-mode file transfer. This code is necessary to
4274 +   prevent Kermit from giving the impression that it is "idle" during file
4275 +   transfers, which, at some sites, can result in the job being logged out
4276 +   in the middle of an active file transfer by idle-job monitors.
4277 +
4278 +   However, this feature can interfere with certain setups; for example,
4279 +   there is a package which substitutes a pty/tty pair for /dev/tty and
4280 +   sets file descriptor 0 to be read-only, preventing Kermit from sending
4281 +   packets. Or... When a Unix shell is invoked under the PICK environment,
4282 +   file descriptor 0 is inoperative.
4283 +
4284 +   To remove this feature and allow Kermit to work in such environments,
4285 +   add the compile-time option:
4286 +
4287 +-DNOFDZERO
4288 +
4289 +   On some versions of Unix, earlier releases of C-Kermit were reported to
4290 +   render a tty device unusable after a hangup operation. Examples include
4291 +   IBM AIX on the RT PC and RS/6000. A typical symptom of this phenomenon
4292 +   is that the DIAL command doesn't work, but CONNECTing to the device and
4293 +   dialing manually do work. A further test is to SET DIAL HANGUP OFF,
4294 +   which should make dialing work once by skipping the pre-dial hangup.
4295 +   However, after the connection is broken, it can't be used any more:
4296 +   subsequent attempts to DIAL the same device don't work. The cure is
4297 +   usually to close and reopen the device as part of the hangup operation.
4298 +   To do this, include the following compile-time option:
4299 +
4300 +-DCLSOPN
4301 +
4302 +   Similarly, there is a section of code in ttopen(), which does another
4303 +   close(open()) to force the O_NDELAY mode change. On some systems, the
4304 +   close(open()) is required to make the mode change take effect, and
4305 +   apparently on most others it does no harm. But reportedly on at least
4306 +   one System V R4 implementation, and on SCO Xenix 3.2, the close(open())
4307 +   operation hangs if the device lacks carrier, EVEN THOUGH the CLOCAL
4308 +   characteristic has just been set to avoid this very problem. If this
4309 +   happens to you, add this to your CFLAGS:
4310 +
4311 +-DNOCOTFMC
4312 +
4313 +   or, equivalently, in your KFLAGS on the make command line. It stands
4314 +   for NO Close(Open()) To Force Mode Change.
4315 +
4316 +   C-Kermit renames files when you give a RENAME command and also
4317 +   according to the current SET FILE COLLISION option when receiving
4318 +   files. The normal Unix way to rename a file is via two system calls:
4319 +   link() and unlink(). But this leaves open a window of vulnerability.
4320 +   Some Unix systems also offer an atomic rename(oldname,newname)
4321 +   function. If your version of Unix has this function, add the following
4322 +   to your CFLAGS:
4323 +
4324 +-DRENAME
4325 +
4326 +   C-Kermit predefines the RENAME for several Unix versions in
4327 +   [319]ckcdeb.h (SVR4, SUNOS41, BSD44, AIXRS, etc). You can tell if
4328 +   rename() is being used if the SHOW FEATURES command includes RENAME in
4329 +   the compiler options list. If the predefined RENAME symbol causes
4330 +   trouble, then add NORENAME to your CFLAGS. Trouble includes:
4331 +
4332 +    a. Linker complains that _rename is an unresolved symbol.
4333 +    b. Linking works, but Kermit's RENAME command doesn't work (which
4334 +       happens because older versions of rename() might have their
4335 +       arguments reversed).
4336 +
4337 +   If rename() is not used, then Kermit uses link()/unlink(), which is
4338 +   equivalent except it is not atomic: there is a tiny interval in which
4339 +   some other process might "do something" to one of the files or links.
4340 +
4341 +   Some Unix systems (Olivetti X/OS, Amdahl UTS/V, ICL SVR3, etc) define
4342 +   the S_ISREG and S_ISDIR macros incorrectly. This is compensated for
4343 +   automatically in [320]ckufio.c. Other systems might have this same
4344 +   problem. If you get a compile-time error message regarding S_ISREG
4345 +   and/or S_ISDIR, add the following to your CFLAGS:
4346 +
4347 +-DISDIRBUG
4348 +
4349 +   Finally, here's a symbol you should NEVER define:
4350 +
4351 +-DCOMMENT
4352 +
4353 +   It's used for commenting out blocks of code. If for some reason you
4354 +   find that your compiler has COMMENT defined, then add -UCOMMENT to
4355 +   CFLAGS or KFLAGS! Similarly, some header files have been known to
4356 +   define COMMENT, in which case you must add "#undef COMMENT" to each
4357 +   C-Kermit source module, after all the #includes.
4358 +
4359 +  9.9. Terminal Interruption
4360 +
4361 +   [ [321]Top ] [ [322]Contents ] [ [323]Section Contents ] [ [324]Next ]
4362 +   [ [325]Previous ]
4363 +
4364 +   When C-Kermit enters interactive command mode, it sets a Control-C
4365 +   (terminal keyboard interrupt = SIGINT) trap to allow it to return to
4366 +   the command prompt whenever the user types Control-C (or whatever is
4367 +   assigned to be the interrupt character). This is implemented using
4368 +   setjmp() and longjmp(). On some systems, depending on the machine
4369 +   architecture and C compiler and who knows what else, you might get
4370 +   "Memory fault (coredump)" or "longjmp botch" instead of the desired
4371 +   effect (this should not happen in 5A(190) and later). In that case, add
4372 +   -DNOCCTRAP to your CFLAGS and rebuild the program.
4373 +
4374 +   Job control -- the ability to "suspend" C-Kermit on a Unix system by
4375 +   typing the "susp" character (normally Ctrl-Z) and then resume execution
4376 +   later (with the "fg" command) -- is a tricky business. C-Kermit must
4377 +   trap suspend signals so it can put the terminal back into normal mode
4378 +   when you suspend it (Kermit puts the terminal into various strange
4379 +   modes during interactive command parsing, CONNECT, and file transfer).
4380 +   Supporting code is compiled into C-Kermit automatically if <signal.h>
4381 +   includes a definition for the SIGTSTP signal. HOWEVER... some systems
4382 +   define this signal without supporting job control correctly. You can
4383 +   build Kermit to ignore SIGTSTP signals by including the -DNOJC option
4384 +   in CFLAGS. (You can also do this at runtime by giving the command SET
4385 +   SUSPEND OFF.)
4386 +
4387 +     NOTE: As of version 5A(190), C-Kermit makes another safety check.
4388 +     Even if job control is available in the operating system (according
4389 +     to the numerous checks made in congm()), it will still disable the
4390 +     catching of SIGTSTP signals if SIGTSTP was set to SIG_IGN at the
4391 +     time C-Kermit was started.
4392 +
4393 +   System V R3 and earlier systems normally do not support job control. If
4394 +   you have an SVR3 system that does, include the following option in your
4395 +   CFLAGS:
4396 +
4397 +-DSVR3JC
4398 +
4399 +   On systems that correctly implement POSIX signal handling, signals can
4400 +   be handled more reliably than in Bell, Berkeley, or AT&T Unixes. On
4401 +   systems (such as QNX) that are "strictly POSIX", POSIX signal handling
4402 +   *must* be used, otherwise no signal will work more than once. If you
4403 +   have POSIX-based system and you find that your version of Kermit
4404 +   responds to Ctrl-C (SIGINT) or Ctrl-Z (SIGTSTP) only once, then you
4405 +   should add the following option to your CFLAGS:
4406 +
4407 +-DCK_POSIX_SIG
4408 +
4409 +   But be careful; some POSIX implementations, notably 4.4BSD, include
4410 +   POSIX signal handling symbols and functions as "stubs" only, which do
4411 +   nothing. Look in <signal.h> for sigsetjmp and siglongjmp and read the
4412 +   comments.
4413 +
4414 +10. DIALING OUT AND COORDINATING WITH UUCP
4415 +
4416 +   [ [326]Top ] [ [327]Contents ] [ [328]Next ] [ [329]Previous ]
4417 +
4418 +   The short version (general):
4419 +
4420 +     In order for C-Kermit to be able to dial out from your Unix
4421 +     computer, you need to give it the same owner, group, and permissions
4422 +     as your other dialout programs, such as cu, tip, minicom, uucp,
4423 +     seyon, etc.
4424 +
4425 +   The short version for Linux only:
4426 +
4427 +     Since Red Hat 7.2, about 2002, Linux does not leave the lockfile
4428 +     handling to each application, but instead provides an external
4429 +     application, /usr/sbin/lockdev, that all applications should invoke
4430 +     when they need to access a serial port; lockdev locks and unlocks
4431 +     the port without requiring the application to have privileges, since
4432 +     the privileges on the lockfile directory are assigned to lockdev.
4433 +     C-Kermit 8.0.211 and later support this method. But C-Kermit still
4434 +     needs to be able to open the port itself, and therefore if the
4435 +     port's permissions do not allow read/write access to the general
4436 +     public, the general rule must still be followed: in the most common
4437 +     case, it must be SETGID to the group uucp (explained below). If a
4438 +     pre-8.0.211 version of C-Kermit is to be installed for use with
4439 +     serial ports on any version of Linux, it must still be installed as
4440 +     described in the following sections.
4441 +
4442 +   The long version:
4443 +
4444 +   Make sure your dialout line is correctly configured for dialing out (as
4445 +   opposed to login). The method for doing this is different for each kind
4446 +   of Unix. Consult your system documentation for configuring lines for
4447 +   dialing out (for example, Sun SPARCstation IPC users should read the
4448 +   section "Setting up Modem Software" in the Desktop SPARC Sun System and
4449 +   Network Manager's Guide, or the Terminals and Modems section of the HP
4450 +   manual, "Configuring HP-UX for Peripherals" (e.g. /usr/sbin/sam =>
4451 +   Peripheral Devices => Terminals and Modems => Add Modem).
4452 +
4453 +   Unlike most other multiuser, multitasking operating systems, Unix
4454 +   allows multiple users to access the same serial device at the same
4455 +   time, even though there is no earthly reason why two users should do
4456 +   this. When they do, user A will read some of the incoming characters,
4457 +   and user B will read the others. In all likelihood, neither user will
4458 +   see them all. Furthermore, User B can hang up User A's call, and so
4459 +   one.
4460 +
4461 +   Rather than change Unix to enforce exclusive access to serial devices
4462 +   such as ttys, when it might still have been possible, Unix developers
4463 +   opted for a "lock file" mechanism. Any process that wants to open a tty
4464 +   device should first check to see if a file of a certain name exists,
4465 +   and if so, not to open the device. If the file does not exist, the
4466 +   process creates the file and then opens the device. When the process
4467 +   closes the device, it destroys the lockfile. This procedure was
4468 +   originated for use with Unix's UUCP, CU, and TIP programs, and so these
4469 +   lockfiles are commonly called "UUCP lockfiles" (UUCP = Unix-to-Unix
4470 +   Copy Program).
4471 +
4472 +   As you can imagine, this method is riddled with pitfalls:
4473 +
4474 +     * If a process does not observe the prevailing lockfile convention,
4475 +       then it can interfere with other "polite" processes. And in fact,
4476 +       very few Unix applications or commands handle lockfiles at all; an
4477 +       original design goal of Unix was that "everything is a file", and
4478 +       countless utilities operate on files directly (by opening them) or
4479 +       indirectly through redirection of standard i/o, without creating or
4480 +       looking for lockfiles.
4481 +     * If a process crashes while it has the device open, the lockfile is
4482 +       left behind, preventing further processes from using the device.
4483 +     * Various versions of Unix use different names for the lockfiles, put
4484 +       them in different directories, with different owners and groups and
4485 +       permissions, and specify their contents differently.
4486 +     * On a given platform, the lockfile conventions may change from one
4487 +       Unix release to the next (for example, SunOS 4.0 to 4.1) or, in the
4488 +       case of Linux, across different distributions.
4489 +     * The same tty device might have more than one name, and most
4490 +       lockfile conventions don't allow for this. Similarly for symbolic
4491 +       links.
4492 +
4493 +   In an attempt to address the problem of "stale" lockfiles, most UUCP
4494 +   implementations put the PID (Process ID) of the creating process in the
4495 +   lockfile. Thus, another process that wants to open the corresponding
4496 +   device can check not only for the lockfile itself, but also can check
4497 +   the PID for validity. But this doesn't work well either:
4498 +
4499 +     * PIDs are stored in diverse formats that change with every new
4500 +       release (short, integer, long, or string in any of various
4501 +       formats). If the reading program does not follow the same
4502 +       convention as the writing program, it can diagnose a valid PID to
4503 +       be invalid, and therefore not honor the lock.
4504 +     * PIDs recycle. If the lockfile was created by PID 1234, which later
4505 +       crashed without removing the lockfile, and then a new process 1234
4506 +       exists a the time the lockfile is checked, the lockfile will be
4507 +       improperly taken as valid, and access to the device denied
4508 +       unnecessarily.
4509 +
4510 +   Several techniques address the problem of multiple names for the same
4511 +   device:
4512 +
4513 +     * Multiple lockfiles. For example, if the user opens a device through
4514 +       a symlink, a lockfile is created for both the symlink name and the
4515 +       true name (obtained from readlink()). However, when multiple
4516 +       drivers are installed for the same device (e.g. /dev/cua,
4517 +       /dev/cufa, etc), this approach won't work unless all applications
4518 +       *know* all the different names for the same device and make
4519 +       lockfiles for all of them, which is obviously not practical.
4520 +     * Lockfiles whose names are not based on the device name. These
4521 +       lockfiles generally have names like LK.inode/major/minor, where
4522 +       inode, major, and minor are numbers, which will always be the same
4523 +       for any physical device, no matter what its name. This form of
4524 +       lockfile is used in System V R4 and its derivatives, such as
4525 +       Solaris, UnixWare, etc. If lockfiles must be used (as opposed to,
4526 +       say, kernel-based locks), this would seem to be the most effective
4527 +       form.
4528 +
4529 +   Most versions of Unix were not designed to accommodate third-party
4530 +   communications software; thus vendors of these Unix products feel no
4531 +   compunction about changing lockfile conventions from release to
4532 +   release, since they also change their versions of the cu, uucp, tip,
4533 +   etc, programs at the same time to match. And since the source code to
4534 +   these programs might not be published, it is difficult for makers of
4535 +   third-party products like C-Kermit to find out what the new conventions
4536 +   are. It also forces release of new versions of C-Kermit whenever the OS
4537 +   vendor makes a change like this.
4538 +
4539 +   Some Unix vendors have taken a small step to simplify communications
4540 +   application development for their products: the inclusion of lockfile
4541 +   routines in the standard system C runtime libraries to shield the
4542 +   application from the details of lockfile management (IBM AIX is an
4543 +   example). When such routines are used, communications applications do
4544 +   not need modification when lockfile conventions change (although they
4545 +   will need recompiling if the routines are statically linked into the
4546 +   application). In the AIX example, the simple function calls ttylock(),
4547 +   ttyunlock(), and ttylocked() replace hundreds of lines of ugly code in
4548 +   C-Kermit that attempts to keep pace with every release of every Unix
4549 +   product over the last 20 years. Inclusion of ttylock() code occurs
4550 +   when:
4551 +
4552 +-DUSETTYLOCK
4553 +
4554 +   is included in the CFLAGS.
4555 +
4556 +   If such routines are available, they should be used. The rest of this
4557 +   section applies when they are not.
4558 +
4559 +   To fit in with UUCP and other Unix-based serial-port communication
4560 +   software, C-Kermit must have the same idea as your system's uucp, cu,
4561 +   and tip programs about what the UUCP lock directory is called, what the
4562 +   lockfile itself is called, and what its contents should be. In most
4563 +   cases, C-Kermit preprocessor flags create the appropriate configuration
4564 +   at compile time if the appropriate makefile target was used (see
4565 +   [330]ckutio.c). The following CFLAGS options can be used to override
4566 +   the built-in configuration:
4567 +
4568 +   -DLCKDIR
4569 +          Tells Kermit that the UUCP lock directory is
4570 +          /usr/spool/uucp/LCK.
4571 +
4572 +   -DACUCNTRL
4573 +          Tells Kermit to use the BSD 4.3 acucntrl() program to turn off
4574 +          getty (login) on the line before using it, and restore getty
4575 +          when done.
4576 +
4577 +   -DHDBUUCP
4578 +          Include this if your system uses Honey DanBer UUCP, in which the
4579 +          lockfile directory and format are relatively standardized.
4580 +
4581 +   -DLOCK_DIR=\\\"/xxx/yyy\\\"
4582 +          Gives the lock directory name explicitly. The triple quoting is
4583 +          necessary. For example:
4584 +
4585 +CFLAGS= -DBSD4 -DLOCK_DIR=\\\"/usr/local/locks\\\" -DNODEBUG
4586 +
4587 +          (NOTE: The triple quoting assumes this is a "top-level" make
4588 +          entry, and not a make entry that calls another one.)
4589 +
4590 +   -DLFDEVNO The lockfile name uses the tty device inode and major and
4591 +          minor
4592 +          numbers: LK.dev.maj.min, as in Sys V R4, e.g. LK.035.044.008.
4593 +
4594 +   When the LK.inode.major.minor form is used, a single lockfile is
4595 +   enough. Otherwise, a single lockfile rarely suffices. For example, in
4596 +   Linux, it is common to have a /dev/modem symbolic link to an actual
4597 +   dialout device, like /dev/cua0 or /dev/ttyS0, whose purpose is to hide
4598 +   the details of the actual driver from the user. So if one user opens
4599 +   /dev/modem, a lockfile called LCK..modem is created, which does not
4600 +   prevent another user from simulataneously opening the same device by
4601 +   its real name.
4602 +
4603 +   On SCO Unix platforms, we have a slightly different problem: the same
4604 +   device is, by convention, known by "lowercase" and "uppercase" names,
4605 +   depending on whether it has modem control. So by convention,
4606 +   communications programs are supposed to create the lockfiles based on
4607 +   the lowercase name. But some programs don't follow this convention. In
4608 +   HP-UX, we have several different names for each serial device. And so
4609 +   on.
4610 +
4611 +   For this reason, on platforms where the LK.inode.major.minor form is
4612 +   not used, C-Kermit also creates a secondary lockfile (which is simply a
4613 +   link to the first) if:
4614 +
4615 +    a. The given device name is a symbolic link. The secondary link is
4616 +       based on the device's real name.
4617 +    b. On SCO: The device name is not a symbolic link, but it contains
4618 +       uppercase letters. The primary link is based on the lowercase name;
4619 +       the secondary link is based on the name that was given.
4620 +    c. On HP-UX: The device name starts with "cu". The primary link is
4621 +       based on the name that was given; the secondary link is based on
4622 +       the corresponding "ttyd" device, e.g. "LCK..cua0p0" and
4623 +       "LCK..ttyd0p0".
4624 +
4625 +   NOTE: symlinks are not handled in HP-UX.
4626 +
4627 +   Honey DanBer (HDB) UUCP, the basis of many UUCP implementations, has
4628 +   two characteristics:
4629 +
4630 +    a. Lockfiles are kept in /usr/spool/locks/ (usually).
4631 +    b. A lockfile contains the process id (pid) in ASCII, rather than as
4632 +       an int.
4633 +
4634 +   Non-HDB selections assume the lockfile contains the pid in int form
4635 +   (or, more precisely, in PID_T form, where PID_T is either int or pid_t,
4636 +   depending on your system's C library and header files). (b), by the
4637 +   way, is subject to interpretation: the numeric ASCII string may or may
4638 +   not be terminated by a newline, it may or may not have leading spaces
4639 +   (or zeros), and the number of leading spaces or zeros can differ, and
4640 +   the differences can be significant.
4641 +
4642 +   Even if you build the program with the right lockfile option, you can
4643 +   still have problems when you try to open the device. Here are the error
4644 +   messages you can get from SET LINE, and what they mean:
4645 +
4646 +    a. "Timed out, no carrier." This one is not related to lockfiles. It
4647 +       means that you have SET CARRIER ON xx, where xx is the number of
4648 +       seconds to wait for carrier, and carrier did not appear within xx
4649 +       seconds. Solution: SET CARRIER AUTO or OFF.
4650 +    b. "Sorry, access to lock denied." Kermit has been configured to use
4651 +       lockfiles, but (a)the lockfile directory is write-protected against
4652 +       you, or (b) it does not exist. The "access to lock denied" message
4653 +       will tell you the reason. If the directory does not exist, check to
4654 +       make sure Kermit is using the right name. Just because version n of
4655 +       your Unix used a certain lockfile directory is no gurantee that
4656 +       version n.1 does not use a different one. Workaround: ask the
4657 +       system administrator to install a symbolic link from the old name
4658 +       to the new name. Other solutions: (see below)
4659 +    c. "Sorry, access to tty device denied." The tty device that you
4660 +       specified in your SET LINE command is read/write protected against
4661 +       you. Solution: (see below)
4662 +    d. "Sorry, device is in use." The tty device you have specified is
4663 +       currently being used by another user. A prefatory message gives you
4664 +       an "ls -l" listing of the lockfile, which should show the username
4665 +       of the person who created it, plus a message "pid = nnn" to show
4666 +       you the process id of the user's program. Solutions: try another
4667 +       device, wait until the other user is finished, ask the other user
4668 +       to hurry up, or ask the system manager for help.
4669 +    e. "Sorry, can't open connection: reason". The device cannot be opened
4670 +       for some other reason, which is listed.
4671 +    f. "sh: /usr/lib/uucp/acucntrl: not found". This means your Kermit
4672 +       program was built with the -DACUCNTRL switch, but your computer
4673 +       system does not have the BSD 4.3 acucntrl program. Solution:
4674 +       install the acucntrl program if you have it, or rebuild Kermit
4675 +       without the -DACUCNTRL switch.
4676 +
4677 +   There are two solutions for problems (b) and (c), both of which involve
4678 +   intervention by your Unix system administrator (superuser):
4679 +
4680 +    a. Have the superuser change the permission of the lockfile directory
4681 +       and to the tty devices so that everyone on the system has
4682 +       read/write permission.
4683 +
4684 +su% chmod 777 /usr/spool/locks (or whatever the path is)
4685 +su% chmod 666 /dev/ttyXX
4686 +
4687 +       One risk here is that people can write lots of junk into the
4688 +       lockfile directory, delete other people's files in the lockfile
4689 +       directory, and intercept other people's data as it goes in and out
4690 +       of the tty device. The major danger here would be intercepting a
4691 +       privileged password. Of course, any user could write a short,
4692 +       ordinary, unprivileged program to do exactly the same thing if the
4693 +       tty device was world read/writeable. The other risk as that
4694 +       telephone calls are not controlled -- anybody on your system can
4695 +       make them, without having to belong to any particular group, and
4696 +       this could run up your phone bill.
4697 +    b. Use groups to regulate access. Normally the lockfile directory and
4698 +       and the dialout devices will have the same group (such as uucp). If
4699 +       so, then put everybody who's allowed to dial out into that group,
4700 +       and make sure that the lockfile directory and the tty devices have
4701 +       group read AND write permission. Example:
4702 +
4703 +su% chmod 770 /usr/spool/locks (or whatever the path is)
4704 +su% chmod 660 /dev/ttyXX
4705 +
4706 +       User whatever tool is available on your platform to add users to
4707 +       the appropropriate group (e.g. edit the /etc/group file).
4708 +    c. Have the superuser change Kermit to run setuid and/or setgid to the
4709 +       owner and/or group of the lockfile directory and the tty devices if
4710 +       necessary), typically uucp (see [331]next section), but NOT root.
4711 +       Example:
4712 +
4713 +su% chown uucp kermit          - or -  chgrp uucp kermit
4714 +su% chmod u+s kermit (setuid)  - or -  chmod g+s kermit (setgid)
4715 +
4716 +       and then make sure the lockfile directory, and the tty devices,
4717 +       have owner (setuid) and/or group (setgid) write permission. For
4718 +       example:
4719 +
4720 +su% chmod o+rwx /usr/spool/uucp
4721 +su% chown uucp /dev/ttyXX ; chmod 600 /dev/ttyXX
4722 +
4723 +       In some cases, the owner and group must be distinct; the key point
4724 +       is that read/write access is required to both the UUCP lockfile
4725 +       directory and the tty itself.
4726 +
4727 +   If you make C-Kermit setuid or setgid to root, it refuses to run:
4728 +
4729 +Fatal: C-Kermit setuid to root!
4730 +
4731 +   Example:
4732 +
4733 +crw-r-----   1 uucp     uucp       5,  67 Feb 11 06:23 /dev/cua3
4734 +drwxrwxr-x   3 root     uucp         1024 Feb 11 06:22 /var/lock
4735 +
4736 +   requires suid uucp to get read/write access on /dev/cua3 and sgid to
4737 +   get read/write access on /var/lock (since you can't set Kermit's uid or
4738 +   gid to root).
4739 +
4740 +     The reason Kermit can't be setuid or setgid to root has to do with
4741 +     the fact that some Unix OS's can't switch user or group IDs in that
4742 +     case. Unfortunately, the prohibition against making Kermit setuid or
4743 +     setgid to root means that Unix C-Kermit can't be used to make rlogin
4744 +     connections by non-root users. (The rlogin port is privileged, which
4745 +     is why the regular rlogin command is setuid root -- which is safe
4746 +     because the rlogin program never has to create or access files like
4747 +     Kermit does.)
4748 +
4749 +   For the lockfile mechanism to achieve its desired purpose -- prevention
4750 +   of access to the same tty device by more than one process at a time --
4751 +   ALL programs on a given computer that open, read or write, and close
4752 +   tty devices must use the SAME lockfile conventions. Unfortunately, this
4753 +   is often not the case. Here is a typical example of how this can go
4754 +   wrong: In SunOS 4.0 and earler, the lockfile directory was
4755 +   /usr/spool/uucp; in 4.1 it was changed to /var/spool/locks in the quest
4756 +   for political correctness. Consequently, any third-party programs (such
4757 +   as C-Kermit) that were not modified to account for this change,
4758 +   recompiled, and reinstalled, did not use the same lockfiles as uucp,
4759 +   tip, etc, and so the entire purpose of the lockfile is defeated.
4760 +
4761 +   What if your Unix system does not have UUCP installed? For example, you
4762 +   have a Unix workstation, and you do not use uucp, cu, or tip, or UUCP
4763 +   was not even supplied with your version of Unix (QNX is an example). In
4764 +   this case, you have two choices:
4765 +
4766 +    a. If there may be more than one person running Kermit at the same
4767 +       time, competing for the same tty device, then create a special
4768 +       lockfile directory just for Kermit, for example, /usr/spool/kermit,
4769 +       and make sure you have read/write access to it. Then add the
4770 +       following to your makefile target CFLAGS, as shown earlier:
4771 +
4772 +-DLOCK_DIR=\\\"/usr/spool/kermit\\\"
4773 +
4774 +    b. If you are the only user on your workstation, and no other
4775 +       processes will ever be competing with Kermit for the dialout tty
4776 +       device, then add -DNOUUCP to your makefile target's CFLAGS and
4777 +       rebuild Kermit.
4778 +
4779 +11. RUNNING UNIX C-KERMIT SETUID OR SETGID
4780 +
4781 +   [ [332]Top ] [ [333]Contents ] [ [334]Next ] [ [335]Previous ]
4782 +
4783 +   Even if you don't intend to run C-Kermit setuid, somebody else might
4784 +   come along and chown and chmod it after it has been built. You should
4785 +   be sure that it is built correctly to run setuid on your system. For
4786 +   POSIX and AT&T Unix based versions, you don't have to do anything
4787 +   special.
4788 +
4789 +   For 4.2 and 4.3 BSD-based Unix versions, you normally need not add
4790 +   anything special to the makefile. The program assumes that the
4791 +   setreuid() and setregid() functions are available, without which we
4792 +   cannot switch back and forth between real and effective uids. If "make"
4793 +   complains that _setreuid or _setregid is/are not defined, add
4794 +   -DNOSETREU to CFLAGS. In this case it is very likely (but not certain)
4795 +   that you cannot protect ttys and lockfiles against people and have them
4796 +   run Kermit setuid.
4797 +
4798 +   If make does not complain about this, you should find out whether your
4799 +   BSD version (4.3 or other systems like SunOS 4.x that claim to include
4800 +   BSD 4.3 compatibility) includes the saved-setuid feature (see long
4801 +   notes under edit 146 in ckc178.upd). If it does, then add -DSAVEDUID to
4802 +   CFLAGS.
4803 +
4804 +     IMPORTANT NOTE: Most Unix system documentation will not give you the
4805 +     required information. To determine whether your Unix system supplies
4806 +     the the saved-original-effective-user/group-id feature, use the
4807 +     ckuuid.c program. Read and follow the instructions in the comments
4808 +     at the beginning.
4809 +
4810 +   C-Kermit for 4.4BSD-based systems automatically use sete[ug]id(). See
4811 +   [336]ckutio.c.
4812 +
4813 +   If you have a version of Unix that is not BSD-based, but which supplies
4814 +   the setreuid() and setregid() functions, and these are the only way to
4815 +   switch between real and effective uid, add -DSETREUID to your makefile
4816 +   target.
4817 +
4818 +     WARNING: There are two calls to access() in [337]ckufio.c, by which
4819 +     Kermit checks to see if it can create an output file. These calls
4820 +     will not work correctly when (a)you have installed C-Kermit setuid
4821 +     or setgid on a BSD-based Unix system, and (b) the
4822 +     saved-original-effective-uid/gid feature is not present, and (c) the
4823 +     access() function always checks what it believes to be the real ID
4824 +     rather than the effective ID. This is the case, for example, in
4825 +     Olivetti X/OS and in NeXTSTEP. In such cases, you can force correct
4826 +     operation of access() calls by defining the symbol SW_ACC_ID at
4827 +     compile time in CFLAGS.
4828 +
4829 +   If you have a version of Unix that does not allow a process to switch
4830 +   back and forth between its effective and real user and group ids
4831 +   multiple times, you probably should not attempt to run Kermit setuid,
4832 +   because once having given up its effective uid or gid (which it must do
4833 +   in order to transfer files, fork a shell, etc) it can never get it
4834 +   back, and so it can not use the original effective uid or gid to create
4835 +   or delete uucp lockfiles. In this case, you'll either have to set the
4836 +   permissions on your lockfile directory to make them publicly
4837 +   read/writable, or dispense with locking altogether.
4838 +
4839 +   MORAL: Are you thoroughly sickened and/or frightened by all that you
4840 +   have just read? You should be. What is the real answer? Simple. Serial
4841 +   devices -- such as ttys and magnetic tapes -- in Unix should be opened
4842 +   with exclusive access only, enforced by the Unix kernel. Shared access
4843 +   has no conceivable purpose, legitimate or otherwise, except by
4844 +   privileged system programs such as getty. The original design dates
4845 +   from the late 1960s, when Unix was developed for laboratory use under a
4846 +   philosophy of trust by people within shouting distance of each other --
4847 +   but even then, no useful purpose was served by this particular form of
4848 +   openness; it was probably more of a political statement. Since the
4849 +   emergence of Unix from the laboratory into the commercial market, we
4850 +   have seen every vestige of openness -- but this one -- stripped away.
4851 +   I'd like to see some influential Unix maker take the bold step of
4852 +   making the simple kernel change required to enforce exclusive access to
4853 +   serial devices. (Well, perhaps not so simple when bidirectionality must
4854 +   also be a goal -- but then other OS's like VMS solved this problem
4855 +   decades ago.)
4856 +
4857 +12. CONFIGURING UNIX WORKSTATIONS
4858 +
4859 +   [ [338]Top ] [ [339]Contents ] [ [340]Next ] [ [341]Previous ]
4860 +
4861 +   On desktop workstations that are used by only the user at the console
4862 +   keyboard, C-Kermit is always used in local mode. But as delivered,
4863 +   C-Kermit runs in remote mode by default. To put it in local mode at
4864 +   startup, you can put a SET LINE command in your .mykermrc.
4865 +
4866 +   You can also build C-Kermit to start up in local mode by default. To do
4867 +   this, include the following in the CFLAGS in your makefile target:
4868 +
4869 +-DDFTTY=\\\"/dev/ttyxx\\\"
4870 +
4871 +   where ttyxx is the name of the device you will be using for
4872 +   communications. Presently there is no way of setting the default modem
4873 +   type at compile time, so use this option only for direct lines.
4874 +
4875 +   C-Kermit does not work well on certain workstations if it is not run
4876 +   from within a terminal window. For example, you cannot start C-Kermit
4877 +   on a NeXT by launching it directly from NeXTstep. Similarly for Sun
4878 +   workstations in the Open Windows environment. Run Kermit in a terminal
4879 +   window.
4880 +
4881 +13. BIZARRE BEHAVIOR AT RUNTIME
4882 +
4883 +   [ [342]Top ] [ [343]Contents ] [ [344]Next ] [ [345]Previous ]
4884 +
4885 +   See the "beware file",
4886 +
4887 +   [346]ckubwr.txt, for hints about runtime misbehavior. This section
4888 +   lists some runtime problems that can be cured by rebuilding C-Kermit.
4889 +
4890 +   The program starts, but there is no prompt, and certain operations
4891 +   don't work (you see error messages like "Kermit command error in
4892 +   background execution"). This is because Kermit thinks it is running in
4893 +   the background. See conbgt() in [347]ckutio.c. Try rebuilding Kermit
4894 +   with:
4895 +
4896 + -DPID_T=pid_t
4897 +
4898 +   added to your CFLAGS. If that doesn't help, find out the actual data
4899 +   type for pids (look in types.h or similar file) and use it in place of
4900 +   "pid_t", for example:
4901 +
4902 + -DPID_T=short
4903 +
4904 +   Unexplainable and inappropriate error messages ("Sockets not supported
4905 +   on this device", etc) have been traced in at least one case to a lack
4906 +   of agreement between the system header files and the actual kernel.
4907 +   This happened because the GNU C compiler (gcc) was being used. gcc
4908 +   wants to have ANSI-C-compliant header files, and so part of the
4909 +   installation procedure for gcc is (or was) to run a shell script called
4910 +   "fixincludes", which translates the system's header files into a
4911 +   separate set of headers that gcc likes. So far so good. Later, a new
4912 +   version of the operating system is installed and nobody remembers to
4913 +   run fixincludes again. From that point, any program compiled with gcc
4914 +   that makes use of header files (particularly ioctl.h) is very likely to
4915 +   misbehave. Solution: run fixincludes again, or use your system's
4916 +   regular C compiler, libraries, and header files instead of gcc.
4917 +
4918 +14. CRASHES AND CORE DUMPS
4919 +
4920 +   [ [348]Top ] [ [349]Contents ] [ [350]Next ] [ [351]Previous ]
4921 +
4922 +   If C-Kermit constitently dumps core at the beginning of a file
4923 +   transfer, look in SHOW FEATURES for CKREALPATH. If found, rebuild with
4924 +   -DNOREALPATH and see if that fixes the problem (some UNIXes have
4925 +   realpath() but it doesn't work).
4926 +
4927 +   Total failure of the Kermit program can occur because of bad memory
4928 +   references, bad system calls, or problems with dynamic memory
4929 +   allocation. First, try to reproduce the problem with debugging turned
4930 +   on: run Kermit with the -d command-line option (for example, "wermit
4931 +   -d") and then examine the resulting debug.log file. The last entry
4932 +   should be in the vicinity of the crash. In VMS, a crash automatically
4933 +   produces a "stack dump" which shows the routine where the crash occurs.
4934 +   In some versions of Unix, you can get a stack dump with "adb" -- just
4935 +   type "adb wermit core" and then give the command "$c", then Ctrl-D to
4936 +   quit (note: replace "wermit" by "kermit" or by the full pathname of the
4937 +   executable that crashed if it is not in the current directory). Or use
4938 +   gdb to get a backtrace, etc.
4939 +
4940 +   In edit 186, one implementation, UNISYS 5000/95 built with "make
4941 +   sys5r3", has been reported to run out of memory very quickly (e.g.
4942 +   while executing a short initialization file that contains a SET DIAL
4943 +   DIRECTORY command). Debug logs show that malloc calls are failing,
4944 +   reason unknown. For this and any other implementation that gives error
4945 +   messages about "malloc failure" or "memory allocation failure", rebuild
4946 +   the program *without* the -DDYNAMIC CFLAGS definition, for example:
4947 +
4948 +make sys5r3 KFLAGS=-UDYNAMIC
4949 +
4950 +   As of edit 169, C-Kermit includes a malloc() debugging package which
4951 +   you may link with the Kermit program to catch runtime malloc errors.
4952 +   See the makefile entries for sunos41md and nextmd for examples of how
4953 +   to select malloc debugging. Once you have linked Kermit with the malloc
4954 +   debugger, it will halt with an informative message if a malloc-related
4955 +   error occurs and, if possible, dump core. For this reason,
4956 +   malloc-debugging versions of Kermit should be built without the "-s"
4957 +   link option (which removes symbols, preventing analysis of the core
4958 +   dump). You have several ways to track down the malloc error: Analyze
4959 +   the core dump with adb. Or reproduce the problem with "log debug" and
4960 +   then look at the code around the last debug.log entry. If you have gcc,
4961 +   build the program with "-g" added to CFLAGS and then debug it with gdb,
4962 +   e.g.
4963 +
4964 +gdb wermit
4965 +break main
4966 +run
4967 +.. set other breakpoints or watchpoints
4968 +continue
4969 +
4970 +   Watchpoints are especially useful for finding memory leaks, but they
4971 +   make the program run about a thousand times slower than usual, so don't
4972 +   set them until the last possible moment. When a watchpoint is hit, you
4973 +   can use the "where" command to find out which C-Kermit source statement
4974 +   triggered it.
4975 +
4976 +   If you have the Pure Software Inc "Purify" product, see the sunos41cp
4977 +   makefile entry for an example of how to use it to debug C-Kermit.
4978 +
4979 +15. SYSLOGGING
4980 +
4981 +   [ [352]Top ] [ [353]Contents ] [ [354]Next ] [ [355]Previous ]
4982 +
4983 +   "Syslogging" means recording selected information in the system log via
4984 +   the Unix syslog() facility, which is available in most Unix versions.
4985 +   Syslogging is not done unless C-Kermit is started with:
4986 +
4987 +--syslog:n
4988 +
4989 +   on the command-line, where n is a number greater than 0 to indicate the
4990 +   level of syslogging. See [356]Section 4.2 of the [357]IKSD
4991 +   Administrator's Guide for details.
4992 +
4993 +   Obviously you can't depend on users to include --syslog:3 (or whatever)
4994 +   on the command line every time they start C-Kermit, so if you want
4995 +   certain kinds of records to be recorded in the system log, you can
4996 +   build C-Kermit with forced syslogging at the desired level; for
4997 +   example, to record logins and dialouts:
4998 +
4999 +make linux KFLAGS=-DSYSLOGLEVEL=2
5000 +
5001 +   Levels 2 and 3 are the most likely candidates for this treatment. Level
5002 +   2 forces logging of all successful dialout calls (e.g. for checking
5003 +   against or phone bills), and level 3 records all connections (SET LINE
5004 +   or SET HOST / TELNET / RLOGIN, etc) so you can see who is connecting
5005 +   out from your system, and to where, e.g. for security auditing.
5006 +
5007 +   Level 2 and 3 records are equivalent to those in the connection log;
5008 +   see the [358]C-Kermit 7.0 Supplement) for a detailed description of the
5009 +   connection log.
5010 +
5011 +16. BUILDING SECURE VERSIONS OF C-KERMIT 8.0
5012 +
5013 +   [ [359]Top ] [ [360]Contents ] [ [361]Next ] [ [362]Previous ]
5014 +
5015 +   C-Kermit 7.0 and later may be built with Kerberos(TM) and/or SRP(TM)
5016 +   (Secure Remote Password) and/or SSL/TLS security for strong
5017 +   authentication and encryption of Internet connections. These security
5018 +   methods require external libraries that, in their binary forms, are
5019 +   restricted from export by USA law. See the [363]Kermit Security
5020 +   Reference) for details. C-Kermit binaries themselves are likewise
5021 +   restricted; the C-Kermit binaries that are available for public
5022 +   download on the Internet are not allowed to contain the security
5023 +   options.
5024 +
5025 +   Sample makefile entries are provided for Linux and many other operating
5026 +   systems. A list of secure makefile entries is included in the Makefile.
5027 +   Complete instructions on building C-Kermit 8.0 with MIT Kerberos;
5028 +   Secure Remote Password; and/or OpenSSL can be found in the [364]Kermit
5029 +   Security Reference.
5030 +
5031 +   SSL/TLS and Kerberos builds are increasingly problematic with the
5032 +   "deprecation" of DES. There is code to detect the presence or absence
5033 +   of DES in the OpenSSL builds, but it doesn't always work because
5034 +   sometimes the SSL libraries are present but routines are missing from
5035 +   them.
5036 +
5037 +     * First of all remember that if your SSL and/or Kerberos header files
5038 +       and libraries are not in the default place, you'll need to override
5039 +       the assumed paths. To find out what the default places are type
5040 +       "make show", e.g.:
5041 +
5042 +[~/kermit] make show
5043 +prefix=/usr/local
5044 +srproot=/usr/local
5045 +sslroot=/usr/local
5046 +manroot=/usr/local
5047 +K4LIB=-L/usr/kerberos/lib
5048 +K4INC=-I/usr/kerberos/include
5049 +K5LIB=-L/usr/kerberos/lib
5050 +K5INC=-I/usr/kerberos/include
5051 +SRPLIB=-L/usr/local/lib
5052 +SRPINC=-I/usr/local/include
5053 +SSLLIB=-L/usr/local/ssl/lib
5054 +SSLINC=-I/usr/local/ssl/include
5055 +[~/kermit]
5056 +
5057 +     * You can override any or all of these by putting assignments on the
5058 +       'make' command line; examples:
5059 +
5060 +make linux+krb5 \
5061 + "K5INC=-I/usr/include/" \
5062 + "K5LIB=-L/usr/lib64/"
5063 +
5064 +make solaris9g+ssl \
5065 +  "SSLLIB=-L/opt/openssl-0.9.8q/lib" \
5066 +  "SSLINC=-I/opt/openssl-0.9.8q/include"
5067 +
5068 +       Or by setting and exporting environment variables prior to giving
5069 +       the 'make' command, as in this example in which (after Beta.01 was
5070 +       uploaded) C-Kermit was successfully linked with OpenSSL 1.0.0d,
5071 +       which was installed alongside OpenSSL 0.9.8r on the same computer.
5072 +       Note the use of the '-i' option instead of '-I' to force gcc to
5073 +       include the right header files (thanks to Nelson Beebe for this):
5074 +
5075 +export PATH=/usr/bin:$PATH
5076 +export SSLINC=-isystem/usr/include
5077 +export "SSLLIB=-L/usr/lib -Wl,-rpath,/usr/lib"
5078 +make linux+ssl
5079 +
5080 +       -i is explained in 'man gcc'; there is a change in what -I does
5081 +       that could have ramifications for many makefile targets, not just
5082 +       Kermit. And -Wl and -rpath are explained in 'man ld'; the idea is
5083 +       build a binary from which useful reports can be obtained with ldd.
5084 +     * Building with OpenSSL versions prior to 0.9.7 doesn't work, even
5085 +       though C-Kermit is designed to work with both the old and new
5086 +       versions. This could probably be fixed if anybody cares.
5087 +     * If a Kerberos or SSL build fails at link time because
5088 +       des_ecb3_encrypt, des_random_seed, and/or des_set_odd_parity come
5089 +       up missing, redo the build with -UCK_DES:
5090 +
5091 +make netbsd+krb5+ssl \
5092 + "K5INC=-I/usr/local/include" \
5093 + "K5LIB=-L/usr/local/kerblib" KFLAGS=-UCK_DES
5094 +
5095 +       I suppose all the SSL and Kerberos targets could be recoded to
5096 +       figure this out automatically (i.e. that DES is installed but with
5097 +       some entry points missing), but it wouldn't be pretty.
5098 +     * Different Kerberos and OpenSSL distributions can be installed with
5099 +       different options; certain libraries might be missing or named
5100 +       differently (for example, libgssapi vs libgssapi_krb5). Some, but
5101 +       not all, of the C-Kermit makefile targets have been fixed to take
5102 +       some of these variations into account by testing for them, most
5103 +       notably the linux ones, linux+ssl, linux+krb5, and linux+krb5+ssl.
5104 +       Probably every target that builds with OpenSSL or Kerberos needs
5105 +       the same treatment but I won't have time.
5106 +     * Why doesn't C-Kermit just use Autoconf? Mainly because the makefile
5107 +       is full of targets for platforms that don't have Autoconf or any
5108 +       other tool like it. (Another reason is that I've always preferred
5109 +       that Kermit have the least dependencies possible on external
5110 +       toolsets.) Perhaps certain targets could be converted to use them,
5111 +       especially Linux because there are so many variations among
5112 +       distributions and versions. Anybody who wants to make, say, an
5113 +       Autonf-based Linux target, be my guest, but bear in mind that one
5114 +       Linux target is supposed to work for all versions and distributions
5115 +       of Linux on all platforms. Well, one target for Linux by itself,
5116 +       another for Linux with OpenSSL, another for Linux with Kerberos 5,
5117 +       and another for Linux with Kerberos 5 and OpenSSL. Each of these is
5118 +       supposed to work on any Linux version with any version of
5119 +       Kerberos 5 or OpenSSL.
5120 +
5121 +   Also note that Kerberos support is for the MIT version only, Heimdal
5122 +   and others are not supported (never have been). Of course anybody can
5123 +   pitch in and add or improve support for whatever they want.
5124 +
5125 +17. INSTALLING C-KERMIT AS AN SSH SERVER SUBSYSTEM
5126 +
5127 +   [ [365]Top ] [ [366]Contents ] [ [367]Previous ]
5128 +
5129 +   This requires C-Kermit 8.0.206 or later and an SSH v2 server. If you
5130 +   list C-Kermit as a Subsystem in the SSH v2 server configuration file
5131 +   (as, for example, SFTP is listed), users can make SSH connections
5132 +   direct to a Kermit server as explained here:
5133 +
5134 +[368]http://www.columbia.edu/kermit/skermit.html
5135 +
5136 +   The name and location of the SSH server configuration file depends on
5137 +   your platform, which SSH product(s) you have, etc. C-Kermit itself must
5138 +   be referred to in this file as "kermit-sshsub". On the host, install
5139 +   the C-Kermit 8.0.211 binary in the normal way. Then, in the same
5140 +   directory as the C-Kermit binary, make a symbolic link:
5141 +
5142 +ln -s kermit kermit-sshsub
5143 +
5144 +   (Note: the "make install" makefile target does this for you.) Then in
5145 +   the sshd configuration file, add a line:
5146 +
5147 +Subsystem  kermit   /some/path/kermit-sshsub
5148 +
5149 +   (where /some/path is the fully specified directory where the symlink
5150 +   is.) This is similar to the line that sets up the SFTP susbsystem.
5151 +   Example:
5152 +
5153 +Subsystem   sftp    /usr/local/libexec/sftp-server
5154 +Subsystem   kermit  /usr/local/bin/kermit-sshsub
5155 +
5156 +   The mechanics might vary for other SSH servers; "man sshd" for details.
5157 +   The method shown here is used because the OpenSSH server does not
5158 +   permit the subsystem invocation to include command-line options.
5159 +   C-Kermit would have no way of knowing that it should enter Server mode
5160 +   if it were not called by a special name.
5161 +
5162 +   [ [369]Top ] [ [370]Contents ] [ [371]C-Kermit Home ] [ [372]C-Kermit
5163 +   9.0 Overview ] [ [373]Kermit Home ]
5164 +     __________________________________________________________________
5165 +
5166 +
5167 +    C-Kermit 9.0 Unix Installation Instructions / The Kermit Project /
5168 +    Columbia University / 30 June 2011
5169 +
5170 +References
5171 +
5172 +   1. http://www.columbia.edu/
5173 +   2. mailto:kermit@columbia.edu
5174 +   3. http://www.columbia.edu/kermit/index.html
5175 +   4. http://www.columbia.edu/kermit/k95.html
5176 +   5. http://www.columbia.edu/kermit/ckermit.html
5177 +   6. http://www.columbia.edu/kermit/ckscripts.html
5178 +   7. http://www.columbia.edu/kermit/current.html
5179 +   8. http://www.columbia.edu/kermit/whatsnew.html
5180 +   9. http://www.columbia.edu/kermit/faq.html
5181 +  10. http://www.columbia.edu/kermit/support.html
5182 +  11. http://www.columbia.edu/kermit/ckuins.html#contents
5183 +  12. http://www.columbia.edu/kermit/ckermit.html
5184 +  13. http://www.columbia.edu/kermit/index.html
5185 +  14. http://www.columbia.edu/kermit/ckuins.html
5186 +  15. http://www.columbia.edu/kermit/ckuins.html#x0
5187 +  16. http://www.columbia.edu/kermit/ckuins.html#x1
5188 +  17. http://www.columbia.edu/kermit/ckuins.html#x2
5189 +  18. http://www.columbia.edu/kermit/ckuins.html#x3
5190 +  19. http://www.columbia.edu/kermit/ckuins.html#x4
5191 +  20. http://www.columbia.edu/kermit/ckuins.html#x5
5192 +  21. http://www.columbia.edu/kermit/ckuins.html#x6
5193 +  22. http://www.columbia.edu/kermit/ckuins.html#x7
5194 +  23. http://www.columbia.edu/kermit/ckuins.html#x8
5195 +  24. http://www.columbia.edu/kermit/ckuins.html#x9
5196 +  25. http://www.columbia.edu/kermit/ckuins.html#x10
5197 +  26. http://www.columbia.edu/kermit/ckuins.html#x11
5198 +  27. http://www.columbia.edu/kermit/ckuins.html#x12
5199 +  28. http://www.columbia.edu/kermit/ckuins.html#x13
5200 +  29. http://www.columbia.edu/kermit/ckuins.html#x14
5201 +  30. http://www.columbia.edu/kermit/ckuins.html#x15
5202 +  31. http://www.columbia.edu/kermit/ckuins.html#x16
5203 +  32. http://www.columbia.edu/kermit/ckuins.html#x17
5204 +  33. http://www.columbia.edu/kermit/ckuins.html#top
5205 +  34. http://www.columbia.edu/kermit/ckuins.html#contents
5206 +  35. http://www.columbia.edu/kermit/ckuins.html#x1
5207 +  36. http://www.columbia.edu/kermit/ckccfg.html
5208 +  37. http://www.columbia.edu/kermit/ckcbwr.html
5209 +  38. http://www.columbia.edu/kermit/ckubwr.html
5210 +  39. http://www.columbia.edu/kermit/ckcplm.html
5211 +  40. http://www.columbia.edu/kermit/ckuins.html#x2
5212 +  41. http://www.columbia.edu/kermit/ckuins.html#x3
5213 +  42. http://www.columbia.edu/kermit/ckuins.html#x4
5214 +  43. http://www.columbia.edu/kermit/ckuins.html#top
5215 +  44. http://www.columbia.edu/kermit/ckuins.html#contents
5216 +  45. http://www.columbia.edu/kermit/ckuins.html#x2
5217 +  46. http://www.columbia.edu/kermit/ckuins.html#x0
5218 +  47. ftp://www.columbia.edu/kermit/archives/cku211.tar.Z
5219 +  48. ftp://www.columbia.edu/kermit/archives/cku211.tar.gz
5220 +  49. http://kermit.columbia.edu/ftp/archives/cku211.tar.Z
5221 +  50. http://kermit.columbia.edu/ftp/archives/cku211.tar.gz
5222 +  51. ftp://www.columbia.edu/kermit/archives/cku211.tar
5223 +  52. http://kermit.columbia.edu/ftp/archives/cku211.tar
5224 +  53. http://www.columbia.edu/kermit/ckuins.html#x7
5225 +  54. http://www.columbia.edu/kermit/ckuins.html#x5
5226 +  55. http://www.columbia.edu/kermit/ckuins.html#x5
5227 +  56. http://www.columbia.edu/kermit/ckuins.html#x16
5228 +  57. http://www.columbia.edu/kermit/ckuins.html#top
5229 +  58. http://www.columbia.edu/kermit/ckuins.html#contents
5230 +  59. http://www.columbia.edu/kermit/ckuins.html#x3
5231 +  60. http://www.columbia.edu/kermit/ckuins.html#x1
5232 +  61. http://www.columbia.edu/kermit/ckuins.html#x5
5233 +  62. http://www.columbia.edu/kermit/ckuins.html#X10
5234 +  63. http://www.columbia.edu/kermit/ckuins.html#x11
5235 +  64. http://www.columbia.edu/kermit/ckuins.html#x10
5236 +  65. http://www.columbia.edu/kermit/ckuins.html#x3
5237 +  66. http://www.columbia.edu/kermit/ck80packages.html
5238 +  67. http://www.columbia.edu/kermit/ckuins.html#x10
5239 +  68. http://www.columbia.edu/kermit/ckuins.html#top
5240 +  69. http://www.columbia.edu/kermit/ckuins.html#contents
5241 +  70. http://www.columbia.edu/kermit/ckuins.html#x4
5242 +  71. http://www.columbia.edu/kermit/ckuins.html#x2
5243 +  72. ftp://www.columbia.edu/kermit/bin/
5244 +  73. http://www.columbia.edu/kermit/ck80binaries.html
5245 +  74. http://www.columbia.edu/kermit/ckuins.html#x7
5246 +  75. http://www.columbia.edu/kermit/ckuins.html#build
5247 +  76. http://www.columbia.edu/kermit/ckuins.html#x5
5248 +  77. http://www.columbia.edu/kermit/ckuins.html#x4
5249 +  78. http://www.columbia.edu/kermit/ckfaq.html#version
5250 +  79. http://www.columbia.edu/kermit/ckuins.html#x4
5251 +  80. mailto:kermit@columbia.edu
5252 +  81. http://www.columbia.edu/kermit/ckuins.html#top
5253 +  82. http://www.columbia.edu/kermit/ckuins.html#contents
5254 +  83. http://www.columbia.edu/kermit/ckuins.html#x5
5255 +  84. http://www.columbia.edu/kermit/ckuins.html#x3
5256 +  85. http://www.columbia.edu/kermit/ckuins.html#x8
5257 +  86. http://www.columbia.edu/kermit/ckuins.html#x9
5258 +  87. ftp://kermit.columbia.edu/kermit/c-kermit/makefile
5259 +  88. ftp://kermit.columbia.edu/kermit/c-kermit/ckpker.mk
5260 +  89. ftp://kermit.columbia.edu/kermit/c-kermit/ckubsd.mak
5261 +  90. http://www.columbia.edu/kermit/ckuins.html#x5
5262 +  91. mailto:kermit-support@columbia.edu
5263 +  92. ftp://kermit.columbia.edu/kermit/c-kermit/makefile
5264 +  93. http://www.columbia.edu/kermit/ckuins.html#x7
5265 +  94. mailto:kermit-support@columbia.edu
5266 +  95. ftp://kermit.columbia.edu/kermit/c-kermit/makefile
5267 +  96. http://www.columbia.edu/kermit/ckuins.html#x5.4
5268 +  97. http://www.columbia.edu/kermit/ckuins.html#x10
5269 +  98. http://www.columbia.edu/kermit/ckuins.html#x11
5270 +  99. http://www.columbia.edu/kermit/ckuins.html#x5
5271 + 100. http://www.columbia.edu/kermit/iksd.html
5272 + 101. http://www.columbia.edu/kermit/ckuins.html#top
5273 + 102. http://www.columbia.edu/kermit/ckuins.html#contents
5274 + 103. http://www.columbia.edu/kermit/ckuins.html#x4.1
5275 + 104. http://www.columbia.edu/kermit/ckccfg.html
5276 + 105. http://www.columbia.edu/kermit/ckuins.html#x4.1
5277 + 106. http://www.columbia.edu/kermit/ckuins.html#x4.2
5278 + 107. http://www.columbia.edu/kermit/ckuins.html#x4.3
5279 + 108. http://www.columbia.edu/kermit/ckuins.html#x4.4
5280 + 109. http://www.columbia.edu/kermit/ckuins.html#x4.5
5281 + 110. http://www.columbia.edu/kermit/ckccfg.html
5282 + 111. http://www.columbia.edu/kermit/ckccfg.html#x8
5283 + 112. http://www.columbia.edu/kermit/iksd.html
5284 + 113. http://www.columbia.edu/kermit/iksd.html
5285 + 114. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5286 + 115. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5287 + 116. mailto:kermit-support@columbia.edu
5288 + 117. ftp://kermit.columbia.edu/kermit/c-kermit/ckcmai.c
5289 + 118. http://www.columbia.edu/kermit/ckuins.html#x15
5290 + 119. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5291 + 120. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5292 + 121. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5293 + 122. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5294 + 123. ftp://kermit.columbia.edu/kermit/c-kermit/ckcnet.c
5295 + 124. ftp://kermit.columbia.edu/kermit/c-kermit/ckcnet.c
5296 + 125. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5297 + 126. ftp://kermit.columbia.edu/kermit/c-kermit/ckcuni.c
5298 + 127. mailto:kermit-support@columbia.edu
5299 + 128. http://www.columbia.edu/kermit/ckuins.html#top
5300 + 129. http://www.columbia.edu/kermit/ckuins.html#contents
5301 + 130. http://www.columbia.edu/kermit/ckuins.html#x4
5302 + 131. http://www.columbia.edu/kermit/ckuins.html#x4.2
5303 + 132. http://www.columbia.edu/kermit/ckuins.html#x4.0
5304 + 133. ftp://kermit.columbia.edu/kermit/c-kermit/makefile
5305 + 134. ftp://kermit.columbia.edu/kermit/c-kermit/ckubwr.txt
5306 + 135. http://www.columbia.edu/kermit/ckubwr.html
5307 + 136. ftp://kermit.columbia.edu/kermit/c-kermit/ckwart.c
5308 + 137. ftp://kermit.columbia.edu/kermit/c-kermit/ckcpro.w
5309 + 138. ftp://kermit.columbia.edu/kermit/c-kermit/ckcpro.c
5310 + 139. http://www.columbia.edu/kermit/ckuins.html#top
5311 + 140. http://www.columbia.edu/kermit/ckuins.html#contents
5312 + 141. http://www.columbia.edu/kermit/ckuins.html#x4
5313 + 142. http://www.columbia.edu/kermit/ckuins.html#x4.3
5314 + 143. http://www.columbia.edu/kermit/ckuins.html#x4.1
5315 + 144. http://www.columbia.edu/kermit/ckuins.html#x5
5316 + 145. http://www.columbia.edu/kermit/ckuins.html#top
5317 + 146. http://www.columbia.edu/kermit/ckuins.html#contents
5318 + 147. http://www.columbia.edu/kermit/ckuins.html#x4
5319 + 148. http://www.columbia.edu/kermit/ckuins.html#x4.4
5320 + 149. http://www.columbia.edu/kermit/ckuins.html#x4.2
5321 + 150. http://www.columbia.edu/kermit/ckuins.html#top
5322 + 151. http://www.columbia.edu/kermit/ckuins.html#contents
5323 + 152. http://www.columbia.edu/kermit/ckuins.html#x4
5324 + 153. http://www.columbia.edu/kermit/ckuins.html#x4.5
5325 + 154. http://www.columbia.edu/kermit/ckuins.html#x4.3
5326 + 155. ftp://kermit.columbia.edu/kermit/c-kermit/ckpker.mk
5327 + 156. http://www.columbia.edu/kermit/ckuins.html#top
5328 + 157. http://www.columbia.edu/kermit/ckuins.html#contents
5329 + 158. http://www.columbia.edu/kermit/ckuins.html#x4
5330 + 159. http://www.columbia.edu/kermit/ckuins.html#x4.4
5331 + 160. ftp://kermit.columbia.edu/kermit/c-kermit/makefile
5332 + 161. ftp://kermit.columbia.edu/kermit/c-kermit/makefile
5333 + 162. ftp://kermit.columbia.edu/kermit/c-kermit/ckcpro.w
5334 + 163. http://www.columbia.edu/kermit/ckuins.html#top
5335 + 164. http://www.columbia.edu/kermit/ckuins.html#contents
5336 + 165. http://www.columbia.edu/kermit/ckuins.html#x6
5337 + 166. http://www.columbia.edu/kermit/ckuins.html#x4
5338 + 167. http://www.columbia.edu/kermit/ckuins.html#x5.1
5339 + 168. http://www.columbia.edu/kermit/ckuins.html#x5.2
5340 + 169. http://www.columbia.edu/kermit/ckuins.html#x5.3
5341 + 170. http://www.columbia.edu/kermit/ckuins.html#x5.4
5342 + 171. http://www.columbia.edu/kermit/
5343 + 172. http://www.columbia.edu/kermit/ckuins.html#x5.4
5344 + 173. http://www.columbia.edu/kermit/ckuins.html#x5.3
5345 + 174. ftp://kermit.columbia.edu/kermit/c-kermit/COPYING.TXT
5346 + 175. ftp://kermit.columbia.edu/kermit/c-kermit/ckermit.ini
5347 + 176. http://www.columbia.edu/kermit/ckuins.html#x5.1
5348 + 177. ftp://kermit.columbia.edu/kermit/c-kermit/ckermod.ini
5349 + 178. ftp://kermit.columbia.edu/kermit/c-kermit/ckermit70.txt
5350 + 179. http://www.columbia.edu/kermit/ck60manual.html
5351 + 180. http://www.columbia.edu/kermit/ckermit70.html
5352 + 181. ftp://kermit.columbia.edu/kermit/c-kermit/ckermit80.txt
5353 + 182. http://www.columbia.edu/kermit/ck60manual.html
5354 + 183. http://www.columbia.edu/kermit/ckermit80.html
5355 + 184. ftp://kermit.columbia.edu/kermit/c-kermit/ckcbwr.txt
5356 + 185. http://www.columbia.edu/kermit/ckcbwr.html
5357 + 186. ftp://kermit.columbia.edu/kermit/c-kermit/ckubwr.txt
5358 + 187. http://www.columbia.edu/kermit/ckubwr.html
5359 + 188. ftp://kermit.columbia.edu/kermit/c-kermit/ckuins.txt
5360 + 189. http://www.columbia.edu/kermit/ckuins.html
5361 + 190. ftp://kermit.columbia.edu/kermit/c-kermit/ckccfg.txt
5362 + 191. http://www.columbia.edu/kermit/ckccfg.html
5363 + 192. ftp://kermit.columbia.edu/kermit/c-kermit/ckcplm.txt
5364 + 193. http://www.columbia.edu/kermit/ckcplm.html
5365 + 194. ftp://kermit.columbia.edu/kermit/c-kermit/ca_certs.pem
5366 + 195. http://www.columbia.edu/kermit/ckuins.html#x16"
5367 + 196. ftp://kermit.columbia.edu/kermit/c-kermit/makefile
5368 + 197. http://www.columbia.edu/kermit/ckuins.html#x?
5369 + 198. http://www.columbia.edu/kermit/ckuins.html#x11
5370 + 199. http://www.columbia.edu/kermit/ckuins.html#x5.2
5371 + 200. http://www.columbia.edu/kermit/ckermit.html#download
5372 + 201. http://www.columbia.edu/kermit/ck80binaries.html
5373 + 202. http://www.columbia.edu/kermit/ckermit.html#download
5374 + 203. http://www.columbia.edu/kermit/ckuins.html#top
5375 + 204. http://www.columbia.edu/kermit/ckuins.html#contents
5376 + 205. http://www.columbia.edu/kermit/ckuins.html#x7
5377 + 206. http://www.columbia.edu/kermit/ckuins.html#x5
5378 + 207. http://www.columbia.edu/kermit/ckuins.html#top
5379 + 208. http://www.columbia.edu/kermit/ckuins.html#contents
5380 + 209. http://www.columbia.edu/kermit/ckuins.html#x8
5381 + 210. http://www.columbia.edu/kermit/ckuins.html#x6
5382 + 211. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5383 + 212. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5384 + 213. http://www.columbia.edu/kermit/ckuins.html#x4.0
5385 + 214. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
5386 + 215. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5387 + 216. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5388 + 217. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5389 + 218. http://www.columbia.edu/kermit/ckuins.html#x10
5390 + 219. http://www.columbia.edu/kermit/ckccfg.html#x2
5391 + 220. http://www.columbia.edu/kermit/ckccfg.html
5392 + 221. http://www.columbia.edu/kermit/ckuins.html#x4
5393 + 222. http://www.columbia.edu/kermit/ckuins.html#x10
5394 + 223. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5395 + 224. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5396 + 225. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5397 + 226. http://www.columbia.edu/kermit/ckuins.html#x9.4
5398 + 227. mailto:kermit-support@columbia.edu
5399 + 228. http://www.columbia.edu/kermit/ckuins.html#top
5400 + 229. http://www.columbia.edu/kermit/ckuins.html#contents
5401 + 230. http://www.columbia.edu/kermit/ckuins.html#x9
5402 + 231. http://www.columbia.edu/kermit/ckuins.html#x7
5403 + 232. http://www.columbia.edu/kermit/ckccfg.html
5404 + 233. http://www.columbia.edu/kermit/ckccfg.html
5405 + 234. http://www.columbia.edu/kermit/ckuins.html#top
5406 + 235. http://www.columbia.edu/kermit/ckuins.html#contents
5407 + 236. http://www.columbia.edu/kermit/ckuins.html#x10
5408 + 237. http://www.columbia.edu/kermit/ckuins.html#x8
5409 + 238. http://www.columbia.edu/kermit/ckuins.html#x9.1
5410 + 239. http://www.columbia.edu/kermit/ckuins.html#x9.1.1
5411 + 240. http://www.columbia.edu/kermit/ckuins.html#x9.1.2
5412 + 241. http://www.columbia.edu/kermit/ckuins.html#x9.1.3
5413 + 242. http://www.columbia.edu/kermit/ckuins.html#x9.2
5414 + 243. http://www.columbia.edu/kermit/ckuins.html#x9.3
5415 + 244. http://www.columbia.edu/kermit/ckuins.html#x9.4
5416 + 245. http://www.columbia.edu/kermit/ckuins.html#x9.5
5417 + 246. http://www.columbia.edu/kermit/ckuins.html#x9.6
5418 + 247. http://www.columbia.edu/kermit/ckuins.html#x9.7
5419 + 248. http://www.columbia.edu/kermit/ckuins.html#x9.8
5420 + 249. http://www.columbia.edu/kermit/ckuins.html#x9.9
5421 + 250. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5422 + 251. http://www.columbia.edu/kermit/ckuins.html#top
5423 + 252. http://www.columbia.edu/kermit/ckuins.html#x9
5424 + 253. http://www.columbia.edu/kermit/ckuins.html#contents
5425 + 254. http://www.columbia.edu/kermit/ckuins.html#x9.2
5426 + 255. http://www.columbia.edu/kermit/ckuins.html#x9.1.1
5427 + 256. http://www.columbia.edu/kermit/ckuins.html#x9.1.2
5428 + 257. http://www.columbia.edu/kermit/ckuins.html#x9.1.3
5429 + 258. http://www.columbia.edu/kermit/ckuins.html#top
5430 + 259. http://www.columbia.edu/kermit/ckuins.html#contents
5431 + 260. http://www.columbia.edu/kermit/ckuins.html#x9
5432 + 261. http://www.columbia.edu/kermit/ckuins.html#x9.1
5433 + 262. http://www.columbia.edu/kermit/ckuins.html#x9.1.3
5434 + 263. http://www.columbia.edu/kermit/ckuins.html#x9.1.1
5435 + 264. http://www.columbia.edu/kermit/ckuins.html#top
5436 + 265. http://www.columbia.edu/kermit/ckuins.html#contents
5437 + 266. http://www.columbia.edu/kermit/ckuins.html#x9
5438 + 267. http://www.columbia.edu/kermit/ckuins.html#x9.1
5439 + 268. http://www.columbia.edu/kermit/ckuins.html#x9.2
5440 + 269. http://www.columbia.edu/kermit/ckuins.html#x9.1.2
5441 + 270. http://www.opengroup.org/onlinepubs/007904975/
5442 + 271. http://www.columbia.edu/kermit/ckuins.html#x9.1.1
5443 + 272. http://www.columbia.edu/kermit/ckuins.html#top
5444 + 273. http://www.columbia.edu/kermit/ckuins.html#contents
5445 + 274. http://www.columbia.edu/kermit/ckuins.html#x9
5446 + 275. http://www.columbia.edu/kermit/ckuins.html#x9.1
5447 + 276. http://www.columbia.edu/kermit/ckuins.html#x9.3
5448 + 277. http://www.columbia.edu/kermit/ckuins.html#x9.1
5449 + 278. http://www.columbia.edu/kermit/ckuins.html#top
5450 + 279. http://www.columbia.edu/kermit/ckuins.html#contents
5451 + 280. http://www.columbia.edu/kermit/ckuins.html#x9
5452 + 281. http://www.columbia.edu/kermit/ckuins.html#x9.4
5453 + 282. http://www.columbia.edu/kermit/ckuins.html#x9.2
5454 + 283. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5455 + 284. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5456 + 285. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5457 + 286. http://www.columbia.edu/kermit/ckuins.html#top
5458 + 287. http://www.columbia.edu/kermit/ckuins.html#contents
5459 + 288. http://www.columbia.edu/kermit/ckuins.html#x9
5460 + 289. http://www.columbia.edu/kermit/ckuins.html#x9.5
5461 + 290. http://www.columbia.edu/kermit/ckuins.html#x9.3
5462 + 291. http://www.columbia.edu/kermit/cable.html
5463 + 292. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5464 + 293. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
5465 + 294. http://www.columbia.edu/kermit/ckuins.html#top
5466 + 295. http://www.columbia.edu/kermit/ckuins.html#contents
5467 + 296. http://www.columbia.edu/kermit/ckuins.html#x9
5468 + 297. http://www.columbia.edu/kermit/ckuins.html#x9.6
5469 + 298. http://www.columbia.edu/kermit/ckuins.html#x9.4
5470 + 299. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
5471 + 300. ftp://kermit.columbia.edu/kermit/c-kermit/ckuus3.c
5472 + 301. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5473 + 302. http://www.columbia.edu/kermit/ckuins.html#top
5474 + 303. http://www.columbia.edu/kermit/ckuins.html#contents
5475 + 304. http://www.columbia.edu/kermit/ckuins.html#x9
5476 + 305. http://www.columbia.edu/kermit/ckuins.html#x9.7
5477 + 306. http://www.columbia.edu/kermit/ckuins.html#x9.5
5478 + 307. http://www.columbia.edu/kermit/ckuins.html#top
5479 + 308. http://www.columbia.edu/kermit/ckuins.html#contents
5480 + 309. http://www.columbia.edu/kermit/ckuins.html#x9
5481 + 310. http://www.columbia.edu/kermit/ckuins.html#x9.8
5482 + 311. http://www.columbia.edu/kermit/ckuins.html#x9.6
5483 + 312. http://www.columbia.edu/kermit/ckuins.html#top
5484 + 313. http://www.columbia.edu/kermit/ckuins.html#contents
5485 + 314. http://www.columbia.edu/kermit/ckuins.html#x9
5486 + 315. http://www.columbia.edu/kermit/ckuins.html#x9.9
5487 + 316. http://www.columbia.edu/kermit/ckuins.html#x9.7
5488 + 317. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5489 + 318. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5490 + 319. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
5491 + 320. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5492 + 321. http://www.columbia.edu/kermit/ckuins.html#top
5493 + 322. http://www.columbia.edu/kermit/ckuins.html#contents
5494 + 323. http://www.columbia.edu/kermit/ckuins.html#x9
5495 + 324. http://www.columbia.edu/kermit/ckuins.html#x10
5496 + 325. http://www.columbia.edu/kermit/ckuins.html#x9.8
5497 + 326. http://www.columbia.edu/kermit/ckuins.html#top
5498 + 327. http://www.columbia.edu/kermit/ckuins.html#contents
5499 + 328. http://www.columbia.edu/kermit/ckuins.html#x11
5500 + 329. http://www.columbia.edu/kermit/ckuins.html#x9
5501 + 330. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5502 + 331. http://www.columbia.edu/kermit/ckuins.html#x11
5503 + 332. http://www.columbia.edu/kermit/ckuins.html#top
5504 + 333. http://www.columbia.edu/kermit/ckuins.html#contents
5505 + 334. http://www.columbia.edu/kermit/ckuins.html#x12
5506 + 335. http://www.columbia.edu/kermit/ckuins.html#x10
5507 + 336. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5508 + 337. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
5509 + 338. http://www.columbia.edu/kermit/ckuins.html#top
5510 + 339. http://www.columbia.edu/kermit/ckuins.html#contents
5511 + 340. http://www.columbia.edu/kermit/ckuins.html#x13
5512 + 341. http://www.columbia.edu/kermit/ckuins.html#x11
5513 + 342. http://www.columbia.edu/kermit/ckuins.html#top
5514 + 343. http://www.columbia.edu/kermit/ckuins.html#contents
5515 + 344. http://www.columbia.edu/kermit/ckuins.html#x14
5516 + 345. http://www.columbia.edu/kermit/ckuins.html#x12
5517 + 346. ftp://kermit.columbia.edu/kermit/c-kermit/ckubwr.txt
5518 + 347. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
5519 + 348. http://www.columbia.edu/kermit/ckuins.html#top
5520 + 349. http://www.columbia.edu/kermit/ckuins.html#contents
5521 + 350. http://www.columbia.edu/kermit/ckuins.html#x15
5522 + 351. http://www.columbia.edu/kermit/ckuins.html#x13
5523 + 352. http://www.columbia.edu/kermit/ckuins.html#top
5524 + 353. http://www.columbia.edu/kermit/ckuins.html#contents
5525 + 354. http://www.columbia.edu/kermit/ckuins.html#x16
5526 + 355. http://www.columbia.edu/kermit/ckuins.html#x14
5527 + 356. http://www.columbia.edu/kermit/uiksd.html#x4.2
5528 + 357. http://www.columbia.edu/kermit/uiksd.html
5529 + 358. http://www.columbia.edu/kermit/ckermit2.html
5530 + 359. http://www.columbia.edu/kermit/ckuins.html#top
5531 + 360. http://www.columbia.edu/kermit/ckuins.html#contents
5532 + 361. http://www.columbia.edu/kermit/ckuins.html#x17
5533 + 362. http://www.columbia.edu/kermit/ckuins.html#x15
5534 + 363. http://www.columbia.edu/kermit/security.html
5535 + 364. http://www.columbia.edu/kermit/security80.html
5536 + 365. http://www.columbia.edu/kermit/ckuins.html#top
5537 + 366. http://www.columbia.edu/kermit/ckuins.html#contents
5538 + 367. http://www.columbia.edu/kermit/ckuins.html#x16
5539 + 368. http://www.columbia.edu/kermit/skermit.html
5540 + 369. http://www.columbia.edu/kermit/ckuins.html#top
5541 + 370. http://www.columbia.edu/kermit/ckuins.html#contents
5542 + 371. http://www.columbia.edu/kermit/ckermit.html
5543 + 372. http://www.columbia.edu/kermit/ck90updates.html
5544 + 373. http://www.columbia.edu/kermit/index.html
5545 --- /dev/null
5546 +++ ckermit-301/ckubwr.txt
5547 @@ -0,0 +1,5353 @@
5548 +
5549 +   [1]The Columbia Crown The Kermit Project | Columbia University
5550 +   612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
5551 +   ...since 1981
5552 +   [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
5553 +   [10]Support
5554 +
5555 +C-Kermit Unix Hints and Tips
5556 +
5557 +     Frank da Cruz
5558 +     [11]The Kermit Project, [12]Columbia University
5559 +
5560 +   As of: C-Kermit 9.0.300 30 June 2011
5561 +   This page last updated: Mon Jun 27 16:01:50 2011 (New York USA Time)
5562 +
5563 +     IF YOU ARE READING A PLAIN-TEXT version of this document, note it is
5564 +     a plain-text dump of a Web page. You can visit the original (and
5565 +     possibly more up-to-date) Web page here:
5566 +
5567 +  [13]http://www.columbia.edu/kermit/ckubwr.html
5568 +
5569 +     Since the material in this file has been accumulating since 1985,
5570 +     some (much) of it might be dated. [14]Feedback from experts on
5571 +     particular OS's and platforms is always welcome.
5572 +
5573 +   [ [15]C-Kermit ] [ [16]Installation Instructions ] [ [17]TUTORIAL ]
5574 +
5575 +CONTENTS
5576 +
5577 +    1. [18]INTRODUCTION
5578 +    2. [19]PREBUILT C-KERMIT BINARIES
5579 +    3. [20]PLATFORM-SPECIFIC NOTES
5580 +    4. [21]GENERAL UNIX-SPECIFIC LIMITATIONS AND BUGS
5581 +    5. [22]INITIALIZATION AND COMMAND FILES
5582 +    6. [23]COMMUNICATION SPEED SELECTION
5583 +    7. [24]COMMUNICATIONS AND DIALING
5584 +    8. [25]HARDWARE FLOW CONTROL
5585 +    9. [26]TERMINAL CONNECTION AND KEY MAPPING
5586 +   10. [27]FILE TRANSFER
5587 +   11. [28]EXTERNAL FILE TRANSFER PROTOCOLS
5588 +   12. [29]SECURITY
5589 +   13. [30]MISCELLANEOUS USER REPORTS
5590 +   14. [31]THIRD-PARTY DRIVERS
5591 +
5592 +   Quick Links:   [ [32]Linux ] [ [33]*BSD ] [[34]Mac OS X] [ [35]AIX ] [
5593 +   [36]HP-UX ] [ [37]Solaris ] [ [38]SCO ] [ [39]DEC/Compaq ]
5594 +
5595 +1. INTRODUCTION
5596 +
5597 +   [ [40]Top ] [ [41]Contents ] [ [42]Next ]
5598 +
5599 +   SECTION CONTENTS
5600 +
5601 +  1.1. [43]Documentation
5602 +  1.2. [44]Technical Support
5603 +  1.3. [45]The Year 2000
5604 +  1.4. [46]The Euro
5605 +
5606 +   THIS IS WHAT USED TO BE CALLED the "beware file" for the Unix version
5607 +   of C-Kermit, previously distributed as ckubwr.txt and, before that, as
5608 +   ckuker.bwr, after the fashion of old Digital Equipment Corporation
5609 +   (DEC) software releases that came with release notes (describing what
5610 +   had changed) and a "beware file" listing known bugs, limitations,
5611 +   "non-goals", and things to watch out for. The C-Kermit beware file has
5612 +   been accumulating since 1985, and it applies to many different hardware
5613 +   platforms and operating systems, and many versions of them, so it is
5614 +   quite large. Prior to C-Kermit 8.0, it was distributed only in
5615 +   plain-text format. Now it is available as a Web document with links,
5616 +   internal cross references, and so on, to make it easier to use.
5617 +
5618 +   This document applies to Unix C-Kermit in general, as well as to
5619 +   specific Unix variations like [47]Linux, [48]AIX, [49]HP-UX,
5620 +   [50]Solaris, and so on, and should be read in conjunction with the
5621 +   [51]platform-independent C-Kermit beware file, which contains similar
5622 +   information, but applying to all versions of C-Kermit (VMS, Windows,
5623 +   OS/2, AOS/VS, VOS, etc, as well as to Unix).
5624 +
5625 +   There is much in this document that is (only) of historical interest.
5626 +   The navigation links should help you skip directly to the sections that
5627 +   are relevant to you. Numerous offsite Web links are supposed to lead to
5628 +   further information but, as you know, Web links go stale frequently and
5629 +   without warning. If you can supply additional, corrected, updated, or
5630 +   better Web links, please feel free to [52]let me know.
5631 +
5632 +1.1. Documentation
5633 +
5634 +   [ [53]Top ] [ [54]Contents ] [ [55]Next ]
5635 +
5636 +   C-Kermit 6.0 is documented in the book [56]Using C-Kermit, Second
5637 +   Edition, by Frank da Cruz and Christine M. Gianone, Digital Press,
5638 +   Burlington, MA, USA, ISBN 1-55558-164-1 (1997), 622 pages. This remains
5639 +   the definitive C-Kermit documentation. Until the third edition is
5640 +   published (sorry, there is no firm timeframe for this), please also
5641 +   refer to:
5642 +
5643 +   [57]Supplement to Using C-Kermit, Second Edition, For C-Kermit 7.0
5644 +          Thorough documentation of features new to version 7.0.
5645 +
5646 +   [58]Supplement to Using C-Kermit, Second Edition, For C-Kermit 8.0
5647 +          Thorough documentation of features new to version 8.0.
5648 +
5649 +   [59]Supplement to Using C-Kermit, Second Edition, For C-Kermit 9.0
5650 +          Thorough documentation of features new to version 9.0.
5651 +
5652 +1.2. Technical Support
5653 +
5654 +   [ [60]Top ] [ [61]Contents ] [ [62]Section Contents ] [ [63]Next ] [
5655 +   [64]Previous ]
5656 +
5657 +   For information on how to get technical support, please visit:
5658 +
5659 +    [65]http://www.columbia.edu/kermit/support.html
5660 +
5661 +1.3. The Year 2000
5662 +
5663 +   [ [66]Top ] [ [67]Contents ] [ [68]Section Contents ] [ [69]Next ] [
5664 +   [70]Previous ]
5665 +
5666 +   The Unix version of C-Kermit, release 6.0 and later, is "Year 2000
5667 +   compliant", but only if the underlying operating system is too. Contact
5668 +   your Unix operating system vendor to find out which operating system
5669 +   versions, patches, hardware, and/or updates are required. (Quite a few
5670 +   old Unixes are still in operation in the new millenium, but with their
5671 +   date set 28 years in the past so at least the non-year parts of the
5672 +   calendar are correct.)
5673 +
5674 +   As of C-Kermit 6.0 (6 September 1996), post-millenium file dates are
5675 +   recognized, transmitted, received, and reproduced correctly during the
5676 +   file transfer process in C-Kermit's File Attribute packets. If
5677 +   post-millenium dates are not processed correctly on the other end, file
5678 +   transfer still takes place, but the modification or creation date of
5679 +   the received file might be incorrect. The only exception would be if
5680 +   the "file collision update" feature is being used to prevent
5681 +   unnecessary transfer of files that have not changed since the last time
5682 +   a transfer took place; in this case, a file might be transferred
5683 +   unnecessarily, or it might not be transferred when it should have been.
5684 +   Correct operation of the update feature depends on both Kermit programs
5685 +   having the correct date and time.
5686 +
5687 +   Of secondary importance are the time stamps in the transaction and/or
5688 +   debug logs, and the date-related script programming constructs, such as
5689 +   \v(date), \v(ndate), \v(day), \v(nday), and perhaps also the
5690 +   time-related ones, \v(time) and \v(ntime), insofar as they might be
5691 +   affected by the date. The \v(ndate) is a numeric-format date of the
5692 +   form yyyymmdd, suitable for both lexical and numeric comparison and
5693 +   sorting: e.g. 19970208 or 20011231. If the underlying operating system
5694 +   returns the correct date information, these variables will have the
5695 +   proper values. If not, then scripts that make decisions based on these
5696 +   variables might not operate correctly.
5697 +
5698 +   Most date-related code is based upon the C Library asctime() string,
5699 +   which always has a four-digit year. In Unix, the one bit of code in
5700 +   C-Kermit that is an exception to this rule is several calls to
5701 +   localtime(), which returns a pointer to a tm struct, in which the year
5702 +   is presumed to be expressed as "years since 1900". The code depends on
5703 +   this assumption. Any platforms that violate it will need special
5704 +   coding. As of this writing, no such platforms are known.
5705 +
5706 +   Command and script programming functions that deal with dates use
5707 +   C-Kermit specific code that always uses full years.
5708 +
5709 +1.4. The Euro
5710 +
5711 +   [ [71]Top ] [ [72]Contents ] [ [73]Section Contents ] [ [74]Previous ]
5712 +
5713 +   C-Kermit 7.0 and later support Unicode (ISO 10646), ISO 8859-15 Latin
5714 +   Alphabet 9, PC Code Page 858, Windows Code Pages 1250 and 1251, and
5715 +   perhaps other character sets, that encode the Euro symbol, and can
5716 +   translate among them as long as no intermediate character-set is
5717 +   involved that does not include the Euro.
5718 +
5719 +2. PREBUILT C-KERMIT BINARIES
5720 +
5721 +   [ [75]Top ] [ [76]Contents ] [ [77]Next ] [ [78]Previous ]
5722 +
5723 +   It is often dangerous to run a binary C-Kermit (or any other) program
5724 +   built on a different computer. Particularly if that computer had a
5725 +   different C compiler, libraries, operating system version, processor
5726 +   features, etc, and especially if the program was built with shared
5727 +   libraries, because as soon as you update the libraries on your system,
5728 +   they no longer match the ones referenced in the binary, and the binary
5729 +   might refuse to load when you run it, in which case you'll see error
5730 +   messages similar to:
5731 +
5732 +  Could not load program kermit
5733 +  Member shr4.o not found or file not an archive
5734 +  Could not load library libcurses.a[shr4.o]
5735 +  Error was: No such file or directory
5736 +
5737 +   (These samples are from AIX.) To avoid this problem, we try to build
5738 +   C-Kermit with statically linked libraries whenever we can, but this is
5739 +   increasingly impossible as shared libraries become the norm.
5740 +
5741 +   It is often OK to run a binary built on an earlier OS version, but it
5742 +   is rarely possible (or safe) to run a binary built on a later one, for
5743 +   example to run a binary built under Solaris 8 on Solaris 2.6. Sometimes
5744 +   even the OS-or-library patch/ECO level makes a difference.
5745 +
5746 +   A particularly insidious problem occurs when a binary was built on a
5747 +   version of the OS that has patches from the vendor (e.g. to libraries);
5748 +   in many cases you won't be able to run such a binary on an unpatched
5749 +   version of the same platform.
5750 +
5751 +   When in doubt, build C-Kermit from the source code on the computer
5752 +   where it is to be run (if possible!). If not, ask us for a binary
5753 +   specific to your configuration. We might have one, and if we don't, we
5754 +   might be able to find somebody who will build one for you.
5755 +
5756 +3. NOTES ON SPECIFIC UNIX VERSIONS
5757 +
5758 +   [ [79]Top ] [ [80]Contents ] [ [81]Next ] [ [82]Previous ]
5759 +
5760 +   SECTION CONTENTS
5761 +
5762 +  3.0.  [83]C-KERMIT ON PC-BASED UNIXES
5763 +  3.1.  [84]C-KERMIT AND AIX
5764 +  3.2.  [85]C-KERMIT AND HP-UX
5765 +  3.3.  [86]C-KERMIT AND LINUX
5766 +  3.4.  [87]C-KERMIT AND NEXTSTEP
5767 +  3.5.  [88]C-KERMIT AND QNX
5768 +  3.6.  [89]C-KERMIT AND SCO
5769 +  3.7.  [90]C-KERMIT AND SOLARIS
5770 +  3.8.  [91]C-KERMIT AND SUNOS
5771 +  3.9.  [92]C-KERMIT AND ULTRIX
5772 +  3.10. [93]C-KERMIT AND UNIXWARE
5773 +  3.11. [94]C-KERMIT AND APOLLO SR10
5774 +  3.12. [95]C-KERMIT AND TANDY XENIX 3.0
5775 +  3.13. [96]C-KERMIT AND OSF/1 (DIGITAL UNIX) (TRU64 UNIX)
5776 +  3.14. [97]C-KERMIT AND SGI IRIX
5777 +  3.15. [98]C-KERMIT AND THE BEBOX
5778 +  3.16. [99]C-KERMIT AND DG/UX
5779 +  3.17. [100]C-KERMIT AND SEQUENT DYNIX
5780 +  3.18. [101]C-KERMIT AND {FREE,OPEN,NET}BSD
5781 +  3.19. [102]C-KERMIT AND MAC OS X
5782 +  3.20. [103]C-KERMIT AND COHERENT
5783 +
5784 +   The following sections apply to specific Unix versions. Most of them
5785 +   contain references to FAQs (Frequently Asked Questions), but these tend
5786 +   to be ephemeral. For possibly more current information see:
5787 +
5788 +  [104]http://www.faqs.org
5789 +  [105]http://aplawrence.com/Unixart/newtounix.html
5790 +
5791 +   One thread that runs through many of them, and implicitly perhaps
5792 +   through all, concerns the problems that occur when trying to dial out
5793 +   on a serial device that is (also) enabled for dialing in. The
5794 +   "solutions" to this problem are many, varied, diverse, and usually
5795 +   gross, involving configuring the device for bidirectional use. This is
5796 +   done in a highly OS-dependent and often obscure manner, and the effects
5797 +   (good or evil) are also highly dependent on the particular OS (and
5798 +   getty variety, etc). Many examples are given in the [106]OS-specific
5799 +   sections below.
5800 +
5801 +   An important point to keep in mind is that C-Kermit is a
5802 +   cross-platform, portable software program. It was not designed
5803 +   specifically and only for your particular Unix version, or for that
5804 +   matter, for Unix in particular at all. It also runs on VMS, AOS/VS,
5805 +   VOS, and other non-Unix platforms. All the Unix versions of C-Kermit
5806 +   share common i/o modules, with compile-time #ifdef constructions used
5807 +   to account for the differences among the many Unix products and
5808 +   releases. If you think that C-Kermit is behaving badly or missing
5809 +   something on your particular Unix version, you might be right -- we
5810 +   can't claim to be expert in hundreds of different OS / version /
5811 +   hardware / library combinations. If you're a programmer, take a look at
5812 +   the source code and [107]send us your suggested fixes or changes. Or
5813 +   else just [108]send us a report about what seems to be wrong and we'll
5814 +   see what we can do.
5815 +
5816 +3.0. C-KERMIT ON PC-BASED UNIXES
5817 +
5818 +   [ [109]Top ] [ [110]Contents ] [ [111]Section Contents ] [ [112]Next ]
5819 +
5820 +   Also see: [113]http://www.pcunix.com/.
5821 +
5822 +   SECTION CONTENTS
5823 +
5824 +  3.0.1. [114]Interrupt Conflicts
5825 +  3.0.2. [115]Windows-Specific Hardware
5826 +  3.0.3. [116]Modems
5827 +  3.0.4. [117]Character Sets
5828 +  3.0.5. [118]Keyboard, Screen, and Mouse Access
5829 +  3.0.6. [119]Laptops
5830 +
5831 +3.0.1. Interrupt Conflicts
5832 +
5833 +   [ [120]Top ] [ [121]Contents ] [ [122]Section Contents ] [ [123]Next ]
5834 +
5835 +   PCs are not the best platform for real operating systems like Unix. The
5836 +   architecture suffers from numerous deficiencies, not the least of which
5837 +   is the stiflingly small number of hardware interrupts (either 7 or 15,
5838 +   many of which are preallocated). Thus adding devices, using multiple
5839 +   serial ports, etc, is always a challenge and often a nightmare. The
5840 +   free-for-all nature of the PC market and the lack of standards combined
5841 +   with the diversity of Unix OS versions make it difficult to find
5842 +   drivers for any particular device on any particular version of Unix.
5843 +
5844 +   Of special interest to Kermit users is the fact that there is no
5845 +   standard provision in the PC architecture for more than 2 communication
5846 +   (serial) ports. COM3 and COM4 (or higher) will not work unless you (a)
5847 +   find out the hardware address and interrupt for each, (b) find out how
5848 +   to provide your Unix version with this information, and (c) actually
5849 +   set up the configuration in the Unix startup files (or whatever other
5850 +   method is used). Watch out for interrupt conflicts, especially when
5851 +   using a serial mouse, and don't expect to be able to use more than two
5852 +   serial ports.
5853 +
5854 +   The techniques for resolving interrupt conflicts are different for each
5855 +   operating system (Linux, NetBSD, etc). In general, there is a
5856 +   configuration file somewhere that lists COM ports, something like this:
5857 +
5858 +  com0    at isa? port 0x3f8 irq 4      # DOS COM1
5859 +  com1    at isa? port 0x2f8 irq 3      # DOS COM2
5860 +
5861 +   The address and IRQ values in this file must agree with the values in
5862 +   the PC BIOS and with the ports themselves, and there must not be more
5863 +   than one device with the same interrupt. Unfortunately, due to the
5864 +   small number of available interrupts, installing new devices on a PC
5865 +   almost always creates a conflict. Here is a typical tale from a Linux
5866 +   user (Fred Smith) about installing a third serial port:
5867 +
5868 +     ...problems can come from a number of causes. The one I fought with
5869 +     for some time, and finally conquered, was that my modem is on an
5870 +     add-in serial port, cua3/IRQ5. By default IRQ5 has a very low
5871 +     priority, and does not get enough service in times when the system
5872 +     is busy to prevent losing data. This in turn causes many resends.
5873 +     There are two 'fixes' that I know of, one is to relax hard disk
5874 +     interrupt hogging by using the correct parameter to hdparm, but I
5875 +     don't like that one because the hdparm man page indicates it is
5876 +     risky to use. The other one, the one I used, was to get 'irqtune'
5877 +     and use it to give IRQ5 the highest priority instead of nearly the
5878 +     lowest. Completely cured the problem.
5879 +
5880 +   Here's another one from a newsgroup posting:
5881 +
5882 +     After much hair pulling, I've discovered why my serial port won't
5883 +     work. Apparently my [PC] has three serial devices (two comm ports
5884 +     and an IR port), of which only two at a time can be active. I looked
5885 +     in the BIOS setup and noticed that the IR port was activated, but
5886 +     didn't realize at the time that this meant that COM2 was thereby
5887 +     de-activated. I turned off the IR port and now the serial port works
5888 +     as advertised.
5889 +
5890 +3.0.2. Windows-Specific Hardware
5891 +
5892 +   [ [124]Top ] [ [125]Contents ] [ [126]Section Contents ] [ [127]Next ]
5893 +   [ [128]Previous ]
5894 +
5895 +   To complicate matters, the PC platform is becoming increasingly and
5896 +   inexorably Windows-oriented. More and more add-on devices are "Windows
5897 +   only" -- meaning they are incomplete and rely on proprietary
5898 +   Windows-based software drivers to do the jobs that you would expect the
5899 +   device itself to do. PCMCIA, PCI, or "Plug-n-Play" devices are rarely
5900 +   supported on PC-based Unix versions such as SCO; Winmodems,
5901 +   Winprinters, and the like are not supported on any Unix variety (with
5902 +   [129]a few exceptions). The self-proclaimed Microsoft PC 97 (or later)
5903 +   standard only makes matters worse since its only purpose to ensure that
5904 +   PCs are "optimized to run Windows 95 and Windows NT 4.0 and future
5905 +   versions of these operating systems".
5906 +
5907 +   With the exception noted (the Lucent modem, perhaps a handful of others
5908 +   by the time you read this), drivers for "Win" devices are available
5909 +   only for Windows, since the Windows market dwarfs that of any
5910 +   particular Unix brand, and for that matter all Unixes (or for that
5911 +   matter, all non-Windows operating systems) combined. If your version of
5912 +   Unix (SCO, Linux, BSDI, FreeBSD, etc) does not support a particular
5913 +   device, then C-Kermit can't use it either. C-Kermit, like any Unix
5914 +   application, must access all devices through drivers and not directly
5915 +   because Unix is a real operating system.
5916 +
5917 +   Don't waste time thinking that you, or anybody else, could write a
5918 +   Linux (or other Unix) driver for a Winmodem or other "Win" device.
5919 +   First of all, these devices generally require realtime control, but
5920 +   since Unix is a true multitasking operating system, realtime device
5921 +   control is not possible outside the kernel. Second, the specifications
5922 +   for these devices are secret and proprietary, and each one (and each
5923 +   version of each one) is potentially different. Third, a Winmodem driver
5924 +   would be enormously complex; it would take years to write and debug, by
5925 +   which time it would be obsolete.
5926 +
5927 +   A more recent generation of PCs (circa 1999-2000) is marketed as
5928 +   "Legacy Free". One can only speculate what that could mean. Most likely
5929 +   it means it will ONLY run the very latest versions of Windows, and is
5930 +   made exclusively of Winmodems, Winprinters, Winmemory, and Win-CPU-fans
5931 +   (Legacy Free is a concept [130]pioneered by Microsoft).
5932 +
5933 +   Before you buy a new PC or add-on equipment, especially serial ports,
5934 +   internal modems, or printers, make sure they are compatible with your
5935 +   version of Unix. This is becoming an ever-greater challenge; only a
5936 +   huge company like Microsoft can afford to be constantly cranking out
5937 +   and/or verifying drivers for the thousands of video boards, sound
5938 +   cards, network adapters, SCSI adapters, buses, etc, that spew forth in
5939 +   an uncontrolled manner from all corners of the world on a daily basis.
5940 +   With very few exceptions, makers of PCs assemble the various components
5941 +   and then verify them only with Windows, which they must do since they
5942 +   are, no doubt, preloading the PC with Windows. To find a modern PC that
5943 +   is capable of running a variety of non-Windows operating systems (e.g.
5944 +   Linux, SCO OpenServer, Unixware, and Solaris) is a formidable challenge
5945 +   requiring careful study of each vendor's "compatibility lists" and
5946 +   precise attention to exact component model numbers and revision levels.
5947 +
5948 +3.0.3. Modems
5949 +
5950 +   [ [131]Top ] [ [132]Contents ] [ [133]Section Contents ] [ [134]Next ]
5951 +   [ [135]Previous ]
5952 +
5953 +   External modems are recommended:
5954 +
5955 +     * They don't need any special drivers.
5956 +     * You can use the lights and speaker to troubleshoot dialing.
5957 +     * You can share them among all types of computers.
5958 +     * You can easily turn them off and on when power-cycling seems
5959 +       warranted.
5960 +     * They are more likely to have manuals.
5961 +
5962 +   Internal PC modems (even when they are not Winmodems, which is
5963 +   increasingly unlikely in new PCs) are always trouble, especially in
5964 +   Unix. Even when they work for dialing out, they might not work for
5965 +   dialing in, etc. Problems that occur when using an internal modem can
5966 +   almost always be eliminated by switching to an external one. Even when
5967 +   an internal modem is not a Winmodem or Plug-n-Play, it is often a
5968 +   no-name model of unknown quality -- not the sort of thing you want
5969 +   sitting directly on your computer's bus. (Even if it does not cause
5970 +   hardware problems, it probably came without a command list, so no Unix
5971 +   software will know how to control it.) For more about Unix compatible
5972 +   modems, see:
5973 +
5974 +  [136]http://www.idir.net/~gromitkc/winmodem.html
5975 +
5976 +   Remember that PCs, even now -- more than two decades after they were
5977 +   first introduced -- are not (in general) capable of supporting more
5978 +   than 2 serial devices. Here's a short success story from a recent
5979 +   newsgroup posting: "I have a Diamond SupraSonic II dual modem in my
5980 +   machine. What I had to end up doing is buying a PS/2 mouse and port and
5981 +   install it. Had to get rid of my serial mouse. I also had to disable
5982 +   PnP in my computer bios. I was having IRQ conflicts between my serial
5983 +   mouse and 'com 3'. Both modems work fine for me. My first modem is
5984 +   ttyS0 and my second is ttyS1." Special third-party multiport boards
5985 +   such as [137]DigiBoard are available for certain Unix platforms
5986 +   (typically SCO, maybe Linux) that come with special platform-specific
5987 +   drivers.
5988 +
5989 +3.0.4. Character Sets
5990 +
5991 +   [ [138]Top ] [ [139]Contents ] [ [140]Section Contents ] [ [141]Next ]
5992 +   [ [142]Previous ]
5993 +
5994 +   PCs generally have PC code pages such as CP437 or CP850, and these are
5995 +   often used by PC-based Unix operating systems, particularly on the
5996 +   console. These are supported directly by C-Kermit's SET FILE
5997 +   CHARACTER-SET and SET TERMINAL CHARACTER-SET commands. Some PC-based
5998 +   Unix versions, such as recent Red Hat Linux releases, might also
5999 +   support Microsoft Windows code pages such as CP1252, or even Latin
6000 +   Alphabet 1 itself (perhaps displayed with CP437 glyphs). (And work is
6001 +   in progress to support Unicode UTF8 in Linux.)
6002 +
6003 +   Certain Windows code pages are not supported directly by C-Kermit, but
6004 +   since they are ISO Latin Alphabets with nonstandard "extensions" in the
6005 +   C1 control range, you can substitute the corresponding Latin alphabet
6006 +   (or other character set) in any C-Kermit character-set related
6007 +   commands:
6008 +
6009 +  Windows Code Page    Substitution
6010 +   CP 1004              Latin-1
6011 +   CP 1051              HP Roman-8
6012 +
6013 +   Other Windows code pages are mostly (or totally) incompatible with
6014 +   their Latin Alphabet counterparts (e.g. CP1250 and Latin-2), and
6015 +   several of these are already supported by C-Kermit 7.0 and later (1250,
6016 +   1251, and 1252).
6017 +
6018 +3.0.5. Keyboard, Screen, and Mouse Access
6019 +
6020 +   [ [143]Top ] [ [144]Contents ] [ [145]Section Contents ] [ [146]Next ]
6021 +   [ [147]Previous ]
6022 +
6023 +   Finally, note that as a real operating system, Unix (unlike Windows)
6024 +   does not provide the intimate connection to the PC keyboard, screen,
6025 +   and mouse that you might expect. Unix applications can not "see" the
6026 +   keyboard, and therefore can not be programmed to understand F-keys,
6027 +   Editing keys, Arrow keys, Alt-key combinations, and the like. This is
6028 +   because:
6029 +
6030 +    a. Unix is a portable operating system, not only for PCs;
6031 +    b. Unix sessions can come from anywhere, not just the PC's own
6032 +       keyboard and screen; and:
6033 +    c. even though it might be possible for an application that actually
6034 +       is running on the PC's keyboard and screen to access these devices
6035 +       directly, there are no APIs (outside of X) for this.
6036 +
6037 +3.0.6. Laptops
6038 +
6039 +   [ [148]Top ] [ [149]Contents ] [ [150]Section Contents ] [
6040 +   [151]Previous ]
6041 +
6042 +   (To be filled in . . .)
6043 +
6044 +3.1. C-KERMIT AND AIX
6045 +
6046 +   [ [152]Top ] [ [153]Contents ] [ [154]Section Contents ] [ [155]Next ]
6047 +   [ [156]Previous ]
6048 +
6049 +   SECTION CONTENTS
6050 +
6051 +  3.1.1. [157]AIX: General
6052 +  3.1.2. [158]AIX: Network Connections
6053 +  3.1.3. [159]AIX: Serial Connections
6054 +  3.1.4. [160]AIX: File Transfer
6055 +  3.1.5. [161]AIX: Xterm Key Map
6056 +
6057 +   For additional information see:
6058 +     * [162]http://www.emerson.emory.edu/services/aix-faq/
6059 +     * [163]http://www.faqs.org/faqs/by-newsgroup/comp/comp.unix.aix.html
6060 +     * [164]http://www.cis.ohio-state.edu/hypertext/faq/usenet/aix-faq/top
6061 +       .html
6062 +     * [165]http://aixpdslib.seas.ucla.edu/
6063 +     * [166]http://www.rootvg.net (AIX history)
6064 +     * [167]ftp://rtfm.mit.edu/pub/usenet/news.answers/aix-faq/part1
6065 +     * [168]ftp://mirrors.aol.com/pub/rtfm/usenet-by-hierarchy/comp/unix/a
6066 +       ix
6067 +
6068 +   and/or read the [169]comp.unix.aix newsgroup.
6069 +  ________________________________________________________________________
6070 +
6071 +3.1.1. AIX: General
6072 +
6073 +   [ [170]Top ] [ [171]Contents ] [ [172]Section Contents ] [ [173]Next ]
6074 +
6075 +   About AIX version numbers: "uname -a" tells the two-digit version
6076 +   number, such as 3.2 or 4.1. The three-digit form can be seen with the
6077 +   "oslevel" command (this information is unavailable at the API level and
6078 +   is reportedly obtained by scanning the installed patch list).
6079 +   Supposedly all three-digit versions within the same two-digit version
6080 +   (e.g. 4.3.1, 4.3.2) are binary compatible; i.e. a binary built on any
6081 +   one of them should run on all others, but who knows. Most AIX advocates
6082 +   tell you that any AIX binary will run on any AIX version greater than
6083 +   or equal to the one under which it was built, but experience with
6084 +   C-Kermit suggests otherwise. It is always best to run a binary built
6085 +   under your exact same AIX version, down to the third decimal place, if
6086 +   possible. Ideally, build it from source code yourself. Yes, this advice
6087 +   would be easier to follow if AIX came with a C compiler.
6088 +  ________________________________________________________________________
6089 +
6090 +3.1.2. AIX: Network Connections
6091 +
6092 +   [ [174]Top ] [ [175]Contents ] [ [176]Section Contents ] [ [177]Next ]
6093 +   [ [178]Previous ]
6094 +
6095 +   File transfers into AIX 4.2 or 4.3 through the AIX Telnet or Rlogin
6096 +   server have been observed to fail (or accumulate huge numbers of
6097 +   correctable errors, or even disconnect the session), when exactly the
6098 +   same kind of transfers into AIX 4.1 work without incident, as do such
6099 +   transfers into all non-AIX platforms on the same kind of connections
6100 +   (with a few exceptions noted elsewhere in this document). AIX 4.3.3
6101 +   seems to be particularly fragile in this regard; the weakness seems to
6102 +   be in its pseudoterminal (pty) driver. High-speed streaming transfers
6103 +   work perfectly, however, if the AIX Telnet server and pty driver are
6104 +   removed from the picture; e.g, by using "set host * 3000" on AIX.
6105 +
6106 +   The problem can be completely cured by replacing the IBM Telnet server
6107 +   with [179]MIT's Kerberos Telnet server -- even if you don't actually
6108 +   use the Kerberos part. Diagnosis: AIX pseudoterminals (which are
6109 +   controlled by the Telnet server to give you a login terminal for your
6110 +   session) have quirks that not even IBM knows about. The situation with
6111 +   AIX 5.x is not known, but if it has the same problem, the same cure is
6112 +   available.
6113 +
6114 +   Meanwhile, the only remedy when going through the IBM Telnet server is
6115 +   to cut back on Kermit's performance settings until you find a
6116 +   combination that works:
6117 +
6118 +     * SET STREAMING OFF
6119 +     * SET WINDOW-SIZE small-number
6120 +     * SET { SEND, RECEIVE } PACKET-LENGTH small-number
6121 +     * SET PREFIXING { CAUTIOUS, ALL }
6122 +
6123 +   In some cases, severe cutbacks are required, e.g. those implied by the
6124 +   ROBUST command. Also be sure that the AIX C-Kermit on the remote end
6125 +   has "set flow none" (which is the default). NOTE: Maybe this one can
6126 +   also be addressed by starting AIX telnetd with the "-a" option. The
6127 +   situation with SSH connections is not known, but almost certainly the
6128 +   same.
6129 +
6130 +   When these problems occur, the system error log contains:
6131 +
6132 +  LABEL:          TTY_TTYHOG
6133 +  IDENTIFIER:     0873CF9F
6134 +  Type:           TEMP
6135 +  Resource Name:  pts/1
6136 +
6137 +  Description
6138 +  TTYHOG OVER-RUN
6139 +
6140 +  Failure Causes
6141 +  EXCESSIVE LOAD ON PROCESSOR
6142 +
6143 +  Recommended Actions
6144 +  REDUCE SYSTEM LOAD.
6145 +  REDUCE SERIAL PORT BAUD RATE
6146 +
6147 +   Before leaving the topic of AIX pseudoterminals, it is very likely that
6148 +   Kermit's PTY and SSH commands do not work well either, for the same
6149 +   reason that Telnet connections into AIX don't work well. A brief test
6150 +   with "pty rlogin somehost" got a perfectly usable terminal (CONNECT)
6151 +   session, but file-transfer problems like those just described.
6152 +
6153 +   Reportedly, telnet from AIX 4.1-point-something to non-Telnet ports
6154 +   does not work unless the port number is in the /etc/services file; it's
6155 +   not clear from the report whether this is a problem with AIX Telnet (in
6156 +   which case it would not affect Kermit), or with the sockets library (in
6157 +   which case it would). The purported fix is IBM APAR IX61523.
6158 +
6159 +   C-Kermit SET HOST or TELNET from one AIX 3.1 (or earlier) system to
6160 +   another won't work right unless you set your local terminal type to
6161 +   something other than AIXTERM. When your terminal type is AIXTERM, AIX
6162 +   TELNET sends two escapes whenever you type one, and the AIX telnet
6163 +   server swallows one of them. This has something to do with the "hft"
6164 +   device. This behavior seems to be removed in AIX 3.2 and later.
6165 +  ________________________________________________________________________
6166 +
6167 +3.1.3. AIX: Serial Connections
6168 +
6169 +   [ [180]Top ] [ [181]Contents ] [ [182]Section Contents ] [ [183]Next ]
6170 +   [ [184]Previous ]
6171 +
6172 +   In AIX 3, 4, or 5, C-Kermit won't be able to "set line /dev/tty0" (or
6173 +   any other dialout device) if you haven't installed "cu" or "uucp" on
6174 +   your system, because installing these is what creates the UUCP lockfile
6175 +   directory. If SET LINE commands always result in "Sorry, access to lock
6176 +   denied", even when C-Kermit has been given the same owner, group, and
6177 +   permissions as cu:
6178 +
6179 +  -r-sr-xr-x   1 uucp     uucp       67216 Jul 27 1999  cu
6180 +
6181 +   and even when you run it as root, then you must go back and install
6182 +   "cu" from your AIX installation media.
6183 +
6184 +   According to IBM's "From Strength to Strength" document (21 April
6185 +   1998), in AIX 4.2 and later "Async supports speeds on native serial
6186 +   ports up to 115.2kbps". However, no API is documented to achieve serial
6187 +   speeds higher than 38400 bps. Apparently the way to do this -- which
6188 +   might or might not work only on the IBM 128-port multiplexer -- is:
6189 +
6190 +  cxma-stty fastbaud /dev/tty0
6191 +
6192 +   which, according to "man cxma-stty":
6193 +
6194 +     fastbaud Alters the baud rate table, so 50 baud becomes 57600 baud.
6195 +     -fastbaud Restores the baud rate table, so 57600 baud becomes 50
6196 +     baud.
6197 +
6198 +   Presumably (but not certainly) this extrapolates to 110 "baud" becomes
6199 +   76800 bps, and 150 becomes 115200 bps. So to use high serial speeds in
6200 +   AIX 4.2 or 4.3, the trick would be to give the "cxma-stty fastbaud"
6201 +   command for the desired tty device before starting Kermit, and then use
6202 +   "set speed 50", "set speed 110", or "set speed 150" to select 56700,
6203 +   76800, or 115200 bps. It is not known whether cxma-stty requires
6204 +   privilege.
6205 +
6206 +   According to one report, "Further investigation with IBM seems to
6207 +   indicate that the only hardware capable of doing this is the 128-port
6208 +   multiplexor with one (or more) of the 16 port breakout cables (Enhanced
6209 +   Remote Async Node 16-Port EIA-232). We are looking at about CDN$4,000
6210 +   in hardware just to hang a 56kb modem on there. Of course, we can then
6211 +   hang 15 more, if we want. This hardware combo is described to be good
6212 +   to 230.4kbps."
6213 +
6214 +   Another report says (quote from AIX newsgroup, March 1999):
6215 +
6216 +     The machine type and the adapter determine the speed that one can
6217 +     actually run at. The older microchannel machines have much slower
6218 +     crystal frequencies and may not go beyond 76,800. A feature put into
6219 +     AIX 421 allows one to key in non-POSIX baud rates and if the uart
6220 +     can support that speed, it will get set. this applies also to 43p's
6221 +     and beyond. 115200 is the max for the 43P's native serial port. As
6222 +     crytal frequencies continue to increase, the built-in serial ports
6223 +     speeds will improve. To use 'uucp' or 'ate' at the higher baud
6224 +     rates, configure the port for the desired speed, but set the speed
6225 +     of uucp or ate to 50. Any non-POSIX speeds set in the ttys
6226 +     configuration will the be used. In the case of the 128-port adapters
6227 +     or the ISA 8-port or PCI 8-port adapter, there are only a few higher
6228 +     baud rates.
6229 +
6230 +    a. Change the port to enable high baud rates:
6231 +          + B50 for 57600
6232 +          + B75 for 76800
6233 +          + B110 for 115200
6234 +          + B200 for 230000
6235 +    b. chdev -l ttyX -a fastbaud=enable
6236 +          + For the 128 ports original style rans, only 57600 bps is
6237 +            supported.
6238 +          + For the new enhanced RANs, up to 230Kbps is supported.
6239 +
6240 +   In AIX 2.2.1 on the RT PC with the 8-port multiplexer, SET SPEED 38400
6241 +   gives 9600 bps, but SET SPEED 19200 gives 19200 (on the built-in S1
6242 +   port).
6243 +
6244 +   Note that some RS/6000s (e.g. the IBM PowerServer 320) have nonstandard
6245 +   rectangular 10-pin serial ports; the DB-25 connector is NOT a serial
6246 +   port; it is a parallel printer port. IBM cables are required for the
6247 +   serial ports, (The IBM RT PC also had rectangular serial ports --
6248 +   perhaps the same as these, perhaps different.)
6249 +
6250 +   If you dial in to AIX through a modem that is connected directly to an
6251 +   AIX port (e.g. on the 128-port multiplexer) and find that data is lost,
6252 +   especially when uploading files to the AIX system (and system error
6253 +   logs report buffer overruns on the port):
6254 +
6255 +    1. Make sure the port and modem are BOTH configured for hardware
6256 +       (RTS/CTS) flow control. The port is configured somewhere in the
6257 +       system configuration, outside of Kermit.
6258 +    2. Tell C-Kermit to "set flow keep"; experimentation shows that SET
6259 +       FLOW RTS/CTS has no effect when used in remote mode (i.e. on
6260 +       /dev/tty, as opposed to a specify port device).
6261 +    3. Fixes for bugs in the original AIX 4.2 tty (serial i/o) support and
6262 +       other AIX bugs are available from IBM at:
6263 +  [185]http://service.software.ibm.com/rs6000/
6264 +
6265 +       Downloads -> Software Fixes -> Download FixDist gets an application
6266 +       for looking up known problems.
6267 +
6268 +   Many problems reported with bidirectional terminal lines on AIX 3.2.x
6269 +   on the RS/6000. Workaround: don't use bidirectional terminal lines, or
6270 +   write a shell-script wrapper for Kermit that turns getty off on the
6271 +   line before starting Kermit, or before Kermit attempts to do the SET
6272 +   LINE. (But note: These problems MIGHT be fixed in C-Kermit 6.0 and
6273 +   later.) The commands for turning getty off and on (respectively) are
6274 +   /usr/sbin/pdisable and /usr/sbin/penable.
6275 +  ________________________________________________________________________
6276 +
6277 +3.1.4. AIX: File Transfer
6278 +
6279 +   [ [186]Top ] [ [187]Contents ] [ [188]Section Contents ] [ [189]Next ]
6280 +   [ [190]Previous ]
6281 +
6282 +   Evidently AIX 4.3 (I don't know about earlier versions) does not allow
6283 +   open files to be overwritten. This can cause Kermit transfers to fail
6284 +   when FILE COLLISION is OVERWRITE, where they might work on other Unix
6285 +   varieties or earlier AIX versions.
6286 +
6287 +   Transfer of binary -- and maybe even text -- files can fail in AIX if
6288 +   the AIX terminal has particular port can have character-set translation
6289 +   done for it by the tty driver. The following advice from a
6290 +   knowledgeable AIX user:
6291 +
6292 +     [This feature] has to be checked (and set/cleared) with a separate
6293 +     command, unfortunately stty doesn't handle this. To check:
6294 +
6295 +  $ setmaps
6296 +  input map: none installed
6297 +  output map: none installed
6298 +
6299 +     If it says anything other than "none installed" for either one, it
6300 +     is likely to cause a problem with kermit. To get rid of installed
6301 +     maps:
6302 +
6303 +  $ setmaps -t NOMAP
6304 +
6305 +     However, I seem to recall that with some versions of AIX before
6306 +     3.2.5, only root could change the setting. I'm not sure what
6307 +     versions - it might have only been under AIX 3.1 that this was true.
6308 +     At least with AIX 3.2.5 an ordinary user can set or clear the maps.
6309 +
6310 +   On the same problem, another knowledgeable AIX user says:
6311 +
6312 +     The way to get information on the NLS mapping under AIX (3.2.5
6313 +     anyway) is as follows. From the command line type:
6314 +
6315 +  lsattr -l tty# -a imap -a omap -E -H
6316 +
6317 +     Replace the tty number for the number sign above. This will give a
6318 +     human readable output of the settings that looks like this;
6319 +
6320 +  # lsattr -l tty2 -a imap -a omap -E -H
6321 +  attribute value description     user_settable
6322 +
6323 +  imap      none  INPUT map file  True
6324 +  omap      none  OUTPUT map file True
6325 +
6326 +     If you change the -H to a -O, you get output that can easily be
6327 +     processed by another program or a shell script, for example:
6328 +
6329 +  # lsattr -l tty2 -a imap -a omap -E -O
6330 +  #imap:omap
6331 +  none:none
6332 +
6333 +     To change the settings from the command line, the chdev command is
6334 +     used with the following syntax.
6335 +
6336 +  chdev -l tty# -a imap='none' -a omap='none'
6337 +
6338 +     Again substituting the appropriate tty port number for the number
6339 +     sign, "none" being the value we want for C-Kermit. Of course, the
6340 +     above can also be changed by using the SMIT utility and selecting
6341 +     devices - tty. (...end quote)
6342 +
6343 +   In 2007 I noticed the following on high-speed SSH connections (local
6344 +   network) into AIX 5.3: streaming transfers into AIX just don't work.
6345 +   The same might be true for Telnet connections; I have no way to check.
6346 +   It appears that the AIX pty driver and/or the SSH (and possibly Telnet)
6347 +   server are not capable of receiving a steady stream of incoming data at
6348 +   high speed. Solution: unknown. Workaround: put "set streaming off" in
6349 +   your .kermrc or .mykermrc file, since streaming is the default for
6350 +   network connections.
6351 +  ________________________________________________________________________
6352 +
6353 +3.1.5. AIX: Xterm Key Map
6354 +
6355 +   [ [191]Top ] [ [192]Contents ] [ [193]Section Contents ] [
6356 +   [194]Previous ]
6357 +
6358 +   Here is a sample configuration for setting up an xterm keyboard for
6359 +   VT220 or higher terminal emulation on AIX, courtesy of Bruce Momjian,
6360 +   Drexel Hill, PA. Xterm can be started like this:
6361 +
6362 +  xterm $XTERMFLAGS +rw +sb +ls $@ -tm 'erase ^? intr ^c' -name vt220 \
6363 +          -title vt220 -tn xterm-220 "$@" &
6364 +
6365 +---------------------------------------------------------------------------
6366 +  XTerm*VT100.Translations: #override \n\
6367 +          <Key>Home: string(0x1b) string("[3~") \n \
6368 +          <Key>End: string(0x1b) string("[4~") \n
6369 +  vt220*VT100.Translations: #override \n\
6370 +  Shift   <Key>F1: string("[23~") \n \
6371 +  Shift   <Key>F2: string("[24~") \n \
6372 +  Shift   <Key>F3: string("[25~") \n \
6373 +  Shift   <Key>F4: string("[26~") \n \
6374 +  Shift   <Key>F5: string("[K~") \n \
6375 +  Shift   <Key>F6: string("[31~") \n \
6376 +  Shift   <Key>F7: string("[31~") \n \
6377 +  Shift   <Key>F8: string("[32~") \n \
6378 +  Shift   <Key>F9: string("[33~") \n \
6379 +  Shift   <Key>F10: string("[34~") \n \
6380 +  Shift   <Key>F11: string("[28~") \n \
6381 +  Shift   <Key>F12: string("[29~") \n \
6382 +          <Key>Print: string(0x1b) string("[32~") \n\
6383 +          <Key>Cancel: string(0x1b) string("[33~") \n\
6384 +          <Key>Pause: string(0x1b) string("[34~") \n\
6385 +          <Key>Insert: string(0x1b) string("[2~") \n\
6386 +          <Key>Delete: string(0x1b) string("[3~") \n\
6387 +          <Key>Home: string(0x1b) string("[1~") \n\
6388 +          <Key>End: string(0x1b) string("[4~") \n\
6389 +          <Key>Prior: string(0x1b) string("[5~") \n\
6390 +          <Key>Next: string(0x1b) string("[6~") \n\
6391 +          <Key>BackSpace: string(0x7f) \n\
6392 +          <Key>Num_Lock: string(0x1b) string("OP") \n\
6393 +          <Key>KP_Divide: string(0x1b) string("Ol") \n\
6394 +          <Key>KP_Multiply: string(0x1b) string("Om") \n\
6395 +          <Key>KP_Subtract: string(0x1b) string("OS") \n\
6396 +          <Key>KP_Add: string(0x1b) string("OM") \n\
6397 +          <Key>KP_Enter: string(0x1b) string("OM") \n\
6398 +          <Key>KP_Decimal: string(0x1b) string("On") \n\
6399 +          <Key>KP_0: string(0x1b) string("Op") \n\
6400 +          <Key>KP_1: string(0x1b) string("Oq") \n\
6401 +          <Key>KP_2: string(0x1b) string("Or") \n\
6402 +          <Key>KP_3: string(0x1b) string("Os") \n\
6403 +          <Key>KP_4: string(0x1b) string("Ot") \n\
6404 +          <Key>KP_5: string(0x1b) string("Ou") \n\
6405 +          <Key>KP_6: string(0x1b) string("Ov") \n\
6406 +          <Key>KP_7: string(0x1b) string("Ow") \n\
6407 +          <Key>KP_8: string(0x1b) string("Ox") \n\
6408 +          <Key>KP_9: string(0x1b) string("Oy") \n
6409 +
6410 +  !       <Key>Up: string(0x1b) string("[A") \n\
6411 +  !       <Key>Down: string(0x1b) string("[B") \n\
6412 +  !       <Key>Right: string(0x1b) string("[C") \n\
6413 +  !       <Key>Left: string(0x1b) string("[D") \n\
6414 +
6415 +  *visualBell:    true
6416 +  *saveLines:     1000
6417 +  *cursesemul:    true
6418 +  *scrollKey:     true
6419 +  *scrollBar:     true
6420 +
6421 +3.2. C-KERMIT AND HP-UX
6422 +
6423 +   [ [195]Top ] [ [196]Contents ] [ [197]Section Contents ] [ [198]Next ]
6424 +   [ [199]Previous ]
6425 +
6426 +   SECTION CONTENTS
6427 +
6428 +  3.2.0. [200]Common Problems
6429 +  3.2.1. [201]Building C-Kermit on HP-UX
6430 +  3.2.2. [202]File Transfer
6431 +  3.2.3. [203]Dialing Out and UUCP Lockfiles in HP-UX
6432 +  3.2.4. [204]Notes on Specific HP-UX Releases
6433 +  3.2.5. [205]HP-UX and X.25
6434 +
6435 +   REFERENCES
6436 +
6437 +   For further information, read the [206]comp.sys.hp.hpux newsgroup.
6438 +
6439 +   C-Kermit is included as part of the HP-UX operating system by contract
6440 +   between Hewlett Packard and Columbia University for HP-UX 10.00 and
6441 +   later. Each level of HP-UX includes a freshly built C-Kermit binary in
6442 +   /bin/kermit, which should work correctly. Binaries built for regular
6443 +   HP-UX may be used on Trusted HP-UX and vice-versa, except for use as
6444 +   IKSD because of the different authentication methods.
6445 +
6446 +   Note that HP does not update C-Kermit versions for any but its most
6447 +   current HP-UX release. So, for example, HP-UX 10.20 has C-Kermit 6.0;
6448 +   11.00 has C-Kermit 7.0, and 11.22 has 8.0. Of course, as with all
6449 +   software, older Kermit versions have bugs (such as buffer overflow
6450 +   vulnerabilities) that are fixed in later versions. From time to time,
6451 +   HP discovers one of these (long-ago fixed) bugs and issues a security
6452 +   alert for the older OS's, recommending some draconian measure to avoid
6453 +   the problem. The true fix in each situation is to install the current
6454 +   release of C-Kermit.
6455 +
6456 +3.2.0. Common Problems
6457 +
6458 +   [ [207]Top ] [ [208]Contents ] [ [209]Section Contents ] [ [210]Next ]
6459 +
6460 +   Some HP workstations have a BREAK/RESET key. If you hit this key while
6461 +   C-Kermit is running, it might kill or suspend the C-Kermit process.
6462 +   C-Kermit arms itself against these signals, but evidently the
6463 +   BREAK/RESET key is -- at least in some circumstances, on certain HP-UX
6464 +   versions -- too powerful to be caught. (Some report that the first
6465 +   BREAK/RESET shows up as SIGINT and is caught by C-Kermit's former
6466 +   SIGINT handler even when SIGINT is currently set to SIG_IGN; the second
6467 +   kills Kermit; other reports suggest the first BREAK/RESET sends a
6468 +   SIGTSTP (suspend signal) to Kermit, which it catches and suspends
6469 +   itself. You can tell C-Kermit to ignore suspend signals with SET
6470 +   SUSPEND OFF. You can tell C-Kermit to ignore SIGINT with SET COMMAND
6471 +   INTERRUPTION OFF. It is not known whether these commands also grant
6472 +   immunity to the BREAK/RESET key (one report states that with SET
6473 +   SUSPEND OFF, the BREAK/RESET key is ignored the first four times, but
6474 +   kills Kermit the 5th time). In any case:
6475 +
6476 +    1. If this key is mapped to SIGINT or SIGTSTP, C-Kermit catches or
6477 +       ignores it, depending on which mode (CONNECT, command, etc) Kermit
6478 +       is in.
6479 +    2. If it causes HP-UX to kill C-Kermit, there is nothing C-Kermit can
6480 +       do to prevent it.
6481 +
6482 +   When HP-UX is on the remote end of the connection, it is essential that
6483 +   HP-UX C-Kermit be configured for Xon/Xoff flow control (this is the
6484 +   default, but in case you change it and then experience file-transfer
6485 +   failures, this is a likely reason).
6486 +
6487 +3.2.1. Building C-Kermit on HP-UX
6488 +
6489 +   [ [211]Top ] [ [212]Contents ] [ [213]Section Contents ] [ [214]Next ]
6490 +   [ [215]Previous ]
6491 +
6492 +     This section applies mainly to old (pre-10.20) HP-UX version on old,
6493 +     slow, and/or memory-constrained hardware.
6494 +
6495 +   During the C-Kermit 6.0 Beta cycle, something happened to ckcpro.w (or,
6496 +   more precisely, the ckcpro.c file that is generated from it) which
6497 +   causes HP optimizing compilers under HP-UX versions 7.0 and 8.0
6498 +   (apparently on all platforms) as well as under HP-UX 9.0 on Motorola
6499 +   platforms only, to blow up. In versions 7.0 and 8.0 the problem has
6500 +   spread to other modules.
6501 +
6502 +   The symptoms vary from the system grinding to a halt, to the compiler
6503 +   crashing, to the compilation of the ckcpro.c module taking very long
6504 +   periods of time, like 9 hours. This problem is handled by compiling the
6505 +   modules that tickle it without optimization; the new C-Kermit makefile
6506 +   takes care of this, and shows how to do it in case the same thing
6507 +   begins happening with other modules.
6508 +
6509 +   On HP-UX 9.0, a kernel parameter, maxdsiz (maximum process data segment
6510 +   size), seems to be important. On Motorola systems, it is 16MB by
6511 +   default, whereas on RISC systems the default is much bigger. Increasing
6512 +   maxdsiz to about 80MB seems to make the problem go away, but only if
6513 +   the system also has a lot of physical memory -- otherwise it swaps
6514 +   itself to death.
6515 +
6516 +   The optimizing compiler might complain about "some optimizations
6517 +   skipped" on certain modules, due to lack of space available to the
6518 +   optimizer. You can increase the space (the incantation depends on the
6519 +   particular compiler version -- see the [216]makefile), but doing so
6520 +   tends to make the compilations take a much longer time. For example,
6521 +   the "hpux0100o+" makefile target adds the "+Onolimit" compiler flag,
6522 +   and about an hour to the compile time on an HP-9000/730. But it *does*
6523 +   produce an executable that is about 10K smaller :-)
6524 +
6525 +   In the makefile, all HP-UX entries automatically skip optimization of
6526 +   problematic modules.
6527 +
6528 +3.2.2. File Transfer
6529 +
6530 +   [ [217]Top ] [ [218]Contents ] [ [219]Section Contents ] [ [220]Next ]
6531 +   [ [221]Previous ]
6532 +
6533 +   Telnet connections into HP-UX versions up to and including 11.11 (and
6534 +   possibly 11.20) tend not to lend themselves to file transfer due to
6535 +   limitations, restrictions, and/or bugs in the HP-UX Telnet server
6536 +   and/or pseudoterminal (pty) driver.
6537 +
6538 +   In C-Kermit 6.0 (1996) an unexpected slowness was noted when
6539 +   transferring files over local Ethernet connections when an HP-UX system
6540 +   (9.05 or 10.00) was on the remote end. The following experiment was
6541 +   conducted to determine the cause. C-Kermit 6.0 was used; the situation
6542 +   is slightly better using C-Kermit 7.0's streaming feature and HP-UX
6543 +   10.20 on the far end.
6544 +
6545 +   The systems were HP-UX 10.00 (on 715/33) and SunOS 4.1.3 (on Sparc-20),
6546 +   both on the same local 10Mbps Ethernet, packet length 4096, parity
6547 +   none, control prefixing "cautious", using only local disks on each
6548 +   machine -- no NFS. In the C-Kermit 6.0 (ACK/NAK) case, the window size
6549 +   was 20; in the streaming case there is no window size (i.e. it is
6550 +   infinite). The test file was C-Kermit executable, transferred in binary
6551 +   mode. Conditions were relatively poor: the Sun and the local net
6552 +   heavily loaded; the HP system is old, slow, and memory-constrained.
6553 +
6554 +                   C-Kermit 6.0...    C-Kermit 7.0...
6555 + Local    Remote   ACK/NAK........    Streaming......
6556 + Client   Server   Send    Receive    Send    Receive
6557 +  Sun      HP       36       18        64       18
6558 +  HP       HP       25       15        37       16
6559 +  HP       Sun      77       83       118       92
6560 +  Sun      Sun      60       60       153      158
6561 +
6562 +   So whenever HP is the remote we have poor performance. Why?
6563 +
6564 +     * Changing file display to CRT has no effect (so it's not the curses
6565 +       library on the client side).
6566 +     * Changing TCP RECV-BUFFER or SEND-BUFFER has little effect.
6567 +     * Telling the client to make a binary-mode connection (SET TELNET
6568 +       BINARY REQUESTED, which successfully negotiates a binary
6569 +       connection) has no effect on throughput.
6570 +
6571 +   BUT... If I start HP-UX C-Kermit as a TCP service:
6572 +
6573 +  set host * 3000
6574 +  server
6575 +
6576 +   and then from the client "set host xxx 3000", I get:
6577 +
6578 +                   C-Kermit 6.0...    C-Kermit 7.0...
6579 + Local    Remote   ACK/NAK........    Streaming......
6580 + Client   Server   Send    Receive    Send    Receive
6581 +  Sun      HP       77       67       106      139
6582 +  HP       HP       50       50        64       62
6583 +  HP       Sun      57       85       155      105
6584 +  Sun      Sun      57       50       321      314
6585 +
6586 +   Therefore the HP-UX telnet server or pty driver seems to be adding more
6587 +   overhead than the SunOS one, and most others. When going through this
6588 +   type of connection (a remote telnet server) there is little Kermit can
6589 +   do improve matters, since the telnet server and pty driver are between
6590 +   the two Kermits, and neither Kermit program can have any influence over
6591 +   them (except putting the Telnet connection in binary mode, but that
6592 +   doesn't help).
6593 +
6594 +   (The numbers for the HP-HP transfers are lower than the others since
6595 +   both Kermit processes are running on the same slow 33MHz CPU.)
6596 +
6597 +   Matters seem to have deteriorated in HP-UX 11. Now file transfers over
6598 +   Telnet connections fail completely, rather than just being slow. In the
6599 +   following trial, a Telnet connection was made from Kermit 95 to HP-UX
6600 +   11.11 on an HP-9000/785/B2000 over local 10Mbps Ethernet running
6601 +   C-Kermit 8.00 in server mode (under the HP-UX Telnet server):
6602 +
6603 +                   Text........    Binary......
6604 +  Stream  Pktlen   GET     SEND    GET     SEND
6605 +    On     4000    Fail    Fail    Fail    Fail
6606 +    Off    4000    Fail    Fail    Fail    Fail
6607 +    Off    2000    OK      Fail    OK      Fail
6608 +    On     2000    OK      Fail    OK      Fail
6609 +    On     3000    Fail    Fail    Fail    Fail
6610 +    On     2500    Fail    Fail    Fail    Fail
6611 +    On     2047    OK      Fail    OK      Fail
6612 +    On     2045    OK      Fail    OK      Fail
6613 +    Off     500    OK      OK      OK      OK
6614 +    On      500    OK      Fail    OK      Fail
6615 +    On      240    OK      Fail    OK      Fail
6616 +
6617 +   As you can see, downloads are problematic unless the receiver's Kermit
6618 +   packet length is 2045 or less, but uploads work only with streaming
6619 +   disabled and the packet length restricted to 500. To force file
6620 +   transfers to work on this connection, the desktop Kermit must be told
6621 +   to:
6622 +
6623 +  set streaming off
6624 +  set receive packet-length 2000
6625 +  set send packet-length 500
6626 +
6627 +   However, if a connection is made between the same two programs on the
6628 +   same two computers over the same network, but this time a direct
6629 +   socket-to-socket connection bypassing the HP-UX Telnet server and pty
6630 +   driver (tell HP-UX C-Kermit to "set host /server * 3000 /raw"; tell
6631 +   desktop client program to "set host blah 3000 /raw"), everything works
6632 +   perfectly with the default Kermit settings (streaming, 4K packets,
6633 +   liberal control-character unprefixing, 8-bit transparency, etc):
6634 +
6635 +                   Text........    Binary......
6636 +  Stream  Pktlen   GET     SEND    GET     SEND
6637 +    On     4000    OK      OK      OK      OK
6638 +
6639 +   And in this case, transfer rates were approximately 900,000 cps. To
6640 +   verify that the behavior reported here is not caused by the new Kermit
6641 +   release, the same experiment was performed on a Telnet connection from
6642 +   the same PC over the same network to the old 715/33 running HP-UX 10.20
6643 +   and C-Kermit 8.00. Text and binary uploads and downloads worked
6644 +   perfectly (albeit slowly) with all the default settings -- streaming,
6645 +   4K packets, etc.
6646 +
6647 +3.2.3. Dialing Out and UUCP Lockfiles in HP-UX
6648 +
6649 +   [ [222]Top ] [ [223]Contents ] [ [224]Section Contents ] [ [225]Next ]
6650 +   [ [226]Previous ]
6651 +
6652 +   HP workstations do not come with dialout devices configured; you have
6653 +   to do it yourself (as root). First look in /dev to see what's there;
6654 +   for example in HP-UX 10.00 or later:
6655 +
6656 +  ls -l /dev/cua*
6657 +  ls -l /dev/tty*
6658 +
6659 +   If you find a tty0p0 device but no cua0p0, you'll need to creat one if
6660 +   you want to dial out; the tty0p0 does not work for dialing out. It's
6661 +   easy: start SAM; in the main Sam window, double-click on Peripheral
6662 +   Device, then in the Peripheral Devices window, double-click on
6663 +   Terminals and Modems. In the Terminals and Modems dialog, click on
6664 +   Actions, then choose "Add modem" and fill in the blanks. For example:
6665 +   Port number 0, speed 57600 (higher speeds tend not to work reliably),
6666 +   "Use device for calling out", do NOT "Receive incoming calls" (unless
6667 +   you know what you are doing), leave "CCITT modem" unchecked unless you
6668 +   really have one, and do select "Use hardware flow control (RTS/CTS)".
6669 +   Then click OK. This creates cua0p0 as well as cul0p0 and ttyd0p0
6670 +
6671 +   If the following sequence:
6672 +
6673 +  set line /dev/cua0p0 ; or other device
6674 +  set speed 115200     ; or other normal speed
6675 +
6676 +   produces the message "?Unsupported line speed". This means either that
6677 +   the port is not configured for dialout (go into SAM as described above
6678 +   and make sure "Use device for calling out" is selected), or else that
6679 +   speed you have given (such as 460800) is supported by the operating
6680 +   system but not by the physical device (in which case, use a lower speed
6681 +   like 57600).
6682 +
6683 +   In HP-UX 9.0, serial device names began to change. The older names
6684 +   looked like "/dev/cua00", "/dev/tty01", etc (sometimes with only one
6685 +   digit). The newer names have two digits with the letter "p" in between.
6686 +   HP-UX 8.xx and earlier have the older form, HP-UX 10.00 and later have
6687 +   the newer form. HP-UX 9.xx has the newer form on Series 800 machines,
6688 +   and the older form on other hardware models. The situation is
6689 +   summarized in the following table (the Convio 10.0 column applies to
6690 +   HP-UX 10 and 11).
6691 +
6692 +  Converged HP-UX Serial I/O Filenames : TTY Mux Naming
6693 +  ---------------------------------------------------------------------
6694 +  General meaning      Old Form     S800 9.0           Convio 10.0
6695 +  ---------------------------------------------------------------------
6696 +  tty* hardwired ports  tty<YY>     tty<X>p<Y>         tty<D>p<p>
6697 +                                    diag:mux<X>        diag:mux<D>
6698 +  ---------------------------------------------------------------------
6699 +  ttyd* dial-in modems  ttyd<YY>    ttyd<X>p<Y>        ttyd<D>p<p>
6700 +                                    diag:ttyd<X>p<Y>   diag:ttyd<D>p<p>
6701 +  ---------------------------------------------------------------------
6702 +  cua* auto-dial out    cua<YY>     cua<X>p<Y>         cua<D>p<p>
6703 +                                    diag:cua<X>p<Y>
6704 +  ---------------------------------------------------------------------
6705 +  cul* dial-out         cul<YY>     cul<X>p<Y>         cul<D>p<p>
6706 +                                    diag:cul<X>p<Y>
6707 +  ---------------------------------------------------------------------
6708 +   <X>= LU (Logical Unit)  <D>= Devspec (decimal card instance)
6709 +   <Y> or <YY> = Port      <p>= Port
6710 +
6711 +   For dialing out, you should use the cua or cul devices. When C-Kermit's
6712 +   CARRIER setting is AUTO or ON, C-Kermit should pop back to its prompt
6713 +   automatically if the carrier signal drops, e.g. when you log out from
6714 +   the remote computer or service. If you use the tty<D>p<d> (e.g. tty0p0)
6715 +   device, the carrier signal should be ignored. The tty<D>p<d> device
6716 +   should be used for direct connections where the carrier signal does not
6717 +   follow RS-232 conventions (use the cul device for hardwired connections
6718 +   through a true null modem). Do not use the ttyd<D>p<d> device for
6719 +   dialing out.
6720 +
6721 +   Kermit's access to serial devices is controlled by "UUCP lockfiles",
6722 +   which are intended to prevent different users using different software
6723 +   programs (Kermit, cu, etc, and UUCP itself) from accessing the same
6724 +   serial device at the same time. When a device is in use by a particular
6725 +   user, a file with a special name is created in:
6726 +
6727 +  /var/spool/locks  (HP-UX 10.00 and later)
6728 +  /usr/spool/uucp   (HP-UX 9.xx and earlier)
6729 +
6730 +   The file's name indicates the device that is in use, and its contents
6731 +   indicates the process ID (pid) of the process that is using the device.
6732 +   Since serial devices and the locks directory are not both publicly
6733 +   readable and writable, Kermit and other communication software must be
6734 +   installed setuid to the owner (bin) of the serial device and setgid to
6735 +   the group (daemon) of the /var/spool/locks directory. Kermit's setuid
6736 +   and setgid privileges are enabled only when opening the device and
6737 +   accessing the lockfiles.
6738 +
6739 +   Let's say "unit" means a string of decimal digits (the interface
6740 +   instance number) followed (in HP-UX 10.00 and later) by the letter "p"
6741 +   (lowercase), followed by another string of decimal digits (the port
6742 +   number on the interface), e.g.:
6743 +
6744 +  "0p0", "0p1", "1p0", etc       (HP-UX 10.00 and later)
6745 +  "0p0", "0p1", "1p0", etc       (HP-UX 9.xx on Series 800)
6746 +  "00",  "01",  "10",  "0", etc  (HP-UX 9.xx not on Series 800)
6747 +  "00",  "01",  "10",  "0", etc  (HP-UX 8.xx and earlier)
6748 +
6749 +   Then a normal serial device (driver) name consists of a prefix ("tty",
6750 +   "ttyd", "cua", "cul", or possibly "cuad" or "culd") followed by a unit,
6751 +   e.g. "cua0p0". Kermit's treatment of UUCP lockfiles is as close as
6752 +   possible to that of the HP-UX "cu" program. Here is a table of the
6753 +   lockfiles that Kermit creates for unit 0p0:
6754 +
6755 +  Selection      Lockfile 1     Lockfile 2
6756 +  /dev/tty0p0    LCK..tty0p0    (none)
6757 +* /dev/ttyd0p0   LCK..ttyd0p0   (none)
6758 +  /dev/cua0p0    LCK..cua0p0    LCK..ttyd0p0
6759 +  /dev/cul0p0    LCK..cul0p0    LCK..ttyd0p0
6760 +  /dev/cuad0p0   LCK..cuad0p0   LCK..ttyd0p0
6761 +  /dev/culd0p0   LCK..culd0p0   LCK..ttyd0p0
6762 +  <other>        LCK..<other>   (none)
6763 +
6764 +   (* = Dialin device, should not be used.)
6765 +
6766 +   In other words, if the device name begins with "cu", a second lockfile
6767 +   for the "ttyd" device, same unit, is created, which should prevent
6768 +   dialin access on that device.
6769 +
6770 +   The <other> case allows for symbolic links, etc, but of course it is
6771 +   not foolproof since we have no way of telling which device is really
6772 +   being used.
6773 +
6774 +   When C-Kermit tries to open a dialout device whose name ends with a
6775 +   "unit", it searches the lockfile directory for all possible names for
6776 +   the same unit. For example, if user selects /dev/cul2p3, Kermit looks
6777 +   for lockfiles named:
6778 +
6779 +  LCK..tty2p3
6780 +  LCK..ttyd2p3
6781 +  LCK..cua2p3
6782 +  LCK..cul2p3
6783 +  LCK..cuad2p3
6784 +  LCK..culd2p3
6785 +
6786 +   If any of these files are found, Kermit opens them to find out the ID
6787 +   (pid) of the process that created them; if the pid is still valid, the
6788 +   process is still active, and so the SET LINE command fails and the user
6789 +   is informed of the pid so s/he can use "ps" to find out who is using
6790 +   the device.
6791 +
6792 +   If the pid is not valid, the file is deleted. If all such files (i.e.
6793 +   with same "unit" designation) are successfully removed, then the SET
6794 +   LINE command succeeds; up to six messages are printed telling the user
6795 +   which "stale lockfiles" are being removed.
6796 +
6797 +   When the "set line" command succeeds in HP-UX 10.00 and later, C-Kermit
6798 +   also creates a Unix System V R4 "advisory lock" as a further precaution
6799 +   (but not guarantee) against any other process obtaining access to the
6800 +   device while you are using it.
6801 +
6802 +   If the selected device was in use by "cu", Kermit can't open it,
6803 +   because "cu" has changed its ownership, so we never get as far as
6804 +   looking at the lockfiles. In the normal case, we can't even look at the
6805 +   device to see who the owner is because it is visible only to its
6806 +   (present) owner. In this case, Kermit says (for example):
6807 +
6808 +  /dev/cua0p0: Permission denied
6809 +
6810 +   When Kermit releases a device it has successfully opened, it removes
6811 +   all the lockfiles that it created. This also happens whenever Kermit
6812 +   exits "under its own power".
6813 +
6814 +   If Kermit is killed with a device open, the lockfile(s) are left
6815 +   behind. The next Kermit program that tries to assign the device, under
6816 +   any of its various names, will automatically clean up the stale
6817 +   lockfiles because the pids they contain are invalid. The behavior of cu
6818 +   and other communication programs under these conditions should be the
6819 +   same.
6820 +
6821 +   Here, by the way, is a summary of the differences between the HP-UX
6822 +   port driver types from John Pezzano of HP:
6823 +
6824 +     There are three types of device files for each port.
6825 +
6826 +     The ttydXXX device file is designed to work as follows:
6827 +
6828 +    1. The process that opens it does NOT get control of the port until CD
6829 +       is asserted. This was intentional (over 15 years ago) to allow
6830 +       getty to open the port but not control it until someone called in.
6831 +       If a process wants to use the direct or callout device files
6832 +       (ttyXXX and culXXX respectively), they will then get control and
6833 +       getty would be blocked. This eliminated the need to use uugetty
6834 +       (and its inherent problems with lock files) for modems. You can see
6835 +       this demonstrated by the fact that "ps -ef" shows a ? in the tty
6836 +       column for the getty process as getty does not have the port yet.
6837 +    2. Once CD is asserted, the port is controlled by getty (or the
6838 +       process handling an incoming call) if there was no process using
6839 +       the port. The ? in the "ps" command now shows the port. At this
6840 +       point, the port accepts data.
6841 +
6842 +     Therefore you should use either the callout culXXX device file
6843 +     (immediate control but no data until CD is asserted) or the direct
6844 +     device file ttyXXX which gives immediate control and immediate data
6845 +     and which ignores by default modem control signals.
6846 +
6847 +     The ttydXXX device should be used only for callin and my
6848 +     recommendation is to use it only for getty and uugetty.
6849 +
6850 +3.2.4 Notes on Specific HP-UX Releases
6851 +
6852 +   SECTION CONTENTS
6853 +
6854 +  3.2.4.1. [227]HP-UX 11
6855 +  3.2.4.2. [228]HP-UX 10
6856 +  3.2.4.3. [229]HP-UX 9
6857 +  3.2.4.4. [230]HP-UX 8
6858 +  3.2.4.5. [231]HP-UX 7 and Earlier
6859 +
6860 +3.2.4.1. HP-UX 11
6861 +
6862 +   [ [232]Top ] [ [233]Contents ] [ [234]Section Contents ] [ [235]Next ]
6863 +
6864 +   As noted in [236]Section 3.2.2, the HP-UX 11 Telnet server and/or
6865 +   pseudoterminal driver are a serious impediment to file transfer over
6866 +   Telnet connections into HP-UX. If you have a Telnet connection into
6867 +   HP-UX 11, tell your desktop Kermit program to:
6868 +
6869 +  set streaming off
6870 +  set receive packet-length 2000
6871 +  set send packet-length 500
6872 +
6873 +   File transfer speeds over connections from HP-UX 11 (dialed or Telnet)
6874 +   are not impeded whatsoever, and can go at whatever speed is allowed by
6875 +   the connection and the Kermit partner on the far end.
6876 +
6877 +   PA-RISC binaries for HP-UX 10.20 or later should run on any PA-RISC
6878 +   system, S700 or S800, as long as the binary was not built under a later
6879 +   HP-UX version than the host operating system. HP-UX 11.00 and 11.11 are
6880 +   only for PA-RISC systems. HP-UX 11.20 is only for IA64 (subsequent
6881 +   HP-UX releases will be for both PA-RISC and IA64). To check binary
6882 +   compatibility, the following C-Kermit 8.0 binaries were run
6883 +   successfully on an HP-9000/785 with HP-UX 11.11:
6884 +
6885 +     * Model 7xx HP-UX 10.20
6886 +     * Model 8xx HP-UX 10.20
6887 +     * Model 7xx HP-UX 11.00
6888 +     * Model 8xx HP-UX 11.00
6889 +     * Model 7xx HP-UX 11.11
6890 +     * Model 8xx HP-UX 11.11
6891 +
6892 +   Binaries built under some of the earlier HP-UX releases, such as 9.05,
6893 +   might also work, but only if built for the same hardware family (e.g.
6894 +   s700).
6895 +
6896 +3.2.4.2. HP-UX 10
6897 +
6898 +   [ [237]Top ] [ [238]Contents ] [ [239]Section Contents ] [ [240]Next ]
6899 +   [ [241]Previous ]
6900 +
6901 +   Beginning in HP-UX 10.10, libcurses is linked to libxcurses, the new
6902 +   UNIX95 (X/Open) version of curses, which has some serious bugs; some
6903 +   routines, when called, would hang and never return, some would dump
6904 +   core. Evidently libxcurses contains a select() routine, and whenever
6905 +   C-Kermit calls what it thinks is the regular (sockets) select(), it
6906 +   gets the curses one, causing a segmentation fault. There is a patch for
6907 +   this from HP, PHCO_8086, "s700_800 10.10 libcurses patch", "shared lib
6908 +   curses program hangs on 10.10", "10.10 enhanced X/Open curses core
6909 +   dumps due to using wrong select call", 96/08/02 (you can tell if the
6910 +   patch is installed with "what /usr/lib/libxcurses.1"; the unpatched
6911 +   version is 76.20, the patched one is 76.20.1.2). It has been verified
6912 +   that C-Kermit works OK with the patched library, but results are not
6913 +   definite for HP-UX 10.20 or higher.
6914 +
6915 +   To ensure that C-Kermit works even on non-patched HP-UX 10.10 systems,
6916 +   separate makefile entries are provided for HP-UX 10.00/10.01, 10.10,
6917 +   10.20, etc, in which the entries for 10.10 and above link with
6918 +   libHcurses, which is "HP curses", the one that was used in 10.00/10.01.
6919 +   HP-UX 11.20 and later, however, link with libcurses, as libHcurses
6920 +   disappeared in 11.20.
6921 +
6922 +3.2.4.3. HP-UX 9
6923 +
6924 +   [ [242]Top ] [ [243]Contents ] [ [244]Section Contents ] [ [245]Next ]
6925 +   [ [246]Previous ]
6926 +
6927 +   HP-UX 9.00 and 9.01 need patch PHNE_10572 (note: this replaces
6928 +   PHNE_3641) for hptt0.o, asio0.o, and ttycomn.o in libhp-ux.a. Contact
6929 +   Hewlett Packard if you need this patch. Without it, the dialout device
6930 +   (tty) will be hung after first use; subsequent attempts to use will
6931 +   return an error like "device busy". (There are also equivalent patches
6932 +   for s700 9.03 9.05 9.07 (PHNE_10573) and s800 9.00 9.04 (PHNE_10416).
6933 +
6934 +   When C-Kermit is in server mode, it might have trouble executing REMOTE
6935 +   HOST commands. This problem happens under HP-UX 9.00 (Motorola) and
6936 +   HP-UX 9.01 (RISC) IF the C-Shell is the login shell AND with the
6937 +   C-Shell Revision 70.15. Best thing is to install HP's Patch PHCO_4919
6938 +   for Series 300/400 and PHCO_5015 for the Series 700/800. PHCO_5015 is
6939 +   called "s700_800 9.X cumulative csh(1) patch with memory leak fix"
6940 +   which works for HP-UX 9.00, 9.01, 9.03, 9.04, 9.05 and 9.07. At least
6941 +   you need C-Shell Revision 72.12!
6942 +
6943 +   C-Kermit works fine -- including its curses-based file-transfer display
6944 +   -- on the console terminal, in a remote session (e.g. when logged in to
6945 +   the HP 9000 on a terminal port or when telnetted or rlogin'd), and in
6946 +   an HP-VUE hpterm window or an xterm window.
6947 +
6948 +3.2.4.4. HP-UX 8
6949 +
6950 +   [ [247]Top ] [ [248]Contents ] [ [249]Section Contents ] [ [250]Next ]
6951 +   [ [251]Previous ]
6952 +
6953 +   To make C-Kermit work on HP-UX 8.05 on a model 720, obtain and install
6954 +   HP-UX patch PHNE_0899. This patch deals with a lot of driver issues,
6955 +   particularly related to communication at higher speeds.
6956 +
6957 +   One user reports:
6958 +
6959 +     On HP-UX 8 DON'T install 'tty patch' PHKL_4656, install PHKL_3047
6960 +     instead! Yesterday I tried this latest tty patch PHKL_4656 and had
6961 +     terrible problems. This patch should fix RTS/CTS problems. With text
6962 +     transver all looks nice. But when I switched over to binary files
6963 +     the serial interface returned only rubish to C-Kermit. All sorts of
6964 +     protocol, CRC and packed errors I had. After several tests and after
6965 +     uninstalling that patch, all transvers worked fine. MB's of data
6966 +     without any errors. So keep your fingers away from that patch. If
6967 +     anybody needs the PHKL_3047 patch I have it here. It is no longer
6968 +     availabel from HP's patch base.
6969 +
6970 +3.2.4.5. HP-UX 7 and Earlier
6971 +
6972 +   [ [252]Top ] [ [253]Contents ] [ [254]Section Contents ] [
6973 +   [255]Previous ]
6974 +
6975 +   When transferring files into HP-UX 5 or 6 over a Telnet connection, you
6976 +   must not use streaming, and you must not use a packet length greater
6977 +   than 512. However, you can use streaming and longer packets when
6978 +   sending files from HP-UX on a Telnet connection. In C-Kermit 8.0, the
6979 +   default receive packet length for HP-UX 5 and 6 was changed to 500 (but
6980 +   you can still increase it with SET RECEIVE PACKET-LENGTH if you wish,
6981 +   e.g. for non-Telnet connections). Disable streaming with SET STREAMING
6982 +   OFF.
6983 +
6984 +   The HP-UX 5.00 version of C-Kermit does not include the fullscreen
6985 +   file-transfer because of problems with the curses library.
6986 +
6987 +   If HP-UX 5.21 with Wollongong TCP/IP is on the remote end of a Telnet
6988 +   connection, streaming transfers to HP-UX invariably fail. Workaround:
6989 +   SET STREAMING OFF. Packets longer than about 1000 should not be used.
6990 +   Transfers from these systems, however, can use streaming and/or longer
6991 +   packets.
6992 +
6993 +   Reportedly, "[there is] a bug in C-Kermit using HP-UX version 5.21 on
6994 +   the HP-9000 series 500 computers. It only occurs when the controlling
6995 +   terminal is using an HP-27140 six-port modem mux. The problem is not
6996 +   present if the controlling terminal is logged into an HP-27130
6997 +   eight-port mux. The symptom is that just after dialing successfully and
6998 +   connecting Kermit locks up and the port is unusable until both forks of
6999 +   Kermit and the login shell are killed." (This report predates C-Kermit
7000 +   6.0 and might no longer apply.)
7001 +
7002 +3.2.5. HP-UX and X.25
7003 +
7004 +   [ [256]Top ] [ [257]Contents ] [ [258]Section Contents ] [
7005 +   [259]Previous ]
7006 +
7007 +   Although C-Kermit presently does not include built-in support for HP-UX
7008 +   X.25 (as it does for the Sun and IBM X.25 products), it can still be
7009 +   used to make X.25 connections as follows: start Kermit and then telnet
7010 +   to localhost. After logging back in, start padem as you would normally
7011 +   do to connect over X.25. Padem acts as a pipe between Kermit and X.25.
7012 +   In C-Kermit 7.0, you might also be able to avoid the "telnet localhost"
7013 +   step by using:
7014 +
7015 +  C-Kermit> pty padem address
7016 +
7017 +   This works if padem uses standard i/o (who knows?).
7018 +
7019 +3.3. C-KERMIT AND LINUX
7020 +
7021 +   [ [260]Top ] [ [261]Contents ] [ [262]Section Contents ] [ [263]Next ]
7022 +   [ [264]Previous ]
7023 +
7024 +   SECTION CONTENTS
7025 +
7026 +  3.3.1. [265]Problems Building C-Kermit for Linux
7027 +  3.3.2. [266]Problems with Serial Devices in Linux
7028 +  3.3.3. [267]Terminal Emulation in Linux
7029 +  3.3.4. [268]Dates and Times
7030 +  3.3.5. [269]Startup Errors
7031 +  3.3.6. [270]The Fullscreen File Transfer Display
7032 +
7033 +     (August 2010) Reportedly C-Kermit packages for certain Linux
7034 +     distributions such as Centos and Ubuntu have certain features
7035 +     disabled, for example the SSH command, SET HOST PTY /SSH, and
7036 +     perhaps anything else to do with SSH and/or pseudoterminals and who
7037 +     knows what else. If you download the regular package ("tarball")
7038 +     from the Kermit Project and build from it ("make linux"), everything
7039 +     is fine.
7040 +
7041 +     C-Kermit in Ubuntu 10.04 and 9.10 was reported slow to start because
7042 +     it was trying to resolve the IP address 255.255.255.255. Later, also
7043 +     in recent Debian versions. The following is seen in the strace:
7044 +
7045 +write(3, "RESOLVE-ADDRESS 255.255.255.255\n", 32)
7046 +
7047 +     This is not Kermit Project code. Turns out to be something in
7048 +     glibc's resolver, and can be fixed by changing /etc/nsswitch.conf,
7049 +     but it might break other software, such as [271]Avahi or anything
7050 +     (such as Gnome, Java, or Cups) that depends on it. I'm not sure
7051 +     where it happens; I don't think Kermit tries to get its IP address
7052 +     at startup time, only when it's needed or asked for, e.g. when
7053 +     making a connection or evaluating \v(ipaddress).
7054 +
7055 +   REFERENCES
7056 +
7057 +   For further information, read the [272]comp.os.linux.misc,
7058 +   [273]comp.os.linux.answers, and other Linux-oriented newsgroups, and
7059 +   see:
7060 +
7061 +   The Linux Document Project (LDP)
7062 +          [274]http://www.tldp.org/
7063 +
7064 +   The Linux FAQ
7065 +          [275]http://www.tldp.org/FAQ/Linux-FAQ.html
7066 +
7067 +   The Linux HOWTOs (especially the Serial HOWTO)
7068 +
7069 +     [276]http://www.tldp.org/HOWTO/Serial-HOWTO.html
7070 +
7071 +     [277]http://tldp.org/HOWTO/Modem-HOWTO.html
7072 +
7073 +     [278]ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO
7074 +
7075 +     [279]ftp://tsx-11.mit.edu/pub/linux/docs/HOWTO
7076 +
7077 +     [280]http://www.tldp.org/HOWTO/
7078 +
7079 +     [281]http://www.tldp.org/hmirrors.html
7080 +
7081 +   Linux Vendor Tech Support Pages:
7082 +
7083 +     [282]http://www.redhat.com/apps/support/
7084 +
7085 +     [283]http://www.debian.org/support
7086 +
7087 +     [284]http://www.slackware.com/support/
7088 +
7089 +     [285]http://www.caldera.com/support/
7090 +
7091 +     [286]SUSE Linux Support
7092 +
7093 +     [287]http://www.mandrake.com/support/
7094 +
7095 +     [288]http://www.turbolinux.com/support/
7096 +
7097 +   Linux Winmodem Support
7098 +          [289]http://www.linmodems.org/
7099 +
7100 +   Also see general comments on PC-based Unixes in [290]Section 3.0.
7101 +
7102 +   What Linux version is it? -- "uname -a" supplies only kernel
7103 +   information, but these days it's the distribution that matters: Red Hat
7104 +   7.3, Debian 2.2, Slackware 8.0, etc. Unfortunately there's no
7105 +   consistent way to get the distribution version. Usually it's in a
7106 +   distribution-specific file:
7107 +
7108 +     Red Hat:   /etc/issue or /etc/redhat-release
7109 +     Debian:    /etc/debian_version
7110 +     Slackware: /etc/slackware-version (at least in later versions)
7111 +
7112 +   Did you know: DECnet is available for Linux? See:
7113 +
7114 +  [291]http://linux.dreamtime.org/decnet/
7115 +
7116 +   (But there is no support for it in C-Kermit -- anybody interested in
7117 +   adding it, please [292]let me know).
7118 +
7119 +   Before proceeding, let's handle the some of the most frequently asked
7120 +   question in the Linux newsgroups:
7121 +
7122 +    1. Neither C-Kermit nor any other Linux application can use Winmodems,
7123 +       except in the [293]rare cases where Linux drivers have been written
7124 +       for them. See [294]Section 3.0.2 for details.
7125 +    2. "Why does it take such a long time to make a telnet connection to
7126 +       (or from) my Linux PC?" (this applies to C-Kermit and to regular
7127 +       Telnet). Most telnet servers these days perform reverse DNS lookups
7128 +       on the client (for security and/or logging reasons). If the Telnet
7129 +       client's address cannot be found by the server's local DNS server,
7130 +       the DNS request goes out to the Internet at large, and this can
7131 +       take quite some time. The solution to this problem is to make sure
7132 +       that both client and host are registered in DNS, and that the
7133 +       registrations are exported. C-Kermit itself performs reverse DNS
7134 +       lookups unless you tell it not to; this is to allow C-Kermit to let
7135 +       you know which host it is actually connected to in case you have
7136 +       made a connection to a host pool (multihomed host). You can disable
7137 +       C-Kermit's reverse DNS lookup with SET TCP REVERSE-DNS-LOOKUP OFF.
7138 +    3. (Any question that has the word "Telnet" in it...) The knee-jerk
7139 +       reaction is "don't use Telnet, use SSH!" There's nothing wrong with
7140 +       Telnet. In fact it's far superior to SSH as a protocol in terms of
7141 +       features and extensibility, not to mention platform neutrality. The
7142 +       issue lurking behind the knee-jerk reaction is security. SSH is
7143 +       thought to be secure, whereas Telnet is thought to be insecure.
7144 +       This is true for clear-text Telnet (because passwords travel in the
7145 +       clear across the network), but apparently few people realize that
7146 +       [295]secure Telnet clients and servers have been available for
7147 +       years, and these are more secure than SSH (for reasons explained
7148 +       [296]HERE).
7149 +    4. (Any question that has the word "FTP" in it...) The knee-jerk
7150 +       reaction being "Don't use FTP, use SCP!" (or SFTP). Same answer as
7151 +       above, but moreso. SCP and SFTP are not only not platform neutral,
7152 +       they're diversity-hostile. They transfer files only in binary mode,
7153 +       which mangles text files across different platforms, to the same
7154 +       degree the platform's text-file record format and character set
7155 +       differ. An extreme example would be an Variable-Block format EBCDIC
7156 +       text file on an IBM mainframe, binary transfer of which to Unix
7157 +       would do you little good indeed. FTP was designed with diversity in
7158 +       mind and secure versions are available.
7159 +
7160 +3.3.1. Problems Building C-Kermit for Linux
7161 +
7162 +   [ [297]Top ] [ [298]Contents ] [ [299]Section Contents ] [ [300]Next ]
7163 +
7164 +   Modern Linux distributions like Red Hat give you a choice at
7165 +   installation whether to include "developer tools". Obviously, you can't
7166 +   build C-Kermit or any other C program from source code if you have not
7167 +   installed the developer tools. But to confuse matters, you might also
7168 +   have to choose (separately) to install the "curses" or "ncurses"
7169 +   terminal control library; thus it is possible to install the C compiler
7170 +   and linker, but omit the (n)curses library and headers. If curses is
7171 +   not installed, you will not be able to build a version of C-Kermit that
7172 +   supports the fullscreen file-transfer display, in which case you'll
7173 +   need to use the "linuxnc" makefile target (nc = No Curses) or else
7174 +   install ncurses before building.
7175 +
7176 +   There are all sorts of confusing issues caused by the many and varied
7177 +   Linux distributions. Some of the worst involve the curses library and
7178 +   header files: where are they, what are they called, which ones are they
7179 +   really? Other vexing questions involve libc5 vs libc6 vs glibc vs
7180 +   glibc2 (C libraries), gcc vs egcs vs lcc (compilers), plus using or
7181 +   avoiding features that were added in a certain version of Linux or a
7182 +   library or a distribution, and are not available in others. As of
7183 +   C-Kermit 8.0, these questions should be resolved by the "linux"
7184 +   makefile target itself, which does a bit of looking around to see
7185 +   what's what, and then sets the appropriate CFLAGS.
7186 +
7187 +3.3.2. Problems with Serial Devices in Linux
7188 +
7189 +   [ [301]Top ] [ [302]Contents ] [ [303]Section Contents ] [ [304]Next ]
7190 +   [ [305]Previous ]
7191 +
7192 +     Also see: "man setserial", "man irqtune".
7193 +     And: [306]Sections 3.0, [307]6, [308]7, and [309]8 of this document.
7194 +
7195 +     NOTE: Red Hat Linux 7.2 and later include a new API that allows
7196 +     serial-port arbitration by non-setuid/gid programs. This API has not
7197 +     yet been added to C-Kermit. If C-Kermit is to be used for dialing
7198 +     out on Red Hat 7.2 or later, it must still be installed as described
7199 +     in in Sections [310]10 and [311]11 of the [312]Installation
7200 +     Instructions.
7201 +
7202 +   Don't expect it to be easy. Queries like the following are posted to
7203 +   the Linux newsgroups almost daily:
7204 +
7205 +     Problem of a major kind with my Compaq Presario 1805 in the sense
7206 +     that the pnpdump doesn't find the modem and the configuration tells
7207 +     me that the modem is busy when I set everything by hand!
7208 +
7209 +     I have <some recent SuSE distribution>, kernel 2.0.35. Using the
7210 +     Compaq tells me that the modem (which is internal) is on COM2, with
7211 +     the usual IRQ and port numbers. Running various Windows diagnostics
7212 +     show me AT-style commands exchanged so I have no reason to beleive
7213 +     that it is a Winmodem. Also, the diagnostics under Win98 tell me
7214 +     that I am talking to an NS 16550AN.
7215 +
7216 +   [Editor's note: This does not necessarily mean it isn't a Winmodem.]
7217 +
7218 +     Under Linux, no joy trying to talk to the modem on /dev/cua1 whether
7219 +     via minicom, kppp, or chat; kppp at least tells me that tcgetattr()
7220 +     failed.
7221 +
7222 +     Usage of setserial:
7223 +
7224 +  setserial /dev/cua1 port 0x2F8 irq 3 autoconfig
7225 +  setserial -g /dev/cua1
7226 +
7227 +     tells me that the uart is 'unknown'. I have tried setting the UART
7228 +     manullay via. setserial to 16550A, 16550, and the other one (8550?)
7229 +     (I didn't try 16540). None of these manual settings resulted in any
7230 +     success.
7231 +
7232 +     A look at past articles leads me to investigate PNP issues by
7233 +     calling pnpdump but pnpdump returns "no boards found". I have looked
7234 +     around on my BIOS (Phoenix) and there is not much evidence of it
7235 +     being PNP aware. However for what it calls "Serial port A", it
7236 +     offers a choice of Auto, Disabled or Manual settings (currently set
7237 +     to Auto), but using the BIOS interface I tried to change to 'manual'
7238 +     and saw the default settings offered to be were 0x3F8 and IRQ 4
7239 +     (COM1). The BIOS menus did not give me any chance to configure COM2
7240 +     or any "modem". I ended up not saving any BIOS changes in the course
7241 +     of my investigations.
7242 +
7243 +   You can also find out a fair amount about your PC's hardware
7244 +   configuration in the text files in /proc, e.g.:
7245 +
7246 +  -r--r--r--    1 root            0 Sep  4 14:00 /proc/devices
7247 +  -r--r--r--    1 root            0 Sep  4 14:00 /proc/interrupts
7248 +  -r--r--r--    1 root            0 Sep  4 14:00 /proc/ioports
7249 +  -r--r--r--    1 root            0 Sep  4 14:00 /proc/pci
7250 +
7251 +   From the directory listing they look like empty files, but in fact they
7252 +   are text files that you "cat":
7253 +
7254 +$ cat /proc/pci
7255 +   Bus  0, device  14, function  0:
7256 +     Serial controller: US Robotics/3Com 56K FaxModem Model 5610 (rev 1).
7257 +       IRQ 10.
7258 +       I/O at 0x1050 [0x1057].
7259 +
7260 +$ setserial -g /dev/ttyS4
7261 +/dev/ttyS4, UART: 16550A, Port: 0x1050, IRQ: 10
7262 +
7263 +$ cat /proc/ioports
7264 +1050-1057 : US Robotics/3Com 56K FaxModem Model 5610
7265 +   1050-1057 : serial(auto)
7266 +
7267 +$ cat /proc/interrupts
7268 +            CPU0
7269 +   0:    7037515          XT-PIC  timer
7270 +   1:          2          XT-PIC  keyboard
7271 +   2:          0          XT-PIC  cascade
7272 +   4:          0          XT-PIC  serial
7273 +   8:          1          XT-PIC  rtc
7274 +   9:     209811          XT-PIC  usb-uhci, eth0
7275 +  14:     282015          XT-PIC  ide0
7276 +  15:          6          XT-PIC  ide1
7277 +
7278 +   Watch out for PCI, PCMCIA and Plug-n-Play devices, Winmodems, and the
7279 +   like (see cautions in [313]Section 3.0 Linux supports Plug-n-Play
7280 +   devices to some degree via the isapnp and pnpdump programs; read the
7281 +   man pages for them. (If you don't have them, look on your installation
7282 +   CD for isapnptool or download it from sunsite or a sunsite mirror or
7283 +   other politically correct location du jour).
7284 +
7285 +   PCI modems do not use standard COM port addresses. The I/O address and
7286 +   IRQ are assigned by the BIOS. All you need to do to get one working,
7287 +   find out the I/O address and interrupt number with (as root) "lspci -v
7288 +   | more" and then give the resulting address and interrupt number to
7289 +   setserial.
7290 +
7291 +   Even when you have a real serial port, always be wary of interrupt
7292 +   conflicts and similar PC hardware configuration issues: a PC is not a
7293 +   real computer like other Unix workstations -- it is generally pieced
7294 +   together from whatever random components were the best bargain on the
7295 +   commodity market the week it was built. Once it's assembled and boxed,
7296 +   not even the manufacturer will remember what it's made of or how it was
7297 +   put together because they've moved on to a new model. Their job is to
7298 +   get it (barely) working with Windows; for Linux and other OS's you are
7299 +   on your own.
7300 +
7301 +   "set line /dev/modem" or "set line /dev/ttyS2", etc, results in an
7302 +   error, "/dev/modem is not a tty". Cause unknown, but obviously a driver
7303 +   issue, not a Kermit one (Kermit uses "isatty()" to check that the
7304 +   device is a tty, so it knows it will be able to issue all the
7305 +   tty-related ioctl's on it, like setting the speed & flow control). Try
7306 +   a different name (i.e. driver) for the same port, e.g. "set line
7307 +   /dev/cua2" or whatever.
7308 +
7309 +   To find what serial ports were registered at the most recent system
7310 +   boot, type (as root): "grep tty /var/log/dmesg".
7311 +
7312 +   "set modem type xxx" (where xxx is the name of a modem) followed by
7313 +   "set line /dev/modem" or "set
7314 +   line /dev/ttyS2", etc, hangs (but can be interrupted with Ctrl-C).
7315 +   Experimentation shows that if the modem is configured to always assert
7316 +   carrier (&C0) the same command does not hang. Again, a driver issue.
7317 +   Use /dev/cua2 (or whatever) instead. (Or not -- hopefully none of these
7318 +   symptoms occurs in C-Kermit 7.0 or later.)
7319 +
7320 +   "set line /dev/cua0" reports "Device is busy", but "set line
7321 +   /dev/ttyS0" works OK.
7322 +
7323 +   In short: If the cua device doesn't work, try the corresponding ttyS
7324 +   device. If the ttyS device doesn't work, try the corresponding cua
7325 +   device -- but note that Linux developers do not recommend this, and are
7326 +   phasing out the cua devices. From /usr/doc/faq/howto/Serial-HOWTO:
7327 +
7328 +   12.4. What's The Real Difference Between the /dev/cuaN And /dev/ttySN
7329 +          Devices?
7330 +          The only difference is the way that the devices are opened. The
7331 +          dialin devices /dev/ttySN are opened in blocking mode, until CD
7332 +          is asserted (ie someone connects). So, when someone wants to use
7333 +          the /dev/cuaN device, there is no conflict with a program
7334 +          watching the /dev/ttySN device (unless someone is connected of
7335 +          course). The multiple /dev entries, allow operation of the same
7336 +          physical device with different operating characteristics. It
7337 +          also allows standard getty programs to coexist with any other
7338 +          serial program, without the getty being retrofitted with locking
7339 +          of some sort. It's especially useful since standard Unix kernel
7340 +          file locking, and UUCP locking are both advisory and not
7341 +          mandatory.
7342 +
7343 +   It was discovered during development of C-Kermit 7.0 that rebuilding
7344 +   C-Kermit with -DNOCOTFMC (No Close/Open To Force Mode Change) made the
7345 +   aforementioned problem with /dev/ttyS0 go away. It is not yet clear,
7346 +   however, what its affect might be on the /dev/cua* devices. As of 19
7347 +   March 1998, this option has been added to the CFLAGS in the makefile
7348 +   entries for Linux ("make linux").
7349 +
7350 +   Note that the cua device is now "deprecated", and new editions of Linux
7351 +   will phase (have phased) it out in favor of the ttyS device. See (if
7352 +   it's still there):
7353 +
7354 +  [314]http://linuxwww.db.erau.edu/mail_archives/linux-kernel/Mar_98/1441.html
7355 +
7356 +   (no, of course it isn't; you'll have to use your imagination). One user
7357 +   reported that C-Kermit 7.0, when built with egcs 1.1.2 and run on Linux
7358 +   2.2.6 with glibc 2.1 (hardware unknown but probably a PC) dumps core
7359 +   when given a "set line /dev/ttyS1" command. When rebuilt with gcc, it
7360 +   works fine.
7361 +
7362 +   All versions of Linux seem to have the following deficiency: When a
7363 +   modem call is hung up and CD drops, Kermit can no longer read the modem
7364 +   signals; SHOW COMMUNICATIONS says "Modem signals not available". The
7365 +   TIOCMGET ioctl() returns -1 with errno 5 ("I/O Error").
7366 +
7367 +   The Linux version of POSIX tcsendbreak(), which is used by C-Kermit to
7368 +   send regular (275msec) and long (1.5sec) BREAK signals, appears to
7369 +   ignore its argument (despite its description in the man page and info
7370 +   topic), and always sends a regular 275msec BREAK. This has been
7371 +   observed in Linux versions ranging from Debian 2.1 to Red Hat 7.1.
7372 +
7373 +3.3.3. Terminal Emulation in Linux
7374 +
7375 +   [ [315]Top ] [ [316]Contents ] [ [317]Section Contents ] [ [318]Next ]
7376 +   [ [319]Previous ]
7377 +
7378 +   C-Kermit is not a terminal emulator. For a brief explanation of why
7379 +   not, see [320]Section 3.0.5. For a fuller explanation, [321]ClICK HERE.
7380 +
7381 +   In Unix, terminal emulation is supplied by the Window in which you run
7382 +   Kermit: the regular console screen, which provides Linux Console
7383 +   "emulation" via the "console" termcap entry, or under X-Windows in an
7384 +   xterm window, which gives VTxxx emulation. An xterm that includes color
7385 +   ANSI and VT220 emulation is available with Xfree86:
7386 +
7387 +  [322]http://dickey.his.com/xterm/xterm.html
7388 +
7389 +   Before starting C-Kermit in an xterm window, you might need to tell the
7390 +   xterm window's shell to "stty sane".
7391 +
7392 +   To set up your PC console keyboard to send VT220 key sequences when
7393 +   using C-Kermit as your communications program in an X terminal window
7394 +   (if it doesn't already), create a file somewhere (e.g. in /root/)
7395 +   called .xmodmaprc, containing something like the following:
7396 +
7397 +  keycode 77  = KP_F1       ! Num Lock     => DEC Gold (PF1)
7398 +  keycode 112 = KP_F2       ! Keypad /     => DEC PF1
7399 +  keycode 63  = KP_F3       ! Keypad *     => DEC PF3
7400 +  keycode 82  = KP_F4       ! Keypad -     => DEC PF4
7401 +  keycode 111 = Help        ! Print Screen => DEC Help
7402 +  keycode 78  = F16         ! Scroll Lock  => DEC Do
7403 +  keycode 110 = F16         ! Pause        => DEC Do
7404 +  keycode 106 = Find        ! Insert       => DEC Find
7405 +  keycode 97  = Insert      ! Home         => DEC Insert
7406 +  keycode 99  = 0x1000ff00  ! Page Up      => DEC Remove
7407 +  keycode 107 = Select      ! Delete       => DEC Select
7408 +  keycode 103 = Page_Up     ! End          => DEC Prev Screen
7409 +  keycode 22  = Delete      ! Backspace sends Delete (127)
7410 +
7411 +   Then put "xmodmap filename" in your .xinitrc file (in your login
7412 +   directory), e.g.
7413 +
7414 +  xmodmap /root/.xmodmaprc
7415 +
7416 +   Of course you can move things around. Use the xev program to find out
7417 +   key codes.
7418 +
7419 +   Console-mode keys are mapped separately using loadkeys, and different
7420 +   keycodes are used. Find out what they are with showkey.
7421 +
7422 +   For a much more complete VT220/320 key mapping for [323]Xfree86 xterm,
7423 +   [324]CLICK HERE.
7424 +
7425 +3.3.4. Dates and Times
7426 +
7427 +   [ [325]Top ] [ [326]Contents ] [ [327]Section Contents ] [ [328]Next ]
7428 +   [ [329]Previous ]
7429 +
7430 +   If C-Kermit's date-time (e.g. as shown by its DATE command) differs
7431 +   from the system's date and time:
7432 +
7433 +    a. Make sure the libc to which Kermit is linked is set to GMT or is
7434 +       not set to any time zone. Watch out for mixed libc5/libc6 systems;
7435 +       each must be set indpendently.
7436 +    b. If you have changed your TZ environment variable, make sure it is
7437 +       exported. This is normally done in /etc/profile or /etc/TZ.
7438 +
7439 +3.3.5. Startup Errors
7440 +
7441 +   [ [330]Top ] [ [331]Contents ] [ [332]Section Contents ] [ [333]Next ]
7442 +   [ [334]Previous ]
7443 +
7444 +   C-Kermit should work on all versions of Linux current through March
7445 +   2003, provided it was built on the same version you have, with the same
7446 +   libraries and header files (just get the source code and "make linux").
7447 +   Binaries tend not to travel well from one Linux machine to another, due
7448 +   to their many differences. There is no guarantee that a particular
7449 +   C-Kermit binary will not stop working at a later date, since Linux
7450 +   tends to change out from under its applications. If that happens,
7451 +   rebuild C-Kermit from source. If something goes wrong with the build
7452 +   process, look on the [335]C-Kermit website for a newer version. If you
7453 +   have the latest version, then [336]report the problem to us.
7454 +
7455 +   Inability to transfer files in Red Hat 7.2: the typical symptom would
7456 +   be if you start Kermit and tell it to RECEIVE, it fails right away with
7457 +   "?/dev/tty: No such device or address" or "?Bad file descriptor". One
7458 +   report says this is because of csh, and if you change your shell to
7459 +   bash or other shell, it doesn't happen. Another report cite bugs in Red
7460 +   Hat 7.2 Telnetd "very seldom (if ever) providing a controlling tty, and
7461 +   lots of other people piled on saying they have the same problem.") A
7462 +   third theory is that this happens only when Linux has been installed
7463 +   without "virtual terminal support".
7464 +
7465 +   A search of RedHat's errata pages shows a bug advisory (RHBA-2001-153)
7466 +   issued 13 November 2001, but updated 6 December, about this same
7467 +   symptom (but with tcsh and login.) Seems that login was not always
7468 +   assigning a controlling TTY for the session, which would make most use
7469 +   of "/dev/tty" somewhat less than useful.
7470 +
7471 +  [337]http://www.redhat.com/support/errata/RHBA-2001-153.html
7472 +
7473 +   Quoting: "Due to terminal handling problems in /bin/login, tcsh would
7474 +   not find the controlling terminal correctly, and a shell in single user
7475 +   mode would exhibit strange terminal input characteristics. This update
7476 +   fixes both of these problems."
7477 +
7478 +   Since the Red Hat 5.1 release (circa August 1998), there have been
7479 +   numerous reports of prebuilt Linux executables, and particularly the
7480 +   Kermit RPM for Red Hat Linux, not working; either it won't start at
7481 +   all, or it gives error messages about "terminal type unknown" and
7482 +   refuses to initialize its curses support. The following is from the
7483 +   [338]Kermit newsgroup:
7484 +
7485 +     From: rchandra@hal9000.buf.servtech.com
7486 +     Newsgroups: comp.protocols.kermit.misc
7487 +     Subject: Red Hat Linux/Intel 5.1 and ncurses: suggestions
7488 +     Date: 22 Aug 1998 15:54:46 GMT
7489 +     Organization: Verio New York
7490 +     Keywords: RedHat RPM 5.1
7491 +
7492 +     Several factors can influence whether "linux" is recognized as a
7493 +     terminal type on many Linux systems.
7494 +
7495 +    1. Your program, or the libraries it linked with (if statically
7496 +       linked), or the libraries it dynamically links with at runtime, are
7497 +       looking for an entry in /etc/termcap that isn't there. (not likely,
7498 +       but possible... I believe but am not certain that this is a very
7499 +       old practice in very old [n]curses library implementations to use a
7500 +       single file for all terminal descriptions.)
7501 +    2. Your program, or the libraries...are looking for a terminfo file
7502 +       that just plain isn't there. (also not so likely, since many people
7503 +       in other recent message threads said that other programs work OK).
7504 +    3. Your program, or the libraries...are looking for a terminfo file
7505 +       that is stored at a pathname that isn't expected by your program,
7506 +       the libraries--and so on. I forgot if I read this in the errata Web
7507 +       page or where exactly I discovered this (Netscape install? Acrobat
7508 +       install?), but it may just be that one libc (let's say for sake of
7509 +       argument, libc5, but I don't know this to be true) expects your
7510 +       terminfo to be in /usr/share/terminfo, and the other (let's say
7511 +       libc6/glibc) expects /usr/lib/terminfo. I remember that the
7512 +       specific instructions in this bugfix/workaround were to do the
7513 +       following or equivalent:
7514 +  cd /usr/lib
7515 +  ln -s ../share/terminfo ./terminfo
7516 +
7517 +       or:
7518 +  ln -s /usr/share/terminfo /usr/lib/terminfo
7519 +
7520 +     So what this says is that the terminfo database/directory structure
7521 +     can be accessed by either path. When something goes to reference
7522 +     /usr/lib/terminfo, the symlink redirects it to essentially
7523 +     /usr/share/terminfo, which is where it really resides on your
7524 +     system. I personally prefer wherever possible to use relative
7525 +     symlinks, because they still hold, more often than break, across
7526 +     mount points, particularly NFS mounts, where the directory structure
7527 +     may be different on the different systems.
7528 +
7529 +   Evidently the terminfo file moved between Red Hat 5.0 and 5.1, but Red
7530 +   Hat did not include a link to let applications built prior to 5.1 find
7531 +   it. Users reported that installing the link fixes the problem.
7532 +
7533 +3.3.6. The Fullscreen File Transfer Display
7534 +
7535 +   [ [339]Top ] [ [340]Contents ] [ [341]Section Contents ] [
7536 +   [342]Previous ]
7537 +
7538 +   Starting with ncurses versions dated 1998-12-12 (about a year before
7539 +   ncurses 5.0), ncurses sets the terminal for buffered i/o, but
7540 +   unfortunately is not able to restore it upon exit from curses (via
7541 +   endwin()). Thus after a file transfer that uses the fullscreen file
7542 +   transfer display, the terminal no longer echos nor responds immediately
7543 +   to Tab, ?, and other special command characters. The same thing happens
7544 +   on other platforms that use ncurses, e.g. FreeBSD. Workarounds:
7545 +
7546 +     * Use SET XFER DISPLAY BRIEF, CRT, SERIAL, or NONE instead of
7547 +       FULLSCREEN; or:
7548 +     * Rebuild with KFLAGS=-DNONOSETBUF (C-Kermit 8.0)
7549 +
7550 +   In Red Hat 7.1, when using C-Kermit in a Gnome terminal window, it was
7551 +   noticed that when the fullscreen file transfer display exits (via
7552 +   endwin()), the previous (pre-file-transfer-display) screen is restored.
7553 +   Thus you can't look at the completed display to see what happened. This
7554 +   is a evidently a new feature of xterm. I can only speculate that
7555 +   initscreen() and endwin() must send some kind of special escape
7556 +   sequences that command xterm to save and restore the screen. To defeat
7557 +   this effect, tell Linux you have a vt100 or other xterm-compatible
7558 +   terminal that is not actually an xterm, or else tell Kermit to SET
7559 +   TRANSFER DISPLAY to something besides FULLSCREEN.
7560 +
7561 +3.4. C-KERMIT AND NEXTSTEP
7562 +
7563 +   [ [343]Top ] [ [344]Contents ] [ [345]Section Contents ] [ [346]Next ]
7564 +   [ [347]Previous ]
7565 +
7566 +   Run C-Kermit in a Terminal, Stuart, or xterm window, or when logged in
7567 +   remotely through a serial port or TELNET connection. C-Kermit does not
7568 +   work correctly when invoked directly from the NeXTSTEP File Viewer or
7569 +   Dock. This is because the terminal-oriented gtty, stty, & ioctl calls
7570 +   don't work on the little window that NeXTSTEP pops up for non-NeXTSTEP
7571 +   applications like Kermit. CBREAK and No-ECHO settings do not take
7572 +   effect in the command parser -- commands are parsed strictly line at a
7573 +   time. "set line /dev/cua" works. During CONNECT mode, the console stays
7574 +   in cooked mode, so characters are not transmitted until carriage return
7575 +   or linefeed is typed, and you can't escape back. If you want to run
7576 +   Kermit directly from the File Viewer, then launch it from a shell
7577 +   script that puts it in the desired kind of window, something like this
7578 +   (for "Terminal"):
7579 +
7580 +  Terminal -Lines 24 -Columns 80 -WinLocX 100 -WinLocY 100 $FONT $FONTSIZE \
7581 +  -SourceDotLogin -Shell /usr/local/bin/kermit &
7582 +
7583 +   C-Kermit does not work correctly on a NeXT with NeXTSTEP 3.0 to which
7584 +   you have established an rlogin connection, due to a bug in NeXTSTEP
7585 +   3.0, which has been reported to NeXT.
7586 +
7587 +   The SET CARRIER command has no effect on the NeXT -- this is a
7588 +   limitation of the NeXTSTEP serial-port device drivers.
7589 +
7590 +   Hardware flow control on the NeXT is selected not by "set flow rts/cts"
7591 +   in Kermit (since NeXTSTEP offers no API for this), but rather, by using
7592 +   a specially-named driver for the serial device: /dev/cufa instead
7593 +   /dev/cua; /dev/cufb instead of /dev/cub. This is available only on
7594 +   68040-based NeXT models (the situation for Intel NeXTSTEP
7595 +   implementations is unknown).
7596 +
7597 +   NeXT-built 68030 and 68040 models have different kinds of serial
7598 +   interfaces; the 68030 has a Macintosh-like RS-422 interface, which
7599 +   lacks RTS and CTS signals; the 68040 has an RS-423 (RS-232 compatible)
7600 +   interface, which supports the commonly-used modem signals. WARNING: the
7601 +   connectors look exactly the same, but the pins are used in completely
7602 +   DIFFERENT ways -- different cables are required for the two kinds of
7603 +   interfaces.
7604 +
7605 +     IF YOU GET LOTS OF RETRANSMISSIONS during file transfer, even when
7606 +     using a /dev/cuf* device and the modem is correctly configured for
7607 +     RTS/CTS flow control, YOU PROBABLY HAVE THE WRONG KIND OF CABLE.
7608 +
7609 +   On the NeXT, Kermit reportedly (by TimeMon) causes the kernel to use a
7610 +   lot of CPU time when using a "set line" connection. That's because
7611 +   there is no DMA channel for the NeXT serial port, so the port must
7612 +   interrupt the kernel for each character in or out.
7613 +
7614 +   One user reported trouble running C-Kermit on a NeXT from within NeXT's
7615 +   Subprocess class under NeXTstep 3.0, and/or when rlogin'd from one NeXT
7616 +   to another: Error opening /dev/tty:, congm: No such device or address.
7617 +   Diagnosis: Bug in NeXTSTEP 3.0, cure unknown.
7618 +
7619 +3.5. C-KERMIT AND QNX
7620 +
7621 +   [ [348]Top ] [ [349]Contents ] [ [350]Section Contents ] [ [351]Next ]
7622 +   [ [352]Previous ]
7623 +
7624 +   See also: The [353]comp.os.qnx newsgroup.
7625 +
7626 +   Support for QNX 4.x was added in C-Kermit 5A(190). This is a
7627 +   full-function implementation, thoroughly tested on QNX 4.21 and later,
7628 +   and verified to work in both 16-bit and 32-bit versions. The 16-bit
7629 +   version was dropped in C-Kermit 7.0 since it can no longer be built
7630 +   successfully (after stripping most most features, I succeeded in
7631 +   getting it to compile and link without complaint, but the executable
7632 +   just beeps when you run it); for 16-bit QNX 4.2x, use C-Kermit 6.0 or
7633 +   earlier, or else [354]G-Kermit.
7634 +
7635 +   The 32-bit version (and the 16-bit version prior to C-Kermit 7.0)
7636 +   supports most of C-Kermit's advanced features including TCP/IP, high
7637 +   serial speeds, hardware flow-control, modem-signal awareness, curses
7638 +   support, etc.
7639 +
7640 +   BUG: In C-Kermit 6.0 on QNX 4.22 and earlier, the fullscreen file
7641 +   transfer display worked fine the first time, but was fractured on
7642 +   subsequent file transfers. Cause and cure unknown. In C-Kermit 7.0 and
7643 +   QNX 4.25, this no longer occurs. It is not known if it would occur in
7644 +   C-Kermit 7.0 or later on earlier QNX versions.
7645 +
7646 +   Dialout devices are normally /dev/ser1, /dev/ser2, ..., and can be
7647 +   opened explicitly with SET LINE. Reportedly, "/dev/ser" (no unit
7648 +   number) opens the first available /dev/sern device.
7649 +
7650 +   Like all other Unix C-Kermit implementations, QNX C-Kermit does not
7651 +   provide any kind of terminal emulation. Terminal specific functions are
7652 +   provided by your terminal, terminal window (e.g. QNX Terminal or
7653 +   xterm), or emulator.
7654 +
7655 +   QNX C-Kermit, as distributed, does not include support for UUCP
7656 +   line-locking; the QNX makefile entries (qnx32 and qnx16) include the
7657 +   -DNOUUCP switch. This is because QNX, as distributed, does not include
7658 +   UUCP, and its own communications software (e.g. qterm) does not use
7659 +   UUCP line locking. If you have a UUCP product installed on your QNX
7660 +   system, remove the -DNOUUCP switch from the makefile entry and rebuild.
7661 +   Then check to see that Kermit's UUCP lockfile conventions are the same
7662 +   as those of your UUCP package; if not, read the [355]UUCP lockfile
7663 +   section of the [356]Installation Instructions and make the necessary
7664 +   changes to the makefile entry (e.g. add -DHDBUUCP).
7665 +
7666 +   QNX does, however, allow a program to get the device open count. This
7667 +   can not be a reliable form of locking unless all applications do it, so
7668 +   by default, Kermit uses this information only for printing a warning
7669 +   message such as:
7670 +
7671 +  C-Kermit>set line /dev/ser1
7672 +  WARNING - "/dev/ser1" looks busy...
7673 +
7674 +   However, if you want to use it as a lock, you can do so with:
7675 +
7676 +  SET QNX-PORT-LOCK { ON, OFF }
7677 +
7678 +   This is OFF by default; if you set in ON, C-Kermit will fail to open
7679 +   any dialout device when its open count indicates that another process
7680 +   has it open. SHOW COMM (in QNX only) displays the setting, and if you
7681 +   have a port open, it also shows the open count.
7682 +
7683 +   As of C-Kermit 8.0, C-Kermit's "open-count" form of line locking works
7684 +   only in QNX4, not in QNX6 (this might change in a future C-Kermit
7685 +   release).
7686 +
7687 +3.6. C-KERMIT AND SCO
7688 +
7689 +   [ [357]Top ] [ [358]Contents ] [ [359]Section Contents ] [ [360]Next ]
7690 +   [ [361]Previous ]
7691 +
7692 +   SECTION CONTENTS
7693 +
7694 +3.6.1. [362]SCO XENIX
7695 +3.6.2. [363]SCO UNIX and OSR5
7696 +3.6.3. [364]Unixware
7697 +3.6.4. [365]Open UNIX 8
7698 +
7699 +   REFERENCES
7700 +
7701 +     * The comp.unix.sco.* newsgroups.
7702 +     * [366]Section 3.10 below for Unixware.
7703 +     * The following FAQs:
7704 +
7705 +        The comp.sco.misc FAQ:
7706 +                [367]http://aplawrence.com/SCOFAQ/
7707 +
7708 +        Caldera (SCO) comp.unix.sco.programmer FAQ:
7709 +                [368]http://www.zenez.com/cgi-bin/scoprogfaq/faq.pl
7710 +
7711 +        The UnixWare 7/OpenUNIX 8 FAQ:
7712 +                [369]http://www.zenez.com/cgi-bin/scouw7faq/faq.pl
7713 +                [370]http://zenez.pcunix.com/cgi-bin/scouw7faq/faq.pl
7714 +
7715 +        High Speed Modems for SCO Unix:
7716 +                [371]http://pcunix.com/Unixart/modems.html
7717 +
7718 +        The UnixWare FAQ
7719 +                [372]http://www.freebird.org/faq/
7720 +
7721 +        The UnixWare 1.x and 2.0 Programmer FAQ
7722 +                [373]http://www.freebird.org/faq/developer.html
7723 +
7724 +        Caldera Support Knowledge Base
7725 +                [374]http://support.caldera.com/caldera
7726 +
7727 +        [375]http://stage.caldera.com/ta/
7728 +                Caldera (SCO) Technical Article Search Center
7729 +
7730 +        [376]http://aplawrence.com/newtosco.html
7731 +                New to SCO (Tony Lawrence)
7732 +
7733 +   The same comments regarding terminal emulation and key mapping apply to
7734 +   SCO operating systems as to all other Unixes. C-Kermit is not a
7735 +   terminal emulator, and you can't use it to map F-keys, Arrow keys, etc.
7736 +   The way to do this is with xmodmap (xterm) or loadkeys (console). For a
7737 +   brief explanation, see [377]Section 3.0.5. For a fuller explanation,
7738 +   [378]ClICK HERE.
7739 +
7740 +   Also see general comments on PC-based Unixes in [379]Section 3.0.
7741 +
7742 +3.6.1. SCO XENIX
7743 +
7744 +   [ [380]Top ] [ [381]Contents ] [ [382]Section Contents ] [ [383]Next ]
7745 +
7746 +   Old Xenix versions... Did you know: Xenix 3.0 is *older* than Xenix
7747 +   2.0?
7748 +
7749 +   In Xenix 2.3.4 and probably other Xenix versions, momentarily dropping
7750 +   DTR to hang up a modem does not work. DTR goes down but does not come
7751 +   up again. Workaround: Use SET MODEM HANGUP-METHOD MODEM-COMMAND.
7752 +   Anybody who would like to fix this is welcome to take a look at
7753 +   tthang() in [384]ckutio.c. Also: modem signals can not be read in
7754 +   Xenix, and the maximum serial speed is 38400.
7755 +
7756 +   There is all sorts of confusion among SCO versions, particularly when
7757 +   third- party communications boards and drivers are installed, regarding
7758 +   lockfile naming conventions, as well as basic functionality. As far as
7759 +   lockfiles go, all bets are off if you are using a third-party multiport
7760 +   board. At least you have the source code. Hopefully you also have a C
7761 +   compiler :-)
7762 +
7763 +   Xenix 2.3.0 and later claim to support RTSFLOW and CTSFLOW, but this is
7764 +   not modern bidirectional hardware flow control; rather it implements
7765 +   the original RS-232 meanings of these signals for unidirectional
7766 +   half-duplex line access: If both RTSFLOW and CTSFLOW bits are set,
7767 +   Xenix asserts RTS when it wants to send data and waits for CTS
7768 +   assertion before it actually starts sending data (also, reportedly,
7769 +   even this is broken in Xenix 2.3.0 and 2.3.1).
7770 +
7771 +3.6.2. SCO UNIX AND OSR5
7772 +
7773 +   [ [385]Top ] [ [386]Contents ] [ [387]Section Contents ] [ [388]Next ]
7774 +   [ [389]Previous ]
7775 +
7776 +   SCO systems tend to use different names (i.e. drivers) for the same
7777 +   device. Typically /dev/tty1a refers to a terminal device that has no
7778 +   modem control; open, read, write, and close operations do not depend on
7779 +   carrier. On the other hand, /dev/tty1A (same name, but with final
7780 +   letter upper case), is the same device with modem control, in which
7781 +   carrier is required (the SET LINE command does not complete until
7782 +   carrier appears, read/write operations fail if there is no carrier,
7783 +   etc).
7784 +
7785 +   SCO OpenServer 5.0.5 and earlier do not support the reading of modem
7786 +   signals. Thus "show comm" does not list modem signals, and C-Kermit
7787 +   does not automatically pop back to its prompt when the modem hangs up
7788 +   the connection (drops CD). The ioctl() call for this is simply not
7789 +   implmented, at least not in the standard drivers. OSR5.0.6 attempts to
7790 +   deal with modem signals but fails; however OSR5.0.6a appears to
7791 +   function properly.
7792 +
7793 +   Dialing is likely not to work well in SCO OpenServer 5.0.x because many
7794 +   of the serial-port APIs simply do not operate when using the standard
7795 +   drivers. For example, if DTR is dropped by the recommended method
7796 +   (setting speed to 0 for half a seconds, then restoring the speed), DTR
7797 +   and RTS go down but never come back up. When in doubt SET MODEM
7798 +   HANGUP-METHOD MODEM-COMMAND or SET DIAL HANGUP OFF.
7799 +
7800 +   On the other hand, certain functions that might not (do not) work right
7801 +   or at all when using SCO drivers (e.g. high serial speeds, hardware
7802 +   flow control, and/or reading of modem signals) might work right when
7803 +   using third-party drivers. (Example: hardware flow control works,
7804 +   reportedly, only on uppercase device like tty1A -- not tty1a -- and
7805 +   only when CLOCAL is clear when using the SCO sio driver, but there are
7806 +   no such restrictions in, e.g., [390]Digiboard drivers).
7807 +
7808 +   One user reports that he can't transfer large files with C-Kermit under
7809 +   SCO OSR5.0.0 and 5.0.4 -- after the first 5K, everything falls apart.
7810 +   Same thing without Kermit -- e.g. with ftp over a PPP connection.
7811 +   Later, he said that replacing SCO's SIO driver with FAS, an alternative
7812 +   communications driver, made the problem go away:
7813 +
7814 +  [391]ftp://ftp.fu-berlin.de/pub/unix/driver/fas
7815 +
7816 +   With regard to bidirectional serial ports on OpenServer 5.0.4, the
7817 +   following advice appeared on an SCO-related newsgroup:
7818 +
7819 +     No amount of configuration information is going to help you on 5.0.4
7820 +     unless it includes the kludge for the primary problem. With almost
7821 +     every modem, the 5.0.4 getty will barf messages and may or may not
7822 +     connect. There are 2 solutions and only one works on 5.0.4. Get the
7823 +     atdialer binary from a 5.0.0 system and substitute it for the native
7824 +     5.0.4 atdialer. The other solution is to upgrade to 5.0.5. And, most
7825 +     of all, on any OpenServer products, do NOT run the badly broken
7826 +     Modem Manager. Configure the modems in the time honored way that
7827 +     dates back to Xenix.
7828 +
7829 +   Use SCO-provided utilities for switching the directionality of a modem
7830 +   line, such as "enable" and "disable" commands. For example, to dial out
7831 +   on tty1a, which is normally set up for logins:
7832 +
7833 +  disable tty1a
7834 +  kermit -l /dev/tty1a
7835 +  enable tty1a
7836 +
7837 +   If a tty device is listed as an ACU in /usr/lib/uucp/Devices and is
7838 +   enabled, getty resets the ownership and permissions to uucp.uucp and
7839 +   640 every time the device is released. If you want to use the device
7840 +   only for dialout, and you want to specify other owners or permissions,
7841 +   you should disable it in /usr/lib/uucp/Devices; this will prevent getty
7842 +   from doing things to it. You should also changes the device's file
7843 +   modes in /etc/conf/node.d/sio by changing fields 5-7 for the desired
7844 +   device(s); this determines how the devices are set if you relink the
7845 +   kernel.
7846 +
7847 +   One SCO user of C-Kermit 5A(190) reported that only one copy of Kermit
7848 +   can run at a time when a Stallion Technologies multiport boards are
7849 +   installed. Cause, cure, and present status unknown (see [392]Section 14
7850 +   for more info regarding Stallion).
7851 +
7852 +   Prior to SCO OpenServer 5.0.4, the highest serial port speed supported
7853 +   by SCO was 38400. However, in some SCO versions (e.g. OSR5) it is
7854 +   possible to map rarely-used lower speeds (like 600 and 1800) to higher
7855 +   ones like 57600 and 115200. To find out how, go to
7856 +   [393]http://www.sco.com/ and search for "115200". In OSR5.0.4, serial
7857 +   speeds up to 921600 are supported through the POSIX interface; C-Kermit
7858 +   6.1.193 or later, when built for OSR5.0.4 using /bin/cc (NOT the UDK,
7859 +   which hides the high-speed definitions from CPP), supports these
7860 +   speeds, but you might be able to run this binary on earlier releases to
7861 +   get the high serial speeds, depending on various factors, described by
7862 +   Bela Lubkin of SCO:
7863 +
7864 +  Serial speeds under SCO Unix / Open Desktop / OpenServer
7865 +  ========================================================
7866 +  Third party drivers (intelligent serial boards) may provide any speeds
7867 +  they desire; most support up to 115.2Kbps.
7868 +
7869 +  SCO's "sio" driver, which is used to drive standard serial ports with
7870 +  8250/16450/16550 and similar UARTs, was limited to 38400bps in older
7871 +  releases.  Support for rates through 115.2Kbps was added in the
7872 +  following releases:
7873 +
7874 +    SCO OpenServer Release 5.0.0 (requires supplement "rs40b")
7875 +    SCO OpenServer Release 5.0.2 (requires supplement "rs40a" or "rs40b")
7876 +    SCO OpenServer Release 5.0.4 or later
7877 +    SCO Internet FastStart Release 1.0.0 or later
7878 +
7879 +   SCO supplements are at [394]ftp://ftp.sco.com/; the "rs40" series are
7880 +   under directory /Supplements/internet
7881 +
7882 +   Kermit includes the high serial speeds in all OSR5 builds, but that
7883 +   does not necessarily mean they work. For example, on our in-house 5.0.5
7884 +   system, SET SPEED 57600 or higher seems to succeed (no error occurs)
7885 +   but when we read the speed back the driver says it is 50. Similarly,
7886 +   76800 becomes 75, and 115200 becomes 110. Testing shows the resulting
7887 +   speed is indeed the low one we read back, not the high one we asked
7888 +   for. Moral: Use speeds higher than 38400 with caution on SCO OSR5.
7889 +
7890 +   Reportedly, if you have a script that makes a TCP/IP SET HOST (e.g.
7891 +   Telnet) connection to SCO 3.2v4.2 with TCP/IP 1.2.1, and then does the
7892 +   following:
7893 +
7894 +  script $ exit
7895 +  hangup
7896 +
7897 +   this causes a pseudoterminal (pty) to be consumed on the SCO system; if
7898 +   you do it enough times, it will run out of ptys. An "exit" command is
7899 +   being sent to the SCO shell, and a HANGUP command is executed locally,
7900 +   so the chances are good that both sides are trying to close the
7901 +   connection at once, perhaps inducing a race condition in which the
7902 +   remote pty is not released. It was speculated that this would be fixed
7903 +   by applying SLS net382e, but it did not. Meanwhile, the workaround is
7904 +   to insert a "pause" between the SCRIPT and HANGUP commands. (The
7905 +   situation with later SCO releases is not known.)
7906 +
7907 +   SCO UNIX and OpenServer allow their console and/or terminal drivers to
7908 +   be configured to translate character sets for you. DON'T DO THIS WHEN
7909 +   USING KERMIT! First of all, you don't need it -- Kermit itself already
7910 +   does this for you. And second, it will (a) probably ruin the formatting
7911 +   of your screens (depending on which emulation you are using); and (b)
7912 +   interfere with all sorts of other things -- legibility of non-ASCII
7913 +   text on the terminal screen, file transfer, etc. Use:
7914 +
7915 +  mapchan -n
7916 +
7917 +   to turn off this feature.
7918 +
7919 +   Note that there is a multitude of SCO entries in the makefile, many of
7920 +   them exhibiting an unusually large number of compiler options. Some
7921 +   people actually understand all of this. Reportedly, things are settling
7922 +   down with SCO OpenServer 5.x and Unixware 7 (and Open UNIX 8 and who
7923 +   knows what the next one will be -- Linux probably) -- the SCO UDK
7924 +   compiler is said to generate binaries that will run on either platform,
7925 +   by default, automatically. When using gcc or egcs, on the other hand,
7926 +   differences persist, plus issues regarding the type of binary that is
7927 +   generated (COFF, ELF, etc), and where and how it can run. All of this
7928 +   could stand further clarification by SCO experts.
7929 +
7930 +3.6.3. Unixware
7931 +
7932 +   [ [395]Top ] [ [396]Contents ] [ [397]Section Contents ] [ [398]Next ]
7933 +   [ [399]Previous ]
7934 +
7935 +   Unixware changed hands several times before landing at SCO, and so has
7936 +   its [400]own section in this document. (Briefly: AT&T UNIX Systems
7937 +   Laboratories sold the rights to the UNIX name and to System V R4 (or
7938 +   R5?) to Novell; later Novell spun its UNIX division off into a new
7939 +   company called Univel, which eventually was bought by SCO, which later
7940 +   was bought by Caldera, which later sort of semi-spun-off SCO...)
7941 +
7942 +3.6.4. Open UNIX 8
7943 +
7944 +   [ [401]Top ] [ [402]Contents ] [ [403]Section Contents ] [
7945 +   [404]Previous ]
7946 +
7947 +   SCO was bought by Caldera in 2000 or 2001 and evolved Unixware 7.1 into
7948 +   Caldera Open UNIX 8.00. It's just like Unixware 7.1 as far as Kermit is
7949 +   concerned (the Unixware 7.1 makefile target works for Open UNIX 8.00,
7950 +   and in fact a Unixware 7.1 Kermit binary built on Unixware 7.1 runs
7951 +   under OU8; a separate OU8 makefile target exists simply to generate an
7952 +   appropriate program startup herald). Open Unix is now defunct;
7953 +   subsequent releases are called UnixWare again (e.g. UnixWare 7.1.3).
7954 +
7955 +3.7. C-KERMIT AND SOLARIS
7956 +
7957 +   [ [405]Top ] [ [406]Contents ] [ [407]Section Contents ] [ [408]Next ]
7958 +   [ [409]Previous ]
7959 +
7960 +   SECTION CONTENTS
7961 +
7962 +3.7.1. [410]Serial Port Configuration
7963 +3.7.2. [411]Serial Port Problems
7964 +3.7.3. [412]SunLink X.25
7965 +3.7.4. [413]Sun Workstation Keyboard Mapping
7966 +3.7.5. [414]Solaris 2.4 and Earlier
7967 +
7968 +   REFERENCES
7969 +
7970 +     * The [415]comp.unix.solaris newsgroup
7971 +     * [416]http://access1.sun.com/
7972 +     * [417]http://docs.sun.com/
7973 +     * [418]http://www.sunhelp.com/
7974 +     * [419]http://www.wins.uva.nl/pub/solaris/solaris2/
7975 +     * [420]http://www.wins.uva.nl/cgi-bin/sfaq.cgi
7976 +     * [421]ftp://ftp.wins.uva.nl/pub/solaris
7977 +     * [422]http://www.science.uva.nl/pub/solaris/solaris2.html
7978 +
7979 +   And about serial communications in particular, see "Celeste's Tutorial
7980 +   on Solaris 2.x Modems and Terminals":
7981 +
7982 +  [423]http://www.stokely.com/
7983 +
7984 +   In particular:
7985 +
7986 +  [424]http://www.stokely.com/unix.sysadm.resources/faqs.sun.html
7987 +
7988 +   For PC-based Solaris, also see general comments on PC-based Unixes in
7989 +   [425]Section 3.0. Don't expect Solaris or any other kind of Unix to
7990 +   work right on a PC until you resolve all interrupt conflicts. Don't
7991 +   expect to be able to use COM3 or COM4 (or even COM2) until you have
7992 +   configured their addresses and interrupts.
7993 +
7994 +3.7.1. Serial Port Configuration
7995 +
7996 +   [ [426]Top ] [ [427]Contents ] [ [428]Section Contents ] [ [429]Section
7997 +   Contents ] [ [430]Next ]
7998 +
7999 +   Your serial port can't be used -- or at least won't work right -- until
8000 +   it is enabled in Solaris. For example, you get a message like "SERIAL:
8001 +   Operation would block" when attempting to dial. This probably indicates
8002 +   that the serial port has not been enabled for use with modems. You'll
8003 +   need to follow the instructions in your system setup or management
8004 +   manual, such as (e.g.) the Desktop SPARC Sun System & Network Manager's
8005 +   Guide, which should contain a section "Setting up Modem Software"; read
8006 +   it and follow the instructions. These might (or might not) include
8007 +   running a program called "eeprom", editing some system configuration
8008 +   file (such as, for example:
8009 +
8010 +  /platform/i86pc/kernel/drv/asy.conf
8011 +
8012 +   and then doing a configuration reboot, or running some other programs
8013 +   like drvconfig and devlinks. "man eeprom" for details.
8014 +
8015 +   Also, on certain Sun models like IPC, the serial port hardware might
8016 +   need to have a jumper changed to make it an RS-232 port rather than
8017 +   RS-423.
8018 +
8019 +   eeprom applies only to real serial ports, not to "Spiff" devices
8020 +   (serial port expander), in which case setup with Solaris' admintool is
8021 +   required.
8022 +
8023 +   Another command you might need to use is pmadm, e.g.:
8024 +
8025 +  pmadm -d -p zsmon -s tty3
8026 +  pmadm -e -p zsmon -s tty3
8027 +
8028 +   You can use the following command to check if a process has the device
8029 +   open:
8030 +
8031 +  fuser -f /dev/term/3
8032 +
8033 +   In some cases, however (according to Sun support, May 2001) "It is
8034 +   still possible that a zombie process has hold of the port EVEN IF there
8035 +   is no lock file and the fuser command comes up empty. In that case, the
8036 +   only way to resolve the problem is by rebooting."
8037 +
8038 +   If you can't establish communication through a serial port to a device
8039 +   that is not asserting CD (Carrier Detect), try setting the environment
8040 +   variable "ttya-ignore-cd" to "true" (replace "ttya" with the port
8041 +   name).
8042 +
8043 +3.7.2. Serial Port Problems
8044 +
8045 +   [ [431]Top ] [ [432]Contents ] [ [433]Section Contents ] [ [434]Next ]
8046 +   [ [435]Previous ]
8047 +
8048 +   Current advice from Sun is to always the /dev/cua/x devices for dialing
8049 +   out, rather than the /dev/term/x. Nevertheless, if you have trouble
8050 +   dialing out with one, try the other.
8051 +
8052 +   Reportedly, if you start C-Kermit and "set line" to a port that has a
8053 +   modem connected to it that is not turned on, and then "set flow
8054 +   rts/cts", there might be some (unspecified) difficulties closing the
8055 +   device because the CTS signal is not coming in from the modem.
8056 +
8057 +3.7.3. SunLink X.25
8058 +
8059 +   [ [436]Top ] [ [437]Contents ] [ [438]Section Contents ] [ [439]Next ]
8060 +   [ [440]Previous ]
8061 +
8062 +   The built-in SunLink X.25 support for Solaris 2.3/2.4./25 and SunLink
8063 +   8.01 or 9.00 works OK provided the X.25 system has been installed and
8064 +   initialized properly. Packet sizes might need to be reduced to 256,
8065 +   maybe even less, depending on the configuration of the X.25
8066 +   installation. On one connection where C-Kermit 6.0 was tested, very
8067 +   large packets and window sizes could be used in one direction, but only
8068 +   very small ones would work in the other.
8069 +
8070 +   In any case, according to Sun, C-Kermit's X.25 support is superfluous
8071 +   with SunLink 8.x / Solaris 2.3. Quoting an anonymous Sun engineer:
8072 +
8073 +     ... there is now no need to include any X.25 code within kermit. As
8074 +     of X.25 8.0.1 we support the use of kermit, uucp and similar
8075 +     protocols over devices of type /dev/xty. This facility was there in
8076 +     8.0, and should also work on the 8.0 release if patch 101524 is
8077 +     applied, but I'm not 100% sure it will work in all cases, which is
8078 +     why we only claim support from 8.0.1 onwards.
8079 +
8080 +     When configuring X.25, on the "Advanced Configuration->Parameters"
8081 +     screen of the x25tool you can select a number of XTY devices. If you
8082 +     set this to be > 1, press Apply, and reboot, you will get a number
8083 +     of /dev/xty entries created.
8084 +
8085 +     Ignore /dev/xty0, it is a special case. All the others can be used
8086 +     exactly as if they were a serial line (e.g. /dev/tty) connected to a
8087 +     modem, except that instead of using Hayes-style commands, you use
8088 +     PAD commands.
8089 +
8090 +     From kermit you can do a 'set line' command to, say, /dev/xty1, then
8091 +     set your dialing command to be "CALL 12345678", etc. All the usual
8092 +     PAD commands will work (SET, PAR, etc).
8093 +
8094 +     I know of one customer in Australia who is successfully using this,
8095 +     with kermit scripts, to manage some X.25-connected switches. He used
8096 +     standard kermit, compiled for Solaris 2, with X.25 8.0 xty devices.
8097 +
8098 +3.7.4. Sun Workstation Keyboard Mapping
8099 +
8100 +   [ [441]Top ] [ [442]Contents ] [ [443]Section Contents ] [ [444]Next ]
8101 +   [ [445]Previous ]
8102 +
8103 +   Hints for using a Sun workstation keyboard for VT emulation when
8104 +   accessing VMS, from the [446]comp.os.vms newsgroup:
8105 +
8106 +     From: Jerry Leichter <leichter@smarts.com>
8107 +     Newsgroups: comp.os.vms
8108 +     Subject: Re: VT100 keyboard mapping to Sun X server
8109 +     Date: Mon, 19 Aug 1996 12:44:21 -0400
8110 +
8111 +     > I am stuck right now using a Sun keyboard (type 5) on systems
8112 +     running SunOS
8113 +     > and Solaris. I would like to use EVE on an OpenVMS box with
8114 +     display back to
8115 +     > the Sun. Does anyone know of a keyboard mapping (or some other
8116 +     procedure)
8117 +     > which will allow the Sun keyboard to approximate a VT100/VT220?
8118 +
8119 +     You can't get it exactly - because the keypad has one fewer key -
8120 +     but you can come pretty close. Here's a set of keydefs I use:
8121 +
8122 +  keycode 101=KP_0
8123 +  keycode 119=KP_1
8124 +  keycode 120=KP_2
8125 +  keycode 121=KP_3
8126 +  keycode 98=KP_4
8127 +  keycode 99=KP_5
8128 +  keycode 100=KP_6
8129 +  keycode 75=KP_7
8130 +  keycode 76=KP_8
8131 +  keycode 77=KP_9
8132 +  keycode 52=KP_F1
8133 +  keycode 53=KP_F2
8134 +  keycode 54=KP_F3
8135 +  keycode 57=KP_Decimal
8136 +  keycode 28=Left
8137 +  keycode 29=Right
8138 +  keycode 30=KP_Separator
8139 +  keycode 105=KP_F4
8140 +  keycode 78=KP_Subtract
8141 +  keycode 8=Left
8142 +  keycode 10=Right
8143 +  keycode 32=Up
8144 +  keycode 33=Down
8145 +  keycode 97=KP_Enter
8146 +
8147 +     Put this in a file - I use "keydefs" in my home directory and feed
8148 +     it into xmodmap:
8149 +
8150 +  xmodmap - <$HOME/keydefs
8151 +
8152 +     This takes care of the arrow keys and the "calculator" key cluster.
8153 +     The "+" key will play the role of the DEC "," key. The Sun "-" key
8154 +     will be like the DEC "-" key, though it's in a physically different
8155 +     position - where the DEC PF4 key is. The PF4 key is ... damn, I'm
8156 +     not sure where "key 105" is. I *think* it may be on the leftmost key
8157 +     of the group of four just above the "calculator" key cluster.
8158 +
8159 +     I also execute the following (this is all in my xinitrc file):
8160 +
8161 +  xmodmap -e 'keysym KP_Decimal = KP_Decimal'
8162 +  xmodmap -e 'keysym BackSpace = Delete BackSpace' \
8163 +          -e 'keysym Delete = BackSpace Delete'
8164 +  xmodmap -e 'keysym KP_Decimal = Delete Delete KP_Decimal'
8165 +  xmodmap -e 'add mod1 = Meta_R'
8166 +  xmodmap -e 'add mod1 = Meta_L'
8167 +
8168 +     Beware of one thing about xmodmap: Keymap changes are applied to the
8169 +     *whole workstation*, not just to individual windows. There is, in
8170 +     fact, no way I know of to apply them to individual windows. These
8171 +     definitions *may* confuse some Unix programs (and/or some Unix
8172 +     users).
8173 +
8174 +     If you're using Motif, you may also need to apply bindings at the
8175 +     Motif level. If just using xmodmap doesn't work, I can try and dig
8176 +     that stuff up for you.
8177 +
8178 +3.7.5. Solaris PPP Connections
8179 +
8180 +   [ [447]Top ] [ [448]Contents ] [ [449]Section Contents ] [ [450]Next ]
8181 +   [ [451]Previous ]
8182 +
8183 +   The following is a report from a user of C-Kermit 8.0 on Solaris 8 and
8184 +   9, who had complained that while Kermit file transfers worked perfectly
8185 +   on direct (non-PPP) dialout connections, they failed miserably on PPP
8186 +   connections. We suggested that the PPP dialer probably was not setting
8187 +   the port and/or modem up in the same way that Kermit did:
8188 +
8189 +     I want to get back on this and tell you what the resolution was. You
8190 +     pointed me in the direction of flow control, which turned out to be
8191 +     the key.
8192 +
8193 +     Some discussion on the comp.unix.solaris newsgroup led to some
8194 +     comments from Greg Andrews about the need to use the uucp driver to
8195 +     talk to the modem (/dev/cua/a). I had to remind Greg that no matter
8196 +     what the manpages for the zs and se drivers say, the ppp that Sun
8197 +     released with Solaris 8 7/01, and has in Solaris 9, is a setuid root
8198 +     program, and simply trying to make a pppd call from user space
8199 +     specifying /dev/cua/a would fail because of permissions. Greg
8200 +     finally put the question to the ppp people, who came back with
8201 +     information that is not laid out anywhere in the docs available for
8202 +     Solaris users. Namely, put /dev/cua/a in one of the priviledged
8203 +     options files in the /etc/ppp directory. That, plus resetting the
8204 +     OBP ttya-ignore-cd flag (this is Sun hardware) to false, seems to
8205 +     have solved the problems.
8206 +
8207 +     While I note that I had installed Kermit suid to uucp to use
8208 +     /dev/cua/a on this particular box, it seems to run fine through
8209 +     /dev/term/a. Not so with pppd.
8210 +
8211 +     With this change in place, I seem to be able to upload and download
8212 +     through telnet run on Kermit with the maximum length packets. I note
8213 +     that the window allocation display does show STREAMING, using
8214 +     telnet. Running ssh on Kermit, I see the standard 1 of 30 windows
8215 +     display, and note that there appears to be a buffer length limit
8216 +     between 1000 and 2000 bytes. Run with 1000, and it's tick-tock,
8217 +     solid as a rock. With 2000 I see timeout errors and RTS/CTS action
8218 +     on the modem.
8219 +
8220 +   Kermit's packet-length and other controls let you make adjustments like
8221 +   this to get around whatever obstacles might be thrown up -- in this
8222 +   case (running Kermit over ssh), the underling Solaris PTY driver.
8223 +
8224 +3.7.6. Solaris 2.4 and Earlier
8225 +
8226 +   [ [452]Top ] [ [453]Contents ] [ [454]Section Contents ] [
8227 +   [455]Previous ]
8228 +
8229 +   C-Kermit can't be compiled successfully under Solaris 2.3 using
8230 +   SUNWspro cc 2.0.1 unless at least some of the following patches are
8231 +   applied to cc (it is not known which one(s), if any, fix the problem):
8232 +
8233 +     * 100935-01 SparcCompiler C 2.0.1: bad code generated when addresses
8234 +       of two double arguments are involved
8235 +     * 100961-05 SPARCcompilers C 2.0.1: conditional expression with
8236 +       function returning structure gives wrong value
8237 +     * 100974-01 SparcWorks 2.0.1: dbx jumbo patch
8238 +     * 101424-01 SPARCworks 2.0.1 maketool SEGV's instantly on Solaris 2.3
8239 +
8240 +   With unpatched cc 2.0.1, the symptom is that certain modules generate
8241 +   truncated object files, resulting in many unresolved references at link
8242 +   time.
8243 +
8244 +     The rest of the problems in this section have to do with
8245 +     bidirectional terminal ports and the Solaris Port Monitor. A bug in
8246 +     C-Kermit 5A ticked a bug in Solaris. The C-Kermit bug was fixed in
8247 +     version 6.0, and the Solaris bug was fixed in 2.4 (I think, or maybe
8248 +     2.5).
8249 +
8250 +   Reportedly, "C-Kermit ... causes a SPARCstation running Solaris 2.3 to
8251 +   panic after the modem connects. I have tried compiling C-Kermit with
8252 +   Sun's unbundled C compiler, with GCC Versions 2.4.5 and 2.5.3, with
8253 +   make targets 'sunos51', 'sunos51tcp', 'sunos51gcc', and even 'sys5r4',
8254 +   and each time it compiles and starts up cleanly, but without fail, as
8255 +   soon as I dial the number and get a 'CONNECT' message from the modem, I
8256 +   get:
8257 +
8258 +  BAD TRAP
8259 +  kermit: Data fault
8260 +  kernel read fault at addr=0x45c, pme=0x0
8261 +  Sync Error Reg 80 <INVALID>
8262 +  ...
8263 +  panic: Data Fault.
8264 +  ...
8265 +  Rebooting...
8266 +
8267 +   The same modem works fine for UUCP/tip calling." Also (reportedly),
8268 +   this only happens if the dialout port is configured as in/out via
8269 +   admintool. If it is configured as out-only, no problem. This is the
8270 +   same dialing code that works on hundreds of other System-V based Unix
8271 +   OS's. Since it should be impossible for a user program to crash the
8272 +   operating system, this problem must be chalked up to a Solaris bug.
8273 +   Even if you SET CARRIER OFF, CONNECT, and dial manually by typing
8274 +   ATDTnnnnnnn, the system panics as soon as the modem issues its CONNECT
8275 +   message. (Clearly, when you are dialing manually, C-Kermit does not
8276 +   know a thing about the CONNECT message, and so the panic is almost
8277 +   certainly caused by the transition of the Carrier Detect (CD) line from
8278 +   off to on.) This problem was reported by many users, all of whom say
8279 +   that C-Kermit worked fine on Solaris 2.1 and 2.2. If the speculation
8280 +   about CD is true, then a possible workaround might be to configure the
8281 +   modem to leave CD on (or off) all the time. Perhaps by the time you
8282 +   read this, a patch will have been issued for Solaris 2.3.
8283 +
8284 +   The following is from Karl S. Marsh, Systems & Networks Administrator,
8285 +   AMBIX Systems Corp, Rochester, NY:
8286 +
8287 +     Environment: Solaris 2.3 Patch 101318-45 C-Kermit 5A(189) (and
8288 +     presumably this applies to 188 and 190 also). eeprom setting:
8289 +
8290 +  ttya-rts-dtr-off=false
8291 +  ttya-ignore-cd=false
8292 +  ttya-mode=19200,8,n,8,-
8293 +
8294 +     To use C-Kermit on a bidirectional port in this environment, do not
8295 +     use admintool to configure the port. Use admintool to delete any
8296 +     services running on the port and then quit admintool and issue the
8297 +     following command:
8298 +
8299 +  pmadm -a -p zsmon -s ttyb -i root -fu -v 1 -m "`ttyadm -b -d /dev/term/b \
8300 +  -l conttyH -m ldterm,ttcompat -s /usr/bin/login -S n`"
8301 +
8302 +     [NOTE: This was copied from a blurry fax, so please check it
8303 +     carefully] where:
8304 +
8305 +  -a = Add service
8306 +  -p = pmtag (zsmon)
8307 +  -s = service tag (ttyb)
8308 +  -i = id to be associated with service tag (root)
8309 +  -fu = create utmp entry
8310 +  -v = version of ttyadm
8311 +  -m = port monitor-specific portion of the port monitor administrative file
8312 +       entry for the service
8313 +  -b = set up port for bidirectional use
8314 +  -d = full path name of device
8315 +  -l = which ttylabel in the /etc/ttydefs file to use
8316 +  -m = a list of pushable STREAMS modules
8317 +  -s = pathname of service to be invoked when connection request received
8318 +  -S = software carrier detect on or off (n = off)
8319 +
8320 +     "This is exactly how I was able to get Kermit to work on a
8321 +     bi-directional port without crashing the system."
8322 +
8323 +   On the Solaris problem, also see SunSolve Bug ID 1150457 ("Using
8324 +   C-Kermit, get Bad Trap on receiving prompt from remote system").
8325 +   Another user reported "So, I have communicated with the Sun tech
8326 +   support person that submitted this bug report [1150457]. Apparently,
8327 +   this bug was fixed under one of the jumbo kernel patches. It would seem
8328 +   that the fix did not live on into 101318-45, as this is EXACTLY the
8329 +   error that I see when I attempt to use kermit on my system."
8330 +
8331 +   Later (Aug 94)... C-Kermit dialout successfully tested on a Sun4m with
8332 +   a heavily patched Solaris 2.3. The patches most likely to have been
8333 +   relevant:
8334 +
8335 +     * 101318-50: SunOS 5.3: Jumbo patch for kernel (includes libc, lockd)
8336 +     * 101720-01: SunOS 5.3: ttymon - prompt not always visible on a modem
8337 +       connection
8338 +     * 101815-01: SunOS 5.3: Data fault in put() NULL queue passed from
8339 +       ttycommon_qfull()
8340 +     * 101328-01: SunOS 5.3: Automation script to properly setup tty ports
8341 +       prior to PCTS execution
8342 +
8343 +   Still later (Nov 94): another user (Bo Kullmar in Sweden) reports that
8344 +   after using C-Kermit to dial out on a bidirectional port, the port
8345 +   might not answer subsequent incoming calls, and says "the problem is
8346 +   easy enough to fix with the Serial Port Manager; I just delete the
8347 +   service and install it again using the graphical interface, which
8348 +   underneath uses commands like sacadm and pmadm." Later Bo reports, "I
8349 +   have found that if I run Kermit with the following script then it
8350 +   works. This script is for /dev/cua/a, "-s a" is the last a in
8351 +   /dev/cua/a:
8352 +
8353 +  #! /bin/sh
8354 +  kermit
8355 +  sleep 2
8356 +  surun pmadm -e -p zsmon -s a
8357 +
8358 +3.8. C-KERMIT AND SUNOS
8359 +
8360 +   [ [456]Top ] [ [457]Contents ] [ [458]Section Contents ] [ [459]Next ]
8361 +   [ [460]Previous ]
8362 +
8363 +   For additional information, see "Celeste's Tutorial on SunOS 4.1.3+
8364 +   Modems and Terminals":
8365 +
8366 +  [461]http://www.stokely.com/
8367 +
8368 +   For FAQs, etc, from Sun, see:
8369 +     * [462]http://access1.sun.com/
8370 +
8371 +   For history of Sun models and SunOS versions, see (should be all the
8372 +   same):
8373 +     * [463]http://www.ludd.luth.se/~bear/project/sun/sun.hardware.txt
8374 +     * [464]ftp://ftp.netcom.com/pub/ru/rubicon/sun.hdwr.ref
8375 +     * [465]ftp://ftp.intnet.net/pub/SUN/Sun-Hardware-Ref
8376 +
8377 +   Sun SPARCstation users should read the section "Setting up Modem
8378 +   Software" in the Desktop SPARC Sun System & Network Manager's Guide. If
8379 +   you don't set up your serial ports correctly, Kermit (and other
8380 +   communications software) won't work right.
8381 +
8382 +   Also, on certain Sun models like IPC, the serial port hardware might
8383 +   need to have a jumper changed to make it an RS-232 port rather than
8384 +   RS-423.
8385 +
8386 +   Reportedly, C-Kermit does not work correctly on a Sun SPARCstation in
8387 +   an Open Windows window with scrolling enabled. Disable scrolling, or
8388 +   else invoke Kermit in a terminal emulation window (xterm, crttool,
8389 +   vttool) under SunView (this might be fixed in later SunOS releases).
8390 +
8391 +   On the Sun with Open Windows, an additional symptom has been reported:
8392 +   outbound SunLink X.25 connections "magically" translate CR typed at the
8393 +   keyboard into LF before transmission to the remote host. This doesn't
8394 +   happen under SunView.
8395 +
8396 +   SET CARRIER ON, when used on the SunOS 4.1 version of C-Kermit
8397 +   (compiled in the BSD universe), causes the program to hang
8398 +   uninterruptibly when SET LINE is issued for a device that is not
8399 +   asserting carrier. When Kermit is built in the Sys V universe on the
8400 +   same computer, there is no problem (it can be interrupted with Ctrl-C).
8401 +   This is apparently a limitation of the BSD-style tty driver.
8402 +
8403 +   SunOS 4.1 C-Kermit has been observed to dump core when running a
8404 +   complicated script program under cron. The dump invariably occurs in
8405 +   ttoc(), while trying to output a character to a TCP/IP TELNET
8406 +   connection. ttoc() contains a write() call, and when the system or the
8407 +   network is very busy, the write() call can get stuck for long periods
8408 +   of time. To break out of deadlocks caused by stuck write() calls, there
8409 +   is an alarm around the write(). It is possible that the core dump
8410 +   occurs when this alarm signal is caught. (This one has not been
8411 +   observed recently -- possibly fixed in edit 190.)
8412 +
8413 +   On Sun computers with SunOS 4.0 or 4.1, SET FLOW RTS/CTS works only if
8414 +   the carrier signal is present from the communication device at the time
8415 +   when C-Kermit enters packet mode or CONNECT mode. If carrier is not
8416 +   sensed (e.g. when dialing), C-Kermit does not attempt to turn on
8417 +   RTS/CTS flow control. This is because the SunOS serial device driver
8418 +   does not allow characters to be output if RTS/CTS is set (CRTSCTS) but
8419 +   carrier (and DSR) are not present. Workaround (maybe): SET CARRIER OFF
8420 +   before giving the SET LINE command, establish the connection, then SET
8421 +   FLOW RTS/CTS
8422 +
8423 +   It has also been reported that RTS/CTS flow control under SunOS 4.1
8424 +   through 4.1.3 works only on INPUT, not on output, and that there is a
8425 +   patch from Sun to correct this problem: Patch-ID# T100513-04, 20 July
8426 +   1993 (this patch might apply only to SunOS 4.1.3). It might also be
8427 +   necessary to configure the eeprom parameters of the serial port; e.g.
8428 +   do the following as root at the shell prompt:
8429 +
8430 +  eeprom  ttya-ignore-cd=false
8431 +  eeprom  ttya-rts-dtr-off=true
8432 +
8433 +   There have been reports of file transfer failures on Sun-3 systems when
8434 +   using long packets and/or large window sizes. One user says that when
8435 +   this happens, the console issues many copies of this message:
8436 +
8437 +  chaos vmunix: zs1: ring buffer overflow
8438 +
8439 +   This means that SunOS is not scheduling Kermit frequently enough to
8440 +   service interrupts from the zs serial device (Zilog 8350 SCC serial
8441 +   communication port) before its input silo overflows. Workaround: use
8442 +   smaller packets and/or a smaller window size, or use "nice" to increase
8443 +   Kermit's priority. Use hardware flow control if available, or remove
8444 +   other active processes before running Kermit.
8445 +
8446 +   SunLink X.25 support in C-Kermit 5A(190) was built and tested
8447 +   successfully under SunOS 4.1.3b and SunLink X.25 7.00.
8448 +
8449 +3.9. C-KERMIT AND ULTRIX
8450 +
8451 +   [ [466]Top ] [ [467]Contents ] [ [468]Section Contents ] [ [469]Next ]
8452 +   [ [470]Previous ]
8453 +
8454 +   See also: The [471]comp.unix.ultrix and [472]comp.sys.dec newsgroups.
8455 +
8456 +   There is no hardware flow control in Ultrix. That's not a Kermit
8457 +   deficiency, but an Ultrix one.
8458 +
8459 +   When sending files to C-Kermit on a Telnet connection to a remote
8460 +   Ultrix system, you must SET PREFIXING ALL (or at least prefix more
8461 +   control characters than are selected by SET PREFIXING CAUTIOUS).
8462 +
8463 +   Reportedly, DEC ULTRIX 4.3 is immune to C-Kermit's disabling of
8464 +   SIGQUIT, which is the signal that is generated when the user types
8465 +   Ctrl-\, which kills the current process (i.e. C-Kermit) and dumps core.
8466 +   Diagnosis and cure unknown. Workaround: before starting C-Kermit -- or
8467 +   for that matter, when you first log in because this applies to all
8468 +   processes, not just Kermit -- give the following Unix command:
8469 +
8470 +  stty quit undef
8471 +
8472 +   Certain operations driven by RS-232 modem signal do not work on
8473 +   DECstations or other DEC platforms whose serial interfaces use MMP
8474 +   connectors (DEC version of RJ45 telephone jack with offset tab). These
8475 +   connectors convey only the DSR and DTR modem signals, but not carrier
8476 +   (CD), RTS, CTS, or RI. Use SET CARRIER OFF to enable communication, or
8477 +   "hotwire" DSR to CD.
8478 +
8479 +   The maximum serial speed on the DECstation 5000 is normally 19200, but
8480 +   various tricks are available (outside Kermit) to enable higher rates.
8481 +   For example, on the 5000/200, 19200 can be remapped (somehow, something
8482 +   to do with "a bit in the SIR", whatever that is) to 38400, but in
8483 +   software you must still refer to this speed as 19200; you can't have
8484 +   19200 and 38400 available at the same time.
8485 +
8486 +   19200, reportedly, is also the highest speed supported by Ultrix, but
8487 +   NetBSD reportedly supports speeds up to 57600 on the DECstation,
8488 +   although whether and how well this works is another question.
8489 +
8490 +   In any case, given the lack of hardware flow control in Ultrix, high
8491 +   serial speeds are problematic at best.
8492 +
8493 +3.10. C-KERMIT AND UNIXWARE
8494 +
8495 +   [ [473]Top ] [ [474]Contents ] [ [475]Section Contents ] [ [476]Next ]
8496 +   [ [477]Previous ]
8497 +
8498 +   See also:
8499 +     * The Freebird Project (Unixware software repository)
8500 +       [478]http://www.freebird.org/
8501 +     * The UnixWare FAQ: [479]http://www.freebird.org/faq/
8502 +     * The following newsgroups:
8503 +          + [480]comp.unix.unixware.misc
8504 +          + [481]comp.unix.sco.misc.
8505 +
8506 +   Also see general comments on PC-based Unixes in [482]Section 3.0. By
8507 +   the way, this section is separate from the SCO (Caldera) section
8508 +   because at the time this section was started, Unixware was owned by a
8509 +   company called Univel. Later it was sold to Novell, and then to SCO.
8510 +   Still later, SCO was sold to Caldera.
8511 +
8512 +   In Unixware 2.0 and later, the preferred serial device names (drivers)
8513 +   are /dev/term/00 (etc), rather than /dev/tty00 (etc). Note the
8514 +   following correspondence of device names and driver characteristics:
8515 +
8516 +  New name       Old name     Description
8517 +  /dev/term/00   /dev/tty00   ???
8518 +  /dev/term/00h  /dev/tty00h  Modem signals and hardware flow control
8519 +  /dev/term/00m  /dev/tty00m  Modem signals(?)
8520 +  /dev/term/00s  /dev/tty00s  Modem signals and software flow control
8521 +  /dev/term/00t  /dev/tty00t  ???
8522 +
8523 +   Lockfile names use device.major.minor numbers, e.g.:
8524 +
8525 +  /var/spool/locks/LK.7679.003.005
8526 +
8527 +   The minor number varies according to the device name suffix (none, h,
8528 +   m, s, or t). Only the device and major number are compared, and thus
8529 +   all of the different names for the same physical device (e.g. all of
8530 +   those shown in the table above) interlock effectively.
8531 +
8532 +   Prior to UnixWare 7, serial speeds higher than 38400 are not supported.
8533 +   In UnixWare 7, we also support 57600 and 115200, plus some unexpected
8534 +   ones like 14400, 28800, and 76800, by virtue of a strange new
8535 +   interface, evidently peculiar to UnixWare 7, discovered while digging
8536 +   through the header files: tcsetspeed(). Access to this interface is
8537 +   allowed only in POSIX builds, and thus the UnixWare 7 version of
8538 +   C-Kermit is POSIX-based, unlike C-Kermit for Unixware 1.x and 2.x
8539 +   (since the earlier UnixWare versions did not support high serial
8540 +   speeds, period).
8541 +
8542 +   HOWEVER, turning on POSIX features engages all of the "#if
8543 +   (!_POSIX_SOURCE)" clauses in the UnixWare header files, which in turn
8544 +   prevent us from having modem signals, access to the hardware flow
8545 +   control APIs, select(), etc -- in short, all the other things we need
8546 +   in communications software, especially when high speeds are used. Oh
8547 +   the irony. And so C-Kermit must be shamelessly butchered -- as it has
8548 +   been so many times before -- to allow us to have the needed features
8549 +   from the POSIX and non-POSIX worlds. See the UNIXWAREPOSIX sections of
8550 +   [483]ckutio.c.
8551 +
8552 +   After the butchery, we wind up with Unixware 2.x having full
8553 +   modem-signal capability, but politically-correct Unixware 7.x lacking
8554 +   the ability to automatically detect a broken connection when carrier
8555 +   drops.
8556 +
8557 +   Meanwhile the Unixware tcsetspeed() function allows any number at all
8558 +   (any long, 0 or positive) as an argument and succeeds if the number is
8559 +   a legal bit rate for the serial device, and fails otherwise. There is
8560 +   no list anywhere of legal speeds. Thus the SET SPEED keyword table
8561 +   ("set speed ?" to see it) is hardwired based on trial and error with
8562 +   all known serial speeds, the maximum being 115200. However, to allow
8563 +   for the possibility that other speeds might be allowed in the future
8564 +   (or with different port drivers), the SET SPEED command for UnixWare 7
8565 +   only allows you to specify any number at all; a warning is printed if
8566 +   the number is not in the list, but the number is accepted anyway; the
8567 +   command succeeds if tcsetspeed() accepts the number, and fails
8568 +   otherwise.
8569 +
8570 +   In C-Kermit 8.0 testing, it was noticed that the POSIX method for
8571 +   hanging up the phone by dropping DTR (set speed 0, pause, restore
8572 +   speed) did not actually drop DTR. The APIs do not return any error
8573 +   indication, but nothing happens. I changed tthang() to skip the special
8574 +   case I had made for Unixware and instead follow the normal path: if
8575 +   TIOCSDTR is defined use that, otherwise blah blah... It turns out
8576 +   TIOCSDTR *is* defined, and it works.
8577 +
8578 +   So in Unixware (at least in 2.1.3) we can read modem signals, hangup by
8579 +   toggling DTR, and so on, BUT... But once the remote hangs up and
8580 +   Carrier drops, the API for reading modem signals ceases to function;
8581 +   although the device is still open, the TIOCMGET ioctl always raises
8582 +   errno 6 = ENXIO, "No such device or address".
8583 +
8584 +   Old business:
8585 +
8586 +   Using C-Kermit 6.0 on the UnixWare 1.1 Application Server, one user
8587 +   reported a system panic when the following script program is executed:
8588 +
8589 +  set line /dev/tty4
8590 +  set speed 9600
8591 +  output \13
8592 +  connect
8593 +
8594 +   The panic does not happen if a PAUSE is inserted:
8595 +
8596 +  set line /dev/tty4
8597 +  set speed 9600
8598 +  pause 1
8599 +  output \13
8600 +  connect
8601 +
8602 +   This is using a Stallion EasyIO card installed as board 0 on IRQ 12 on
8603 +   a Gateway 386 with the Stallion-supplied driver. The problem was
8604 +   reported to Novell and Stallion and (reportedly) is now fixed.
8605 +
8606 +3.11. C-KERMIT AND APOLLO SR10
8607 +
8608 +   [ [484]Top ] [ [485]Contents ] [ [486]Section Contents ] [ [487]Next ]
8609 +   [ [488]Previous ]
8610 +
8611 +   Reportedly, version 5A(190), when built under Apollo SR10 using "make
8612 +   sr10-bsd", compiles, links, and executes OK, but leaves the terminal
8613 +   unusable after it exits -- the "cs7" or "cs8" (character size)
8614 +   parameter has become cs5. The terminal must be reset from another
8615 +   terminal. Cause and cure unknown. Suggested workaround: Wrap Kermit in
8616 +   a shell script something like:
8617 +
8618 +  kermit @*
8619 +  stty sane
8620 +
8621 +3.12. C-KERMIT AND TANDY XENIX 3.0
8622 +
8623 +   [ [489]Top ] [ [490]Contents ] [ [491]Section Contents ] [ [492]Next ]
8624 +   [ [493]Previous ]
8625 +
8626 +   C-Kermit 7.0 was too big to be built on Tandy Xenix, even in a minimum
8627 +   configuration; version 6.0 is the last one that fits.
8628 +
8629 +   Reportedly, in C-Kermit 6.0, if you type lots of Ctrl-C's during
8630 +   execution of the initialization file, ghost Kermit processes will be
8631 +   created, and will compete for the keyboard. They can only be removed
8632 +   via "kill -9" from another terminal, or by rebooting. Diagnosis --
8633 +   something strange happening with the SIGINT handler while the process
8634 +   is reading the directory (it seems to occur during the SET PROMPT
8635 +   [\v(dir)] ... sequence). Cure: unknown. Workaround: don't interrupt
8636 +   C-Kermit while it is executing its init file on the Tandy 16/6000.
8637 +
8638 +3.13. C-KERMIT AND OSF/1 (DIGITAL UNIX) (TRU64 UNIX)
8639 +
8640 +   [ [494]Top ] [ [495]Contents ] [ [496]Section Contents ] [ [497]Next ]
8641 +   [ [498]Previous ]
8642 +
8643 +   While putting together and testing C-Kermit 8.0, it was discovered that
8644 +   binaries built for one version of Tru64 Unix (e.g. 4.0G) might exhibit
8645 +   very strange behavior if run on a different version of Tru64 Unix (e.g.
8646 +   5.1A). The typical symptom was that a section of the initialization
8647 +   file would be skipped, notably locating the dialing and/or network
8648 +   directory as well as finding and executing the customization file,
8649 +   ~/.mykermrc. This problem also is reported to occur on Tru64 Unix 5.0
8650 +   (Rev 732) even when running a C-Kermit binary that was built there.
8651 +   However, the Tru64 5.1A binary works correctly on 5.0. Go figure.
8652 +
8653 +   When making Telnet connections to a Digital Unix or Tru64 system, and
8654 +   your Telnet client forwards your user name, the Telnet server evidently
8655 +   stuffs the username into login's standard input, and you see:
8656 +
8657 +  login: ivan
8658 +  Password:
8659 +
8660 +   This is clearly going to play havoc with scripts that look for
8661 +   "login:". Workaround (when Kermit is your Telnet client): SET LOGIN
8662 +   USER to nothing, to prevent Kermit from sending your user ID.
8663 +
8664 +   Before you can use a serial port on a new Digital Unix system, you must
8665 +   run uucpsetup to enable or configure the port. Evidently the /dev/tty00
8666 +   and 01 devices that appear in the configuration are not usable;
8667 +   uucpsetup turns them into /dev/ttyd00 and 01, which are. Note that
8668 +   uucpsetup and other uucp-family programs are quite primitive -- they
8669 +   only know about speeds up to 9600 bps and their selection of modems
8670 +   dates from the early 1980s. None of this affects Kermit, though -- with
8671 +   C-Kermit, you can use speeds up to 115200 bps (at least in DU4.0 and
8672 +   later) and modern modems with hardware flow control and all the rest.
8673 +
8674 +   Reportedly, if a modem is set for &S0 (assert DSR at all times), the
8675 +   system resets or drops DTR every 30 seconds; reportedly DEC says to set
8676 +   &S1.
8677 +
8678 +   Digital Unix 3.2 evidently wants to believe your terminal is one line
8679 +   longer than you say it is, e.g. when a "more" or "man" command is
8680 +   given. This is has nothing to do with C-Kermit, but tends to annoy
8681 +   those who use Kermit or other terminal emulators to access Digital Unix
8682 +   systems. Workaround: tell Unix to "stty rows 23" (or whatever).
8683 +
8684 +   Reportedly, there is some bizarre behavior when trying to use a version
8685 +   of C-Kermit built on one Digital Unix 4.0 system on another one,
8686 +   possibly due to differing OS or library revision levels; for example,
8687 +   the inability to connect to certain TCP/IP hosts. Solution: rebuild
8688 +   C-Kermit from source code on the system where you will be using it.
8689 +
8690 +   Digital Unix tgetstr() causes a segmentation fault. C-Kermit 7.0 added
8691 +   #ifdefs to avoid calling this routine in Digital Unix. As a result, the
8692 +   SCREEN commands always send ANSI escape sequences -- even though curses
8693 +   knows your actual terminal type.
8694 +
8695 +   Reportedy the Tru64 Unix 4.0E 1091 Telnet server does not tolerate
8696 +   streaming transfers into itself, at least not when the sending Kermit
8697 +   is on the same local network. Solution: tell one Kermit or the other
8698 +   (or both) to "set streaming off". This might or might be the case with
8699 +   earlier and/or later Tru64, Digital Unix, and OSF/1 releases.
8700 +
8701 +3.14. C-KERMIT AND SGI IRIX
8702 +
8703 +   [ [499]Top ] [ [500]Contents ] [ [501]Section Contents ] [ [502]Next ]
8704 +   [ [503]Previous ]
8705 +
8706 +   See also:
8707 +     * The [504]comp.sys.sgi.misc and [505]comp.sys.sgi.admin newsgroups.
8708 +       [506]The SGI website
8709 +     * The SGI FAQ:
8710 +          + [507]http://www-viz.tamu.edu/~sgi-faq/
8711 +          + [508]ftp://viz.tamu.edu/pub/sgi/faq/
8712 +
8713 +   About IRIX version numbers: "uname -a" tells the "two-digit" version
8714 +   number, such as "5.3" or "6.5". The three-digit form can be seen with
8715 +   "uname -R". (this information is unavailable at the simple API level).
8716 +   Supposedly all three-digit versions within the same two-digit version
8717 +   (e.g. 6.5.2, 6.5.3) are binary compatible; i.e. a binary built on any
8718 +   one of them should run on all others. The "m" suffix denotes just
8719 +   patches; the "f" suffix indicates that features were added.
8720 +
8721 +   An IRIX binary built on lower MIPS model (Instruction Set Architecture,
8722 +   ISA) can run on higher models, but not vice versa:
8723 +
8724 +     MIPS1 R3000 and below
8725 +     MIPS2 R4000
8726 +     MIPS3 R4x00
8727 +     MIPS4 R5000 and above
8728 +
8729 +   Furthermore, there are different Application Binary Inferfaces (ABIs):
8730 +
8731 +     COFF    32 bits, IRIX 5.3, 5.2, 5.1, 4.x and below
8732 +     o32 ELF 32 bits, IRIX 5.3, 6.0 - 6.5
8733 +     N32 ELF 32 bits, IRIX 6.2 - 6.5
8734 +     N64 ELF 64 bits, IRIX 6.2 - 6.5
8735 +
8736 +   Thus a prebuilt IRIX binary works on a particular machine only if (a)
8737 +   the machine's IRIX version (to one decimal place) is equal to or
8738 +   greater than the version under which the binary was built; (b) the
8739 +   machine's MIPS level is greater or equal to that of the binary; and (c)
8740 +   the machine supports the ABI of the binary. If all three conditions are
8741 +   not satisfied, of course, you can build a binary yourself from source
8742 +   code since, unlike some other Unix vendors, SGI does supply a C
8743 +   compiler and libraries.
8744 +
8745 +   SGI did not supply an API for hardware flow control prior to IRIX 5.2.
8746 +   C-Kermit 6.1 and higher for IRIX 5.2 and higher supports hardware flow
8747 +   control in the normal way, via "set flow rts/cts".
8748 +
8749 +   For hardware flow control on earlier IRIX and/or C-Kermit versions, use
8750 +   the ttyf* (modem control AND hardware flow control) devices and not the
8751 +   ttyd* (direct) or ttym* (modem control but no hardware flow control)
8752 +   ones, and obtain the proper "hardware handshaking" cable from SGI,
8753 +   which is incompatible with the ones for the Macintosh and NeXT even
8754 +   though they look the same ("man serial" for further info) and tell
8755 +   Kermit to "set flow keep" and "set modem flow rts/cts".
8756 +
8757 +   Serial speeds higher than 38400 are available in IRIX 6.2 and later, on
8758 +   O-class machines (e.g. Origin, Octane) only, and are supported by
8759 +   C-Kermit 7.0 and later. Commands such as "set speed 115200" may be
8760 +   given on other models (e.g. Iris, Indy, Indigo) but will fail because
8761 +   the OS reports an invalid speed for the device.
8762 +
8763 +   Experimentation with both IRIX 5.3 and 6.2 shows that when logged in to
8764 +   IRIX via Telnet, that remote-mode C-Kermit can't send files if the
8765 +   packet length is greater than 4096; the Telnet server evidently has
8766 +   this restriction (or bug), since there is no problem sending long
8767 +   packets on serial or rlogin connections. However, it can receive files
8768 +   with no problem if the packet length is greater than 4096. As a
8769 +   workaround, the FAST macro for IRIX includes "set send packet-length
8770 +   4000". IRIX 6.5.1 does not have this problem, so evidently it was fixed
8771 +   some time after IRIX 6.2. Tests show file-transfer speeds are better
8772 +   (not worse) with 8K packets than with 4K packets from IRIX 6.5.1.
8773 +
8774 +   Reportedly some Indys have bad serial port hardware. IRIX 5.2, for
8775 +   example, needs patch 151 to work around this; or upgrade to a later
8776 +   release. Similarly, IRIX 5.2 has several problems with serial i/o, flow
8777 +   control, etc. Again, patch or upgrade.
8778 +
8779 +   Reportedly on machines with IRIX 4.0, Kermit cannot be suspended by
8780 +   typing the suspend ("swtch") character if it was started from csh, even
8781 +   though other programs can be suspended this way, and even though the Z
8782 +   and SUSPEND commands still work correctly. This is evidently because
8783 +   IRIX's csh does not deliver the SIGTSTP signal to Kermit. The reason
8784 +   other programs can be suspended in the same environment is probably
8785 +   that they do not trap SIGTSTP themselves, so the shell is doing the
8786 +   suspending rather than the application.
8787 +
8788 +   Also see notes about IRIX 3.x in the [509]C-Kermit for Unix
8789 +   Installation Instructions.
8790 +
8791 +   If you have problems making TCP/IP connections in versions of IRIX
8792 +   built with GCC 2.95.2, see the bugs section of:
8793 +
8794 +  [510]http://freeware.sgi.com/Installable/gcc-2.95.2.html.
8795 +
8796 +   Reportedly, if you allow gcc to compile C-Kermit on Irix you should be
8797 +   aware that there might be problems with some of the network code. The
8798 +   specifics are at
8799 +   [511]http://freeware.sgi.com/Installable/gcc-2.95.2.html; scroll down
8800 +   to the "known bugs" section at the end of the document.
8801 +
8802 +3.15. C-KERMIT AND THE BEBOX
8803 +
8804 +   [ [512]Top ] [ [513]Contents ] [ [514]Section Contents ] [ [515]Next ]
8805 +   [ [516]Previous ]
8806 +
8807 +   See also: The [517]comp.sys.be newsgroup.
8808 +
8809 +   The BeBox has been discontinued and BeOS repositioned for PC platforms.
8810 +   The POSIX parts of BeOS are not finished, nor is the sockets library,
8811 +   therefore a fully functional version of C-Kermit is not possible. In
8812 +   version 6.0 of C-Kermit, written for BeOS DR7, it was possible to:
8813 +
8814 +     * set line /dev/serial2 (and probably the other serial ports)
8815 +     * set speed 115200 (and at least some of the lower baud rates)
8816 +     * connect
8817 +     * set modem type hayes (and likely others, too)
8818 +     * dial phone-number
8819 +     * set send packet-length 2048 (other lengths for both send and
8820 +       receive)
8821 +     * set receive packet length 2048
8822 +     * set file type binary (text mode works, too) (with remote kermit
8823 +       session in server mode)
8824 +     * put bedrop.jpg
8825 +     * get bedrop.jpg
8826 +     * get bedrop.jpg bedrop.jpg2
8827 +     * finish, bye
8828 +
8829 +   The following do not work:
8830 +     * kermit does not detect modem hangup
8831 +     * !/RUN/PUSH [commandline command]
8832 +     * Running kermit in remote mode
8833 +     * Using other protocols (x/y/zmodem)
8834 +     * TCP networking interface (Be's TCP/IP API has a ways to go, still)
8835 +
8836 +   C-Kermit does not work on BeOS DR8 because of changes in the underlying
8837 +   APIs. Unfortunately not enough changes were made to allow the regular
8838 +   POSIX-based C-Kermit to work either. Note: the lack of a fork() service
8839 +   requires the select()-based CONNECT module, but there is no select().
8840 +   There is a select() in DR8, but it doesn't work.
8841 +
8842 +   C-Kermit 7.0 was built for BeOS 4.5 and works in remote mode. It does
8843 +   not include networking support since the APIs are still not there. It
8844 +   is not known if dialing out works, but probably not. Be experts are
8845 +   welcome to lend a hand.
8846 +
8847 +3.16. C-KERMIT AND DG/UX
8848 +
8849 +   [ [518]Top ] [ [519]Contents ] [ [520]Section Contents ] [ [521]Next ]
8850 +   [ [522]Previous ]
8851 +
8852 +   Somebody downloaded the C-Kermit 6.0 binary built under DG/UX 5.40 and
8853 +   ran it under DG/UX 5.4R3.10 -- it worked OK except that file dates for
8854 +   incoming files were all written as 1 Jan 1970. Cause and cure unknown.
8855 +   Workaround: SET ATTRIBUTE DATE OFF. Better: Use a version of C-Kermit
8856 +   built under and for DG/UX 5.4R3.10.
8857 +
8858 +3.17. C-KERMIT AND SEQUENT DYNIX
8859 +
8860 +   [ [523]Top ] [ [524]Contents ] [ [525]Section Contents ] [ [526]Next ]
8861 +   [ [527]Previous ]
8862 +
8863 +   Reportedly, when coming into a Sequent Unix (DYNIX) system through an
8864 +   X.25 connection, Kermit doesn't work right because the Sequent's
8865 +   FIONREAD ioctl returns incorrect data. To work around, use the
8866 +   1-character-at-a-time version of myread() in ckutio.c (i.e. undefine
8867 +   MYREAD in ckutio.c and rebuild the program). This is unsatisfying
8868 +   because two versions of the program would be needed -- one for use over
8869 +   X.25, and the other for serial and TCP/IP connections.
8870 +
8871 +3.18. C-KERMIT AND FREEBSD, OPENBSD, and NETBSD
8872 +
8873 +   [ [528]Top ] [ [529]Contents ] [ [530]Section Contents ] [ [531]Next ]
8874 +   [ [532]Previous ]
8875 +
8876 +   Some NebBSD users have reported difficulty escaping back from CONNECT
8877 +   mode, usually when running NetBSD on non-PC hardware. Probably a
8878 +   keyboard issue.
8879 +
8880 +   NetBSD users have also reported that C-Kermit doesn't pop back to the
8881 +   prompt if the modem drops carrier. This needs to be checked out & fixed
8882 +   if possible.
8883 +
8884 +   (All the above seems to work properly in C-Kermit 7.0 and later.)
8885 +
8886 +3.19. C-KERMIT AND MAC OS X
8887 +
8888 +   [ [533]Top ] [ [534]Contents ] [ [535]Section Contents ] [ [536]Next ]
8889 +   [ [537]Previous ]
8890 +
8891 +   Mac OS X is Apple's 4.4BSD Unix variety, closely related to FreeBSD,
8892 +   but different. "uname -a" is singularly uninformative, as in Linux,
8893 +   giving only the Darwin kernel version number. The way to find out the
8894 +   actual Mac OS X version is with
8895 +
8896 +     /usr/bin/sw_vers -productName
8897 +     /usr/bin/sw_vers -productVersion
8898 +
8899 +   or:
8900 +
8901 +     fgrep -A 1 'ProductVersion'
8902 +     /System/Library/CoreServices/SystemVersion.plist
8903 +
8904 +   Here are some points to be aware of:
8905 +
8906 +     * A big gotcha for Kermit users is that Mac OS X does not support
8907 +       serial ports and, as far as I can tell, doesn't support its
8908 +       built-in modem either, for anything other than making Internet
8909 +       connections. Macintoshes capable of running Mac OS X, such as the
8910 +       G5 and later, come without serial ports and without any APIs to
8911 +       support them, and also without the UUCP family of programs
8912 +       (including cu), nor any standard for serial-port lockfile
8913 +       directory.
8914 +     * Early versions of Mac OS X came without Curses, Termlib, or
8915 +       Terminfo libraries. Later versions seem to have ncurses (it would
8916 +       seem that Mac OS X 10.3.9 was the first mature and complete version
8917 +       of Mac OS X). Kermit uses curses for its file-transfer display. See
8918 +       elsewhere about curses-vs-ncurses confusion.
8919 +     * In the HFS+ file system, filenames are case-folded. Thus "makefile"
8920 +       and "Makefile" are the same file. So, for example, suppose you are
8921 +       sending two distinct files, Foo and FOO, from (say) Linux to Mac OS
8922 +       X. This will produce a file collision that will be handled
8923 +       according to Mac OS X C-Kermit's FILE COLLISION setting, which by
8924 +       default is BACKUP, so the Mac will wind up with files called FOO
8925 +       and Foo.~1~.
8926 +     * HSF+ files that are composed of a resource fork and a data fork...
8927 +       I doubt that C-Kermit does anything useful with them. There is no
8928 +       code in C-Kermit for traditional two-forked Macintosh files, but it
8929 +       could be added if there is any demand (code for this existed in
8930 +       [538]Mac Kermit, the old pre-Mac-OS-X Macintosh version of
8931 +       C-Kermit).
8932 +     * In case you want to transfer a traditional Macintosh text file (or
8933 +       data fork of a file that is plain text), you can use these C-Kermit
8934 +       commands:
8935 +
8936 +set file eol cr
8937 +set file character-set apple-quickdraw
8938 +send /text filename
8939 +
8940 +     * File or pathnames that include spaces must be enclosed in either
8941 +       doublequotes or curly braces in C-Kermit commands.
8942 +     * Mac OS X can use a third-party package manager called "fink".
8943 +       Various fink packages for C-Kermit are floating around that are not
8944 +       standard releases. For example, there's a C-Kermit 8.0.201 package
8945 +       in which C-Kermit was modifed (at least) to use a UUCP lockfile
8946 +       directory that does not exist on vanilla Mac OS X systems.
8947 +
8948 +Mac OS X and Serial Ports
8949 +
8950 +   Apple is in the forefront of companies that believe serial ports have
8951 +   no use in the modern world and so has simply eliminated all traces of
8952 +   them from its machines and OS. But of course serial ports are still
8953 +   needed to connect not only to external modems, but also to the control
8954 +   ports of hubs, routers, terminal servers, PBXs, and similar devices,
8955 +   not to mention barcode readers, POS systems and components, speaking
8956 +   devices, hand calculators such as the HP48, automated factory-floor
8957 +   equipment, and scientific, medical, and lab equipment (to name a few).
8958 +   Among workers in these areas, there is a need to add serial ports back
8959 +   onto this platform, which is being filled by third-party products such
8960 +   as the [539]Keyspan High Speed USB Serial Adapter USA-19HS, which has a
8961 +   DB-9 male connector. To use the Keyspan device, you must install the
8962 +   accompanying device drivers, which winds up giving you serial ports
8963 +   with names like /dev/cu.USA19H3b1P1.1, /dev/cu.KeySerial1,
8964 +   /dev/tty.KeySerial1.
8965 +
8966 +   C-Kermit 9.0 works "out of the box" with third-party serial ports on
8967 +   Mac OS X, because it is built by default ("make macosx") without the
8968 +   "UUCP lockfile" feature. If you have C-Kermit 9.0 on a personal
8969 +   Macintosh, you can skip the next section.
8970 +
8971 +Mac OS X Serial Ports with C-Kermit 8.0 and earlier
8972 +
8973 +   In earlier versions of C-Kermit, you'll need to either build a special
8974 +   -DNOUUCP version, or deal with the UUCP port contention sytem in
8975 +   [540]all its glory (this is usually an exercise in futility because any
8976 +   other applications on your Mac that use the serial port will not
8977 +   necessarily follow the same conventions):
8978 +
8979 +    1. su (or sudo -s)
8980 +       chgrp xxxx /var/spool/lock
8981 +       chmod g+w /var/spool/lock
8982 +       chgrp xxxx /dev/cu.*
8983 +       (where xxxx is the name of the group for users to whom serial-port
8984 +       access is to be granted). Use "admin" or other existing group, or
8985 +       create a new group if desired. NB:
8986 +
8987 +     In the absence of official guidance from Apple or anyone else, we
8988 +     choose /var/spool/lock as the lockfile directory because this
8989 +     directory (a) already exists on vanilla Mac OS X installations, and
8990 +     (b) it is the directory used for serial-port lockfiles on many other
8991 +     platforms.
8992 +    2. Put all users who need access to the serial port in the same group.
8993 +    3. Make sure the serial device files that are to be used by C-Kermit
8994 +       have group read-write permission and (if you care) lack world
8995 +       read-write permission, e.g.:
8996 +
8997 +     chmod g+rw,o-rw /dev/cu.*
8998 +
8999 +   If you do the above, then there's no need to become root to use Kermit,
9000 +   or to make Kermit suid or sgid. Just do this:
9001 +
9002 +chmod 775 wermit
9003 +mv wermit /usr/local/kermit
9004 +
9005 +   (or whatever spot is more appropriate, e.g. /usr/bin/). For greater
9006 +   detail about installation, [541]CLICK HERE.
9007 +
9008 +   Alternatively, to build a pre-9.0 version of C-Kermit without UUCP
9009 +   lockfile support, set the NOUUCP flag; e.g. (for Mac OS 10.4):
9010 +
9011 +     make macosx10.4 KFLAGS=-DNOUUCP
9012 +
9013 +   This circumvents the SET PORT failure "?Access to lockfile directory
9014 +   denied". But it also sacrifices Kermit's ability to ensure that only
9015 +   one copy of Kermit can have the device open at a time, since Mac OS X
9016 +   is the same as all other varieties of Unix in that exclusive access to
9017 +   serial ports is not enforced in any way. But if it's for your own
9018 +   desktop machine that nobody else uses, a -DNOUUCP version might be
9019 +   adequate and preferable to the alternatives.
9020 +
9021 +   To build C-Kermit 9.0 with UUCP support, do:
9022 +
9023 +     make macosx KFLAGS=-UNOUUCP
9024 +
9025 +   (note: "-U", not "-D).
9026 +
9027 +RS-232 versus RS-422
9028 +
9029 +   Meanwhile, back when Macs had serial ports, they were not RS-232 (the
9030 +   standard for connecting computers with nearby modems) but rather RS-422
9031 +   or -423 (a standard for connecting serial devices over longer
9032 +   distances). Macintosh serial ports do not support modems well because
9033 +   they do not have enough wires (or more properly in the case RS-422/423,
9034 +   wire pairs) to convey a useful subset of modem signals.
9035 +
9036 +   Keyspan also sells a [542]USB Twin Serial Adapter that gives you two
9037 +   Mini-Din8 RS-422 ports, that are no better (or worse) for communicating
9038 +   with modems or serial devices than a real Mac Din-8 port was. In
9039 +   essense, you get Data In, Data Out, and two modem signals. It looks to
9040 +   me as if the signals chosen by Keyspan are RTS and CTS. This gives you
9041 +   hardware flow control, but at the expense of Carrier Detect. Thus to
9042 +   use C-Kermit with a Keyspan USB serial port, you must tell C-Kermit to:
9043 +
9044 +set modem type none                ; (don't expect a modem)
9045 +set carrier-watch off              ; (ignore carrier signal)
9046 +set port /dev/cu.USA19H3b1P1.1     ; (open the port)
9047 +set flow rts/cts                   ; (this is the default)
9048 +set speed 57600                    ; (or whatever)
9049 +connect                            ; (or DIAL or whatever)
9050 +
9051 +   Use Ctrl-\C in the normal manner to escape back to the C-Kermit>
9052 +   prompt. Kermit can't pop back to its prompt automatically when Carrier
9053 +   drops because there is no Carrier signal in the physical interface.
9054 +
9055 +   Here's a typical sequence for connecting to Cisco devices (using a
9056 +   mixture of command-line options and interactive commands at the
9057 +   prompt):
9058 +
9059 +$ ckermit -l /dev/cu.USA19H3b1P1.1 -b 9600
9060 +C-Kermit> set carrier-watch off
9061 +C-Kermit> connect
9062 +
9063 +   Instructions for the built-in modem (if any) remain to be written due
9064 +   to lack of knowledge. If you can contribute instructions, hints, or
9065 +   tips, please [543]send them in.
9066 +
9067 +3.20. C-KERMIT AND COHERENT
9068 +
9069 +   [ [544]Top ] [ [545]Contents ] [ [546]Section Contents ] [
9070 +   [547]Previous ]
9071 +
9072 +   Also see:
9073 +
9074 +     [548]http://www.uni-giessen.de/faq/archiv/coherent-faq.general/msg000
9075 +   00.html
9076 +
9077 +   Mark Williams COHERENT was perhaps the first commercial Unix-based
9078 +   operating system for PCs, first appearing about 1983 or -84 for the
9079 +   PC/XT (?), and popular until about 1993, when Linux took over.
9080 +   C-Kermit, as of version 8.0, is still current for COHERENT 386 4.2
9081 +   (i.e. only for i386 and above). Curses is included, but lots of other
9082 +   features are omitted due to lack of the appropriate OS features, APIs,
9083 +   libraries, hardware, or just space: e.g. TCP/IP, floating-point
9084 +   arithmetic, learned scripts. Earlier versions of COHERENT ran on 8086
9085 +   and 80286, but these are to small to build or run C-Kermit, but
9086 +   G-Kermit should be OK (as might be ancient versions of C-Kermit).
9087 +
9088 +   You can actually build a version with floating point support -- just
9089 +   take -DNOFLOAT out of CFLAGS and add -lm to LIBS; NOFLOAT is the
9090 +   default because COHERENT tends to run on old PCs that don't have
9091 +   floating-point hardware. You can also add "-f" to CFLAGS to have it
9092 +   link in the floating-point emulation library. Also I'm not sure why
9093 +   -DNOLEARN is included, since it depends on select(), which COHERENT
9094 +   has.
9095 +
9096 +4. GENERAL UNIX-SPECIFIC HINTS, LIMITATIONS, AND BUGS
9097 +
9098 +   [ [549]Top ] [ [550]Contents ] [ [551]Next ] [ [552]Previous ]
9099 +
9100 +4.1. Modem Signals
9101 +
9102 +   There seems to be an escalating demand for the ability to control "dumb
9103 +   serial devices" (such as "smartcard readers", barcode readers, etc) by
9104 +   explicitly manipulating modem signals, particularly RTS. This might
9105 +   have been easy to do in DOS, where there is no operating system
9106 +   standing between the application and the serial device, but it is
9107 +   problematic in Unix, where modem signals are controlled by the serial
9108 +   device driver. If the driver does not provide an API for doing this,
9109 +   then the application can't do it. If it does provide an API, expect it
9110 +   to be totally different on each Unix platform, since there is no
9111 +   standard for this.
9112 +
9113 +4.2. NFS Troubles
9114 +
9115 +   Beginning with C-Kermit 6.0, the default C-Kermit prompt includes your
9116 +   current (working) directory; for example:
9117 +
9118 +  [/usr/olga] C-Kermit>
9119 +
9120 +   (In C-Kermit 7.0 the square braces were replaced by round parentheses
9121 +   to avoid conflicts with ISO 646 national character sets.)
9122 +
9123 +   If that directory is on an NFS-mounted disk, and NFS stops working or
9124 +   the disk becomes unavailable, C-Kermit will hang waiting for NFS and/or
9125 +   the disk to come back. Whether you can interrupt C-Kermit when it is
9126 +   hung this way depends on the specific OS. Kermit has called the
9127 +   operating systems's getcwd() function, and is waiting for it to return.
9128 +   Some versions of Unix (e.g. HP-UX 9.x) allow this function to be
9129 +   interrupted with SIGINT (Ctrl-C), others (such as HP-UX 8.x) do not. To
9130 +   avoid this effect, you can always use SET PROMPT to change your prompt
9131 +   to something that does not involve calling getcwd(), but if NFS is not
9132 +   responding, C-Kermit will still hang any time you give a command that
9133 +   refers to an NFS-mounted directory. Also note that in some cases, the
9134 +   uninterruptibility of NFS-dependent system or library calls is
9135 +   considered a bug, and sometimes there are patches. For HP-UX, for
9136 +   example:
9137 +
9138 +                                                        replaced by:
9139 +  HP-UX 10.20     libc    PHCO_8764                     PHCO_14891/PHCO_16723
9140 +  HP-UX 10.10     libc    PHCO_8763                     PHCO_14254/PHCO_16722
9141 +  HP-UX 9.x       libc    PHCO_7747       S700          PHCO_13095
9142 +  HP-UX 9.x       libc    PHCO_6779       S800          PHCO_11162
9143 +
9144 +4.3. C-Kermit as Login Shell
9145 +
9146 +   You might have reason to make C-Kermit the login shell for a specific
9147 +   user, by entering the pathname of Kermit (possibly with command-line
9148 +   switches, such as -x to put it in server mode) into the shell field of
9149 +   the /etc/passwd file. This works pretty well. In some cases, for
9150 +   "ultimate security", you might want to use a version built with
9151 +   -DNOPUSH (see the [553]Configurations Options document for this, but
9152 +   even if you don't, then PUSHing or shelling out from C-Kermit just
9153 +   brings up a new copy of C-Kermit (but warning: this does not prevent
9154 +   the user from explicitly running a shell; e.g. "run /bin/sh"; use
9155 +   NOPUSH to prevent this).
9156 +
9157 +4.4. C-Kermit versus screen and splitvt
9158 +
9159 +   C-Kermit file transfers will probably not work if attemped through the
9160 +   "splitvt" or GNU "screen" programs because the screen optimization (or
9161 +   at least, line wrapping, control-character absorption) done by this
9162 +   package interferes with Kermit's packets.
9163 +
9164 +   The same can apply to any other environment in which the user's session
9165 +   is captured, monitored, recorded, or manipulated. Examples include the
9166 +   'script' program (for making a typescript of a session), the
9167 +   Computronics PEEK package and pksh (at least versions of it prior to
9168 +   1.9K), and so on.
9169 +
9170 +   You might try the following -- what we call "doomsday Kermit" --
9171 +   settings to push packets through even the densest and most obstructive
9172 +   connections, such as "screen" and "splitvt" (and certain kinds of 3270
9173 +   protocol emulators): Give these commands to BOTH Kermit programs:
9174 +
9175 +  SET FLOW NONE
9176 +  SET CONTROL PREFIX ALL
9177 +  SET RECEIVE PACKET-LENGTH 70
9178 +  SET RECEIVE START 62
9179 +  SET SEND START 62
9180 +  SET SEND PAUSE 100
9181 +  SET BLOCK B
9182 +
9183 +   If it works, it will be slow.
9184 +
9185 +4.5. C-Kermit versus DOS Emulators
9186 +
9187 +   On Unix workstations equipped with DOS emulators like SoftPC, watch out
9188 +   for what these emulators do to the serial port drivers. After using a
9189 +   DOS emulator, particularly if you use it to run DOS communications
9190 +   software, you might have to reconfigure the serial ports for use by
9191 +   Unix.
9192 +
9193 +4.6. C-Kermit versus Job Control
9194 +
9195 +   Interruption by Ctrl-Z makes Unix C-Kermit try to suspend itself with
9196 +   kill(0,SIGTSTP), but only on platforms that support job control, as
9197 +   determined by whether the symbol SIGTSTP is defined (or on POSIX or
9198 +   SVR4 systems, if syconf(_SC_JOB_CONTROL) or _POSIX_JOB_CONTROL in
9199 +   addition to SIGTSTP). However, if Kermit is running under a login shell
9200 +   (such as the original Bourne shell) that does not support job control,
9201 +   the user's session hangs and must be logged out from another terminal,
9202 +   or hung up on. There is no way Kermit can defend itself against this.
9203 +   If you use a non-job control shell on a computer that supports job
9204 +   control, give a command like "stty susp undef" to fix it so the suspend
9205 +   signal is not attached to any particular key, or give the command SET
9206 +   SUSPEND OFF to C-Kermit, or build C-Kermit with -DNOJC.
9207 +
9208 +4.7. Dates and Times
9209 +
9210 +   Unix time conversion functions typically apply locale rules to return
9211 +   local time in terms of any seasonal time zone change in effect for the
9212 +   given date. The diffdate function assumes that the same timezone rules
9213 +   are in effect for both dates, but a date with timezone information will
9214 +   be converted to the local time zone in effect at the given time, e.g.,
9215 +   a GMT specification will produce either a Standard Time or Daylight
9216 +   Savings Time, depending on which applies at the given time. An example
9217 +   using the 2001 seasonal change from EDT (-0400) to EST (-0500):
9218 +
9219 +  C-Kermit> DATE 20011028 05:01:02 GMT  ; EDT
9220 +  20011028 01:01:02
9221 +  C-Kermit> DATE 20011028 06:01:02 GMT  ; EST
9222 +  20011028 01:01:02
9223 +  C-Kermit>
9224 +
9225 +   but the implicit change in timezone offset is not recognized:
9226 +
9227 +  C-Kermit> echo \fdiffdate(20011028 05:01:02 GMT, 20011028 06:01:02 GMT)
9228 +  +0:00
9229 +  C-Kermit>
9230 +
9231 +   Date/time arithmetic, offsets, delta times, and timezone support are
9232 +   new to C-Kermit 8.0, and might be expected to evolve and improve in
9233 +   subsequent releases.
9234 +
9235 +   On some platforms, files downloaded with HTTP receive the current
9236 +   timestamp, rather than the HTTP "Last Modified" time (this can be fixed
9237 +   by including utime.h, e.g. in SunOS and Tru64...).
9238 +
9239 +4.8. Pseudoterminals
9240 +
9241 +   The SSH and PTY commands work by assigning a pseudoterminal and reading
9242 +   and writing from it. Performance varies according to the specific
9243 +   platform ranging from very fast to very flow.
9244 +
9245 +   SSH and PTY commands can fail if (a) all pseudoterminals are in use; or
9246 +   (b) you do not have read/write access to the pseudoterminal that was
9247 +   assigned. An example of (b) was reported with the Zipslack Slackware
9248 +   Linux distribution, in which the pseudoterminals were created with
9249 +   crw-r--r-- permission, instead of crw-rw-rw-.
9250 +
9251 +4.9. Miscellaneous
9252 +
9253 +     * Reportedly, the Unix C-Kermit server, under some conditions, on
9254 +       certain particular systems, fails to log out its login session upon
9255 +       receipt of a BYE command. Before relying on the BYE command
9256 +       working, test it a few times to make sure it works on your system:
9257 +       there might be system configuration or security mechanisms to
9258 +       prevent an inferior process (like Kermit) from killing a superior
9259 +       one (like the login shell).
9260 +     * On AT&T 7300 (3B1) machines, you might have to "stty nl1" before
9261 +       starting C-Kermit. Do this if characters are lost during
9262 +       communications operations.
9263 +     * Under the bash shell (versions prior to 1.07 from CWRU), "pushing"
9264 +       to an inferior shell and then exiting back to Kermit leaves Kermit
9265 +       in the background such that it must be explicitly fg'd. This is
9266 +       reportedly fixed in version 1.07 of bash (and definitely in modern
9267 +       bash versions).
9268 +
9269 +5. INITIALIZATION AND COMMAND FILES
9270 +
9271 +   [ [554]Top ] [ [555]Contents ] [ [556]Next ] [ [557]Previous ]
9272 +
9273 +   C-Kermit's initialization file for Unix is .kermrc (lowercase, starts
9274 +   with period) in your home directory, unless Kermit was built with the
9275 +   system-wide initialization-file option (see the [558]C-Kermit for Unix
9276 +   Installation Instructions).
9277 +
9278 +   C-Kermit identifies your home directory based on the environment
9279 +   variable, HOME. Most Unix systems set this variable automatically when
9280 +   you log in. If C-Kermit can't find your initialization file, check your
9281 +   HOME variable:
9282 +
9283 +  echo $HOME      (at the Unix prompt)
9284 +
9285 +   or:
9286 +
9287 +  echo \$(HOME)   (at the C-Kermit prompt)
9288 +
9289 +   If HOME is not defined, or is defined incorrectly, add the appropriate
9290 +   definition to your Unix .profile or .login file, depending on your
9291 +   shell:
9292 +
9293 +  setenv HOME full-pathname-of-your-home-directory  (C-Shell, .login file)
9294 +
9295 +   or:
9296 +
9297 +  HOME=full-pathname-of-your-home-directory         (sh, ksh, .profile file)
9298 +  export HOME
9299 +
9300 +   NOTE: Various other operations depend on the correct definition of
9301 +   HOME. These include the "tilde-expansion" feature, which allows you to
9302 +   refer to your home directory as "~" in filenames used in C-Kermit
9303 +   commands, e.g.:
9304 +
9305 +  send ~/.kermrc
9306 +
9307 +   as well as the \v(home) variable.
9308 +
9309 +   Prior to version 5A(190), C-Kermit would look for its initialization
9310 +   file in the current directory if it was not found in the home
9311 +   directory. This feature was removed from 5A(190) because it was a
9312 +   security risk. Some people, however, liked this behavior and had
9313 +   .kermrc files in all their directories that would set up things
9314 +   appropriately for the files therein. If you want this behavior, you can
9315 +   accomplish it in various ways, for example:
9316 +
9317 +     * Create a shell alias, for example:
9318 +  alias kd="kermit -Y ./.kermrc"
9319 +
9320 +     * Create a .kermrc file in your home directory, whose contents are:
9321 +  take ./.kermrc
9322 +
9323 +   Suppose you need to pass a password from the Unix command line to a
9324 +   C-Kermit script program, in such a way that it does not show up in "ps"
9325 +   or "w" listings. Here is a method (not guaranteed to be 100% secure,
9326 +   but definitely more secure than the more obvious methods):
9327 +
9328 +  echo mypassword | kermit myscript
9329 +
9330 +   The "myscript" file contains all the commands that need to be executed
9331 +   during the Kermit session, up to and including EXIT, and also includes
9332 +   an ASK or ASKQ command to read the password from standard input, which
9333 +   has been piped in from the Unix 'echo' command, but it must not include
9334 +   a CONNECT command. Only "kermit myscript" shows up in the ps listing.
9335 +
9336 +6. COMMUNICATION SPEED SELECTION
9337 +
9338 +   [ [559]Top ] [ [560]Contents ] [ [561]Next ] [ [562]Previous ]
9339 +
9340 +   Version-7 based Unix implementations, including 4.3 BSD and earlier and
9341 +   Unix systems based upon BSD, use a 4-bit field to record a serial
9342 +   device's terminal speed. This leaves room for 16 speeds, of which the
9343 +   first 14 are normally:
9344 +
9345 +     0, 50, 75, 110, 134.5, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
9346 +     and 9600
9347 +
9348 +   The remaining two are usually called EXTA and EXTB, and are defined by
9349 +   the particular Unix implementation. C-Kermit determines which speeds
9350 +   are available on your system based on whether symbols for them are
9351 +   defined in your terminal device header files. EXTA is generally assumed
9352 +   to be 19200 and EXTB 38400, but these assumptions might be wrong, or
9353 +   they might not apply to a particular device that does not support these
9354 +   speeds. Presumably, if you try to set a speed that is not legal on a
9355 +   particular device, the driver will return an error, but this can not be
9356 +   guaranteed.
9357 +
9358 +   On these systems, it is usually not possible to select a speed of 14400
9359 +   bps for use with V.32bis modems. In that case, use 19200 or 38400 bps,
9360 +   configure your modem to lock its interface speed and to use RTS/CTS
9361 +   flow control, and tell C-Kermit to SET FLOW RTS/CTS and SET DIAL
9362 +   SPEED-MATCHING OFF.
9363 +
9364 +   The situation is similar, but different, in System V. SVID Third
9365 +   Edition lists the same speeds, 0 through 38400.
9366 +
9367 +   Some versions of Unix, and/or terminal device drivers that come with
9368 +   certain third-party add-in high-speed serial communication interfaces,
9369 +   use the low "baud rates" to stand for higher ones. For example, SET
9370 +   SPEED 50 gets you 57600 bps; SET SPEED 75 gets you 76800; SET SPEED 110
9371 +   gets 115200.
9372 +
9373 +   SCO ODT 3.0 is an example where a "baud-rate-table patch" can be
9374 +   applied that can rotate the tty driver baud rate table such that
9375 +   600=57600 and 1800=115k baud. Similarly for Digiboard
9376 +   multiport/portservers, which have a "fastbaud" setting that does this.
9377 +   Linux has a "setserial" command that can do it, etc.
9378 +
9379 +   More modern Unixes support POSIX-based speed setting, in which the
9380 +   selection of speeds is not limited by a 4-bit field. C-Kermit 6.1
9381 +   incorporates a new mechanism for finding out (at compile time) which
9382 +   serial speeds are supported by the operating system that does not
9383 +   involve editing of source code by hand; on systems like Solaris 5.1,
9384 +   IRIX 6.2, and SCO OSR5.0.4, "set speed ?" will list speeds up to 460800
9385 +   or 921600. In C-Kermit 7.0 and later:
9386 +
9387 +    1. If a symbol for a particular speed (say B230400 for 230400 bps)
9388 +       appears in whatever header file defines acceptable serial speeds
9389 +       (e.g. <termbits.h> or <sys/termios.h> or <sys/ttydev.h>, etc), the
9390 +       corresponding speed will appear in C-Kermit's "set speed ?" list.
9391 +    2. The fact that a given speed is listed in the header files and
9392 +       appears in C-Kermit's list does not mean the driver will accept it.
9393 +       For example, a computer might have some standard serial ports plus
9394 +       some add-on ones with different drivers that accept a different
9395 +       repertoire of speeds.
9396 +    3. The fact that a given speed is accepted by the driver does not
9397 +       guarantee the underlying hardware can accept it.
9398 +
9399 +   When Kermit is given a "set speed" command for a particular device, the
9400 +   underlying system service is called to set the speed; its return code
9401 +   is checked and the SET SPEED command fails if the return code indicates
9402 +   failure. Regardless of the system service return status, the device's
9403 +   speed is then read back and if it does not match the speed that was
9404 +   requested, an error message is printed and the command fails.
9405 +
9406 +   Even when the command succeeds, this does not guarantee successful
9407 +   operation at a particular speed, especially a high one. That depends on
9408 +   electricity, information theory, etc. How long is the cable, what is
9409 +   its capacitance, how well is it shielded, etc, not to mention that
9410 +   every connection has two ends and its success depends on both of them.
9411 +   (With the obvious caveats about internal modems, is the cable really
9412 +   connected, interrupt conflicts, etc etc etc).
9413 +
9414 +   Note, in particular, that there is a certain threshold above which
9415 +   modems can not "autobaud" -- i.e. detect the serial interface speed
9416 +   when you type AT (or whatever else the modem's recognition sequence
9417 +   might be). Such modems need to be engaged at a lower speed (say 2400 or
9418 +   9600 or even 115200 -- any speed below their autobaud threshold) and
9419 +   then must be given a modem-specific command (which can be found in the
9420 +   modem manual) to change their interface speed to the desired higher
9421 +   speed, and then the software must also be told to change to the new,
9422 +   higher speed.
9423 +
9424 +   For additional information, read [563]Section 9.5 of the Installation
9425 +   Instructions, plus any platform-specific notes in [564]Section 3 above.
9426 +
9427 +7. COMMUNICATIONS AND DIALING
9428 +
9429 +   [ [565]Top ] [ [566]Contents ] [ [567]Next ] [ [568]Previous ]
9430 +
9431 +7.1. Serial Ports and Modems
9432 +
9433 +   If you SET LINE to a serial port modem-control device that has nothing
9434 +   plugged in to it, or has a modem connected that is powered off, and you
9435 +   have not given a prior SET MODEM TYPE or SET CARRIER-WATCH OFF command,
9436 +   the SET LINE command is likely to hang. In most cases, you can Ctrl-C
9437 +   out. If not, you'll have to kill C-Kermit from another terminal.
9438 +
9439 +   Similarly, if you give a SET MODEM TYPE HAYES (or USR, or any other
9440 +   modem type besides DIRECT, NONE, or UNKNOWN) and then SET LINE to an
9441 +   empty port, the subsequent close (implicit or explicit) is liable to
9442 +   hang or even crash (through no fault of Kermit's -- the hanging or
9443 +   crashing is inside a system call such as cfsetospeed() or close()).
9444 +
9445 +   The SET CARRIER-WATCH command works as advertised only if the
9446 +   underlying operating system and device drivers support this feature; in
9447 +   particular only if a read() operation returns immediately with an error
9448 +   code if the carrier signal goes away or, failing that, if C-Kermit can
9449 +   obtain the modem signals from the device driver (you can tell by giving
9450 +   a "set line" command to a serial device, and then a "show
9451 +   communications" command -- if modem signals are not listed, C-Kermit
9452 +   won't be able to detect carrier loss, the WAIT command will not work,
9453 +   etc). Of course, the device itself (e.g. modem) must be configured
9454 +   appropriately and the cables convey the carrier and other needed
9455 +   signals, etc.
9456 +
9457 +   If you dial out from Unix system, but then notice a lot of weird
9458 +   character strings being stuck into your session at random times
9459 +   (especially if they look like +++ATQ0H0 or login banners or prompts),
9460 +   that means that getty is also trying to control the same device. You'll
9461 +   need to dial out on a device that is not waiting for a login, or else
9462 +   disable getty on the device.
9463 +
9464 +   As of version 7.0, C-Kermit makes explicit checks for the Carrier
9465 +   Detect signal, and so catches hung-up connections much better than 6.0
9466 +   and earlier. However, it still can not be guaranteed to catch every
9467 +   ever CD on-to-off transition. For example, when the HP-UX version of
9468 +   C-Kermit is in CONNECT mode on a dialed connection and CARRIER-WATCH ON
9469 +   or AUTO, and you turn off the modem, HP-UX is stuck in a read() that
9470 +   never returns. (C-Kermit does not pop back to its prompt automatically,
9471 +   but you can still escape back.)
9472 +
9473 +   If, on the other hand, you log out from the remote system, and it hangs
9474 +   up, and CD drops on the local modem, C-Kermit detects this and pops
9475 +   back to the prompt as it should. (Evidently there can be a difference
9476 +   between CD and DSR turning off at the same time, versus CD turning off
9477 +   while DSR stays on; experimentation with &S0/&S1/&S2 on your modem
9478 +   might produce the desired results).
9479 +
9480 +   When Unix C-Kermit exits, it closes (and must close) the communications
9481 +   device. If you were dialed out, this will most likely hang up the
9482 +   connection. If you want to get out of Kermit and still use Kermit's
9483 +   communication device, you have several choices:
9484 +
9485 +    1. Shell out from Kermit or suspend Kermit, and refer to the device
9486 +       literally (as in "term -blah -blah < /dev/cua > /dev/cua").
9487 +    2. Shell out from Kermit and use the device's file descriptor which
9488 +       Kermit makes available to you in the \v(ttyfd) variable.
9489 +    3. Use C-Kermit's REDIRECT command.
9490 +    4. Use C-Kermit new EXEC /REDIRECT command.
9491 +
9492 +   If you are having trouble dialing:
9493 +
9494 +    1. Make sure the dialout line is configured correctly. More about this
9495 +       below.
9496 +    2. Make sure all necessary patches are installed for your operating
9497 +       system.
9498 +    3. If you can't dial on a "bidirectional" line, then configure it for
9499 +       outbound-only (remove the getty) and try again. (The mechanisms --
9500 +       if any -- for grabbing bidirectional lines for dialout vary wildly
9501 +       among Unix implementations and releases, and C-Kermit -- which runs
9502 +       on well over 300 different Unix variations -- makes no effort to
9503 +       keep up with them; the recommended method for coping with this
9504 +       situation is to wrap C-Kermit in a shell script that takes the
9505 +       appropriate actions.)
9506 +    4. Make sure C-Kermit's SET DIAL and SET MODEM parameters agree with
9507 +       the modem you are actually using -- pay particular attention to SET
9508 +       DIAL SPEED-MATCHING.
9509 +    5. If MODEM HANGUP-METHOD is set to RS232-SIGNAL, change it to
9510 +       MODEM-COMMAND. Or vice-versa.
9511 +    6. Try SET DIAL HANGUP OFF before the DIAL command. Also, SET DIAL
9512 +       DISPLAY ON to watch what's happening. See [569]Section 8 of the
9513 +       [570]Installation Instructions.
9514 +    7. Read pages 50-67 of [571]Using C-Kermit.
9515 +    8. As a last resort, don't use the DIAL command at all; SET CARRIER
9516 +       OFF and CONNECT to the modem and dial interactively, or write a
9517 +       script program to dial the modem.
9518 +
9519 +   Make sure your dialout line is correctly configured for dialing out (as
9520 +   opposed to login). The method for doing this is different for each kind
9521 +   of Unix system. Consult your system documentation for configuring lines
9522 +   for dialing out (for example, Sun SparcStation IPC users should read
9523 +   the section "Setting up Modem Software" in the Desktop SPARC Sun System
9524 +   & Network Manager's Guide; HP-9000 workstation users should consult the
9525 +   manual Configuring HP-UX for Peripherals, etc).
9526 +
9527 +   Symptom: DIAL works, but a subsequent CONNECT command does not.
9528 +   Diagnosis: the modem is not asserting Carrier Detect (CD) after the
9529 +   connection is made, or the cable does not convey the CD signal. Cure:
9530 +   Reconfigure the modem, replace the cable. Workaround: SET CARRIER OFF
9531 +   (at least in System-V based Unix versions).
9532 +
9533 +   For Berkeley-Unix-based systems (4.3BSD and earlier), Kermit includes
9534 +   code to use LPASS8 mode when parity is none, which is supposed to allow
9535 +   8-bit data and Xon/Xoff flow control at the same time. However, as of
9536 +   edit 174, this code is entirely disabled because it is unreliable: even
9537 +   though the host operating system might (or might not) support LPASS8
9538 +   mode correctly, the host access protocols (terminal servers, telnet,
9539 +   rlogin, etc) generally have no way of finding out about it and
9540 +   therefore render it ineffective, causing file transfer failures. So as
9541 +   of edit 174, Kermit once again uses rawmode for 8-bit data, and so
9542 +   there is no Xon/Xoff flow control during file transfer or terminal
9543 +   emulation in the Berkeley-based versions (4.3 and earlier, not 4.4).
9544 +
9545 +   Also on Berkeley-based systems (4.3 and earlier), there is apparently
9546 +   no way to configure a dialout line for proper carrier handling, i.e.
9547 +   ignore carrier during dialing, require carrier thereafter, get a fatal
9548 +   error on any attempt to read from the device after carrier drops (this
9549 +   is handled nicely in System V by manipulation of the CLOCAL flag). The
9550 +   symptom is that carrier loss does not make C-Kermit pop back to the
9551 +   prompt automatically. This is evident on the NeXT, for example, but not
9552 +   on SunOS, which supports the CLOCAL flag. This is not a Kermit problem,
9553 +   but a limitation of the underlying operating system. For example, the
9554 +   cu program on the NeXT doesn't notice carrier loss either, whereas cu
9555 +   on the Sun does.
9556 +
9557 +   On certain AT&T Unix systems equipped with AT&T modems, DIAL and HANGUP
9558 +   don't work right. Workarounds: (1) SET DIAL HANGUP OFF before
9559 +   attempting to dial; (2) If HANGUP doesn't work, SET LINE, and then SET
9560 +   LINE <device> to totally close and reopen the device. If all else
9561 +   fails, SET CARRIER OFF.
9562 +
9563 +   C-Kermit does not contain any particular support for AT&T DataKit
9564 +   devices. You can use Kermit software to dial in to a DataKit line, but
9565 +   C-Kermit does not contain the specialized code required to dial out
9566 +   from a DataKit line. If the Unix system is connected to DataKit via
9567 +   serial ports, dialout should work normally (e.g. set line /dev/ttym1,
9568 +   set speed 19200, connect, and then see the DESTINATION: prompt, from
9569 +   which you can connect to another computer on the DataKit network or to
9570 +   an outgoing modem pool, etc). But if the Unix system is connected to
9571 +   the DataKit network through the special DataKit interface board, then
9572 +   SET LINE to a DataKit pseudodevice (such as /dev/dk031t) will not work
9573 +   (you must use the DataKit "dk" or "dkcu" program instead). In C-Kermit
9574 +   7.0 and later, you can make Kermit connections "though" dk or dkcu
9575 +   using "set line /pty".
9576 +
9577 +   In some BSD-based Unix C-Kermit versions, SET LINE to a port that has
9578 +   nothing plugged in to it with SET CARRIER ON will hang the program (as
9579 +   it should), but it can't be interrupted with Ctrl-C. The interrupt trap
9580 +   is correctly armed, but apparently the Unix open() call cannot be
9581 +   interrupted in this case. When SET CARRIER is OFF or AUTO, the SET LINE
9582 +   will eventually return, but then the program hangs (uninterruptibly)
9583 +   when the EXIT or QUIT command (or, presumably, another SET LINE
9584 +   command) is given. The latter is probably because of the attempt to
9585 +   hang up the modem. (In edit 169, a timeout alarm was placed around this
9586 +   operation.)
9587 +
9588 +   With SET DIAL HANGUP OFF in effect, the DIAL command might work only
9589 +   once, but not again on the same device. In that case, give a CLOSE
9590 +   command to close the device, and then another SET LINE command to
9591 +   re-open the same device. Or rebuild your version of Kermit with the
9592 +   -DCLSOPN compile-time switch.
9593 +
9594 +   The DIAL command says "To cancel: Type your interrupt character
9595 +   (normally Ctrl-C)." This is just one example of where program messages
9596 +   and documentation assume your interrupt character is Ctrl-C. But it
9597 +   might be something else. In most (but not necessarily all) cases, the
9598 +   character referred to is the one that generates the SIGINT signal. If
9599 +   Ctrl-C doesn't act as an interrupt character for you, type the Unix
9600 +   command "stty -a" or "stty all" or "stty everything" to see what your
9601 +   interrupt character is. (Kermit could be made to find out what the
9602 +   interrupt character is, but this would require a lot of
9603 +   platform-dependent coding and #ifdefs, and a new routine and interface
9604 +   between the platform-dependent and platform-independent parts of the
9605 +   program.)
9606 +
9607 +   In general, the hangup operation on a serial communication device is
9608 +   prone to failure. C-Kermit tries to support many, many different kinds
9609 +   of computers, and there seems to be no portable method for hanging up a
9610 +   modem connection (i.e. turning off the RS-232 DTR signal and then
9611 +   turning it back on again). If HANGUP, DIAL, and/or Ctrl-\H do not work
9612 +   for you, and you are a programmer, look at the tthang() function in
9613 +   ckutio.c and see if you can add code to make it work correctly for your
9614 +   system, and send the code to the address above. (NOTE: This problem has
9615 +   been largely sidestepped as of edit 188, in which Kermit first attempts
9616 +   to hang up the modem by "escaping back" via +++ and then giving the
9617 +   modem's hangup command, e.g. ATH0, when DIAL MODEM-HANGUP is ON, which
9618 +   is the default setting.)
9619 +
9620 +   Even when Kermit's modem-control software is configured correctly for
9621 +   your computer, it can only work right if your modem is also configured
9622 +   to assert the CD signal when it is connected to the remote modem and to
9623 +   hang up the connection when your computer drops the DTR signal. So
9624 +   before deciding Kermit doesn't work with your modem, check your modem
9625 +   configuration AND the cable (if any) connecting your modem to the
9626 +   computer -- it should be a straight-through [572]modem cable conducting
9627 +   the signals FG, SG, TD, RD, RTS, CTS, DSR, DTR, CD, and RI.
9628 +
9629 +   Many Unix systems keep aliases for dialout devices; for example,
9630 +   /dev/acu might be an alias for /dev/tty00. But most of these Unix
9631 +   systems also use UUCP lockfile conventions that do not take this
9632 +   aliasing into account, so if one user assigns (e.g.) /dev/acu, then
9633 +   another user can still assign the same device by referring to its other
9634 +   name. This is not a Kermit problem -- Kermit must follow the lockfile
9635 +   conventions used by the vendor-supplied software (cu, tip, uucp).
9636 +
9637 +   The SET FLOW-CONTROL KEEP option should be given *before* any
9638 +   communication (dialing, terminal emulation, file transfer,
9639 +   INPUT/OUTPUT/TRANSMIT, etc) is attempted, if you want C-Kermit to use
9640 +   all of the device's preexisting flow-control related settings. The
9641 +   default flow-control setting is XON/XOFF, and it will take effect when
9642 +   the first communication-related command is given, and a subsequent SET
9643 +   FLOW KEEP command will not necessarily know how to restore *all* of the
9644 +   device's original flow-control settings.
9645 +
9646 +7.2. Network Connections
9647 +
9648 +   C-Kermit tries to use the 8th bit for data when parity is NONE, and
9649 +   this generally works on real Unix terminal (tty) devices, but it often
9650 +   does not work when the Unix system is accessed over a network via
9651 +   telnet or rlogin protocols, including (in many cases) through terminal
9652 +   servers. For example, an Encore computer with Annex terminal servers
9653 +   only gives a 7-bit path if the rlogin protocol is selected in the
9654 +   terminal server but it gives the full 8 bits if the proprietary RDP
9655 +   protocol is used.
9656 +
9657 +   If file transfer does not work through a host to which you have
9658 +   rlogin'd, use "rlogin -8" rather than "rlogin". If that doesn't work,
9659 +   tell both Kermit programs to "set parity space".
9660 +
9661 +   The Encore TELNET server does not allow long bursts of input. When you
9662 +   have a TELNET connection to an Encore, tell C-Kermit on the Encore to
9663 +   SET RECEIVE PACKET-LENGTH 200 or thereabouts.
9664 +
9665 +8. HARDWARE FLOW CONTROL
9666 +
9667 +   [ [573]Top ] [ [574]Contents ] [ [575]Next ] [ [576]Previous ]
9668 +
9669 +   SET FLOW RTS/CTS is available in Unix C-Kermit only when the underlying
9670 +   operating system provides an Application Program Interface (API) for
9671 +   turning this feature on and off under program control, which turns out
9672 +   to be a rather rare feature among Unix systems. To see if your Unix
9673 +   C-Kermit version supports hardware flow control, type "set flow ?" at
9674 +   the C-Kermit prompt, and look for "rts/cts" among the options. Other
9675 +   common situations include:
9676 +
9677 +    1. The API is available, so "set flow rts/cts" appears as a valid
9678 +       C-Kermit command, but it doesn't do anything because the device
9679 +       driver (part of the operating system) was never coded to do
9680 +       hardware flow control. This is common among System V R4
9681 +       implementations (details below).
9682 +    2. The API is not available, so "set flow rts/cts" does NOT appear as
9683 +       a valid C-Kermit command, but you can still get RTS/CTS flow
9684 +       control by selecting a specially named device in your SET LINE
9685 +       command. Examples:
9686 +          + NeXTSTEP: /dev/cufa instead of /dev/cua, /dev/cufb instead of
9687 +            /dev/cub (68040 only; "man zs" for further info).
9688 +          + IRIX: /dev/ttyf2 instead of /dev/ttyd2 or /dev/ttym2 ("man 7
9689 +            serial").
9690 +    3. The API is available, doesn't work, but a workaround as in (2) can
9691 +       be used.
9692 +    4. The API is available, but Kermit doesn't know about it. In these
9693 +       cases, you can usually use an stty command to enable RTS/CTS on the
9694 +       device, e.g. "stty crtscts" or "stty ctsflow", "stty rtsflow",
9695 +       before starting Kermit, and then tell Kermit to SET FLOW KEEP.
9696 +    5. No API and no special device drivers. Hardware flow control is
9697 +       completely unavailable.
9698 +
9699 +   System V R4 based Unixes are supposed to supply a <termiox.h> file,
9700 +   which gives Kermit the necessary interface to command the terminal
9701 +   driver to enable/disable hardware flow control. Unfortunately, but
9702 +   predictably, many implementations of SVR4 whimsically place this file
9703 +   in /usr/include/sys rather than /usr/include (where SVID clearly
9704 +   specifies it should be; see SVID, Third Edition, V1, termiox(BA_DEV).
9705 +   Thus if you build C-Kermit with any of the makefile entries that
9706 +   contain -DTERMIOX or -DSTERMIOX (the latter to select <sys/termiox.h>),
9707 +   C-Kermit will have "set flow rts/cts" and possibly other hardware
9708 +   flow-control related commands. BUT... That does not necessarily mean
9709 +   that they will work. In some cases, the underlying functions are simply
9710 +   not coded into the operating system.
9711 +
9712 +   WARNING: When hardware flow control is available, and you enable in
9713 +   Kermit on a device that is not receiving the CTS signal, Kermit can
9714 +   hang waiting for CTS to come up. This is most easily seen when the
9715 +   local serial port has nothing plugged in to it, or is connected to an
9716 +   external modem that is powered off.
9717 +
9718 +9. TERMINAL CONNECTION AND KEY MAPPING
9719 +
9720 +   [ [577]Top ] [ [578]Contents ] [ [579]Next ] [ [580]Previous ]
9721 +
9722 +   C-Kermit is not a terminal emulator. Refer to page 147 of [581]Using
9723 +   C-Kermit, 2nd Edition: "Most versions of C-Kermit -- Unix, VMS, AOS/VS,
9724 +   VOS, etc -- provide terminal connection without emulation. These
9725 +   versions act as a 'semitransparent pipe' between the remote computer
9726 +   and your terminal, terminal emulator, console driver, or window, which
9727 +   in turn emulates (or is) a specific kind of terminal." The environment
9728 +   in which you run C-Kermit is up to you.
9729 +
9730 +   If you are an X Windows user, you should be aware of an alternative to
9731 +   xterm that supports VT220 emulation, from Thomas E. Dickey:
9732 +
9733 +  [582]http://dickey.his.com/xterm/xterm.html
9734 +
9735 +   Unix C-Kermit's SET KEY command currently can not be used with keys
9736 +   that generate "wide" scan codes or multibyte sequences, such as
9737 +   workstation function or arrow keys, because Unix C-Kermit does not have
9738 +   direct access to the keyboard.
9739 +
9740 +   However, many Unix workstations and/or console drivers provide their
9741 +   own key mapping feature. With xterm, for example, you can use 'xmodmap'
9742 +   ("man xmodmap" for details); here is an xterm mapping to map the Sun
9743 +   keyboard to DEC VT200 values for use with VT-terminal oriented
9744 +   applications like VMS EVE:
9745 +
9746 +  keycode 101=KP_0
9747 +  keycode 119=KP_1
9748 +  keycode 120=KP_2
9749 +  keycode 121=KP_3
9750 +  keycode 98=KP_4
9751 +  keycode 99=KP_5
9752 +  keycode 100=KP_6
9753 +  keycode 75=KP_7
9754 +  keycode 76=KP_8
9755 +  keycode 77=KP_9
9756 +  keycode 52=KP_F1
9757 +  keycode 53=KP_F2
9758 +  keycode 54=KP_F3
9759 +  keycode 57=KP_Decimal
9760 +  keycode 28=Left
9761 +  keycode 29=Right
9762 +  keycode 30=KP_Separator
9763 +  keycode 105=KP_F4
9764 +  keycode 78=KP_Subtract
9765 +  keycode 8=Left
9766 +  keycode 10=Right
9767 +  keycode 32=Up
9768 +  keycode 33=Down
9769 +  keycode 97=KP_Enter
9770 +
9771 +   Users of Linux consoles can use loadkeys ("man dumpkeys loadkeys
9772 +   keytables" for details. The format used by loadkeys is compatible with
9773 +   that used by Xmodmap, although it is not definitely certain that the
9774 +   keycodes are compatible for different keyboard types (e.g. Sun vs HP vs
9775 +   PC, etc).
9776 +
9777 +10. FILE TRANSFER
9778 +
9779 +   [ [583]Top ] [ [584]Contents ] [ [585]Next ] [ [586]Previous ]
9780 +
9781 +   On most platforms, C-Kermit can not handle files longer than 2^31 or
9782 +   2^32 bytes long, because it uses the traditional file i/o APIs that use
9783 +   32-bit words to represent the file size. To accommodate longer files,
9784 +   we would have to switch to a new and different API. Unfortunately, each
9785 +   platform has a different one, a nightmare to handle in portable code.
9786 +   The C-Kermit file code was written in the days long before files longer
9787 +   than 2GB were supported or even contemplated in the operating systems
9788 +   where C-Kermit ran.
9789 +
9790 +   If uploads (or downloads) fail immediately, give the CAUTIOUS command
9791 +   to Kermit and try again. If they still fail, then try SET PREFIXING
9792 +   ALL. If they still fail, try SET PARITY SPACE. If they still fail, try
9793 +   ROBUST.
9794 +
9795 +   If reception (particularly of large files and/or binary files) begins
9796 +   successfully but then fail constently after a certain amount of bytes
9797 +   have been sent, check:
9798 +
9799 +     * Your ulimit ("ulimit -a")
9800 +     * The amount of available space on the target disk ("df ." or "df -k
9801 +       .")
9802 +     * Your personal disk quota (platform- and site-dependent)
9803 +     * The maximum file size on the receiver's file system (e.g. 2GB in
9804 +       old verions the Linux VFS file system, and/or in applications that
9805 +       have not been recoded to use new "large file" APIs).
9806 +     * If it's an NFS-mounted disk (if so, try uploading to a local disk)
9807 +     * Is there an "idle limit" on the receiving end?
9808 +
9809 +   If none of these seem to explain it, then the problem is not size
9810 +   related, but reflects some clash between the file contents and the
9811 +   characteristics of the connection, in which case follow the
9812 +   instructions in the first paragraph of this section.
9813 +
9814 +   Suppose two copies of Kermit are receiving files into the same
9815 +   directory, and the files have the same name, e.g. "foo.bar". Whichever
9816 +   one starts first opens an output file called "foo.bar". The second one
9817 +   sees there is already a foo.bar file, and so renames the existing
9818 +   foo.bar to foo.bar.~1~ (or whatever). When the first file has been
9819 +   received completely, Kermit goes to change its modification time and
9820 +   permissions to those given by the file sender in the Attribute packet.
9821 +   But in Unix, the APIs for doing this take a filename, not a file
9822 +   descriptor. Since the first Kermit's file has been renamed, and the
9823 +   second Kermit is using the original name, the first Kermit changes the
9824 +   modtime and permissions of the second Kermit's file, not its own.
9825 +   Although there might be a way to work around this in the code, e.g.
9826 +   using inode numbers to keep track of which file is which, this would be
9827 +   tricky and most likely not very portable. It's better to set up your
9828 +   application to prevent such things from happening, which is easy enough
9829 +   using the script language, filename templates, etc.
9830 +
9831 +   Suppose you start C-Kermit with a command-line argument to send or
9832 +   receive a file (e.g. "kermit -r") and then type Ctrl-\c immediately
9833 +   afterwards to escape back and initiate the other end of the transfer,
9834 +   BUT your local Kermit's escape character is not Ctrl-\. In this case,
9835 +   the local Kermit passes the Ctrl-\ to the remote system, and if this is
9836 +   Unix, Ctrl-\ is likely to be its SIGQUIT character, which causes the
9837 +   current program to halt and dump core. Well, just about the first thing
9838 +   C-Kermit does when it starts is to disable the SIGQUIT signal. However,
9839 +   it is still possible for SIGQUIT to cause Kermit to quit and dump core
9840 +   if it is delivered while Kermit is being loaded or started, before the
9841 +   signal can be disabled. There's nothing Kermit itself can do about
9842 +   this, but you can prevent it from happening by disabling SIGQUIT in
9843 +   your Unix session. The command is usually something like:
9844 +
9845 +  stty quit undef
9846 +
9847 +   Unix C-Kermit does not reject incoming files on the basis of size.
9848 +   There appears to be no good (reliable, portable) way to determine in
9849 +   advance how much disk space is available, either on the device, or
9850 +   (when quotas or other limits are involved) to the user.
9851 +
9852 +   Unix C-Kermit discards all carriage returns from incoming files when in
9853 +   text mode.
9854 +
9855 +   If C-Kermit has problems creating files in writable directories when it
9856 +   is installed setuid or setgid on BSD-based versions of Unix such as
9857 +   NeXTSTEP 3.0, it probably needs to be rebuilt with the -DSW_ACC_ID
9858 +   compilation switch.
9859 +
9860 +   If you SET FILE DISPLAY FULLSCREEN, and C-Kermit complains "Sorry,
9861 +   terminal type not supported", it means that the terminal library
9862 +   (termcap or termlib) that C-Kermit was built with does not know about a
9863 +   terminal whose name is the current value of your TERM environment
9864 +   variable. If this happens, but you want to have the fullscreen file
9865 +   transfer display, EXIT from C-Kermit and set a Unix terminal type from
9866 +   among the supported values that is also supported by your terminal
9867 +   emulator, or else have an entry for your terminal type added to the
9868 +   system termcap and/or terminfo database.
9869 +
9870 +   If you attempt to suspend C-Kermit during local-mode file transfer and
9871 +   then continue it in the background (via bg), it will block for "tty
9872 +   output" if you are using the FULLSCREEN file transfer display. This is
9873 +   apparently a problem with curses. Moving a local-mode file transfer
9874 +   back and forth between foreground and background works correctly,
9875 +   however, with the SERIAL, CRT, BRIEF, or NONE file transfer displays.
9876 +
9877 +   If C-Kermit's command parser no longer echoes, or otherwise acts
9878 +   strangely, after returning from a file transfer with the fullscreen
9879 +   (curses) display, and the curses library for your version of Unix
9880 +   includes the newterm() function, then try rebuilding your version of
9881 +   C-Kermit with -DCK_NEWTERM. Similarly if it echoes doubly, which might
9882 +   even happen during a subsequent CONNECT session. If rebuilding with
9883 +   -DCK_NEWTERM doesn't fix it, then there is something very strange about
9884 +   your system's curses library, and you should probably not use it. Tell
9885 +   C-Kermit to SET FILE DISPLAY CRT, BRIEF, or anything else other than
9886 +   FULLSCREEN, and/or rebuild without -DCK_CURSES, and without linking
9887 +   with (termlib and) curses. Note: This problem seemed to have escalated
9888 +   in C-Kermit 7.0, and -DCK_NEWTERM had to be added to many builds that
9889 +   previously worked without it: Linux, AIX 4.1, DG/UX, etc. In the Linux
9890 +   case, it is obviously because of changes in the (n)curses library; the
9891 +   cause in the other cases is not known.
9892 +
9893 +   C-Kermit creates backup-file names (such as "oofa.txt.~1~") based on
9894 +   its knowledge of the maximum filename length on the platform where it
9895 +   is running, which is learned at compile time, based on MAXNAMLEN or
9896 +   equivalent symbols from the system header files. But suppose C-Kermit
9897 +   is receiving files on a Unix platform that supports long filenames, but
9898 +   the incoming files are being stored on an NFS-mounted file system that
9899 +   supports only short names. NFS maps the external system to the local
9900 +   APIs, so C-Kermit has no way of knowing that long names will be
9901 +   truncated. Or that C-Kermit is running on a version of Unix that
9902 +   supports both long-name and short-name file systems simultaneously
9903 +   (such as HP-UX 7.00). This can cause unexpected behavior when creating
9904 +   backup files, or worse. For example, you are sending a group of files
9905 +   whose names are differentiated only by characters past the point at
9906 +   which they would be truncated, each file will overwrite the previous
9907 +   one upon arrival.
9908 +
9909 +11. EXTERNAL FILE TRANSFER PROTOCOLS
9910 +
9911 +   [ [587]Top ] [ [588]Contents ] [ [589]Next ] [ [590]Previous ]
9912 +
9913 +   SECTION CONTENTS
9914 +
9915 +  11.1. [591]C-Kermit as an External Protocol
9916 +  11.2. [592]Invoking External Protocols from C-Kermit
9917 +
9918 +   Unix C-Kermit can be used in conjunction with other communications
9919 +   software in various ways. C-Kermit can be invoked from another
9920 +   communications program as an "external protocol", and C-Kermit can also
9921 +   invoke other communication software to perform external protocols.
9922 +
9923 +   This sort of operation makes sense only when you are dialing out from
9924 +   your Unix system (or making a network connection from it). If the Unix
9925 +   system is the one you have dialed in to, you don't need any of these
9926 +   tricks. Just run the desired software on your Unix system instead of
9927 +   Kermit. When dialing out from a Unix system, the difficulty is getting
9928 +   two programs to share the same communication device in spite of the
9929 +   Unix UUCP lockfile mechanism, which would normally prevent any sharing,
9930 +   and preventing the external protocol from closing (and therefore
9931 +   hanging up) the device when it exits back to the program that invoked
9932 +   it.
9933 +
9934 +11.1. C-KERMIT AS AN EXTERNAL PROTOCOL
9935 +
9936 +   [ [593]Top ] [ [594]Contents ] [ [595]Section Contents ] [ [596]Next ]
9937 +
9938 +   (This section deleted; see [597]Using C-Kermit, 2nd Ed, Chapter 14.)
9939 +
9940 +   "pcomm" is a general-purpose terminal program that provides file
9941 +   transfer capabilities itself (X- and YMODEM variations) and the ability
9942 +   to call on external programs to do file transfers (ZMODEM and Kermit,
9943 +   for example). You can tell pcomm the command to send or receive a file
9944 +   with an external protocol:
9945 +                        Send                            Receive
9946 +        ZMODEM          sz filename                     rz
9947 +        Kermit          kermit -s filename              kermit -r
9948 +
9949 +   pcomm runs external programs for file transfer by making stdin and
9950 +   stdout point to the modem port, and then exec-ing "/bin/sh -c xxx"
9951 +   (where xxx is the appropriate command). However, C-Kermit does not
9952 +   treat stdin and stdout as the communication device unless you instruct
9953 +   it:
9954 +
9955 +
9956 +                        Send                            Receive
9957 +        Kermit          kermit -l 0 -s filename         kermit -l 0 -r
9958 +
9959 +   The "-l 0" option means to use file descriptor 0 for the communication
9960 +   device.
9961 +
9962 +   In general, any program can pass any open file descriptor to C-Kermit
9963 +   for the communication device in the "-l" command-line option. When
9964 +   Kermit is given a number as the argument to the "-l" option, it simply
9965 +   uses it as a file descriptor, and it does not attempt to close it upon
9966 +   exit.
9967 +
9968 +   Here's another example, for Seyon (a Linux communication program).
9969 +   First try the technique above. If that works, fine; otherwise... If
9970 +   Seyon does not give you a way to access and pass along the file
9971 +   descriptor, but it starts up the Kermit program with its standard i/o
9972 +   redirected to its (Seyon's) communications file descriptor, you can
9973 +   also experiment with the following method, which worked here in brief
9974 +   tests on SunOS. Instead of having Seyon use "kermit -r" or "kermit -s
9975 +   filename" as its Kermit protocol commands, use something like this
9976 +   (examples assume C-Kermit 6.0):
9977 +
9978 +   For serial connections:
9979 +
9980 +  kermit -YqQl 0 -r                     <-- to receive
9981 +  kermit -YqQl 0 -s filename(s)         <-- to send one or more files
9982 +
9983 +   For Telnet connections:
9984 +
9985 +  kermit -YqQF 0 -r                     <-- to receive
9986 +  kermit -YqQF 0 -s filename(s)         <-- to send one or more files
9987 +
9988 +   Command line options:
9989 +
9990 +  Y    - skip executing the init file
9991 +  Q    - use fast file transfer settings (default in 8.0)
9992 +  l 0  - transfer files using file descriptor 0 for a serial connection
9993 +  F 0  - transfer files using file descriptor 0 for a Telnet connection
9994 +  q    - quiet - no messages
9995 +  r    - receive
9996 +  s    - send
9997 +
9998 +11.2. INVOKING EXTERNAL PROTOCOLS FROM C-KERMIT
9999 +
10000 +   [ [598]Top ] [ [599]Contents ] [ [600]Section Contents ] [
10001 +   [601]Previous ]
10002 +
10003 +     (This section is obsolete, but not totally useless. See Chapter 14
10004 +     of [602]Using C-Kermit, 2nd Edition).
10005 +
10006 +   After you have opened a communication link with C-Kermit's SET LINE
10007 +   (SET PORT) or SET HOST (TELNET) command, C-Kermit makes its file
10008 +   descriptor available to you in the \v(ttyfd) variable so you can pass
10009 +   it along to other programs that you RUN from C-Kermit. Here, for
10010 +   example, C-Kermit runs itself as an external protocol:
10011 +
10012 +  C-Kermit>set modem type hayes
10013 +  C-Kermit>set line /dev/acu
10014 +  C-Kermit>set speed 2400
10015 +  C-Kermit>dial 7654321
10016 +   Call complete.
10017 +  C-Kermit>echo \v(ttyfd)
10018 +   3
10019 +  C-Kermit>run kermit -l \v(ttyfd)
10020 +
10021 +   Other programs that accept open file descriptors on the command line
10022 +   can be started in the same way.
10023 +
10024 +   You can also use your shell's i/o redirection facilities to assign
10025 +   C-Kermit's open file descriptor (ttyfd) to stdin or stdout. For
10026 +   example, old versions of the Unix ZMODEM programs, sz and rz, when
10027 +   invoked as external protocols, expect to find the communication device
10028 +   assigned to stdin and stdout with no option for specifying any other
10029 +   file descriptor on the sz or rz command line. However, you can still
10030 +   invoke sz and rz as exterior protocols from C-Kermit if your current
10031 +   shell ($SHELL variable) is ksh (the Korn shell) or bash (the
10032 +   Bourne-Again shell), which allows assignment of arbitrary file
10033 +   descriptors to stdin and stdout:
10034 +
10035 +  C-Kermit> run rz <&\v(ttyfd) >&\v(ttyfd)
10036 +
10037 +   or:
10038 +
10039 +  C-Kermit> run sz oofa.zip <&\v(ttyfd) >&\v(ttyfd)
10040 +
10041 +   In version 5A(190) and later, you can use C-Kermit's REDIRECT command,
10042 +   if it is available in your version of C-Kermit, to accomplish the same
10043 +   thing without going through the shell:
10044 +
10045 +  C-Kermit> redirect rz
10046 +
10047 +   or:
10048 +
10049 +  C-Kermit> redirect sz oofa.zip
10050 +
10051 +   A complete set of rz,sz,rb,sb,rx,sx macros for Unix C-Kermit is defined
10052 +   in the file ckurzsz.ini. It automatically chooses the best redirection
10053 +   method (but is redundant since C-Kermit 6.0, which now has built-in
10054 +   support for external protocols via its SET PROTOCOL command).
10055 +
10056 +   Note that external protocols can be used on C-Kermit SET LINE or SET
10057 +   HOST connections only if they operate through standard input and
10058 +   standard output. If they open their own connections, Kermit can't
10059 +   redirect them over its own connection.
10060 +
10061 +12. SECURITY
10062 +
10063 +   [ [603]Top ] [ [604]Contents ] [ [605]Next ] [ [606]Previous ]
10064 +
10065 +   As of version 7.0, C-Kermit supports a wide range of security options
10066 +   for authentication and encryption: Kerberos 4, Kerberos 5 / GSSAPI,
10067 +   SSL/TLS, and SRP. See the separate [607]security document for details.
10068 +
10069 +13. MISCELLANEOUS USER REPORTS
10070 +
10071 +   [ [608]Top ] [ [609]Contents ] [ [610]Next ] [ [611]Previous ]
10072 +
10073 +Date: Thu, 12 Mar 92 1:59:25 MEZ
10074 +From: Walter Mecky <walter@rent-a-guru.de>
10075 +Subject: Help.Unix.sw
10076 +To: svr4@pcsbst.pcs.com, source@usl.com
10077 +
10078 +PRODUCT:        Unix
10079 +RELEASE:        Dell SVR4 V2.1 (is USL V3.0)
10080 +MACHINE:        AT-386
10081 +PATHNAME:       /usr/lib/libc.so.1
10082 +                /usr/ccs/lib/libc.a
10083 +ABSTRACT:       Function ttyname() does not close its file descriptor
10084 +DESCRIPTION:
10085 +        ttyname(3C) opens /dev but never closes it. So if it is called
10086 +        often enough the open(2) in ttyname() fails. Because the broken
10087 +        ttyname() is in the shared lib too all programs using it can
10088 +        fail if they call it often enough. One important program is
10089 +        uucico which calls ttyname for every file it transfers.
10090 +
10091 +
10092 +   Here is a little test program if your system has the bug:
10093 +
10094 +#include <stdlib.h>
10095 +#include <stdio.h>
10096 +main() {
10097 +    int i = 0;
10098 +    while (ttyname(0) != NULL)
10099 +      i++;
10100 +    perror("ttyname");
10101 +    printf("i=%d\n", i);
10102 +}
10103 +
10104 +   If this program runs longer than some seconds you don't have the bug.
10105 +
10106 +   WORKAROUND: None FIX: Very easy if you have source code.
10107 +
10108 +   Another user reports some more explicit symptoms and recoveries:
10109 +
10110 +> What happens is when invoking ckermit we get one of the following
10111 +> error messages:
10112 +>   You must set line
10113 +>   Not a tty
10114 +>   No more processes.
10115 +> One of the following three actions clears the peoblem:
10116 +>   shutdown -y -g0 -i6
10117 +>   kill -9 the ttymon with the highest PID
10118 +>   Invoke sysadm and disable then enable the line you want to use.
10119 +> Turning off respawn of sac -t 300 and going to getty's and uugetty's
10120 +> does not help.
10121 +>
10122 +> Also C-Kermit reports "?timed out closing /dev/ttyxx".
10123 +> If this happens all is well.
10124 +
10125 +------------------------------
10126 +
10127 +   (Note: the following problem also occurs on SGI and probably many other
10128 +   Unix systems):
10129 +
10130 +   From: James Spath <spath@jhunix.hcf.jhu.edu>
10131 +   To: Info-Kermit-Request@cunixf.cc.columbia.edu
10132 +   Date: Wed, 9 Sep 1992 20:20:28 -0400
10133 +   Subject: C-Kermit vs uugetty (or init) on Sperry 5000
10134 +
10135 +   We have successfully compiled the above release on a Unisys/Sperry
10136 +   5000/95. We used the sys5r3 option, rather than sys5r2 since we have
10137 +   VR3 running on our system. In order to allow dialout access to
10138 +   non-superusers, we had to do "chmod 666 /dev/tty###, where it had been
10139 +   -rw--w--w- (owned by uucp), and to do "chmod +w /usr/spool/locks". We
10140 +   have done text and binary file transfers through local and remote
10141 +   connections.
10142 +
10143 +   The problem concerning uucp ownership and permissions is worse than I
10144 +   thought at first. Apparently init or uugetty changes the file
10145 +   permissions after each session. So I wrote the following C program to
10146 +   open a set of requested tty lines. I run this for any required outgoing
10147 +   line prior to a Kermit session.
10148 +
10149 +   ------ cut here -------
10150 +/* opentty.c -- force allow read on tty lines for modem i/o */
10151 +/* idea from: restrict.c -- System 5 Admin book Thomas/Farrow p. 605 */
10152 +/* /jes jim spath {spath@jhunix.hcj.jhu.edu } */
10153 +/* 08-Sep-92 NO COPYRIGHT. */
10154 +/* this must be suid to open other tty lines */
10155 +
10156 +/* #define DEBUG */
10157 +#define TTY "/dev/tty"
10158 +#define LOK "/usr/spool/locks/LCK..tty"
10159 +#include <stdio.h>
10160 +
10161 +/* allowable lines: */
10162 +#define TOTAL_LINES 3
10163 +static char allowable[TOTAL_LINES][4] = { "200", "201", "300" };
10164 +static int total=TOTAL_LINES;
10165 +int allow;
10166 +
10167 +/* states: */
10168 +#define TTY_UNDEF 0
10169 +#define TTY_LOCK  1
10170 +#define TTY_OKAY  2
10171 +
10172 +main(argc, argv)
10173 +int argc; char *argv[]; {
10174 +    char device[512];
10175 +    char lockdev[512];
10176 +    int i;
10177 +    if (argc == 1) {
10178 +        fprintf(stderr, "usage: open 200 [...]\n");
10179 +    }
10180 +    while (--argc > 0 && (*++argv) != NULL ) {
10181 +#ifdef DEBUG
10182 +        fprintf(stderr, "TRYING: %s%s\n", TTY, *argv);
10183 +#endif
10184 +        sprintf(device, "%s%s", TTY, *argv);
10185 +        sprintf(lockdev, "%s%s", LOK, *argv);
10186 +        allow = TTY_UNDEF; i = 0;
10187 +        while (i <= total) { /* look at all defined lines */
10188 +#ifdef DEBUG
10189 +            fprintf(stderr, "LOCKFILE? %s?\n", lockdev);
10190 +#endif
10191 +            if (access(lockdev, 00) == 0) {
10192 +                allow=TTY_LOCK;
10193 +                break;
10194 +            }
10195 +#ifdef DEBUG
10196 +            fprintf(stderr, "DOES:%s==%s?\n", allowable[i], *argv);
10197 +#endif
10198 +            if (strcmp(allowable[i], *argv) == 0)
10199 +              allow=TTY_OKAY;
10200 +            i++;
10201 +        }
10202 +#ifdef DEBUG
10203 +        fprintf(stderr, "allow=%d\n", allow);
10204 +#endif
10205 +        switch (allow) {
10206 +          case TTY_UNDEF:
10207 +            fprintf (stderr, "open: not allowed on %s\n", *argv);
10208 +            break;
10209 +          case TTY_LOCK:
10210 +            fprintf (stderr, "open: device locked: %s\n", lockdev);
10211 +            break;
10212 +          case TTY_OKAY:
10213 +            /* attempt to change mode on device */
10214 +            if (chmod (device, 00666) < 0)
10215 +              fprintf (stderr, "open: cannot chmod on %s\n", device);
10216 +            break;
10217 +          default:
10218 +            fprintf (stderr, "open: FAULT\n");
10219 +        }
10220 +    }
10221 +    exit (0);
10222 +}
10223 +
10224 +14. THIRD-PARTY DRIVERS
10225 +
10226 +   [ [612]Top ] [ [613]Contents ] [ [614]Next ] [ [615]Previous ]
10227 +
10228 +   Unix versions, especially those for PCs (SCO, Unixware, etc) might be
10229 +   augmented by third-party communication-board drivers from Digiboard,
10230 +   Stallion, etc. These can sometimes complicate matters for Kermit
10231 +   considerably since Kermit has no way of knowing that it is going
10232 +   through a possibly nonstandard driver. Various examples are listed in
10233 +   the earlier sections of this document; search for Stallion, Digiboard,
10234 +   etc. Additionally:
10235 +
10236 +     * The Stallion Technologies EasyConnection serial board driver does
10237 +       not always report the state of DSR as low. From Stallion (October
10238 +       1997): "Unfortunately, this is a bug in our driver. We have
10239 +       implemented all of the other TIOMC functions, eg DTR, DCD, RTS and
10240 +       CTS, but not DSR. Our driver should report the actual state of DSR
10241 +       on those of our cards that have a DSR signal. That the driver
10242 +       always reports DSR as not asserted (0), is a bug in the driver. The
10243 +       driver should be either reporting the state of DSR correctly on
10244 +       those cards that support DSR or as always asserted (1) on those
10245 +       cards that do not have a DSR signal. This will be fixed in a future
10246 +       version of our drivers; at this time I cannot say when this will
10247 +       be." And later, "As far as I can tell, we don't support the
10248 +       termios/termiox ioctls that relate specifically to DSR and RI; all
10249 +       the rest are supported. This will, as I mentioned earlier, be fixed
10250 +       in the next release of our ATA software."
10251 +       - World Wide Escalation Support, Stallion Technologies, Toowong
10252 +       QLD, [616]support@stallion.oz.au.
10253 +
10254 +   Later (December 1997, from the same source):
10255 +
10256 +     * We have now released a new version of the ATA software, version
10257 +       5.4.0. This version fixes the problem with the states of the DSR
10258 +       and RI signals and how they were being reported by the driver. This
10259 +       is the problem that you reported in October. The DSR signal is
10260 +       reported correctly on those cards that support the DSR signal, such
10261 +       as the early revision of the EasyIO card and the EasyConnection 8D4
10262 +       panel, and as always asserted on those cards that do not support
10263 +       the DSR signal in the hardware. The new driver is available from
10264 +       our Web site, [617]www.stallion.com, in the /drivers/ata5/UnixWare
10265 +       directory.
10266 +
10267 +   [ [618]Top ] [ [619]Contents ] [ [620]C-Kermit Home ] [ [621]C-Kermit
10268 +   8.0 Overview ] [ [622]Kermit Home ]
10269 +     __________________________________________________________________
10270 +
10271 +     C-Kermit 8.0 Unix Hints and Tips / [623]The Kermit Project /
10272 +   [624]Columbia University / [625]kermit@columbia.edu
10273 +
10274 +References
10275 +
10276 +   1. http://www.columbia.edu/
10277 +   2. mailto:kermit@columbia.edu
10278 +   3. http://www.columbia.edu/kermit/index.html
10279 +   4. http://www.columbia.edu/kermit/k95.html
10280 +   5. http://www.columbia.edu/kermit/ckermit.html
10281 +   6. http://www.columbia.edu/kermit/ckscripts.html
10282 +   7. http://www.columbia.edu/kermit/current.html
10283 +   8. http://www.columbia.edu/kermit/whatsnew.html
10284 +   9. http://www.columbia.edu/kermit/faq.html
10285 +  10. http://www.columbia.edu/kermit/support.html
10286 +  11. http://www.columbia.edu/kermit/
10287 +  12. http://www.columbia.edu/
10288 +  13. http://www.columbia.edu/kermit/ckubwr.html
10289 +  14. mailto:kermit-support@columbia.edu
10290 +  15. http://www.columbia.edu/kermit/ckermit.html
10291 +  16. http://www.columbia.edu/kermit/ckuins.html
10292 +  17. http://www.columbia.edu/kermit/ckututor.html
10293 +  18. http://www.columbia.edu/kermit/ckubwr.html#x1
10294 +  19. http://www.columbia.edu/kermit/ckubwr.html#x2
10295 +  20. http://www.columbia.edu/kermit/ckubwr.html#x3
10296 +  21. http://www.columbia.edu/kermit/ckubwr.html#x4
10297 +  22. http://www.columbia.edu/kermit/ckubwr.html#x5
10298 +  23. http://www.columbia.edu/kermit/ckubwr.html#x6
10299 +  24. http://www.columbia.edu/kermit/ckubwr.html#x7
10300 +  25. http://www.columbia.edu/kermit/ckubwr.html#x8
10301 +  26. http://www.columbia.edu/kermit/ckubwr.html#x9
10302 +  27. http://www.columbia.edu/kermit/ckubwr.html#x10
10303 +  28. http://www.columbia.edu/kermit/ckubwr.html#x11
10304 +  29. http://www.columbia.edu/kermit/ckubwr.html#x12
10305 +  30. http://www.columbia.edu/kermit/ckubwr.html#x13
10306 +  31. http://www.columbia.edu/kermit/ckubwr.html#x14
10307 +  32. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10308 +  33. http://www.columbia.edu/kermit/ckubwr.html#x3.18
10309 +  34. http://www.columbia.edu/kermit/ckubwr.html#x3.19
10310 +  35. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10311 +  36. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10312 +  37. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10313 +  38. http://www.columbia.edu/kermit/ckubwr.html#x3.6
10314 +  39. http://www.columbia.edu/kermit/ckubwr.html#x3.13
10315 +  40. http://www.columbia.edu/kermit/ckubwr.html#top
10316 +  41. http://www.columbia.edu/kermit/ckubwr.html#contents
10317 +  42. http://www.columbia.edu/kermit/ckubwr.html#x2
10318 +  43. http://www.columbia.edu/kermit/ckubwr.html#x1.1
10319 +  44. http://www.columbia.edu/kermit/ckubwr.html#x1.2
10320 +  45. http://www.columbia.edu/kermit/ckubwr.html#x1.3
10321 +  46. http://www.columbia.edu/kermit/ckubwr.html#x1.4
10322 +  47. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10323 +  48. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10324 +  49. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10325 +  50. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10326 +  51. http://www.columbia.edu/kermit/ckcbwr.html
10327 +  52. mailto:kermit-support@columbia.edu
10328 +  53. http://www.columbia.edu/kermit/ckubwr.html#top
10329 +  54. http://www.columbia.edu/kermit/ckubwr.html#contents
10330 +  55. http://www.columbia.edu/kermit/ckubwr.html#x1.2
10331 +  56. http://www.columbia.edu/kermit/ck60manual.html
10332 +  57. http://www.columbia.edu/kermit/ckermit70.html
10333 +  58. http://www.columbia.edu/kermit/ckermit80.html
10334 +  59. http://www.columbia.edu/kermit/ckermit90.html
10335 +  60. http://www.columbia.edu/kermit/ckubwr.html#top
10336 +  61. http://www.columbia.edu/kermit/ckubwr.html#contents
10337 +  62. http://www.columbia.edu/kermit/ckubwr.html#x1
10338 +  63. http://www.columbia.edu/kermit/ckubwr.html#x1.3
10339 +  64. http://www.columbia.edu/kermit/ckubwr.html#x1.1
10340 +  65. http://www.columbia.edu/kermit/support.html
10341 +  66. http://www.columbia.edu/kermit/ckubwr.html#top
10342 +  67. http://www.columbia.edu/kermit/ckubwr.html#contents
10343 +  68. http://www.columbia.edu/kermit/ckubwr.html#x1
10344 +  69. http://www.columbia.edu/kermit/ckubwr.html#x1.4
10345 +  70. http://www.columbia.edu/kermit/ckubwr.html#x1.2
10346 +  71. http://www.columbia.edu/kermit/ckubwr.html#top
10347 +  72. http://www.columbia.edu/kermit/ckubwr.html#contents
10348 +  73. http://www.columbia.edu/kermit/ckubwr.html#x1
10349 +  74. http://www.columbia.edu/kermit/ckubwr.html#x1.3
10350 +  75. http://www.columbia.edu/kermit/ckubwr.html#top
10351 +  76. http://www.columbia.edu/kermit/ckubwr.html#contents
10352 +  77. http://www.columbia.edu/kermit/ckubwr.html#x3
10353 +  78. http://www.columbia.edu/kermit/ckubwr.html#x1
10354 +  79. http://www.columbia.edu/kermit/ckubwr.html#top
10355 +  80. http://www.columbia.edu/kermit/ckubwr.html#contents
10356 +  81. http://www.columbia.edu/kermit/ckubwr.html#x4
10357 +  82. http://www.columbia.edu/kermit/ckubwr.html#x2
10358 +  83. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10359 +  84. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10360 +  85. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10361 +  86. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10362 +  87. http://www.columbia.edu/kermit/ckubwr.html#x3.4
10363 +  88. http://www.columbia.edu/kermit/ckubwr.html#x3.5
10364 +  89. http://www.columbia.edu/kermit/ckubwr.html#x3.6
10365 +  90. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10366 +  91. http://www.columbia.edu/kermit/ckubwr.html#x3.8
10367 +  92. http://www.columbia.edu/kermit/ckubwr.html#x3.9
10368 +  93. http://www.columbia.edu/kermit/ckubwr.html#x3.10
10369 +  94. http://www.columbia.edu/kermit/ckubwr.html#x3.11
10370 +  95. http://www.columbia.edu/kermit/ckubwr.html#x3.12
10371 +  96. http://www.columbia.edu/kermit/ckubwr.html#x3.13
10372 +  97. http://www.columbia.edu/kermit/ckubwr.html#x3.14
10373 +  98. http://www.columbia.edu/kermit/ckubwr.html#x3.15
10374 +  99. http://www.columbia.edu/kermit/ckubwr.html#x3.16
10375 + 100. http://www.columbia.edu/kermit/ckubwr.html#x3.17
10376 + 101. http://www.columbia.edu/kermit/ckubwr.html#x3.18
10377 + 102. http://www.columbia.edu/kermit/ckubwr.html#x3.19
10378 + 103. http://www.columbia.edu/kermit/ckubwr.html#x3.20
10379 + 104. http://www.faqs.org/
10380 + 105. http://aplawrence.com/Unixart/newtounix.html
10381 + 106. http://www.columbia.edu/kermit/ckubwr.html#x3
10382 + 107. mailto:kermit-support@columbia.edu
10383 + 108. http://www.columbia.edu/kermit/support.html
10384 + 109. http://www.columbia.edu/kermit/ckubwr.html#top
10385 + 110. http://www.columbia.edu/kermit/ckubwr.html#contents
10386 + 111. http://www.columbia.edu/kermit/ckubwr.html#x3
10387 + 112. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10388 + 113. http://www.pcunix.com/
10389 + 114. http://www.columbia.edu/kermit/ckubwr.html#x3.0.1
10390 + 115. http://www.columbia.edu/kermit/ckubwr.html#x3.0.2
10391 + 116. http://www.columbia.edu/kermit/ckubwr.html#x3.0.3
10392 + 117. http://www.columbia.edu/kermit/ckubwr.html#x3.0.4
10393 + 118. http://www.columbia.edu/kermit/ckubwr.html#x3.0.5
10394 + 119. http://www.columbia.edu/kermit/ckubwr.html#x3.0.6
10395 + 120. http://www.columbia.edu/kermit/ckubwr.html#top
10396 + 121. http://www.columbia.edu/kermit/ckubwr.html#contents
10397 + 122. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10398 + 123. http://www.columbia.edu/kermit/ckubwr.html#x3.0.2
10399 + 124. http://www.columbia.edu/kermit/ckubwr.html#top
10400 + 125. http://www.columbia.edu/kermit/ckubwr.html#contents
10401 + 126. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10402 + 127. http://www.columbia.edu/kermit/ckubwr.html#x3.0.3
10403 + 128. http://www.columbia.edu/kermit/ckubwr.html#x3.0.1
10404 + 129. http://www.linmodems.org/
10405 + 130. http://www.microsoft.com/hwdev/platform/PCdesign/LR/default.asp
10406 + 131. http://www.columbia.edu/kermit/ckubwr.html#top
10407 + 132. http://www.columbia.edu/kermit/ckubwr.html#contents
10408 + 133. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10409 + 134. http://www.columbia.edu/kermit/ckubwr.html#x3.0.4
10410 + 135. http://www.columbia.edu/kermit/ckubwr.html#x3.0.2
10411 + 136. http://www.idir.net/~gromitkc/winmodem.html
10412 + 137. http://www.digi.com/
10413 + 138. http://www.columbia.edu/kermit/ckubwr.html#top
10414 + 139. http://www.columbia.edu/kermit/ckubwr.html#contents
10415 + 140. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10416 + 141. http://www.columbia.edu/kermit/ckubwr.html#x3.0.5
10417 + 142. http://www.columbia.edu/kermit/ckubwr.html#x3.0.3
10418 + 143. http://www.columbia.edu/kermit/ckubwr.html#top
10419 + 144. http://www.columbia.edu/kermit/ckubwr.html#contents
10420 + 145. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10421 + 146. http://www.columbia.edu/kermit/ckubwr.html#x3.0.6
10422 + 147. http://www.columbia.edu/kermit/ckubwr.html#x3.0.4
10423 + 148. http://www.columbia.edu/kermit/ckubwr.html#top
10424 + 149. http://www.columbia.edu/kermit/ckubwr.html#contents
10425 + 150. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10426 + 151. http://www.columbia.edu/kermit/ckubwr.html#x3.0.5
10427 + 152. http://www.columbia.edu/kermit/ckubwr.html#top
10428 + 153. http://www.columbia.edu/kermit/ckubwr.html#contents
10429 + 154. http://www.columbia.edu/kermit/ckubwr.html#x3
10430 + 155. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10431 + 156. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10432 + 157. http://www.columbia.edu/kermit/ckubwr.html#x3.1.1
10433 + 158. http://www.columbia.edu/kermit/ckubwr.html#x3.1.2
10434 + 159. http://www.columbia.edu/kermit/ckubwr.html#x3.1.3
10435 + 160. http://www.columbia.edu/kermit/ckubwr.html#x3.1.4
10436 + 161. http://www.columbia.edu/kermit/ckubwr.html#x3.1.5
10437 + 162. http://www.emerson.emory.edu/services/aix-faq/
10438 + 163. http://www.faqs.org/faqs/by-newsgroup/comp/comp.unix.aix.html
10439 + 164. http://www.cis.ohio-state.edu/hypertext/faq/usenet/aix-faq/top.html
10440 + 165. http://aixpdslib.seas.ucla.edu/
10441 + 166. http://www.rootvg.net(AIXhistory)/
10442 + 167. ftp://rtfm.mit.edu/pub/usenet/news.answers/aix-faq/part1
10443 + 168. ftp://mirrors.aol.com/pub/rtfm/usenet-by-hierarchy/comp/unix/aix
10444 + 169. news:comp.unix.aix
10445 + 170. http://www.columbia.edu/kermit/ckubwr.html#top
10446 + 171. http://www.columbia.edu/kermit/ckubwr.html#contents
10447 + 172. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10448 + 173. http://www.columbia.edu/kermit/ckubwr.html#x3.1.2
10449 + 174. http://www.columbia.edu/kermit/ckubwr.html#top
10450 + 175. http://www.columbia.edu/kermit/ckubwr.html#contents
10451 + 176. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10452 + 177. http://www.columbia.edu/kermit/ckubwr.html#x3.1.3
10453 + 178. http://www.columbia.edu/kermit/ckubwr.html#x3.1.1
10454 + 179. http://www.columbia.edu/kermit/security.html#servers
10455 + 180. http://www.columbia.edu/kermit/ckubwr.html#top
10456 + 181. http://www.columbia.edu/kermit/ckubwr.html#contents
10457 + 182. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10458 + 183. http://www.columbia.edu/kermit/ckubwr.html#x3.1.4
10459 + 184. http://www.columbia.edu/kermit/ckubwr.html#x3.1.2
10460 + 185. http://service.software.ibm.com/rs6000/
10461 + 186. http://www.columbia.edu/kermit/ckubwr.html#top
10462 + 187. http://www.columbia.edu/kermit/ckubwr.html#contents
10463 + 188. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10464 + 189. http://www.columbia.edu/kermit/ckubwr.html#x3.1.5
10465 + 190. http://www.columbia.edu/kermit/ckubwr.html#x3.1.3
10466 + 191. http://www.columbia.edu/kermit/ckubwr.html#top
10467 + 192. http://www.columbia.edu/kermit/ckubwr.html#contents
10468 + 193. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10469 + 194. http://www.columbia.edu/kermit/ckubwr.html#x3.1.4
10470 + 195. http://www.columbia.edu/kermit/ckubwr.html#top
10471 + 196. http://www.columbia.edu/kermit/ckubwr.html#contents
10472 + 197. http://www.columbia.edu/kermit/ckubwr.html#x3
10473 + 198. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10474 + 199. http://www.columbia.edu/kermit/ckubwr.html#x3.1
10475 + 200. http://www.columbia.edu/kermit/ckubwr.html#x3.2.0
10476 + 201. http://www.columbia.edu/kermit/ckubwr.html#x3.2.1
10477 + 202. http://www.columbia.edu/kermit/ckubwr.html#x3.2.2
10478 + 203. http://www.columbia.edu/kermit/ckubwr.html#x3.2.3
10479 + 204. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4
10480 + 205. http://www.columbia.edu/kermit/ckubwr.html#x3.2.5
10481 + 206. news:comp.sys.hp.hpux
10482 + 207. http://www.columbia.edu/kermit/ckubwr.html#top
10483 + 208. http://www.columbia.edu/kermit/ckubwr.html#contents
10484 + 209. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10485 + 210. http://www.columbia.edu/kermit/ckubwr.html#x3.2.1
10486 + 211. http://www.columbia.edu/kermit/ckubwr.html#top
10487 + 212. http://www.columbia.edu/kermit/ckubwr.html#contents
10488 + 213. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10489 + 214. http://www.columbia.edu/kermit/ckubwr.html#x3.2.2
10490 + 215. http://www.columbia.edu/kermit/ckubwr.html#x3.2.0
10491 + 216. ftp://kermit.columbia.edu/kermit/f/makefile
10492 + 217. http://www.columbia.edu/kermit/ckubwr.html#top
10493 + 218. http://www.columbia.edu/kermit/ckubwr.html#contents
10494 + 219. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10495 + 220. http://www.columbia.edu/kermit/ckubwr.html#x3.2.3
10496 + 221. http://www.columbia.edu/kermit/ckubwr.html#x3.2.1
10497 + 222. http://www.columbia.edu/kermit/ckubwr.html#top
10498 + 223. http://www.columbia.edu/kermit/ckubwr.html#contents
10499 + 224. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10500 + 225. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4
10501 + 226. http://www.columbia.edu/kermit/ckubwr.html#x3.2.2
10502 + 227. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.1
10503 + 228. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.2
10504 + 229. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.3
10505 + 230. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.4
10506 + 231. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.5
10507 + 232. http://www.columbia.edu/kermit/ckubwr.html#top
10508 + 233. http://www.columbia.edu/kermit/ckubwr.html#contents
10509 + 234. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10510 + 235. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.2
10511 + 236. http://www.columbia.edu/kermit/ckubwr.html#x3.2.2
10512 + 237. http://www.columbia.edu/kermit/ckubwr.html#top
10513 + 238. http://www.columbia.edu/kermit/ckubwr.html#contents
10514 + 239. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4
10515 + 240. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.3
10516 + 241. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.1
10517 + 242. http://www.columbia.edu/kermit/ckubwr.html#top
10518 + 243. http://www.columbia.edu/kermit/ckubwr.html#contents
10519 + 244. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4
10520 + 245. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.4
10521 + 246. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.2
10522 + 247. http://www.columbia.edu/kermit/ckubwr.html#top
10523 + 248. http://www.columbia.edu/kermit/ckubwr.html#contents
10524 + 249. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4
10525 + 250. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.5
10526 + 251. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.3
10527 + 252. http://www.columbia.edu/kermit/ckubwr.html#top
10528 + 253. http://www.columbia.edu/kermit/ckubwr.html#contents
10529 + 254. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4
10530 + 255. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4.4
10531 + 256. http://www.columbia.edu/kermit/ckubwr.html#top
10532 + 257. http://www.columbia.edu/kermit/ckubwr.html#contents
10533 + 258. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10534 + 259. http://www.columbia.edu/kermit/ckubwr.html#x3.2.4
10535 + 260. http://www.columbia.edu/kermit/ckubwr.html#top
10536 + 261. http://www.columbia.edu/kermit/ckubwr.html#contents
10537 + 262. http://www.columbia.edu/kermit/ckubwr.html#x3
10538 + 263. http://www.columbia.edu/kermit/ckubwr.html#x3.4
10539 + 264. http://www.columbia.edu/kermit/ckubwr.html#x3.2
10540 + 265. http://www.columbia.edu/kermit/ckubwr.html#x3.3.1
10541 + 266. http://www.columbia.edu/kermit/ckubwr.html#x3.3.2
10542 + 267. http://www.columbia.edu/kermit/ckubwr.html#x3.3.3
10543 + 268. http://www.columbia.edu/kermit/ckubwr.html#x3.3.4
10544 + 269. http://www.columbia.edu/kermit/ckubwr.html#x3.3.5
10545 + 270. http://www.columbia.edu/kermit/ckubwr.html#x3.3.6
10546 + 271. http://en.wikipedia.org/wiki/Avahi_(software)
10547 + 272. news:comp.os.linux.misc
10548 + 273. news:comp.os.linux.answers
10549 + 274. http://www.tldp.org/
10550 + 275. http://www.tldp.org/FAQ/Linux-FAQ.html
10551 + 276. http://www.tldp.org/HOWTO/Serial-HOWTO.html
10552 + 277. http://tldp.org/HOWTO/Modem-HOWTO.html
10553 + 278. ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO
10554 + 279. ftp://tsx-11.mit.edu/pub/linux/docs/HOWTO
10555 + 280. http://www.tldp.org/HOWTO/
10556 + 281. http://www.tldp.org/hmirrors.html
10557 + 282. http://www.redhat.com/apps/support/
10558 + 283. http://www.debian.org/support
10559 + 284. http://www.slackware.com/support/
10560 + 285. http://www.caldera.com/support/
10561 + 286. http://www.novell.com/support/microsites/microsite.do
10562 + 287. http://www.mandrake.com/support/
10563 + 288. http://www.turbolinux.com/support/
10564 + 289. http://www.linmodems.org/
10565 + 290. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10566 + 291. http://linux.dreamtime.org/decnet/
10567 + 292. mailto:kermit-support@columbia.edu
10568 + 293. http://www.linmodems.org/
10569 + 294. http://www.columbia.edu/kermit/ckubwr.html#x3.0.2
10570 + 295. http://www.columbia.edu/kermit/security.html#servers
10571 + 296. http://www.columbia.edu/kermit/sshclient.html
10572 + 297. http://www.columbia.edu/kermit/ckubwr.html#top
10573 + 298. http://www.columbia.edu/kermit/ckubwr.html#contents
10574 + 299. http://www.columbia.edu/kermit/ckubwr.html#x3
10575 + 300. http://www.columbia.edu/kermit/ckubwr.html#x3.3.2
10576 + 301. http://www.columbia.edu/kermit/ckubwr.html#top
10577 + 302. http://www.columbia.edu/kermit/ckubwr.html#contents
10578 + 303. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10579 + 304. http://www.columbia.edu/kermit/ckubwr.html#x3.3.3
10580 + 305. http://www.columbia.edu/kermit/ckubwr.html#x3.3.1
10581 + 306. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10582 + 307. http://www.columbia.edu/kermit/ckubwr.html#x6
10583 + 308. http://www.columbia.edu/kermit/ckubwr.html#x7
10584 + 309. http://www.columbia.edu/kermit/ckubwr.html#x8
10585 + 310. http://www.columbia.edu/kermit/ckuins.html#x10
10586 + 311. http://www.columbia.edu/kermit/ckuins.html#x11
10587 + 312. http://www.columbia.edu/kermit/ckuins.html
10588 + 313. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10589 + 314. http://linuxwww.db.erau.edu/mail_archives/linux-kernel/Mar_98/1441.html
10590 + 315. http://www.columbia.edu/kermit/ckubwr.html#top
10591 + 316. http://www.columbia.edu/kermit/ckubwr.html#contents
10592 + 317. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10593 + 318. http://www.columbia.edu/kermit/ckubwr.html#x3.3.4
10594 + 319. http://www.columbia.edu/kermit/ckubwr.html#x3.3.2
10595 + 320. http://www.columbia.edu/kermit/ckubwr.html#x3.0.5
10596 + 321. http://www.columbia.edu/kermit/ckfaq.html#term
10597 + 322. http://dickey.his.com/xterm/xterm.html
10598 + 323. http://dickey.his.com/xterm/xterm.html
10599 + 324. ftp://kermit.columbia.edu/kermit/f/xmodmap.txt
10600 + 325. http://www.columbia.edu/kermit/ckubwr.html#top
10601 + 326. http://www.columbia.edu/kermit/ckubwr.html#contents
10602 + 327. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10603 + 328. http://www.columbia.edu/kermit/ckubwr.html#x3.3.5
10604 + 329. http://www.columbia.edu/kermit/ckubwr.html#x3.3.3
10605 + 330. http://www.columbia.edu/kermit/ckubwr.html#top
10606 + 331. http://www.columbia.edu/kermit/ckubwr.html#contents
10607 + 332. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10608 + 333. http://www.columbia.edu/kermit/ckubwr.html#x3.3.6
10609 + 334. http://www.columbia.edu/kermit/ckubwr.html#x3.3.4
10610 + 335. http://www.columbia.edu/kermit/ckermit.html
10611 + 336. mailto:kermit-support@columbia.edu
10612 + 337. http://www.redhat.com/support/errata/RHBA-2001-153.html
10613 + 338. news:comp.protocols.kermit.misc
10614 + 339. http://www.columbia.edu/kermit/ckubwr.html#top
10615 + 340. http://www.columbia.edu/kermit/ckubwr.html#contents
10616 + 341. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10617 + 342. http://www.columbia.edu/kermit/ckubwr.html#x3.3.5
10618 + 343. http://www.columbia.edu/kermit/ckubwr.html#top
10619 + 344. http://www.columbia.edu/kermit/ckubwr.html#contents
10620 + 345. http://www.columbia.edu/kermit/ckubwr.html#x3
10621 + 346. http://www.columbia.edu/kermit/ckubwr.html#x3.5
10622 + 347. http://www.columbia.edu/kermit/ckubwr.html#x3.3
10623 + 348. http://www.columbia.edu/kermit/ckubwr.html#top
10624 + 349. http://www.columbia.edu/kermit/ckubwr.html#contents
10625 + 350. http://www.columbia.edu/kermit/ckubwr.html#x3
10626 + 351. http://www.columbia.edu/kermit/ckubwr.html#x3.6
10627 + 352. http://www.columbia.edu/kermit/ckubwr.html#x3.4
10628 + 353. news:comp.os.qnx
10629 + 354. http://www.columbia.edu/kermit/gkermit.html
10630 + 355. http://www.columbia.edu/kermit/ckuins.html#x10
10631 + 356. http://www.columbia.edu/kermit/ckuins.html
10632 + 357. http://www.columbia.edu/kermit/ckubwr.html#top
10633 + 358. http://www.columbia.edu/kermit/ckubwr.html#contents
10634 + 359. http://www.columbia.edu/kermit/ckubwr.html#x3
10635 + 360. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10636 + 361. http://www.columbia.edu/kermit/ckubwr.html#x3.5
10637 + 362. http://www.columbia.edu/kermit/ckubwr.html#x3.6.1
10638 + 363. http://www.columbia.edu/kermit/ckubwr.html#x3.6.2
10639 + 364. http://www.columbia.edu/kermit/ckubwr.html#x3.6.3
10640 + 365. http://www.columbia.edu/kermit/ckubwr.html#x3.6.4
10641 + 366. http://www.columbia.edu/kermit/ckubwr.html#x3.10
10642 + 367. http://aplawrence.com/SCOFAQ/
10643 + 368. http://www.zenez.com/cgi-bin/scoprogfaq/faq.pl
10644 + 369. http://www.zenez.com/cgi-bin/scouw7faq/faq.pl
10645 + 370. http://zenez.pcunix.com/cgi-bin/scouw7faq/faq.pl
10646 + 371. http://pcunix.com/Unixart/modems.html
10647 + 372. http://www.freebird.org/faq/
10648 + 373. http://www.freebird.org/faq/developer.html
10649 + 374. http://support.caldera.com/caldera
10650 + 375. http://stage.caldera.com/ta/
10651 + 376. http://aplawrence.com/newtosco.html
10652 + 377. http://www.columbia.edu/kermit/ckubwr.html#x3.0.5
10653 + 378. http://www.columbia.edu/kermit/ckfaq.html#term
10654 + 379. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10655 + 380. http://www.columbia.edu/kermit/ckubwr.html#top
10656 + 381. http://www.columbia.edu/kermit/ckubwr.html#contents
10657 + 382. http://www.columbia.edu/kermit/ckubwr.html#x3.6
10658 + 383. http://www.columbia.edu/kermit/ckubwr.html#x3.6.1
10659 + 384. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
10660 + 385. http://www.columbia.edu/kermit/ckubwr.html#top
10661 + 386. http://www.columbia.edu/kermit/ckubwr.html#contents
10662 + 387. http://www.columbia.edu/kermit/ckubwr.html#x3.6
10663 + 388. http://www.columbia.edu/kermit/ckubwr.html#x3.6.3
10664 + 389. http://www.columbia.edu/kermit/ckubwr.html#x3.6.1
10665 + 390. http://www.digi.com/
10666 + 391. ftp://ftp.fu-berlin.de/pub/unix/driver/fas
10667 + 392. http://www.columbia.edu/kermit/ckubwr.html#x14
10668 + 393. http://www.sco.com/
10669 + 394. ftp://ftp.sco.com/
10670 + 395. http://www.columbia.edu/kermit/ckubwr.html#top
10671 + 396. http://www.columbia.edu/kermit/ckubwr.html#contents
10672 + 397. http://www.columbia.edu/kermit/ckubwr.html#x3.6
10673 + 398. http://www.columbia.edu/kermit/ckubwr.html#x3.6.4
10674 + 399. http://www.columbia.edu/kermit/ckubwr.html#x3.6.2
10675 + 400. http://www.columbia.edu/kermit/ckubwr.html#x3.10
10676 + 401. http://www.columbia.edu/kermit/ckubwr.html#top
10677 + 402. http://www.columbia.edu/kermit/ckubwr.html#contents
10678 + 403. http://www.columbia.edu/kermit/ckubwr.html#x3.6
10679 + 404. http://www.columbia.edu/kermit/ckubwr.html#x3.6.3
10680 + 405. http://www.columbia.edu/kermit/ckubwr.html#top
10681 + 406. http://www.columbia.edu/kermit/ckubwr.html#contents
10682 + 407. http://www.columbia.edu/kermit/ckubwr.html#x3
10683 + 408. http://www.columbia.edu/kermit/ckubwr.html#x3.8
10684 + 409. http://www.columbia.edu/kermit/ckubwr.html#x3.6
10685 + 410. http://www.columbia.edu/kermit/ckubwr.html#x3.7.1
10686 + 411. http://www.columbia.edu/kermit/ckubwr.html#x3.7.2
10687 + 412. http://www.columbia.edu/kermit/ckubwr.html#x3.7.3
10688 + 413. http://www.columbia.edu/kermit/ckubwr.html#x3.7.4
10689 + 414. http://www.columbia.edu/kermit/ckubwr.html#x3.7.5
10690 + 415. news:comp.unix.solaris
10691 + 416. http://access1.sun.com/
10692 + 417. http://docs.sun.com/
10693 + 418. http://www.sunhelp.com/
10694 + 419. http://www.wins.uva.nl/pub/solaris/solaris2/
10695 + 420. http://www.wins.uva.nl/cgi-bin/sfaq.cgi
10696 + 421. ftp://ftp.wins.uva.nl/pub/solaris
10697 + 422. http://www.science.uva.nl/pub/solaris/solaris2.html
10698 + 423. http://www.stokely.com/
10699 + 424. http://www.stokely.com/unix.sysadm.resources/faqs.sun.html
10700 + 425. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10701 + 426. http://www.columbia.edu/kermit/ckubwr.html#top
10702 + 427. http://www.columbia.edu/kermit/ckubwr.html#contents
10703 + 428. http://www.columbia.edu/kermit/ckubwr.html#x3
10704 + 429. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10705 + 430. http://www.columbia.edu/kermit/ckubwr.html#x3.7.2
10706 + 431. http://www.columbia.edu/kermit/ckubwr.html#top
10707 + 432. http://www.columbia.edu/kermit/ckubwr.html#contents
10708 + 433. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10709 + 434. http://www.columbia.edu/kermit/ckubwr.html#x3.7.3
10710 + 435. http://www.columbia.edu/kermit/ckubwr.html#x3.7.1
10711 + 436. http://www.columbia.edu/kermit/ckubwr.html#top
10712 + 437. http://www.columbia.edu/kermit/ckubwr.html#contents
10713 + 438. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10714 + 439. http://www.columbia.edu/kermit/ckubwr.html#x3.7.4
10715 + 440. http://www.columbia.edu/kermit/ckubwr.html#x3.7.2
10716 + 441. http://www.columbia.edu/kermit/ckubwr.html#top
10717 + 442. http://www.columbia.edu/kermit/ckubwr.html#contents
10718 + 443. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10719 + 444. http://www.columbia.edu/kermit/ckubwr.html#x3.7.5
10720 + 445. http://www.columbia.edu/kermit/ckubwr.html#x3.7.3
10721 + 446. news:comp.os.vms
10722 + 447. http://www.columbia.edu/kermit/ckubwr.html#top
10723 + 448. http://www.columbia.edu/kermit/ckubwr.html#contents
10724 + 449. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10725 + 450. http://www.columbia.edu/kermit/ckubwr.html#x3.7.6
10726 + 451. http://www.columbia.edu/kermit/ckubwr.html#x3.7.4
10727 + 452. http://www.columbia.edu/kermit/ckubwr.html#top
10728 + 453. http://www.columbia.edu/kermit/ckubwr.html#contents
10729 + 454. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10730 + 455. http://www.columbia.edu/kermit/ckubwr.html#x3.7.5
10731 + 456. http://www.columbia.edu/kermit/ckubwr.html#top
10732 + 457. http://www.columbia.edu/kermit/ckubwr.html#contents
10733 + 458. http://www.columbia.edu/kermit/ckubwr.html#x3
10734 + 459. http://www.columbia.edu/kermit/ckubwr.html#x3.9
10735 + 460. http://www.columbia.edu/kermit/ckubwr.html#x3.7
10736 + 461. http://www.stokely.com/
10737 + 462. http://access1.sun.com/
10738 + 463. http://www.ludd.luth.se/~bear/project/sun/sun.hardware.txt
10739 + 464. ftp://ftp.netcom.com/pub/ru/rubicon/sun.hdwr.ref
10740 + 465. ftp://ftp.intnet.net/pub/SUN/Sun-Hardware-Ref
10741 + 466. http://www.columbia.edu/kermit/ckubwr.html#top
10742 + 467. http://www.columbia.edu/kermit/ckubwr.html#contents
10743 + 468. http://www.columbia.edu/kermit/ckubwr.html#x3
10744 + 469. http://www.columbia.edu/kermit/ckubwr.html#x3.10
10745 + 470. http://www.columbia.edu/kermit/ckubwr.html#x3.8
10746 + 471. news:comp.unix.ultrix
10747 + 472. news:comp.sys.dec
10748 + 473. http://www.columbia.edu/kermit/ckubwr.html#top
10749 + 474. http://www.columbia.edu/kermit/ckubwr.html#contents
10750 + 475. http://www.columbia.edu/kermit/ckubwr.html#x3
10751 + 476. http://www.columbia.edu/kermit/ckubwr.html#x3.11
10752 + 477. http://www.columbia.edu/kermit/ckubwr.html#x3.9
10753 + 478. http://www.freebird.org/
10754 + 479. http://www.freebird.org/faq/
10755 + 480. news:comp.unix.unixware.misc
10756 + 481. news:comp.unix.sco.misc
10757 + 482. http://www.columbia.edu/kermit/ckubwr.html#x3.0
10758 + 483. ftp://kermit.columbia.edu/kermit/f/ckutio.c
10759 + 484. http://www.columbia.edu/kermit/ckubwr.html#top
10760 + 485. http://www.columbia.edu/kermit/ckubwr.html#contents
10761 + 486. http://www.columbia.edu/kermit/ckubwr.html#x3
10762 + 487. http://www.columbia.edu/kermit/ckubwr.html#x3.12
10763 + 488. http://www.columbia.edu/kermit/ckubwr.html#x3.10
10764 + 489. http://www.columbia.edu/kermit/ckubwr.html#top
10765 + 490. http://www.columbia.edu/kermit/ckubwr.html#contents
10766 + 491. http://www.columbia.edu/kermit/ckubwr.html#x3
10767 + 492. http://www.columbia.edu/kermit/ckubwr.html#x3.13
10768 + 493. http://www.columbia.edu/kermit/ckubwr.html#x3.11
10769 + 494. http://www.columbia.edu/kermit/ckubwr.html#top
10770 + 495. http://www.columbia.edu/kermit/ckubwr.html#contents
10771 + 496. http://www.columbia.edu/kermit/ckubwr.html#x3
10772 + 497. http://www.columbia.edu/kermit/ckubwr.html#x3.14
10773 + 498. http://www.columbia.edu/kermit/ckubwr.html#x3.12
10774 + 499. http://www.columbia.edu/kermit/ckubwr.html#top
10775 + 500. http://www.columbia.edu/kermit/ckubwr.html#contents
10776 + 501. http://www.columbia.edu/kermit/ckubwr.html#x3
10777 + 502. http://www.columbia.edu/kermit/ckubwr.html#x3.15
10778 + 503. http://www.columbia.edu/kermit/ckubwr.html#x3.13
10779 + 504. news:comp.sys.sgi.misc
10780 + 505. news:comp.sys.sgi.admin
10781 + 506. http://www.sgi.com/
10782 + 507. http://www-viz.tamu.edu/~sgi-faq/
10783 + 508. ftp://viz.tamu.edu/pub/sgi/faq/
10784 + 509. http://www.columbia.edu/kermit/ckuins.html
10785 + 510. http://freeware.sgi.com/Installable/gcc-2.95.2.html
10786 + 511. http://freeware.sgi.com/Installable/gcc-2.95.2.html
10787 + 512. http://www.columbia.edu/kermit/ckubwr.html#top
10788 + 513. http://www.columbia.edu/kermit/ckubwr.html#contents
10789 + 514. http://www.columbia.edu/kermit/ckubwr.html#x3
10790 + 515. http://www.columbia.edu/kermit/ckubwr.html#x3.16
10791 + 516. http://www.columbia.edu/kermit/ckubwr.html#x3.14
10792 + 517. news:comp.sys.be
10793 + 518. http://www.columbia.edu/kermit/ckubwr.html#top
10794 + 519. http://www.columbia.edu/kermit/ckubwr.html#contents
10795 + 520. http://www.columbia.edu/kermit/ckubwr.html#x3
10796 + 521. http://www.columbia.edu/kermit/ckubwr.html#x3.17
10797 + 522. http://www.columbia.edu/kermit/ckubwr.html#x3.15
10798 + 523. http://www.columbia.edu/kermit/ckubwr.html#top
10799 + 524. http://www.columbia.edu/kermit/ckubwr.html#contents
10800 + 525. http://www.columbia.edu/kermit/ckubwr.html#x3
10801 + 526. http://www.columbia.edu/kermit/ckubwr.html#x3.18
10802 + 527. http://www.columbia.edu/kermit/ckubwr.html#x3.16
10803 + 528. http://www.columbia.edu/kermit/ckubwr.html#top
10804 + 529. http://www.columbia.edu/kermit/ckubwr.html#contents
10805 + 530. http://www.columbia.edu/kermit/ckubwr.html#x3
10806 + 531. http://www.columbia.edu/kermit/ckubwr.html#x3.19
10807 + 532. http://www.columbia.edu/kermit/ckubwr.html#x3.17
10808 + 533. http://www.columbia.edu/kermit/ckubwr.html#top
10809 + 534. http://www.columbia.edu/kermit/ckubwr.html#contents
10810 + 535. http://www.columbia.edu/kermit/ckubwr.html#x3
10811 + 536. http://www.columbia.edu/kermit/ckubwr.html#x3.20
10812 + 537. http://www.columbia.edu/kermit/ckubwr.html#x3.18
10813 + 538. http://www.columbia.edu/kermit/mac.html
10814 + 539. http://www.amazon.com/gp/product/B0000VYJRY?ie=UTF8&tag=aleidmoreldom-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B0000VYJRY
10815 + 540. http://www.columbia.edu/kermit/ckuins.html#x10
10816 + 541. http://www.columbia.edu/kermit/ckuins.html
10817 + 542. http://www.amazon.com/gp/product/B000FX61MS?ie=UTF8&tag=aleidmoreldom-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B000FX61MS
10818 + 543. mailto:kermit@columbia.edu
10819 + 544. http://www.columbia.edu/kermit/ckubwr.html#top
10820 + 545. http://www.columbia.edu/kermit/ckubwr.html#contents
10821 + 546. http://www.columbia.edu/kermit/ckubwr.html#x3
10822 + 547. http://www.columbia.edu/kermit/ckubwr.html#x3.19
10823 + 548. http://www.uni-giessen.de/faq/archiv/coherent-faq.general/msg00000.html
10824 + 549. http://www.columbia.edu/kermit/ckubwr.html#top
10825 + 550. http://www.columbia.edu/kermit/ckubwr.html#contents
10826 + 551. http://www.columbia.edu/kermit/ckubwr.html#x5
10827 + 552. http://www.columbia.edu/kermit/ckubwr.html#x3
10828 + 553. http://www.columbia.edu/kermit/ckccfg.html
10829 + 554. http://www.columbia.edu/kermit/ckubwr.html#top
10830 + 555. http://www.columbia.edu/kermit/ckubwr.html#contents
10831 + 556. http://www.columbia.edu/kermit/ckubwr.html#x6
10832 + 557. http://www.columbia.edu/kermit/ckubwr.html#x4
10833 + 558. http://www.columbia.edu/kermit/ckuins.html
10834 + 559. http://www.columbia.edu/kermit/ckubwr.html#top
10835 + 560. http://www.columbia.edu/kermit/ckubwr.html#contents
10836 + 561. http://www.columbia.edu/kermit/ckubwr.html#x7
10837 + 562. http://www.columbia.edu/kermit/ckubwr.html#x5
10838 + 563. http://www.columbia.edu/kermit/ckuins.html#9.5
10839 + 564. http://www.columbia.edu/kermit/ckubwr.html#x3
10840 + 565. http://www.columbia.edu/kermit/ckubwr.html#top
10841 + 566. http://www.columbia.edu/kermit/ckubwr.html#contents
10842 + 567. http://www.columbia.edu/kermit/ckubwr.html#x8
10843 + 568. http://www.columbia.edu/kermit/ckubwr.html#x6
10844 + 569. http://www.columbia.edu/kermit/ckuins.html#x8
10845 + 570. http://www.columbia.edu/kermit/ckuins.html
10846 + 571. http://www.columbia.edu/kermit/ck60manual.html
10847 + 572. http://www.columbia.edu/kermit/cable.html
10848 + 573. http://www.columbia.edu/kermit/ckubwr.html#top
10849 + 574. http://www.columbia.edu/kermit/ckubwr.html#contents
10850 + 575. http://www.columbia.edu/kermit/ckubwr.html#x9
10851 + 576. http://www.columbia.edu/kermit/ckubwr.html#x7
10852 + 577. http://www.columbia.edu/kermit/ckubwr.html#top
10853 + 578. http://www.columbia.edu/kermit/ckubwr.html#contents
10854 + 579. http://www.columbia.edu/kermit/ckubwr.html#x10
10855 + 580. http://www.columbia.edu/kermit/ckubwr.html#x8
10856 + 581. http://www.columbia.edu/kermit/ck60manual.html
10857 + 582. http://dickey.his.com/xterm/xterm.html
10858 + 583. http://www.columbia.edu/kermit/ckubwr.html#top
10859 + 584. http://www.columbia.edu/kermit/ckubwr.html#contents
10860 + 585. http://www.columbia.edu/kermit/ckubwr.html#x11
10861 + 586. http://www.columbia.edu/kermit/ckubwr.html#x9
10862 + 587. http://www.columbia.edu/kermit/ckubwr.html#top
10863 + 588. http://www.columbia.edu/kermit/ckubwr.html#contents
10864 + 589. http://www.columbia.edu/kermit/ckubwr.html#x12
10865 + 590. http://www.columbia.edu/kermit/ckubwr.html#x10
10866 + 591. http://www.columbia.edu/kermit/ckubwr.html#x11.1
10867 + 592. http://www.columbia.edu/kermit/ckubwr.html#x11.2
10868 + 593. http://www.columbia.edu/kermit/ckubwr.html#top
10869 + 594. http://www.columbia.edu/kermit/ckubwr.html#contents
10870 + 595. http://www.columbia.edu/kermit/ckubwr.html#x11
10871 + 596. http://www.columbia.edu/kermit/ckubwr.html#x11.2
10872 + 597. http://www.columbia.edu/kermit/ck60manual.html
10873 + 598. http://www.columbia.edu/kermit/ckubwr.html#top
10874 + 599. http://www.columbia.edu/kermit/ckubwr.html#contents
10875 + 600. http://www.columbia.edu/kermit/ckubwr.html#x11
10876 + 601. http://www.columbia.edu/kermit/ckubwr.html#x11.1
10877 + 602. http://www.columbia.edu/kermit/ck60manual.html
10878 + 603. http://www.columbia.edu/kermit/ckubwr.html#top
10879 + 604. http://www.columbia.edu/kermit/ckubwr.html#contents
10880 + 605. http://www.columbia.edu/kermit/ckubwr.html#x13
10881 + 606. http://www.columbia.edu/kermit/ckubwr.html#x11
10882 + 607. http://www.columbia.edu/kermit/security.html
10883 + 608. http://www.columbia.edu/kermit/ckubwr.html#top
10884 + 609. http://www.columbia.edu/kermit/ckubwr.html#contents
10885 + 610. http://www.columbia.edu/kermit/ckubwr.html#x14
10886 + 611. http://www.columbia.edu/kermit/ckubwr.html#x12
10887 + 612. http://www.columbia.edu/kermit/ckubwr.html#top
10888 + 613. http://www.columbia.edu/kermit/ckubwr.html#contents
10889 + 614. http://www.columbia.edu/kermit/ckubwr.html#x15
10890 + 615. http://www.columbia.edu/kermit/ckubwr.html#x14
10891 + 616. mailto:support@stallion.oz.au
10892 + 617. http://www.stallion.com/
10893 + 618. http://www.columbia.edu/kermit/ckubwr.html#top
10894 + 619. http://www.columbia.edu/kermit/ckubwr.html#contents
10895 + 620. http://www.columbia.edu/kermit/ckermit.html
10896 + 621. http://www.columbia.edu/kermit/ck80.html
10897 + 622. http://www.columbia.edu/kermit/index.html
10898 + 623. http://www.columbia.edu/kermit/index.html
10899 + 624. http://www.columbia.edu/
10900 + 625. mailto:kermit@columbia.edu
10901 --- /dev/null
10902 +++ ckermit-301/ckermit.ini
10903 @@ -0,0 +1,8 @@
10904 +COMMENT - Standard C-Kermit initialization file
10905 +;
10906 +echo
10907 +echo The very long standard initialization file that was distributed
10908 +echo with C-Kermit 6, 7, and 8 is no longer recommended as "standard",
10909 +echo since its features were little used.  It is still available in
10910 +echo the C-Kermit distribution as ockermit.ini.
10911 +echo
10912 --- /dev/null
10913 +++ ckermit-301/ckc300.txt
10914 @@ -0,0 +1,7820 @@
10915 +C-KERMIT 9.0 CHANGE LOG (Changes since 8.0.207 / K95 2.1.3 January 2003)
10916 +
10917 +  Chronological order.
10918 +  Go to the bottom to find the newest edits.
10919 +
10920 +  F. da Cruz, The Kermit Project, Columbia University, NYC.
10921 +  Last update: 28 June 2011.
10922 +
10923 +FTP USER, FTP ACCOUNT, plus the various prompts and switches for FTP username,
10924 +password, and account all neglected to strip quotes, and in most cases quotes
10925 +are necessary to specify a username that contains spaces.  ckcftp.c,
10926 +15 Jan 2003.
10927 +
10928 +FTP MPUT f1 f2 f3... gets a parse error if any of the fn's do not match an
10929 +existing file.  This is bad for scripts.  In doftpput(), cmfdb() looks for
10930 +keywords (switches) or CMIFI.  When it hits CMIFI, it exits from the initial
10931 +parse loop and then does additional cmifi()s in a loop until done.  The most
10932 +obvious fix is to parse each field with cmfdb(CMIFI,CMFLD), i.e. fall back to
10933 +CMFLD if CMIFI doesn't match anything.  Then if CMFLD was used, we don't add
10934 +the filespec to the list.  This is a rather big change but it seems to work.
10935 +No error messages or failures happen for non-matching fields, but an error
10936 +message is printed (and the MPUT command fails) if none of the fields match
10937 +any files.  This fix got in too late for 2.1.3; workaround: use C-Shell
10938 +like wildcard list (ftp mput "{*.abc,foo.*}").  ckcftp.c, 16 Jan 2003.
10939 +
10940 +GREP did not pass its pattern through the expander, thus variables could
10941 +not be used for patterns.  This must have been an oversight -- I can't find
10942 +anything in my notes about it.  Fixed in dogrep(): ckuus6.c, 24 Jan 2003.
10943 +
10944 +New makefile target for HP-UX 11.xx with OpenSSL from Tapani Tarvainen.
10945 +makefile, 31 Jan 2003.
10946 +
10947 +From Jeff:
10948 + . Avoid core dump when dereferencing tnc_get_signature(): ckuus4.c.
10949 + . Bump version numbers to 8.0.208, 2.1.4: ckcmai.c.
10950 +
10951 +Added /NOLOGIN to FTP [OPEN].  ckcftp.c, 10 Feb 2003.
10952 +
10953 +Don't dump core if FTP DEBUG is ON and FTP OPEN does not include a service.
10954 +openftp(): ckcftp.c, 10 Feb 2003.
10955 +
10956 +HELP PATTERN text incorrectly identified commands and functions with
10957 +floating and anchored patterns.  The corrected lists are:
10958 +Floating: GREP, TYPE /MATCH:, /EXCEPT: patterns, \farraylook(),
10959 +Anchored: IF MATCH, file-matching wildcards, \fsearch(), \frsearch()
10960 +ckuus2.c, 10 Feb 2003.     
10961 +
10962 +INPUT n \fpattern(xxx) did not work for case-independent comparisons.
10963 +Fixed in doinput(): ckuus4.c, 10 Feb 2003.
10964 +
10965 +It seems \fpattern() didn't work with MINPUT at all.  There was no code to
10966 +handle \fpattern() in the MINPUT parse loop, so it never worked.  The code
10967 +had to be totally rewritten to use cmfld() in a loop, rather than cmtxt()
10968 +and then cksplit().  Furthermore, whenever any of the fields was an
10969 +\fjoin(), this had to be split.  ckuusr.c, 10 Feb 2003.
10970 +
10971 +Macro replacement via \m() and \fdefinition() does not work as advertised
10972 +(i.e. case sensitively) for associative array elements; e.g. \m(xxx<abc>) is
10973 +treated the same as \m(xxx<ABC>), contrary to section 7.10.10 of the C-Kermit
10974 +7.0 update notes, and to the fact that the two really do exist separately.
10975 +Fixed by adding a static function isaarray(s) which succeeds if s is an
10976 +associative array reference and fails otherwise, and then having \m()
10977 +and \fdef() call mxxlook() (case-sensitive lookup) if isaarray(), otherwise
10978 +(as before) mxlook()).  ckuus4.c, 11 Feb 2003.
10979 +
10980 +Fixed FTP OPEN to allow the /USER switch to override SET FTP AUTOLOGIN OFF,
10981 +just as /NOLOGIN overrides SET FTP AUTOLOGIN ON.  ckcftp.c, 11 Feb 2003.
10982 +
10983 +In K95, "set key \1234 \27H" (any SET KEY command in which the first char of
10984 +the definition was backslash, and the ONLY character after the backslash
10985 +quantity was an uppercase letter, that letter would be lowercased).  Diagnosis:
10986 +xlookup() poking its argument (see notes from July 2000).  Jeff sent a fix.
10987 +ckucmd.c, 15 Feb 2003.
10988 +
10989 +Ran my S-Expression torture test to make sure Sexps still worked.  They do,
10990 +except the bitwise & and | operators were broken, e.g. (& 7 2) and (| 1 2 4)
10991 +get "Invalid operand" errors.  Jeff's code had added an early failure return
10992 +from the lookup loop when when a single-byte keyword matched a keyword that
10993 +started with the same byte but was more than one byte long.  So "&" would hit
10994 +"&&" and fail instead of continuing its search (xlookup tables aren't sorted
10995 +so there can be no early return).  Fixed in xlookup(): ckucmd.c, 16 Feb 2003.
10996 +
10997 +Got rid of "krbmit" target from makefile.  It's still there, but we don't
10998 +use it any more.  All secure targets now use "xermit", and produce a binary
10999 +called wermit, just like the regular ones do (except the old ckucon.c ones).
11000 +Non-secure targets, since they don't define any of the security symbols,
11001 +wind up compiling and linking to (mostly) empty security modules.  makefile,
11002 +15 Feb 2003.
11003 +
11004 +Added \fcvtdate(xxx,3) to format its result in MDTM format (yyyymmddhhmmss,
11005 +all numeric, no spaces or punctuation).  Of course these numeric strings
11006 +are too big to be 32-bit numbers and are useless for arithmetic, but they're
11007 +useful for lexical comparison, etc.  ckuus[24].c, 16 Feb 2003.
11008 +
11009 +The following FTP commands did not set FAILURE when they failed: RMDIR,
11010 +CD, CDUP, Fixed in the corresponding doftpblah() routines.  ckcftp.c,
11011 +16 Feb 2003.
11012 +
11013 +RENAME would sometimes not print an error message when it failed, e.g. in K95
11014 +when the destination file already existed.  ckuus6.c, 17 Feb 2003.
11015 +
11016 +Fixed COPY error messages, which did not come out in standard format when
11017 +/LIST was not included.  ckuus6.c, 17 Feb 2003.
11018 +
11019 +Fixed #ifdefs in ck_crp.c to allow nonsecure builds on old platforms like
11020 +System V/68 R3.  19 Feb 2003.
11021 +
11022 +Similar treatment for ck_ssl.c.  20 Feb 2003.
11023 +
11024 +From Jeff, 21 Feb 2003:
11025 + . AIX53 and AIX52 symbols for ckcdeb.h, makefile.
11026 + . New gcc targets for various AIX 4.x/5.x versions: makefile.
11027 + . Copyright date updates: ck_crp.c, ck_ssl.c.
11028 + . ENABLE/DISABLE QUERY broken because keyword table out of order: ckuusr.c.
11029 + . Fixed the use of HTTP proxies for HTTP [RE]OPEN for Unix: ckcnet.c.
11030 +
11031 +Also for K95 only: Allow file transfer when K95 is invoked on the remote end
11032 +of a connection to a Pragma Systems Terminal Server connection; automatically
11033 +SET EXIT HANGUP OFF when invoked with open port handle ("k95 -l nnnn").
11034 +
11035 +"cd a*" failed even when "a*" matched only one directory.  Fixed in cmifi():
11036 +ckucmd.c, 21 Feb 2003.
11037 +
11038 +In the Unix version, replace "extern int errno;" with "#include <errno.h>"
11039 +if __GLIBC__ is defined, since glibc now defines a thread-specific errno.
11040 +ckcdeb.h, 26 Feb 2003.
11041 +
11042 +Added #ifdefs to skip compilation of ckuath.c in nonsecure builds.  Tested
11043 +by building both secure and regular versions in Linux.  ckuath.c, 26 Feb 2003.
11044 +
11045 +Ran the build-in-84-different-configurations script on Linux to make sure it
11046 +still builds with all different combinations of feature selection options.
11047 +All OK.  26 Feb 2003.
11048 +
11049 +Built on VMS.  Needed to add a prototype for mxxlook*() to ckuusr.h; built
11050 +OK otherwise.  26 Feb 2003.
11051 +
11052 +From Jeff: More #ifdef shuffling for nonsecure builds: ckuath.c, ck_ssl.c,
11053 +27 Feb 2003.
11054 +
11055 +Added code to ensure \v(download) ends in a directory separator in Unix,
11056 +Windows, and OS/2.  ckuus7.c, 27 Feb 2003.
11057 +
11058 +Added code to K95 zfnqfp() to tack on directory separator when returning
11059 +a directory name.  ckofio.c, 27 Feb 2003.
11060 +
11061 +Somehow an old copy of ckuath.c popped to replace the new one.  Put the new
11062 +one back.  28 Feb 2003.
11063 +
11064 +From Jeff: Fix typo in my K95 zfnqfp() code from yesterday; fixes for handling
11065 +UNCs uniformly, no matter which way their slashes are leaning.  ckofio.c,
11066 +28 Feb 2003.
11067 +
11068 +At Jeff Mezei's suggestion, separate text and binary mode open sequences
11069 +for VMS session log.  ckvfio.c, 28 Feb 2003.
11070 +
11071 +Added freebsd48 target for FreeBSD 4.8.  makefile, 1 Mar 2003.
11072 +
11073 +Changed Mac OS X entries to include -DUSE_STRERROR.  makefile, 2 Mar 2003.
11074 +
11075 +Fixed GETOK /GUI to evaluate its text argument.  ckuus6.c, 3 Mar 2003.
11076 +
11077 +Jeff fixed the K95 Dialer QUICK dialog to (a) allow templates, and (b) have
11078 +a Save-As option.  3 Mar 2003.
11079 +
11080 +Jeff fixed a problem with the Xmodem-CRC checksum being crunched whenever
11081 +there was a retransmission.  7 Mar 2003.
11082 +
11083 +Added target/banner for Tru64 5.1B.  makefile, ckuver.h, 5 Mar 2003.
11084 +
11085 +In Unix, the zcopy() routine (used by the COPY command) reset the user's umask
11086 +to 0 for the remainder of the Kermit process lifetime.  The bug was in
11087 +ckufio.c 8.0.194, 24 Oct 2002, and is fixed in ckufio.c 8.0.195, 6 Mar 2003.
11088 +Of course this happened after building 155 C-Kermit 8.0.208 binaries.  (But
11089 +before officially releasing 8.0.208.)
11090 +
11091 +In the VMS version, changed:
11092 +
11093 +        while ((n--) && xx_inc(2) > -1) ;
11094 +to:
11095 +        while ((n--) && xx_inc(2) >= 0) ;
11096 +
11097 +to suppress the "...is being compared with a relational operator to a constant
11098 +whose value is not greater than zero" warning.  ckvtio.c, 7 Mar 2002.
11099 +
11100 +Added a debug call to dologend in hopes of catching overzealous Locus
11101 +switching, which seems to happen only in K95.  ckuus3.c, 7 Mar 2002.
11102 +
11103 +Rebuilt binaries for some of the more current Unix releases: AIX 4.3.3-5.1,
11104 +Solaris 7-9 , Red Hat 7.0-8.0, Slackware 8.1, Freebsd 4.7-4.8, NetBSD 1.6,
11105 +OpenBSD 3.2, Unixware 7.1.3, Open Unix 8, OSR5.0.6a, etc.  A Unix binary with
11106 +COPY umask fix shows a 6 Mar 2003 date for "UNIX File support" in SHOW
11107 +VERSIONS; a binary without the fix shows 24 Oct 2002.
11108 +
11109 +C-Kermit 8.0.208 dated 14 March 2003 released on 10 March 2003.
11110 +
11111 +---8.0.208---
11112 +
11113 +From Jeff 13 Mar 2003:
11114 + . Updated SSL module allows importation of tickets from host.
11115 + . freebsd50+openssl target: makefile.
11116 + . FTP PUT /PERMISSIONS error message for K95: ckcftp.c.
11117
11118 +Fixed MINPUT to strip quotes or braces from around targets (this was broken
11119 +on Feb 10th).  Thanks to Jason Heskett for discovering and reporting this
11120 +(killer) bug.  ckuusr.c, 14 Mar 2003.
11121 +
11122 +Changed version number to 209 Dev.00.  ckcmai.c, 14 Mar 2003.
11123 +
11124 +While debugging the alphapage script, I found that the command "minput 8 \6\13
11125 +\21\13 \13\27\4\13 \30\13" gets "?Not confirmed" in 8.0.208 and 8.0.209, but
11126 +not in 206 and earlier.  This problem too was introduced on Feb 10th by
11127 +changing MINPUT parsing from cmtxt() followed by cksplit() to cmfld() in a
11128 +loop.  cmfld() uses setatm() to return its result and of course setatm()
11129 +breaks on \13.  Changing setatm() not to do this would break everything else.
11130 +But cmfld() has no arguments that let us tell it to do anything different in
11131 +this case.  Changing the API would be a disaster.  The only solution is to add
11132 +an "MINPUT ACTIVE" (minputactive) global variable that tells cmfld() to tell
11133 +setatm() not to break on CR.  Now MINPUT with braced targets containing CR
11134 +and/or LF works in 209, 206, and 201 (but not 208).  ckucmd.c, ckuusr.c,
11135 +ckuus5.c, 15 Mar 2003.
11136 +
11137 +MINPUT n \fjoin(&a) works OK if all the members of \&a[] are text strings, but
11138 +if they are strings of control chars (as above), they don't get separated by
11139 +the spaces.  For example in:
11140 +
11141 +  dcl \&a[] = "\4\5" "\6\7" xxx
11142 +  minput 10 \fjoin(&a)
11143 +
11144 +MINPUT gets two targets: "aaa" and "\4\5 \6\7 xxx".  The bug was in the
11145 +cksplit() call in the \fjoin() case of MINPUT: it needed to specify an
11146 +include set consisting of all the control characters except NUL.  ckuusr.c,
11147 +16 Mar 2003.
11148 +
11149 +But there's still a problem:
11150 +
11151 +  dcl \&a[] = "\4\5\13\10" "\6\7" "xxx"
11152 +
11153 +creates an array whose first member is "^D^E (one doublequote included).  But
11154 +if braces are used instead, there's no problem.  Same deal as MINPUT: cmfld()
11155 +breaks on CR or LF, thus the end quote is lost.  If I set minputactive for
11156 +DECLARE initializers too, that fixes it.  Is there any reason not to do this?
11157 +Can't think of any (famous last words)...  ckuusr.c, 16 Mar 2003.
11158 +
11159 +Since it has multiple applications, changed the flag's name from minputactive
11160 +to keepallchars.  ckucmd.c, ckuus[r5].c, 16 Mar 2003.
11161 +
11162 +\v(exedir) wasn't being set correctly (it included the program name as well
11163 +as the directory).  Fixed in getexedir(): ckuus4.c, 16 Mar 2003.
11164 +
11165 +SET CARRIER-WATCH <Esc> "auto matic" (spurious space in supplied keyword).
11166 +Cosmetic only; it still worked.  Fixed in setdcd(): ckuus3.c, 16 Mar 2003.
11167 +
11168 +"directory a b c" listed too many files -- all files whose names END WITH a,
11169 +b, or c, rather than the files whose names WERE a, b, or c.  Diagnosis: The
11170 +filespec is changed into a pattern: {a,b,c}, which is the correct form.  It is
11171 +passed to nzxpand(), which goes through the directory getting filenames and
11172 +sending each one to ckmatch() with the given pattern.  ckmatch() receives the
11173 +correct pattern but then prepends a "*" -- that's not right.  It's not just
11174 +in filename matching either.  The following succeeds when it shouldn't:
11175 +
11176 +  if match xxxxc {{a,b,c}} <command>
11177 +
11178 +Changing ckmatch() to not prepend the "*" to each segment fixes the command
11179 +above but breaks lots of others.  Running through the "match" torture-test
11180 +script shows the problem occurs only when the {a,b,c} list is the entire
11181 +pattern, and not embedded within a larger pattern.  Testing for this case
11182 +fixed the problem.  ckmatch(): ckclib.c, 16 Mar 2003.
11183 +
11184 +Fixed FTP MODTIME to not print anything if QUIET ON.  ckcftp.c, 16 Mar 2003.
11185 +
11186 +Picked up a new ckuath.c from Jeff, not sure what the changes are. 16 Mar 2003.
11187 +
11188 +Did a few regular and secure builds to make sure I didn't wreck anything.
11189 +
11190 +Changed version number to 209 (final).  ckcmai.c, 16 Mar 2003.
11191 +
11192 +Jason Heskett found another bug: if you define a macro FOO inside the
11193 +definition of another macro BAR, and FOO's definition includes an odd number
11194 +of doublequotes (such as 1), FOO's definition absorbs the rest of BAR's
11195 +definition.  Example:
11196 +
11197 +  def TEST {
11198 +    .foo = {X"}
11199 +    sho mac foo
11200 +  }
11201 +  do test
11202 +  sho mac foo
11203 +
11204 +Results in:
11205 +
11206 +  foo = {X"}, sho mac foo
11207 +
11208 +Diagnosis: the TEST definition becomes:
11209 +
11210 +  def TEST .foo = {X"}, sho mac foo
11211 +
11212 +and the macro reader is erroneously treating the doublequote as an open
11213 +quote, and then automatically closes the quote at the end of the definition.
11214 +The error is that a doublequote should be significant only at the beginning of
11215 +a field.  But the macro reader isn't a command parser; it doesn't know what
11216 +a field is -- it's just looking for commas and skipping over quoted ones.
11217 +First we have to fix an oversight: SET COMMAND DOUBLEQUOTING OFF should have
11218 +worked here, but it wasn't tested in this case.  Fixed in getncm(): ckuus5.c,
11219 +17 Mar 2003.
11220 +
11221 +There are only certain cases where it makes sense to treat doublequotes as
11222 +signicant:
11223 +
11224 + . An open quote must be at the beginning or preceded by a space.
11225 + . A close quote is only at the end or else followed by a space.
11226 +
11227 +This too was fixed in getncm(): ckuus5.c, 17 Mar 2003.
11228 +
11229 +A fix from Jeff SSL/TLS FTP data decoding.  ckcftp.c, 18 Mar 2003.
11230 +
11231 +Tried building C-Kermit on a Cray Y-MP with UNICOS 9.0.  "int suspend",
11232 +declared in ckcmai.c and used in many modules, conflicts with:
11233 +
11234 +  unistd.h:extern int suspend __((int _Category, int _Id));
11235 +
11236 +The "=Dsuspend=xsuspend" trick doesn't work for this; there is no way around
11237 +the conflict other than to rename the variable: ckcmai.c, ckutio.c,
11238 +ckuus[35xy].c.  26 Mar 2003.  VMS and K95 not affected.
11239 +
11240 +OK that gets us past ckcmai.c...  Then in ckutio.c I had to add a new #ifdef
11241 +around the LFDEVNO setting, because the Cray didn't have mkdev.h.  Could not
11242 +find a Cray-specific manifest symbol, so I made a new makefile target (cray9)
11243 +that sets this symbol.  Having done this I have no idea what kind of lockfile
11244 +would be created, but I also doubt if anybody dials out from a Cray.  The
11245 +binary should run a C90, J90, or Y-MP.  makefile, 26 Mar 2003.
11246 +
11247 +Added a target for SCO OSR5.0.7.  makefile, ckuver.h, 30 Mar 2003.
11248 +
11249 +Changed since 208:
11250 +makefile ckuver.h ckcmai.c ckclib.c ckcftp.c ckucmd.c ckuus*.c ckutio.c.
11251 +
11252 +---8.0.209---
11253 +
11254 +From Mark Sapiro, a fix for the March 17th doubleqote fix, getncm(): ckuus5.c,
11255 +4 Apr 2003.
11256 +
11257 +From Jeff, 29 Apr 2003:
11258 + . Corrected target for HP-UX 11.00 + OpenSSL: makefile, 
11259 + . Do not allow WILL AUTH before WONT START_TLS: ckctel.h ckctel.c
11260 + . Add hooks for SFTP and SET/SHOW SFTP: ckcdeb.h ckuusr.h ckuusr.c ckuus3.c
11261 + . Add SKERMIT ckuusr.h ckuusr.c
11262 + . Add ADM-5 terminal emulation: ckuus7.c, ckuus5.c
11263 + . Uncomment and update HELP SET SSH V2 AUTO-REKEY: ckuus2.c
11264 + . Enable IF TERMINAL-MACRO and IF STARTED-FROM-DIALER for C-Kermit: ckuus6.c
11265 + . Fix conflicting NOSCROLL keyword definition: ckuusr.h
11266 + . Set ttname when I_AM_SSH: ckuusy.c
11267 + . Add extended arg parsing for SSH, Rlogin, Telnet: ckuusy.c, ckuus4.c
11268 + . Security updates: ckuath.c, ck_ssl.c
11269 + . Change K95 version number to 2.2.0: ckcmai.c
11270 + . Save K95 term i/o state before executing keyboard macro: ckuus4.c
11271 + . Add tests for SSH Subsystem active during INPUT/OUTPUT/CONNECT: ckuus[45].c
11272 + . Enable K95 SET SSH V2 AUTO-REKEY: ckuus3.c
11273 +
11274 +SFTP and SET SFTP subcommands are implemented up to the case statements.
11275 +
11276 +Files of mine that Jeff hadn't picked up:
11277 +  ckuver.h ckcftp.c ckutio.c ckuusx.c (just minor changes for last build-all)
11278 +
11279 +On 4 Jan 2003, SET RECEIVE MOVE-TO was changed to convert is argument to an
11280 +absolute path, which made it impossible to specify a relative path, then
11281 +move to different directories and have it apply relatively to each directory.
11282 +Changed this as follows:
11283 +
11284 + . Parser uses cmtxt() rather than cmdir() so it won't fail at parse time.
11285 + . If path is absolute, we fail at parse time if directory doesn't exist.
11286 + . In reof() we run the the path through xxstring (again, in case deferred
11287 +   evaluation of variables is desired) and then, if not null, use it.
11288 + . If the directory doesn't exist, rename() fails and reof() returns -4,
11289 +   resulting in a protocol error (this is not a change).  We do NOT create
11290 +   the directory on the fly. 
11291 +
11292 +I also fixed SET SEND/RECEIVE RENAME-TO to parse with cmtxt() rather than
11293 +cmdir(), since it's parsing a text template, not a directory name, e.g.
11294 +"set receive rename-to file-\v(time)-v(date)-\v(pid)".  This was totally
11295 +broken, since when I don't know.  We don't call xxstring() in this parse, so
11296 +evaluation is always deferred -- I'd better not change this.  ckuus7.c,
11297 +ckcfns.c, 1 May 2003.
11298 +
11299 +From Jeff, Sat May  3 14:15:23 2003:
11300 + . Pick up the right isascii definition for K95: ckctel.c
11301 + . malloc...  ckuath.c (new safe malloc routines for K95)
11302 + . Add author listing: ckuus5.c
11303 + . SSH Heartbeat support (K95 only): ckuus[23].c
11304 + . Prescan --height and --width to avoid window resizing at startup: ckuusy.c
11305 + . Add checks for fatal() or doexit() called from sysinit(): ckuusx.c
11306 + . Move some K95-specific definitions to ckoker.h: ckcdeb.h
11307 + . Add support for ON_CD macro in zchdir(): ckufio.c
11308 + . Add a command to let FTP client authenticate with SSLv2: ckcftp.c
11309 + . Fix parsing of FTP file facts like "UNIX.mode": ckcftp.c
11310 +
11311 +ON_CD will need some explaining (to be done).  It's implemented for Unix,
11312 +VMS, WIndows, and OS/2.
11313 +
11314 +The FTP file facts fix came from first exposure to the new OpenBSD FTP
11315 +server: ftp://ftp7.usa.openbsd.org/pub/os/OpenBSD/3.3/i386/
11316 +The period in "UNIX.mode" caused an erroneous word break, adding junk to
11317 +the filename.
11318 +
11319 +About the malloc changes, Jeff says "K95 is not behaving well in low memory
11320 +environments.  I'm not sure that C-Kermit does much better.  The program does
11321 +not crash but it certainly does not behave the way the user expects it to.
11322 +I'm beginning to think that any malloc() error should be treated as fatal."
11323 +
11324 +Not visible in these changes because it's in K95-specific modules: Jeff made
11325 +SET ATTRIBUTES OFF and SET ATTRIBUTES DATE OFF apply to XYZMODEM transfers.
11326 +
11327 +From Jeff, 11 May 2003:
11328 + . Add support for SSH Keepalive to relevant SET command (K95): ckuus3.c
11329 + . Reduce max overlapped i/o requests from 30 to 7 (K95): ckuus7.c
11330 + . Don't call sysinit() in fatal(): ckuusx.c.
11331 + . Some new conditionalizations for SSL module: ck_ssl.c
11332 +
11333 +The doublequote-parsing fixes from March and April broke the SWITCH statement,
11334 +which is implemented by internally defining, then executing, a macro.  If I
11335 +drop back to the old dumb handling of doublequotes, everything is fixed except
11336 +the problem of March 17th.  But can we really expect getncm() to pre-guess
11337 +what the parser is going to do?  getncm()'s only job is to find command
11338 +boundaries, which are represented by commas.  Commas, however, is needed IN
11339 +commands too.  We take a comma literally if it is quoted with \, or is inside
11340 +a matched pair of braces, parens, or doublequotes.  It is not unreasonable to
11341 +require a doublequote in a macro definition to be prefixed by \ when it is to
11342 +be taken literally.  The proper response to Jason Heskett's complaint of March
11343 +17th should have been to leave the code alone and recommand an appropriate
11344 +form of quoting:
11345 +
11346 +  def TEST {
11347 +      .foo = {X\"}
11348 +      sho mac foo
11349 +  }
11350 +
11351 +And this is what I have done.  Another reason for sticking with the old method
11352 +is that it's explainable.  The "improved" method, even if it worked, would be
11353 +be impossible to explain.  Btw, in testing this I noticed that the switch-test
11354 +script made 8.0.201 dump core.  Today's version is fine.  The problem with
11355 +quoted strings inside of IF {...} clauses and FOR and WHILE loops is fixed
11356 +too.  Perhaps "unbroken" would be a better word.  ckuus5.c, 11 May 2003.
11357 +
11358 +Vace discovered that FTP MGET /EXCEPT:{... (with an unterminated /EXCEPT list)
11359 +could crash Kermit.  Fixed in ckcftp.c, 11 May 2003.
11360 +
11361 +CONTINUE should not affect SUCCESS/FAILURE status.  ckuusr.c, 11 May 2003.
11362 +
11363 +Fixed an oversight that goes back 15 years.  While \{123} is allowed for
11364 +decimal codes, \x{12} and \o{123} were never handled.  ckucmd.c, 11 May 2003.
11365 +
11366 +Added support for Red Hat <baudboy.h> and /usr/sbin/lockdev.  Supposedly this
11367 +allows Kermit to be installed without setuid or setgid bits and still be able
11368 +to lock and use the serial device.  Compiles and starts, but not tested.
11369 +ckcdeb.h, makefile, ckutio.c, ckuus5.c, 16 May 2003.
11370 +
11371 +From Jeff: FTP ASCII send data to host when FTP /SSL was in use was broken.
11372 +ftp_dpl is set to Clear when FTP /SSL is in use.  This was causing the data to
11373 +be written to the socket with send() instead of the OpenSSL routines.
11374 +ckcftp.c, ckuath.c, 21 May 2003.
11375 +
11376 +From Jeff: Stuff for Kerberos 524: ckcdeb.h.  Fixes for FTP; "FTP ASCII send
11377 +data did not properly compute the end of line translations.  On Unix (and
11378 +similar platforms) the end of line was correct for no character sets but
11379 +incorrect when character sets were specified.  On Windows/OS2, the end of line
11380 +was correct when character sets were specified and incorrect when they were
11381 +not.  On MAC, both were broken.  Also, FTP Send Byte counts were incorrect
11382 +when character sets were specified."  ckcftp.c.  17 Jun 2003.
11383 +
11384 +From Jeff: fixes to HTTP /AGENT: and /USER: switch action: ckcnet.c ckuus3.c
11385 +ck_crp.c ckcftp.c ckuus2.c ckuusy.c ckuusr.c ckcnet.h, 21 Jun 2003.
11386 +
11387 +From Jeff: Fix SET DIALER BACKSPACE so it can override a previous SET KEY
11388 +(e.g. from INI file): ckuus7.c.  Some SSL/TLS updates: ck_ssl.c.  HTTP support
11389 +for VMS and other VMS improvements (e.g. a way to not have to hardwire the
11390 +C-Kermit version number into the build script) from Martin Vorlaender:
11391 +ckcnet.h, ckuus[r3].c, ckcdeb.h, ckvtio.c, ckcnet.c, ckvker.com.  Built on
11392 +Solaris (gcc/ansi) and SunOS (cc/k&r).  The new VMS script tests the VMS
11393 +version and includes HTTP support only for VMS 6.2 or later.  2 Jul 2003.
11394 +
11395 +Tried to build on our last VMS system but it seems to be dead.  Looks like a
11396 +head crash (makes really loud noises, boot says DKA0 not recognized) (fooey, I
11397 +just paid good money to renew the VMS license).  Tried building at another
11398 +site with:
11399 +
11400 +  Process Software MultiNet V4.3 Rev A-X,
11401 +  Compaq AlphaServer ES40, OpenVMS AXP V7.3
11402 +  Compaq C V6.4-008 on OpenVMS Alpha V7.3
11403 +
11404 +Had to make a few corrections to ckvker.com.  But still, compilation of
11405 +ckcnet.c bombs, indicating that the SELECT definition somehow got lost
11406 +somewhere since the 209 release (i.e. no SELECT type is defined so it falls
11407 +thru to "SELECT is required for this code").  But I don't see anything in
11408 +ckcdeb.h or ckcnet.[ch] that would explain this.  Not ckvker.com either
11409 +(putting the old one back gives the same result).  OK, I give up, maybe it's
11410 +just that I haven't tried building it on MultiNet recently.  What about UCX?
11411 +Aha, builds fine there except for warnings about mlook, dodo, and parser in
11412 +ckvfio.c (because of ON_CD) -- I suppose I have #include <ckucmd.h>... (done)
11413 +Anyhow it builds OK and the HTTP code is active and almost works (HTTP OPEN
11414 +works; HTTP GET seems to succeed but creates an empty file every time).  Tried
11415 +building under MultiNet at another installation; same bad result.
11416 +
11417 +OK so why won't it build for MultiNet?  Comparing ckcnet.c with the 209
11418 +version, not a single #ifdef or #include is changed.  Tried building with
11419 +p3="NOHTTP" -- builds OK, aha.  Where's the problem?  Not ckcnet.h...
11420 +Not ckcdeb.h...  OK I give up, will revisit this next time I get time to
11421 +do anything with the code.
11422 +
11423 +Later Jeff said "Martin did not implement VMS networking for the HTTP code.
11424 +All he did was activate the #define HTTP which happens to work because his
11425 +connections are using SSL/TLS connections.  http_inc(), http_tol(), etc have
11426 +no support for VMS networking regardless of whether it is UCX or MULTINET.
11427 +The vast majority of HTTP connections are not secured by SSL/TLS.  It makes no
11428 +sense to support HTTP on VMS until someone is willing to either do the work or
11429 +pay have the work done to implement VMS networking in that code base."  So the
11430 +fix is to not enable HTTP for VMS after all.  Removed the CKHTTP definition
11431 +for VMS from ckcdeb.h, 6 Jul 2003.
11432 +
11433 +Fixed ckvfio.c to #include <ckuusr.h> (instead of <ckucmd.h>) to pick up 
11434 +missing prototypes.  6 Jul 2003.
11435 +
11436 +From Arthur Marsh: solaris2xg+openssl+zlib+srp+pam+shadow and the corresponding
11437 +Solaris 7 target.  makefile, 6 Jul 2003.
11438 +
11439 +Remove duplicate #includes for <sys/stat.h>, <errno.h>, and <ctype.h> from
11440 +ckcftp.c.  6 Jul 2003.
11441 +
11442 +Add -DUSE_MEMCPY to Motorola SV/68 targets because of shuffled #includes in 
11443 +ckcftp.c.  8 Jul 2003.
11444 +
11445 +From Jeff: Fix problems mixing SSL and SRP without Kerberos.  Plus a few minor
11446 +#define comment changes and a reshuffling of #defines in ckcdeb.h to allow me
11447 +to build on X86 Windows without Kerberos.  ckcdeb.h, ck_crp.c, ckuath.c,
11448 +10 Jul 2003.
11449 +
11450 +From Jeff: updated ckuat2.h and ckuath.c, 29 Jul 2003.
11451 +
11452 +Mats Peterson noticed that a very small Latin-1 file would be incorrectly
11453 +identified as UCS-2 by scanfile().  Fixed in ckuusx.c, 29 Jul 2003.
11454 +
11455 +Fixed ACCESS macro definition to account for the fact that FIND is now a
11456 +built-in command.  ckermit.ini, 30 Jul 2003.
11457 +
11458 +From Jeff: Fix for typo in urlparse() (svc/hos): ckuusy.c, 18 Aug 2003.
11459 +
11460 +From Jeff: Redhat9 makefile targets (needed for for OpenSSL 0.9.7):
11461 +makefile, 19 Aug 2003.
11462 +
11463 +GREP /NOLIST and /COUNT did too much magic, with some undesirable fallout:
11464 +"GREP /NOLIST /COUNT:x args" printed "file:count" for each file.  "GREP
11465 +/COUNT:x /NOLIST args" did not print "file:count", but neither did it set the
11466 +count variable.  Removed the magic.  Also one of the GREP switches,
11467 +/LINENUMBERS, was out of order.  Fixed in ckuus6.c, 20 Aug 2003.
11468 +
11469 +From Jeff: "Reorganizing code to enable building with different subsets of
11470 +options; a few typos corrected as well."  ckcdeb.h, ckuver.h (for RH9),
11471 +ckcnet.c, ckuus7.c, ckuus3.c: 24 Aug 2003.
11472 +
11473 +Scanfile misidentified a big PDF file as text because the first 800K of it
11474 +*was* text (most other PDF files were correctly tagged as binary).  Fixed
11475 +by adding a check for the PDF signature at the beginning of the file.
11476 +scanfile(): ckuusx.c, 25 Aug 2003.
11477 +
11478 +Ditto for PostScript files, but conservatively.  Signature at beginning of
11479 +file must begin with "%!PS-Ado".  If it's just "%!" (or something nonstandard
11480 +like "%%Creator: Windows PSCRIPT") we do a regular scan.  Also added "*.ps"
11481 +to all binary filename patterns.  ckuusx.c, 4 Sep 2003.
11482 +
11483 +Ditto (but within #ifndef NOPCLSCAN) for PCL (<ESC>E) and PJL (<ESC>%) files,
11484 +but no binpatterns (note: ".PCL" is the extension for TOPS-20 EXEC scripts).
11485 +ckuusx.c, 4 Sep 2003.
11486 +
11487 +Added comments about OpenSSL 0.9.7 to all linux+openssl targets.
11488 +makefile, 4 Sep 2003.
11489 +
11490 +From Jeff: Added - #define ALLOW_KRB_3DES_ENCRYPT.  When this symbol is defined
11491 +at compilation Kermit will allow non-DES session keys to be used during Telnet
11492 +Auth.  These session keys can then be used for Telnet Encrypt.  The reason
11493 +this is not compiled on by default is that the MIT Kerberos Telnet does not
11494 +follow the RFC for constructing keys for ENCRYPT DES when the keys are longer
11495 +than 8 bytes in length.  ckuath.c, ckuus5.c, 4 Sep 2003.
11496 +
11497 +"ftp mget a b c" succeeded if one or more of the files did not exist, even
11498 +with "set ftp error-action proceed".  This is because the server's NLST file
11499 +list does not include any files that don't exist, so the client never even
11500 +tries to get them.  Fortunately, the way the code is structured, this one was
11501 +easy to fix.  ckcftp.c, 14 Sep 2003.
11502 +
11503 +From Jeff: Corrected code in ckcnet.c to ensure that Reverse DNS Lookups are
11504 +not performed if tcp_rdns is OFF.  Fixed ck_krb5_getrealm() to actually return
11505 +the realm of the credentials cache and not the default realm specified in the
11506 +krb5.conf file.  Previously krb5_cc_get_principal() was not being called.
11507 +Fixed ck_krb5_is_tgt_valid() to test the TGT in the current ccache and not the
11508 +TGT constructed from the default realm.  ckcnet.c, ckuath.c, 14 Sep 2003.
11509 +
11510 +Marco Bernardi noticed that IF DIRECTORY could produce a false positive if
11511 +the argument directory had previously been referenced but then removed.  This
11512 +is because of the clever isdir() cache that was added to speed up recursion
11513 +through big directory trees.  Changed IF DIRECTORY to make a second check
11514 +(definitive but more expensive) if isdir() succeeds, and changed the
11515 +directory-deleting routine, ckmkdir(), to flush the directory cache (UNIX
11516 +only -- this also should be done in K95 but it's not critical).  This was
11517 +done by adding a routine, clrdircache() to ckufio.c, which sets prevstat
11518 +to -1 and prevpath[0] to NUL.  ckcfn3.c, ckuus6.c, ckufio.c, 18 Sep 2003.
11519 +
11520 +Marco reported the second fix still didn't work for him (even though it did
11521 +for me).  Rather than try to figure out why, I concluded that the directory
11522 +cache is just not safe: a directory found a second ago might have been deleted
11523 +or renamed not only by Kermit but by some other process.  Why did I add this
11524 +in the first place?  The log says:
11525 +
11526 +  Some debug logs showed that isdir() is often called twice in a row on the
11527 +  same file.  Rather than try to sort out clients, I added a 1-element cache
11528 +  to Unix isdir().  ckufio.c, 24 Apr 2000.
11529 +
11530 +Experimentation with DIR and DIR /RECURSIVE does not show this happening at
11531 +all.  So I #ifdef'd out the directory cache (see #ifdef ISDIRCACHE in ckufio.c;
11532 +ISDIRCACHE is not defined) and backed off the previous changes: ckufio.c,
11533 +ckcfn3.c, ckuus6.c, 28 Sep 2003.
11534 +
11535 +From Jeff: Replace the compile time ALLOW_KRB_3DES_ENCRYPT with a run-time
11536 +command SET TELNET BUG AUTH-KRB5-DES which defaults to ON: ckctel.[ch],
11537 +ckuus[234].c, ck_crp.c, ckuath.c.  4 Oct 2003.
11538 +
11539 +Allow DIAL RETRIES to be any positive number, and catch negative ones.
11540 +Also added code to check for atoi() errors (e.g. truncation).  At least on
11541 +some platforms (e.g. Solaris) atoi() is supposed to set errno, but it
11542 +doesn't.  ckuus3.c, ckucmd.c, 4 Oct 2003.
11543 +
11544 +Added /DEFAULT: to ASK-class commands (ASK, ASKQ, GETOK):
11545 +
11546 + . For popups: no way to send defaults to popup_readtext() or popup_readpass().
11547 + . For GUI ASK[Q], pass default to gui_txt_dialog().
11548 + . For GUI GETOK, convert "yes" "ok" or "no" default to number for uq_ok().
11549 + . For Text GETOK, add default to cmkey().
11550 + . For Text ASK[Q], add default to cmtxt().
11551 + . For GETC, GETKEY, and READ: no changes.
11552 +
11553 +GETOK, ASK, and ASKQ with /TIMEOUT: no longer fail when the timer goes off
11554 +if a /DEFAULT was supplied.  The GUI functions (uq_blah) don't seem to
11555 +support timeouts.  Only the text version has been tested.  ckuus[26].c,
11556 +4 Oct 2003.
11557 +
11558 +From Jeff: add /DEFAULT: for popups.  ckuus6.c. 6 Oct 2003.
11559 +
11560 +Change SET DIAL INTERVAL to be like SET DIAL RETRIES.  ckuus[34].c, 6 Oct 2003.
11561 +
11562 +Added target for HP-UX 10/11 + OpenSSL built with gcc, from Chris Cheney.
11563 +Makefile, 12 Oct 2003.
11564 +
11565 +From Jeff, 6 Nov 2003:
11566 + . #ifdef adjustments: ckcftp.c, ckcdeb.h
11567 + . Fix spurious consumption of first byte(s) on Telnet connection: ckctel.c
11568 + . Another HP PJL test for scanfile: ckuusx.c.
11569 + . K95: Recognize DG4xx protected fields in DG2xx emulation: ckuus7.c.
11570 + . Add SSLeay version display to SHOW AUTH command: ckuus7.c
11571 + . Improved SET MOUSE CLEAR help text: ckuus2.c.
11572 + . Improved Kverbs help text: ckuus2.c (+ new IBM-3151 Kverbs).
11573 + . Some changes to ck_ssl.c, ckuath.c.
11574 +
11575 +From PeterE, 10 Nov 2003:
11576 + . Improved HP-UX 10/11 makefile targets for OpenSSL.
11577 + . #ifdef fix for OpenSSL on HP-UX: ck_ssl.c.
11578 +
11579 +Another new makefile from PeterE with improved and integrated HP-UX targets.
11580 +12 Nov 2003.
11581 +
11582 +A couple fixes to the solaris9g+krb5+krb4+openssl+shadow+pam+zlib target
11583 +from Jeff.  Added a solaris9g+openssl+shadow+pam+zlib target.  makefile,
11584 +21 Nov 2003.
11585 +
11586 +From Jeff, 30 Nov 2003:
11587 + . Fix SEND /MOVE-TO: ckuusr.c.
11588 + . Fix K95 SET TITLE to allow quotes/braces around text: ckuus7.c.
11589 + . Improved "set term autodownload ?" response: ckuus5.c.
11590 + . Fix SHOW FEATURES to specify the protocol for encryption: ckuus5.c
11591 + . Make {SEND, RECEIVE} {MOVE-TO, RENAME-TO} work for XYZMODEM (K95 only).
11592 +
11593 +From Jeff: 7 Jan 2004:
11594 + . At one point Frank started to add a timer parameter to the
11595 +   uq_txt() function but he only did it for the non-ANSI
11596 +   compilers.  I added it for the ANSI compilers, fixed the
11597 +   prototypes and provided a default value easily changed
11598 +   DEFAULT_UQ_TIMEOUT: ckcker.h, ckuus[36].c, ck_ssl.c, ckcftp.c, ckuath.c.
11599 + . Fixed SET TERMINAL DEBUG ON (typo in variable name): ckuus7.c.
11600 + . Fixed BEEP INFORMATION; previously it made no sound, now uses
11601 +   MB_ICONQUESTION.  ckuusx.c.
11602 +
11603 +From Ian Beckwith <ian@nessie.mcc.ac.uk> (Debianization), 7 Jan 2004:
11604 + . Search dir/ckermit for docs, as well as dir/kermit in cmdini(): ckuus5.c.
11605 + . New linux+krb5+krb4+openssl+shadow+pam target (kitchen sink minus SRP,
11606 +   which Debian does not distribute): makefile.
11607 + ? Mangles the DESTDIR support in makefile to install into a staging area:
11608 +   makefile (I didn't take this one yet).
11609 +
11610 +Updated copyright notices for 2004, all modules.  7 Jan 2004.
11611 +
11612 +Added INPUT /NOMATCH, allowing INPUT to be used for a fixed amount of time
11613 +without attempting to match any text or patterns, so it's no longer
11614 +necessary to "input 600 STRING_THAT_WILL_NEVER_COME".  If /NOMATCH is
11615 +included, INPUT succeeds if the timeout expires, with \v(instatus) = 1
11616 +(meaning "timed out"); fails upon interruption or i/o error.  ckuusr.h,
11617 +ckuus[r24].c, 7 Jan 2004.
11618 +
11619 +Added SET INPUT SCALE-FACTOR <float>.  This scales all INPUT timeouts by the
11620 +given factor, allowing time-sensitive scripts to be adjusted to changing
11621 +conditions such as congested networks or different-speed modems without
11622 +having to change each INPUT-class command.  This affects only those timeouts
11623 +that are given in seconds, not as wall-clock times.  Although the scale
11624 +factor can have a fractional part, the INPUT timeout is still an integer.
11625 +Added this to SHOW INPUT, and added a \v(inscale) variable for it.
11626 +ckuusr.h, ckuus[r257].c, 7 Jan 2004.
11627 +
11628 +undef \%a, \fverify(abc,\%a) returns 0, which makes it look as if \%a is a
11629 +string composed of a's, b's, and/or c's, when in fact it contains nothing.
11630 +Changed \fverify() to return -1 in this case.  ckuus4.c, 12 Jan 2004.
11631 +
11632 +\fcode(xxx) returned an empty string if its argument string was empty.  This
11633 +makes it unsafe to use in arithmetic or boolean expressions.  Changed it to
11634 +return 0 if its argument was missing, null, or empty.  ckuus4.c, 12 Jan 2004.
11635 +
11636 +Updated \verify() and \fcode() help text.  ckuus2.c, 12 Jan 2004.
11637 +
11638 +While setting up IKSD, Ian Beckwith noticed that including the --initfile:
11639 +option caused Kermit to start parsing its own Copyright string as if it were
11640 +the command line, and eventually crash.  I couldn't reproduce on Solaris /
11641 +Sparc but I could in Linux / i386 (what Ian is using) -- a change from Jeff
11642 +on 28 Apr 2003 set the command-line arg pointer to a literal empty string in
11643 +prescan() about line 1740 of of ckuus4.c; the pointer is incremented next
11644 +time thru the loop, resulting in random memory being referenced.  Fixed by
11645 +setting the pointer to NULL instead of "".  ckuus4.c, 12 Jan 2004.
11646 +
11647 +declare \&a[999999999999999] would dump core on some platforms.  atoi()
11648 +or whatever would truncate the dimension to maxint.  When we add 1 to the
11649 +result, we get a negative number, which is used as an index, loop test, etc.
11650 +Fixed both dodcl() and dclarray() to check for (n+1 < 0).  ckuus[r5].c,
11651 +12 Jan 2004.
11652 +
11653 +Unix zchki() would fail on /dev/tty, which is unreasonable.  This prevented
11654 +FOPEN /READ from reading from the terminal.  zchki() already allowed for
11655 +/dev/null, so I added /dev/tty to the list of specials.  Ditto for FOPEN
11656 +/WRITE and zchko().  ckufio.c 13 Jan 2004.
11657 +
11658 +Added untabify() routine to ckclib.[ch], 13 Jan 2004.
11659 +Added FREAD /TRIM and /UNTABIFY.  ckuus[27].c, 13 Jan 2004.
11660 +Added \funtabify().  ckuusr.h, ckuus[24].c, 13 Jan 2004.
11661 +
11662 +Dat Nguyen noticed that (setq u 'p') followed by (u) dumped core.  This was
11663 +caused by an over-clever optimization that skipped mallocs for short
11664 +literals, but then went on later to try to free one that hadn't been
11665 +malloc'd.  Fixed in dosexp(): ckuus3.c, 14 Jan 2004.
11666 +
11667 +Catch another copyright date.  ckuus5.c, 14 Jan 2004.
11668 +
11669 +Fixed SWITCH to work even when SET COMMAND DOUBLEQUOTE OFF (from Mark
11670 +Sapiro).  ckuus5.c, 15 Jan 2004.
11671 +
11672 +Changed version to 8.0.211 so scripts can test for recently added features.
11673 +ckcmai.c, 15 Jan 2004.
11674 +
11675 +Fixed a glitch in K95 "help set port".  ckuus2.c, 20 Jan 2004.
11676 +
11677 +Fix from Jeff: Connections to a TLS-aware protocol which require a reconnect
11678 +upon certificate verification failure could not reconnect if the connection
11679 +was initiated from the command line or via a URL.  ckctel.c ckcmai.c
11680 +ckuusr.c ckuus7.c ckuusy.c, 20 Jan 2004.
11681 +
11682 +From Alex Lewin: makefile target and #ifdef for Mac OS X 10.3 (Panther):
11683 +makefile, ckcnet.c, 7 Feb 2004.
11684 +
11685 +Added KFLAGS to sco32v507 targets to make PTY and SSH commands work.  The
11686 +same flags could probably also be added to earlier OSR5 targets but they
11687 +have not been tested there.  makefile, 7 Feb 2004.
11688 +
11689 +Checked a complaint that "LOCAL &a" did not make array \&a[] local.  Indeed
11690 +it did not, and can not.  You have to use the full syntax in the LOCAL
11691 +command, "LOCAL \&a[]", or else it doesn't know it's not a macro named &a.
11692 +7 Feb 2004.
11693 +
11694 +Fixed some confusion in creating IKSD database file and temp-file names.
11695 +I was calling zfnqfp() without remembering that the path member of the
11696 +returned struct included the filename, so to get just the directory name,
11697 +I needed to strip the filename from the right.  ckuusy.c, 2 Mar 2004.
11698 +
11699 +New ckuath.c, ck_ssl.c from Jeff.  2 Mar 2004.
11700 +
11701 +Updated Jeff's affiliation in VERSION command text.  ckuusr.c, 2 Mar 2004.
11702 +
11703 +Designation changed from Dev.00 to Beta.01.  ckcmai.c, 2 Mar 2004.
11704 +
11705 +Fixed zrename() syslogging -- it had success and failure reversed.
11706 +Beta.02: ckufio.c, 4 Mar 2004.
11707 +
11708 +Problem: when accessing IKSD via a kermit:// or iksd:// URL, and a user ID
11709 +is given but no password, doxarg() set the password to "" instead of leaving
11710 +it NULL, but all the tests in dourl() are for NULL.  Fixed in doxarg():
11711 +ckuusy.c, 5 Mar 2004.
11712 +
11713 +The logic in dourl() about which macro to construct (login and connect,
11714 +login and get directory listing, or login and fetch a file) was a bit off,
11715 +so all three cases were not handled.  ckcmai.c, 5 Mar 2004.
11716 +
11717 +Trial Beta builds:
11718 + . HP-UX B.11.11 PA-RISC
11719 + . HP-UX B.11.23 IA64
11720 + . Tru64 4.0G Alpha
11721 + . Tru64 5.1B Alpha
11722 + . Debian 3.0 i386
11723 + . Red Hat ES 2.1 i386
11724 + . Slackware 9.1 i386
11725 + . VMS 7.3-1 Alpha + UCX 5.3
11726 + . VMS 7.3-1 Alpha no TCP/IP
11727 + . VMS 7.3 Alpha MultiNet 4.3 A-X
11728 + . SCO UnixWare 7.1.4 i386
11729 + . SCO OSR5.0.7 i386
11730 + . Solaris 9 Sparc
11731 +
11732 +Fixed compiler warning in doxarg() caused by typo (NULL instead of NUL) in
11733 +the 5 March doxarg() edit.  ckuusy.c, 9 Mar 2004.
11734 +
11735 +IKSD (kermit://) command-line URLs did not work right if the client had
11736 +already preauthenticated with Kerberos or somesuch because they tried to log
11737 +in again with REMOTE LOGIN.  The macros constructed in doxarg() needed to
11738 +check \v(authstate) before attempting REMOTE LOGIN.  ckcmai.c, 10 Mar 2004.
11739 +
11740 +Added ckuker.nr to x.sh (ckdaily upload) and updated ckuker.nr with current
11741 +version number and dates.  10 Mar 2004.
11742 +
11743 +Replaced hardwired references to /usr/local in makefile with $(prefix)
11744 +(which defaults to /usr/local, but can be overridden on the command line),
11745 +suggested by Nelson Beebe for use with Configure.  10 Mar 2004.
11746 +
11747 +From Nelson Beebe: In the Kermit makefile in the install target commands,
11748 +line 981 reads:
11749 +
11750 +        cp $(BINARY) $(DESTDIR)$(BINDIR)/kermit || exit 1;\
11751 +
11752 +Could you please add this line before it:
11753 +
11754 +        rm -f $(DESTDIR)$(BINDIR)/kermit;\
11755 +
11756 +Some sites (mine included) keep multiple versions of software around,
11757 +with hard links between $(prefix)/progname and $(prefix)/progname-x.y.z.
11758 +Failure to remove the $(prefix)/progname at "make install" time then
11759 +replaces the old $(prefix)/progname-x.y.z with the new one, destroying
11760 +an old version that the site wanted to be preserved.  makefile, 10 Mar 2004.
11761 +
11762 +Minor syntax and typo fixes (mostly prototypes): ckcdeb.h, ckcfns.c,
11763 +ckclib.c, ckufio.c, ckuusr.h, ckuusx.c, 10 Mar 2004.  (I still have a few
11764 +more to do.)
11765 +
11766 +Added CC=$(CC) CC2=$(CC2) to many (but not all) makefile targets that
11767 +reference other makefile targets.  On some platforms (notably AIX, Solaris,
11768 +SunOS) there are specific targets for different compilers, so I skipped
11769 +those.  makefile, 10 Mar 2004.
11770 +
11771 +Added error checking to kermit:// URL macros, so they don't plow ahead
11772 +after the connection is closed.  ckcmai.c, 11 Mar 2004.
11773 +
11774 +Added FreeBSD 4.9 and 5.1 targets (only the herald is affected).
11775 +makefile, ckuver.h, 11 Mar 2004.
11776 +
11777 +Added "LIBS=-lcrypt" to bsd44 targets since nowadays crypt is almost always
11778 +unbundled from libc.  Also added explanatory notes.  makefile, 11 Mar 2004.
11779 +
11780 +Changed MANDIR to default to $(manroot)/man/man1, and manroot to default
11781 +to $(prefix).  More adding of CC=$(CC) clauses: {Free,Net,Open}BSD, 4.4BSD.
11782 +makefile, 11 Mar 2004.
11783 +
11784 +Miscellaneous cleanups: ckuusx.c, ckcnet.c, ckufio.c, 11 Mar 2004.
11785 +
11786 +Corrected the check in the linux target to see if /usr/include/crypt.h
11787 +exists, and if so to define HAVE_CRYPT_H, which is used in ckcdeb.h to
11788 +#include <crypt.h> to get the prototype for crypt() and prevent bogus
11789 +conversions on its return type on 64-bit platforms (the previous test wasn't
11790 +quite right and the resulting symbol wasn't spelled right).  makefile,
11791 +12 Mar 2004.
11792 +
11793 +From Jeff, 14 Mar 2004:
11794 + . Initialize localuidbuf[] in tn_snenv(): ckctel.c.
11795 + . Remove remote-mode checks in hupok() for K95G only (why?): ckuus3.c.
11796 + . Add help text for new K95-only TYPE /GUI switches: ckuus2.c.
11797 + . TYPE /GUI parsing, ...: ckuusr.c.
11798 + . TYPE /GUI action, dotype(): ckuus6.c
11799 + . Change Jeff's affiliation: most modules.
11800 +
11801 +20 Mar 2004: Looked into adding long file support, i.e. handling files more
11802 +than 2GB (or 4GB) long.  Discovered very quickly this would be a major
11803 +project.  Each platform has a different API, or environment, or transition
11804 +plan, or whatever -- a nightmare to handle in portable code.  At the very
11805 +least we'll need to convert a lot of Kermit variables from long or unsigned
11806 +long to some new Kermit type, which in turn is #defined or typedef'd
11807 +appropriately for each platform (to off_t or size_t or whatever).  Then we
11808 +have to worry about the details of open() vs fopen(); printf() formats (%lld
11809 +vs %Ld vs %"PRId64"...), platforms like HP-UX where you might have to use
11810 +different APIs for different file systems on the same computer, etc.  We'll
11811 +need to confront this soon, but let's get a good stable 8.0.211 release out
11812 +first!  Meanwhile, for future reference, here are a few articles:
11813 +
11814 +General: http://freshmeat.net/articles/view/709/
11815 +Linux:   http://www.ece.utexas.edu/~luo/linux_lfs.html
11816 +HP-UX:   http://devrsrc1.external.hp.com/STK/partner/lg_files.pdf
11817 +Solaris: http://wwws.sun.com/software/whitepapers/wp-largefiles/largefiles.pdf
11818 +
11819 +Looked into FTP timeouts.  It appears I can just call empty() (which is
11820 +nothing more than a front end for select()) with the desired timeout before
11821 +any kind of network read.  If it returns <= 0, we have a timeout.  This is
11822 +not quite the same as using alarm() / signal() around a recv() (which could
11823 +get stuck) but alarm() / signal() are not not used in the FTP module and are
11824 +not naturally portable to Windows, but select() is already in use in the FTP
11825 +module for both Unix and Windows.  This form of timeout could be used
11826 +portably for both command response and data reads.  What about writes to the
11827 +command or data socket?  They can get stuck for hours and hours without
11828 +returning too, but the select() approach won't help here -- we need the
11829 +actual send() or recv() to time out, or be wrapped in an alarm()/signal()
11830 +kind of mechanism.  But if we can do that for sends, we can also do it for
11831 +receives.  Better check with Jeff before I start programming anything.
11832 +20 Mar 2004.
11833 +
11834 +Later: Decided to postpone the above two projects (ditto IPv6) until after
11835 +8.0.211 is released because both will have major impacts on portability.
11836 +Grumble: all i/o APIs should have been designed from the beginning with a
11837 +timeout parameter.  To this day, hardly any have this feature.
11838 +
11839 +3-4 Apr 2004: More 8.0.211 Beta.02+ test builds:
11840 +
11841 + . FreeBSD 3.3
11842 + . FreeBSD 4.4
11843 + . Linux Debian 2.1
11844 + . Linux RH 6.1
11845 + . Linux RH 7.1
11846 + . Linux RH 7.2
11847 + . Linux RH 9 (with 84 different combinations of feature selection)
11848 + . Linux SuSE 6.4
11849 + . Linux SuSE 7.0
11850 + . NetBSD 1.4.1
11851 + . NetBSD 1.5.2
11852 + . OpenBSD 2.5
11853 + . OpenBSD 3.0
11854 + . QNX 4.25
11855 + . SCO UnixWare 2.1.3
11856 + . SCO UnixWare 7.1.4
11857 + . SCO OpenServer 5.0.7
11858 + . SCO XENIX 2.3.4 (no TCP)
11859 +
11860 +Changes needed: None.
11861 +
11862 +Problem: SCO XENIX 2.3.4 network build failed in the FTP module with
11863 +header-file syntax and conflicting-definitions trouble.  I'm not going to
11864 +try to fix it; 8.0.209 built OK with FTP, so we'll just keep that one
11865 +available.
11866 +
11867 +Got access to VMS 8.1 on IA64.  Building the nonet version of C-Kermit
11868 +required minor modifications to ckvvms.h, ckv[ft]io.c, and ckvcon.c, to
11869 +account for a third architecture.  Also to SHOW FEATURES in ckuus5.c.  Once
11870 +that was done, the UCX 5.5 version built OK too.  Starts OK, makes Telnet
11871 +connection OK, sends files.  Has some obvious glitches though -- "stat"
11872 +after a file transfer reports 0 elapsed time (in fact it was 00:09:48) and
11873 +1219174400 cps (when in fact it was 10364).  This doesn't happen on the
11874 +Alpha.  Btw, the IA64 binary is twice as big as the Alpha one.  Changed
11875 +to Beta.03.  5 Apr 2004.
11876 +
11877 +Fixed the ckdaily script to include the makefile and man page in the Zip
11878 +file (they were not included because the Zip file was intended mainly for
11879 +VMS users, but some Unix users prefer Zip to tar.gz).  6 Apr 2004.
11880 +
11881 +Traced problems in VMS/IA64 statistics report to rftimer()/gftimer() in
11882 +ckvtio.c, which use sys$ and lib$ calls to figure elapsed time.  These work
11883 +on VAX and Alpha but not IA64.  Sent a report to the chief engineer of the
11884 +IA64 VMS port; he says it's probably a bug in VMS 8.1 (which is not a real
11885 +release); he'll make sure it's fixed in 8.2.  As an experiment, tried
11886 +swapping in the Unix versions of these routines (which call gettimeofday()
11887 +etc).  They seem work just fine (it hung a couple times but I think that's
11888 +because the underlying system hung too; trying it later on a new connection,
11889 +it was fine; however I noticed a BIG discrepancy in throughput between
11890 +sending and receiving).  Moved definitions for VMS64BIT and VMSI64 to
11891 +ckcdeb.h so all modules can use them and added them to the SHOW FEATURES
11892 +display.  Added VMSV80 definition to build procedure.  Beta.03+.  ckcdeb.h,
11893 +ckcuus5.c, ckcvvms.h, ckvtio.c, ckvker.com, 6 Apr 2004.
11894 +
11895 +While doing the build-all, I noticed the VMS version did not build with
11896 +Multinet or older UCX versions, always with the same errors -- undeclared
11897 +variables, undefined symbols, all TCP/IP related.  This didn't happen a
11898 +couple weeks ago...  Somehow the order of #includes was messed up --
11899 +ckuusr.h depended on symbols that are defined in ckcnet.h, but ckcnet.h
11900 +was being included after ckuusr.h...  this was compounded by two missing
11901 +commas in ckvker.com.  11 Apr 2004.
11902 +
11903 +Removed Beta designation, released as 8.0.211, 10 Apr 2004.
11904 +
11905 +I had somehow lost the edit to ckutio.c that changed the UUCP lockfile for
11906 +Mac OS X from /var/spool/uucp to /var/spool/lock.  So I slipped it in and
11907 +re-uploaded version 8.0.211.  You can tell the difference because SHOW
11908 +VERSIONS has 17 Apr 2004 for the Communications I/O module.  Also the 10.3
11909 +executable now has a designer banner: "Mac OS X 10.3".  makefile, ckuver.h,
11910 +ckutio.c, ckuus[45].c, 17 Apr 2004.
11911 +
11912 +---8.0.211---
11913 +
11914 +Removed "wermit" from "make clean" (how did it get there?).  makefile.
11915 +
11916 +From Jeff, applied 10 May 2004.
11917 + . Rearrange #ifdefs that define OS/2-only features. ckcdeb.h.
11918 + . Fix two strncat()s that should have been ckstrncat()s.  ckuus7.c.
11919 + . Fix two strncat()s that should have been ckstrncat()s.  ckuus4.c.
11920 + . Fix one strncat(). ckcfns.c.
11921 + . SET FTP CHAR ON used backwards byte order when output to screen.  ckcfns.c.
11922 + . Fix two strncat()s.  ckuus3.c.
11923 + . Add SET NETWORK TYPE NAMED-PIPE for K95.  ckuus3.c.
11924 + . Add "No active connections" message to hupok().  ckuus3.c.
11925 + . Fix many strncat()s.  ckcnet.c.
11926 + . Fix some strncat()s.  ckcftp.c
11927 + . Make FTP port unsigned short for 16383 < port < 65536.  ckcftp.c.
11928 + . Improvements to FTP USER command.  ckcftp.c.
11929 + . Fix FEAT parsing to allow for various forms of whitespace.  ckcftp.c.
11930 +
11931 +S-Expression (AND FOO BAR) would not short-circuit if FOO's value was 0,
11932 +even though short-circuiting code has been there since Day 1.  Similarly for
11933 +(OR BAR FOO).  Turns out the first operand was a special case that bypassed
11934 +the short-circuit check.  Fixed in dosexp(): ckuus3.c, 10 May 2004.
11935 +
11936 +Red Hat 7.3 (and maybe others) <baudboy.h> referenced open() without first
11937 +ensuring it was declared.  The declaration is in <fcntl.h>, which is after
11938 +<baudboy.h> in ckutio.c series of #includes.  Made a special case for this.
11939 +ckutio.c (see comments), 10 May 2004.
11940 +
11941 +If the local Kermit's parity is set to SPACE and then a file arrives via
11942 +autodownload, automatic parity detection improperly switches it to NONE.
11943 +Fixed in rpack() by switching parity automatically only if parchk() returns
11944 +> 0 (rather than > -1), since NONE and SPACE are indistinguishable.  A
11945 +bigger problem still remains: autodownload does not work at all if the
11946 +sender is using actual parity bits (even, odd, or mark) and the receiver's
11947 +parity is NONE.  ckcfn2.c, 10 May 2004.
11948 +
11949 +When a DIAL MACRO is defined and the phone number is comprised of more than
11950 +one "word" (i.e. contains spaces), the dial macro loses the second and
11951 +subsequent words after the first call. Fixed in xdial() by inserting quotes
11952 +around phone number before passing it to xdial(). ckuus6.c, 10 May 2004.
11953 +
11954 +DIAL MACRO fix was not right; the quotes were kept as part of the phone
11955 +number and sent to the modem.  dodo() pokes its argument to separate the
11956 +macro argument string into its component arguments.  xdial() is called
11957 +repeatedly on the same string, so after the first time, a NUL has been
11958 +deposited after the first word of the telephone number.  The fix is to have
11959 +xdial() create a pokeable copy of its argument string before calling
11960 +dodo(dial-macro,args...).  It might seem odd that dodo pokes its argument,
11961 +but making copies would be would be prohibitive in space and time.
11962 +ckuus6.c, 23 May 2004.
11963 +
11964 +FTP CD did not strip braces or quotes from around its argument.  Fixed in
11965 +doftprmt(): ckcftp.c, 23 May 2004.
11966 +
11967 +Added client side of REMOTE MESSAGE/RMESSAGE/RMSG: ckuus[r27].c, 23 May 2004.
11968 +
11969 +Server side of REMOTE MESSAGE: ckcpro.w, 23 May 2004.
11970 +
11971 +From Dave Sneddon: an updated CKVKER.COM containing a fix where the
11972 +COMPAQ_SSL symbol was not defined but later referenced which generated an
11973 +undefined symbol error.  ckvker.com, 5 Jan 2005.
11974 +
11975 +From Andy Tanenbaum (28 May 2005):
11976 + . Fix an errant prototype in ckcker.h and ckucmd.h - () instead of (void).
11977 + . Add support for MINIX 3.0.  makefile, ckutio.c, ckufio.c, ckuver.h.
11978 +
11979 +Fixed messed-up sndhlp() call which apparently had been jiggered to
11980 +compensate for the bad prototype which has now been fixed, ckcpro.w,
11981 +12 Jun 2005.
11982 +
11983 +From Jeff (12 June 2005):
11984 + . Security updates.  ck_ssl.c, ck_crp.c, ckuath.c.
11985 + . Fix bug in K95 SET PRINTER CHARACTER-SET. ckuus3.c.
11986 + . Add printer character-set to K95 SHOW PRINTER display. ckuus5,c
11987 + . Add SET MSKERMIT FILE-RENAMING to K95. ckuus7.c, ckuusr.h.
11988 + . Add help for K95 SET MSKERMIT.  ckuus2.c.
11989 + . Add SET GUI CLOSE to K95.  ckuusr.h, ckuus2.c, ckuus3.c
11990 + . Add help text for K95 SET GUI MENUBAR and TOOLBAR.  ckuus2.c.
11991 + . Add --noclose command-line option for K95.  ckuusy.c
11992 + . Add PAM support for Mac OS X.  ckufio.c.
11993 + . Add GSSAPI support for Mac OS X.  ckcftp.c.
11994 + . Pick up more URL options.  ckcker.h, ckuusy.c.
11995 + . Fix bug in delta-time calculation across year boundary.  ckucmd.c.
11996 + . Add Secure Endpoints to copyright notices.  ckcmai.c.
11997 + . Fix FTP HELP to override unverbose setting.  ckcftp.c.
11998 + . Fix assorted minor typos.
11999 +
12000 +From Matthias Kurz: automatic herald generation for NetBSD 2.0 and later,
12001 +"make netbsd2".  ckuver.h, makefile, 12 Jun 2005.
12002 +
12003 +Added SET TERMINAL LF-DISPLAY, like CR-DISPLAY but for linefeed rather than
12004 +carriage return.  ckuusr.h, ckuus[257x].c, 12 Jun 2005.
12005 +
12006 +Made a command-line option --unbuffered to do what the -DNONOSETBUF
12007 +compile-time option does, i.e. force unbuffered console i/o.  Unix only.
12008 +ckuusr.h, ckuusy.c, ckutio.c, 12 Jun 2005.
12009 +
12010 +Fixed getiact() (which displays TERM IDLE-ACTION setting) to display
12011 +space as \{32}.  ckuus7.c, 12 Jun 2005.
12012 +
12013 +Added LMV as a synonym for LRENAME, which is itself a synonym for LOCAL
12014 +RENAME.  ckuusr.c, 12 Jun 2005.
12015 +
12016 +Put HELP SET TERMINAL DG-UNIX-MODE text where it belonged.  ckuus2.c,
12017 +12 Jun 2005.
12018 +
12019 +Added IF LINK (Unix only) to test if a filename is a symlink.  Uses the most
12020 +simpleminded possible method, calls readlink() to see if it succeeds or fails.
12021 +No other method is dependable across different Unixes.  This code should be
12022 +portable because I already use readlink() elsewhere within exactly the same
12023 +#ifdefs.  ckufio.c, ckuus2.c, ckuus6.c, 12 Jun 2005.
12024 +
12025 +Fixed a bug in which \fdir() wouldn't work when its argument was the nonwild
12026 +name of a directory file.  zxpand(): ckufio.c, 12 Jun 2005.
12027 +
12028 +Made \fdirectory() a synonym for \fdirectories().  Made \fdir() an
12029 +acceptable abbreviation for these, even though it clashes with \fdirname(),
12030 +which still works as before.  ckuus4.c, 12 Jun 2005.
12031 +
12032 +Added the long-needed \flopx() function, to return rightmost pieces of
12033 +strings, such as file extensions.  \fstripx() and \flopx() are the
12034 +orthogonal functions we need to pick filenames apart from the right:
12035 +\stripx(foo.tar.gz) = foo.tar; flopx(foo.tar.gz) = gz.  ckuusr.h, ckuusr.c,
12036 +ckuus2.c, 12 Jun 2005.
12037 +
12038 +Removed reference to defunct fax number, ckcmai.c, 12 Jun 2005.
12039 +
12040 +Added -DHAVE_PTMX to linux+krb5+openssl+zlib+shadow+pam.  From Timothy Folks.
12041 +makefile, 12 Jun 2005.
12042 +
12043 +Built on Solaris 9 and NetBSD 2.0.
12044 +
12045 +From Jeff: New build target for Mac OS X 10.3 with Kerberos 5 and SSL.
12046 +makefile, 14 Jun 2005.
12047 +
12048 +Fixed error in ckuver.h NetBSD #ifdefs.  15 Jun 2005.
12049 +
12050 +Fixed SET TERMINAL IDLE-ACTION OUTPUT to work as documented, namely if the
12051 +output string is empty, to send a NUL.  Previously there was no way to make
12052 +it send a NUL.  ckuus7.c, 15 Jun 2005.
12053 +
12054 +Suppose (in Unix, for example) a filename contains wildcard characters, such
12055 +as {abc}.txt.  When referring to such a file (e.g. in a SEND command), these
12056 +characters can be quoted, e.g. \{abc\}.txt.  But if the file list has been
12057 +obtained programmatically, e.g. stored in an array, there is no way, short
12058 +of tedious, complicated, and error-prone string processing, to reference the
12059 +file.  For this we need a way to disable wildcard processing.  I added { ON,
12060 +OFF } choices for the SET WILD and SHOW FILE commands: ckuusr.h, ckuus[234].c.
12061 +{ ON, OFF } turns wildcarding off and on without affecting the { KERMIT,
12062 +SHELL } agent choice; it does this by setting a new and separate global
12063 +variable, wildena.  Added semantics to ckufio.c.  Crude but effective.  It
12064 +might have been more Unixlike to add Yet Another form of quoting but we
12065 +have enough of that already (later maybe I'll add a \function() for this).
12066 +Needs to be propogated to Windows and VMS.  15 Jun 2005.
12067 +
12068 +Improved and fixed typos in HELP WILDCARD and HELP PATTERN.  ckuus2.c,
12069 +15 Jun 2005.
12070 +
12071 +The GREP command, and probably anything else that uses ckmatch() for pattern
12072 +matching, failed on patterns like */[0-3]*.html.  The [a-b] handler, when
12073 +failing to match at the current position, neglected to back up the pattern
12074 +and try again on the remainder of the string.  I also fixed another case, in
12075 +which matching a literal string a*b?c against the pattern a[*?]*[?*]c caused
12076 +ckmatch() to recurse until it blew up.  ckclib.c, 16 Jun 2005.
12077 +
12078 +Added builds and designer banner for Solaris 10.  makefile, ckuver.h,
12079 +27 Jun 2005.
12080 +
12081 +Defined CKHTTP for NetBSD, the HTTP code builds and works fine there.
12082 +ckcdeb.h, 2 Jul 2005.
12083 +
12084 +Added #ifndef OSF40..#endif around definition of inet_aton() in ck_ssl()
12085 +to allow building in Tru64.  Added tru64-51b+openssl to makefile.
12086 +15 Jul 2005.
12087 +
12088 +HTTP GET would fail if the URL contained any metacharacters, no matter how
12089 +much you quoted them.  Although it uses cmfld() to parse the (partial) URL,
12090 +it then uses cmofi() to get the output filename, which by default is the
12091 +"filename" from the URL, which might be something like "rankem.asp?id=1639".
12092 +cmofi() refuses to accept unquoted metacharacters in "filenames" and that's
12093 +what happens in this case if the output filename is not specified.  Worked
12094 +around this by disabling wildcard processing around HTTP GET using the new
12095 +"wildena" variable from June 15th.  ckuusr.c, 18 Jul 2005.
12096 +
12097 +Fixed the June 16th fix to the pattern matcher.  I fixed a real problem, but
12098 +I made an unrelated optimization that introduced new ones.  ckclib.c,
12099 +18 Jul 2005.
12100 +
12101 +Added missing help text for \fb64encode() and \fb64decode().  ckuus2.c,
12102 +18 Jul 2005.
12103 +
12104 +Changed SET WILD OFF help text to warn that this setting prevents the
12105 +creation of backup files (later I'll have to see if something more useful
12106 +can be done about this).  ckuus2.c, 18 Jul 2005.
12107 +
12108 +Built OK on Mac OS X 10.4.2 using macosx103 target (but with some
12109 +"signedness" warnings in ckcnet.c and ckcftp.c).  Built on Unixware 7.1.4
12110 +with uw7 target.  27-28 Jul 2005. 
12111 +
12112 +Added -DCKHTTP to Mac OS X 10.3-.4 KFLAGS.  Makefile, 4 Aug 2005.
12113 +
12114 +Built on BSDI 4.3.1.  Added -DCKHTTP.  
12115 +
12116 +Compact substring notation extended to accept not only start:length but also
12117 +start-end notation.  Thus \s(foo[12:18]) means the substring of foo starting
12118 +at position 12 of length 18, and tne new \s(foo[12-18]) means the substring
12119 +of foo starting at position 12 and ending with position 18.  Ditto for
12120 +\:(\%a), etc.  ckuus4.c, 9 Aug 2005.
12121 +
12122 +See correspondence with Mark Sapiro, Nov 2003 and Sep 2004, about certain
12123 +variations on IF syntax having been broken by the introduction of "immediate
12124 +macros" circa 1999.  It seems the problem -- variables not being expanded --
12125 +always occurs in the ELSE part when (a) the IF condition is false; (b) the
12126 +ELSE command is "standalone", i.e. expressed as a separate command after the
12127 +IF command (original C-Kermit 5A syntax), and (c) its command list is a block.
12128 +This would suggest the problem is in the XXELS parser.
12129 +
12130 +Going back to 1999, I find this:
12131 +  Fixed a problem Jim Whitby noticed with quoting in ELSE statements.  This
12132 +  problem was introduced when I unified IF and XIF, and occurs only when
12133 +  ELSE begins on a line, followed by a { command list } rather than a single
12134 +  command.  The solution (gross) was to make a special version of pushcmd()
12135 +  (called pushqcmd()) for this situation, which doubles backslashes while
12136 +  copying, BUT ONLY IF it's a command list (i.e. starts with "{"); otherwise
12137 +  we break lots of other stuff.  Result passes Jim's test and still passes
12138 +  ckedemo.ksc and iftest.ksc.  ckucmd.c, ckuus6.c, 27 Sep 99.
12139 +
12140 +I undid this change and it made no difference to all the other IF
12141 +constructions (in fact, it fixed an urelated one that was broken, so now
12142 +iftest scores 54 out of 54, instead of 53).  However, it does not fix the
12143 +ELSE problem; in fact it pushes it all the way in the other direction:
12144 +
12145 +  The opposite occurs any time you try to execute an immediate macro inside a
12146 +  macro or any other { block }: not only is the variable evaluated, it is
12147 +  evaluated into nothing.  It looks like this happens only in immediate
12148 +  macros, i.e. *commands* that start with '{'.  So maybe we really have two
12149 +  isolated problems, that can each be fixed.
12150 +
12151 +The situation is illustrated by this simple script:
12152 +
12153 +  def xx {
12154 +      if false { echo \%1, echo \%2 }
12155 +      else { echo \%3, echo \%4 }
12156 +  }
12157 +  xx one two three four
12158 +
12159 +With pushqcmd() it echoes the variable names literally; with pushcmd() it 
12160 +echoes empty lines.  Since ELSE, when its argument is a block, dispatches
12161 +to the immediate-macro handler, it seems we have unified the two problems,
12162 +so fixing one should fix the other.
12163 +
12164 +The problem is that we define a new temporary macro and then call dodo() to
12165 +execute it.  But if the definition contains macro arguments, we have added a
12166 +new level of macro invocation, thus wiping out the current level of args.
12167 +The cure is to expand the variables in the immediate macro in the current
12168 +context, before executing it.  This means simply changing the cmtxt() call
12169 +that reads the immediate macro to specify xxsting as its processing
12170 +function, rather than NULL, which is used for real macros to defer their
12171 +argument evaluation until after the macro entered.  ckuusr.c, 11 Aug 2005.
12172 +
12173 +Added a new makefile target, macosx10.4, for Mac OS X 10.4.  This one uses
12174 +an undocumented trick to get the otherwise unavailable-except-by-clicking
12175 +Mac OS X version number (in this case 10.4.2) and stuff it into the HERALD
12176 +string.  makefile, 11 Aug 2005.
12177 +
12178 +Built OK on Solaris 9, Solaris 10 (with a few implicit declaration warnings
12179 +in ckuusx.c), Mac OS X 10.4.2 (with some warnings in ckcnet.c and ckcftp.c),
12180 +Mac OS X 10.3.9 (also using the macos10.4 entry, which gets the right
12181 +version number, and gets no warnings at all), RH Enterprise Linux AS4 on AMD
12182 +x86_64, Tru64 Unix 4.0F, SCO UnixWare 7.1.4
12183 +
12184 +For docs and/or scriptlib:  Unix C-Kermit can be a stdin/out filter.  The
12185 +trick is to use the ASK, ASKQ, or GETC command for input, specifying no
12186 +prompt, and ECHO or XECHO for output, e.g.:
12187 +
12188 +while true {
12189 +    ask line
12190 +    if fail exit 0
12191 +    echo \freverse(\m(line))
12192 +}
12193 +exit 0
12194 +
12195 +FOPEN didn't do anything with the channel number if the open failed, so any
12196 +subsequent command that tried to reference it would get a parse error it was
12197 +undefined or non-numeric, not very helpful.  Changed FOPEN to set the
12198 +channel number to -1 if the file can't be opened.  Now subsequent operations
12199 +on the channel fail with "Channel -1: File not open".  I also added two
12200 +magic channel numbers: -8 means that any FILE command (besides OPEN and
12201 +STATUS) on that channel is a noop that succeeds silently; -9 is a noop that
12202 +fails silently.  So now it's possible to simply set a channel number to one
12203 +of these values to disable i/o to certain file without getting lots of error
12204 +messages.  dofile(): ckuus7.c, 12 Aug 2005.
12205 +
12206 +Added automatic herald construction for UnixWare 7.  makefile, 12 Aug 2005.
12207 +
12208 +Unix isdir() never allowed for arguments that started with tilde, so gave
12209 +incorrect results for ~/tmp/ or ~fdc.  The problem was mainly invisible
12210 +since most commands that parsed file or directory names used cmifi(), cmdir(),
12211 +etc, which did the conversions themselves.  But IF DIRECTORY was an exception,
12212 +since its operand had to be treated as just text, and then tested after it
12213 +was parsed.  ckufio.c, 13 Aug 2005.
12214 +
12215 +Fixed the following:
12216 +"ckuusx.c", line 8959: warning: implicit function declaration: ckgetpeer
12217 +"ckufio.c", line 1869: warning: implicit function declaration: ttwait
12218 +"ckufio.c", line 2941: warning: implicit function declaration: mlook
12219 +"ckufio.c", line 2943: warning: implicit function declaration: dodo
12220 +"ckufio.c", line 2944: warning: implicit function declaration: parser
12221 +"ckcftp.c", line 2625: warning: implicit function declaration: delta2sec
12222 +"ckcftp.c", line 4071: warning: no explicit type given for parameter: prm
12223 +"ckcftp.c", line 8389: warning: no explicit type given for parameter: brief
12224 +ckuusx.c, ckufio.c, ckcftp.c, ckucmd.h.  13 Aug 2005.
12225 +
12226 +Unbuffered stdout code has never worked because the setbuf(stdout,NULL) call
12227 +has to occur before the stdout has been used.  The reason it's needed is
12228 +that some Kermit code writes to stderr (which is unbuffered) and other code
12229 +writes to stdout, and therefore typescripts can come out jumbled.  Robert
12230 +Simmons <robertls@nortel.com> provided the needed clue when he insisted it
12231 +worked only when executed at the very beginning of main().  So I moved the
12232 +code to that spot.  But since now we also want to make unbuffered a runtime
12233 +(command-line) option, I had to do a clunky by-hand pre-prescan inline in
12234 +main() to look thru argv[], even before prescan() was called.  ckcmai.c,
12235 +ckutio.c, ckuusy.c, 13 Aug 2005.  (Now that this works, it might be a good
12236 +idea to remove all use of stderr from Kermit.)
12237 +
12238 +Managed, after some finagling, to build a 64-bit version on Solaris 10 at
12239 +Utah Math with Sun cc.  (Can't make any gcc builds at all, 32- or 64-bit,
12240 +they all blow up in <sys/siginfo.h>.)  New target: solaris10_64.  makefile,
12241 +15 Aug 2005.
12242 +
12243 +The 64-bit Solaris 10 version compiles and links OK and transfers files in
12244 +remote mode.  It can make FTP connections and use them, but Telnet connections
12245 +always fail with "network unreachable".  This is with all default libs and
12246 +include files.  Nelson has a separate set in /usr/local, which he references
12247 +explicitly in all his 64-bit builds, but using these makes no difference.
12248 +Some data type is wrong in ckcnet.c.  But telnet works fine in 64-bit Linux
12249 +and Tru64 builds.  Debug logs trace the difference to netopen() (of course),
12250 +the spot where we test the results of inet_addr(), which is already marked
12251 +suspicious for 64-bit builds.  It seems that inet_addr() is of type in_addr_t,
12252 +which in turn is u_int32, i.e. an unsigned 32-bit int.  Yet the man page says
12253 +that failure is indicated by returning -1.  I guess this doesn't matter in
12254 +32-bit builds, but in the 64-bit world, the test for failure didn't work
12255 +right.  I made a Solaris-specific workaround, and checked that it works in
12256 +both 32-bit and 64-builds.  I really hate typedefs.  ckcnet.c, 15 Aug 2005.
12257 +
12258 +Changed the plain-text version (as opposed to the popup or GUI version - the
12259 +GUI version, at least, already does this) of ASKQ to echo keystrokes
12260 +asterisks rather than simply not echo anything, so it's easier to see what
12261 +you're doing, the effects of editing, etc.  Experimental; for now, there's
12262 +no way to disable this.  Not sure if there needs to be.  Anyway, to get this
12263 +working required a fair amount of cleaning up of gtword(), which was echoing
12264 +different ways in different places.  ckuus6.c, ckucmd.c, 15 Aug 2005.
12265 +
12266 +Added a solaris9_64 target for building a 64-bit version on Solaris 9 with
12267 +Sun cc.  Verified, using the DIR command and \fsize() function on a 4.4GB
12268 +file, that the Solaris 64-bit version of Kermit gets the size correctly, and
12269 +that it can copy such a file (thus its fopen/fread/fwrite/fclose interface
12270 +works right).  Initiated a large-file transfer between here and Utah over
12271 +SSH and verified that it puts the correct file size in the A packet when
12272 +sending; the right quantites are shown on the file transfer display (file
12273 +size CPS, percent done, etc).  But even at 5Mb/sec, it takes a good while to
12274 +transfer 4.4GB, more than 2 hours (not streaming; 30 window slots, 4K
12275 +packets, maybe it would go faster with streaming)...  After an hour or so,
12276 +it filled up the partition and gave up (gracefully) before it reached the
12277 +2GB frontier (drained its pending packets, closed the partial file).
12278 +Restarted at 12:54, this time with streaming and 8K packets (the speed
12279 +wasn't significantly different).  This time it transferred 95% of the file
12280 +(4187660288 bytes) before failing because the disk filled up.  Went to Utah
12281 +and started a transfer between two Solaris 10/Sparc hosts; this goes about 8
12282 +times faster.  The transfer completed successfully after 17m41s.  All fields
12283 +in the f.t. display looked right the whole time.  Then I verified various
12284 +other 64-bit combinations transferring the same 4.4GB file:
12285 +
12286 +        To................
12287 +  From  Sol  Amd  i64  Tru      
12288 +  Sol   OK   OK   OK   OK      Sol = Solaris 10 / Sparc
12289 +  Amd   OK                     Amd = AMD x86_64 RH Enterprise Linux AS4
12290 +  i64   OK                     i64 = Intel IA64, RH 2.1AS
12291 +  Tru                          Tru = Tru64 Unix 4.0F Alpha
12292 +
12293 +(The other combinations are difficult to test for logistical reasons.)
12294 +
12295 +Tried sending the same long file with Kermit's FTP client.  It chugged along
12296 +for a while until I stopped it; it would have taken hours to complete.
12297 +There is no indication that it wouldn't have worked, assuming the FTP server
12298 +could also handle long files, which who knows.  Anyway, Kermit showed all
12299 +the right data on the display screen.  17 Aug 2005.
12300 +
12301 +On AMD x86_64 and IA64 native 64-bit Linux builds, the pty routines did not
12302 +work at all.  ptsname() dumped core.  If I commented out ptsname(), then the
12303 +next thing dumped core.  The same code works on the other 64-bit builds.
12304 +Poking around, I see that this version of Linux has an openpty() function,
12305 +which I could try using instead of the current API -- grantpty(), etc.  Then
12306 +I see that openpty() is already coded into Kermit's pty module,
12307 +conditionalized under HAVE_OPENPTY, which has never before been defined for
12308 +any build.  I added a test to the makefile linux target (look for the
12309 +openpty() prototype in <pty.h>, if found define HAVE_OPENPTY as a CFLAG and
12310 +also add -lutil to LNKFLAGS).  Works fine on the problem builds, and also
12311 +on previously working 32-bit builds.  makefile, 17 Aug 2005.
12312 +
12313 +Fixed a bug in the ASKQ echo asterisks code, which made the VMS version of
12314 +C-Kermit always echo asterisks.  Turns out that some code in the main parse
12315 +loop to reset command-specific flags was in the wrong place, which had other
12316 +effects too, for example ASKQ temporarily turns off debug logging as a
12317 +security measure, but the code to turn it back on was skipped in most cases.
12318 +Some other side effects related to the DIRECTORY and CD commands might have
12319 +been possible but I haven't seen them.  ckuus[56].c, 23 Aug 2005.
12320 +
12321 +Problem reported when sending a file to VMS when the name in the F packet
12322 +starts with a device specification and does not include a directory field,
12323 +and PATHNAMES are RELATIVE.  Example: dsk:foo.bar becomes f_oo.bar.  The
12324 +code assumes that if there is a device field, it is followed by a directory
12325 +field, and it inserts a dot after the '[', which in this case is not there.
12326 +Later the dot becomes '_' because of the only-one-dot rule.  Solution: only
12327 +insert the dot if there really is an opening bracket.  nzrtol(): ckvfio.c,
12328 +23 Aug 2005.
12329 +
12330 +A report on the newsgroup complains that C-Kermit and K95 servers were
12331 +sending REMOTE DIR listings with only #J line terminators, rather than #M#J.
12332 +Yet all the other REMOTE xxx responses arrived with #M#J.  snddir() was
12333 +neglecting to switch to text mode.  ckcfns.c, 26 Aug 2005.
12334 +
12335 +Back to long files.  What happens if 32-bit Kermit is sent a long file?
12336 +It gets an A-packet that looks like this:
12337 +
12338 +  ^A_"A."U1""B8#120050815 18:28:03!'42920641*4395073536,#775-!7@ )CP
12339 +
12340 +The 32-bit receiver reacts like so:
12341 +
12342 +  gattr length[4395073536]=100106240
12343 +
12344 +the first number being the string from the A-packet, the second being the
12345 +value of the long int it was converted to by atol().  Clearly not equal in
12346 +this case.  When this happens Kermit should reject the file instead of
12347 +accepting it and then getting a horrible error a long time later.  Added
12348 +code to gattr() to convert the result of atol() back to a string and compare
12349 +it with the original string; if they're not equal, reject the file on the
12350 +assumption that the only reason this could happen is overflow.  Also some
12351 +other code in case the sender sends the only LENGTHK attribute.  Now files
12352 +whose lengths are too big for a long int are rejected right away, provided
12353 +the sender sends the length in an A packet ahead of the file itself.  If
12354 +this new code should ever cause a problem, it can be bypassed with SET
12355 +ATTRIBUTE LENGTH OFF.  ckcfn3.c, 26 Aug 2005.
12356 +
12357 +As I recall from when I was testing this a few weeks ago, when the too-big
12358 +length is not caught at A-packet time, the transfer fails more or less
12359 +gracefully when the first attempt is made to write past the limit.  I went
12360 +to doublecheck this by sending a big file from the 64-bit Solaris10 version
12361 +to a 32-bit Mac OS X version that does not have today's code.  The Mac
12362 +thinks the incoming file is 2GB long when it's really 4GB+.  But in this
12363 +case, something new happens!  Although the percent done and transfer rate go
12364 +negative, the file keeps coming.  It would seem that Mac OS X lets us create
12365 +long files without using any special APIs.  The transfer runs to completion.
12366 +Mac OS X Kermit says SUCCESS (but gets the byte count and cps wrong, of
12367 +course).  But then a STATUS command says FAILURE.  The file was, however,
12368 +transferred successfully; it is exactly the same length and compares byte
12369 +for byte with the original.  This tells me that in the Mac OS X version --
12370 +and how many others like it??? -- today's rejection code should not be
12371 +enabled.  Meanwhile I put today's new code in #ifndef NOCHECKOVERFLOW..#endif,
12372 +and defined this symbol in the Mac OS X 10.4 target.  Over time, I'll have
12373 +to find out what other platforms have this characteristic.  And of course
12374 +I'll also have to do something about file-transfer display, statistics, and
12375 +status.  makefile, ckcfn3.c, 26 Aug 2005.
12376 +
12377 +From now on I'm going to bump the Dev.xx number each time I upload a new
12378 +ckdaily.  This one will be Dev.02.  ckckmai.c, 26 Aug 2005.
12379 +
12380 +Got rid of all the extraneous FreeBSD 4 and 5 build targets.  Now there's
12381 +one (freebsd) for all FreeBSD 4.1 and later.  makefile, 27 Aug 2005.
12382 +
12383 +Mac OS X 10.4 (Tiger) is a 64-bit OS.  Building C-Kermit 0n 10.4.2 without
12384 +any special switches stilll gives a 32-bit executable.  Ditto building with
12385 +-mpowerpc64.  Further investigation turned up a tip sheet on MySQL that says
12386 +you have to include all of these: -mpowerpc64 -mcpu=G5 -mtune=G5 -arch
12387 +ppc64.  That did the trick.  New makefile target: macosx10.4_64.  But the
12388 +10.4.2 system I tried did not have 64-bit [n]curses or resolv libs, so this
12389 +build has no -DNOCURSES -DNO_DNS_SRV.  makefile, 27 Aug 2005.
12390 +
12391 +Created a symbol CK_64BIT to indicate true 64-bit builds at compile time.
12392 +Added 64-bit announcement to the startup herald and the VERSION text.
12393 +ckcdeb.h, ckuus[r5].c, 27 Aug 2005.
12394 +
12395 +Added a built-in variable \v(bits) to indicate the size of the build
12396 +(16, 32, 64, or whatever else sizeof() might report).  ckuusr.h, ckuus4.c,
12397 +27 Aug 2005.
12398 +
12399 +Got rid of all the warnings in 64-bit Mac OS X about args to getsockopt(),
12400 +getsockname(), and getpeername(), and the comparisons on the return value
12401 +of inet_addr().  ckcnet.[ch], 27 Aug 2005.
12402 +
12403 +Now to check the effects on other builds...
12404 +  Linux on AMD64: ok.
12405 +  Linux on IA64: ok.
12406 +  Linux on i386: ok.
12407 +  Mac OS X 10.3.9 32-bit: ok.
12408 +  Solaris 10 64-bit: ok.
12409 +  Solaris 9 32-bit: ok.
12410 +  Tru64 4.0F: ok.
12411 +  FreeBSD 4.11: ok.
12412 +  FreeBSD 5.4 ia64 (64-bit): ok.
12413 +  FreeBSD 5.4 i386 (32-bit): ok.
12414 +
12415 +The Tru64 5.1B build totally blew up because they have their own unique
12416 +sockopt/etc length-argument data type (int!), so I had to roll back on using
12417 +socklen_t for this in all 64-bit builds.  Checked to make sure it still
12418 +builds on Tru64 4.0F after this change (it does).  ckcnet.h, 27 Aug 2005.
12419 +
12420 +The HP-UX 11i/ia64 build comes out to be 32-bit but thinks it's 64-bit.
12421 +CK_64BIT is set because __ia64 is defined.  So how do I actually make a
12422 +64-bit HP-UX build?  I tried adding +DD64 to CFLAGS, and this generates
12423 +64-bit object files but linking fails to find the needed 64-bit libs
12424 +(e.g. -lm).  For now I added an exception for HPUX to the CK_64BIT
12425 +definition section.  ckcdeb.h, 27 Aug 2005.
12426 +
12427 +Took the time to verify my recollection about the "graceful failure" on a
12428 +regular Pentium Linux system when receiving a too-big file...  OK, it's not
12429 +exactly graceful.  It gets a "File size limit exceeded" error; the message
12430 +is printed in the middle of the file-transfer display, apparently not by
12431 +Kermit, and Kermit exits immediately.  Looks like a trap...  Yup.  "File
12432 +size limit exceeded" is SIGXFSZ (25).  What happens if we set it to SIG_IGN?
12433 +Just the right thing: The receiver gets "Error writing data" at 2147483647
12434 +bytes, sends E-packet to sender with this message, and recovers with total
12435 +grace (drains packet buffers, returns to prompt).  ckutio.c, 27 Aug 2005.
12436 +
12437 +Backed off from rejecting a file because its announced size overflows a
12438 +long.  Now instead, I set the file size to -2 (a negative size means the
12439 +size is unknown, but we have always used -1 for this; -2 means "unknown and
12440 +probably too big").  In this case, the f-t display says:
12441 +
12442 +  File Size: POSSIBLY EXCEEDS LOCAL FILE SIZE LIMIT
12443 +
12444 +then the user can interrupt it with X or whatever, or can let it run and
12445 +see if maybe (as in the case of Mac OS X) it will be accepted anyway.  This
12446 +way, we skip all the bogus calculations of percent done, time remaining, etc.
12447 +ckcfn3.c, ckuusx.c, 27 Aug 2005.
12448 +
12449 +Discovered that VMS C-Kermit on Alpha and IA64 is a 32-bit application;
12450 +sizeof(long) == sizeof(char *) == 4.  Tried adding /POINTER_SIZE=64 to VMS
12451 +DECC builds on Alpha and IA64, but the results aren't great.  Tons of
12452 +warnings about pointer size mismatches between Kermit pointers and RMS ones,
12453 +and the executable doesn't run.  It appears that access to long files
12454 +would require a lot of hacking, similar to what's needed for 32-bit Linux.
12455 +
12456 +--- Dev.02: 27 Aug 2005 ---
12457 +
12458 +From Jeff, 28 Aug 2005.
12459 + . Fix SSH GLOBAL-KNOWN-HOSTS-FILE / USER-KNOWN-HOSTS-FILE parsing, ckuus3.c.
12460 + . Pick up K95STARTFLAGS from environment, ckuus4.c.
12461 + . Fix some typos in command-line processing (-q), ckuus4.c.
12462 + . Be sure to suppress herald if started with -q, ckuus7.c.
12463 + . Fix ssh command-line switches, ckuusy.c.
12464 +
12465 +Eric Smutz complained that HTTP POST was adding an extraneous blank line,
12466 +which prevented his application from successfully posting.  RFC 2616 states
12467 +(in Section 4.1):
12468 +
12469 +   In the interest of robustness, servers SHOULD ignore any empty
12470 +   line(s) received where a Request-Line is expected. In other words, if
12471 +   the server is reading the protocol stream at the beginning of a
12472 +   message and receives a CRLF first, it should ignore the CRLF.
12473 +
12474 +   Certain buggy HTTP/1.0 client implementations generate extra CRLF's
12475 +   after a POST request. To restate what is explicitly forbidden by the
12476 +   BNF, an HTTP/1.1 client MUST NOT preface or follow a request with an
12477 +   extra CRLF.
12478 +
12479 +This seems pretty clear.  One section of code in http_post() (just above the
12480 +postopen: label) was appending a CRLF to a buffer whose last already was
12481 +terminated by CRLF, and then appended a second CRLF; thus two empty lines.
12482 +I removed the second one.  ckcnet.c, 28 Aug 2005.
12483 +
12484 +I looked into the 64-bitness of NetBSD, it seems to be like Linux and
12485 +FreeBSD on 64-bit hardware, i.e. you just build it there and it works, at
12486 +least on Alpha and AMD64, going back to NetBSD 1.4 or 1.5.  But I don't have
12487 +access to any of these for verification and documentation on the Web is
12488 +scanty.
12489 +
12490 +Checked PeterE's complaint again of warnings in ckutio.c about parameter
12491 +list of get[ug]id() and gete[ug]id().  When I "make hpux1100o" on HP-UX
12492 +11.11 (PA-RISC), there are definitely no warnings.  He says the same thing
12493 +happens on 10.xx, but I don't have access to that any more.  I also did
12494 +"make hpux1100o" on HP-UX 11.23 (11i v2) (PA-RISC), also no warnings.
12495 +(Except in both cases, a warning about a comment within a comment in
12496 +/usr/include/sys/ptyio.h).  On HP-UX 11i v2 on Itanium, however, there are
12497 +TONS of warnings, mostly of the "variable set but never used" kind.  Also
12498 +"dollar sign used in identifier".  Tracking this last one down, I see it's
12499 +complaining about code that's in #ifdefs for other platforms, such as
12500 +Apollo Aegis.  Is "aegis" defined in HP-UX 11i v2/IA64?  No!  (It would show
12501 +up in SHOW FEATURES if it was.)  Some phase of the compiler is complaining
12502 +about code that it should be skipping (and that, in fact, it *is* skipping
12503 +it because the build is successful).  It's as if cc is running lint for me
12504 +but not telling lint which macros are defined and which are not.
12505 +
12506 +Verified that 64-bit linking fails in the same way for HP-UX 11i v2 on both
12507 +IA64 and PA-RISC.  Sent a query to HP.
12508 +
12509 +Compiling ckcnet.c and ckcftp.c got the familiar sockopt-related warnings on
12510 +HP-UX 11i v2; turns out it is just like Tru64 Unix in using an int for the
12511 +length argument.  Added another special case and the warnings went away.
12512 +ckcnet.h, 28 Aug 2005.
12513 +
12514 +Added some stuff to SHOW FEATURES to see what kinds of macros are exposed
12515 +(e.g. INT_MAX, LONG_MAX, LLONG_MAX, etc) and also show sizeof(long long) and
12516 +sizeof(off_t).  Building this code all over the place will give me an idea
12517 +of how widespread these data types are, and to what extent I can tell
12518 +whether they are available from clues in the header files.  (At first
12519 +glance, it appears that I'm not picking up <limits.h>, but adding an
12520 +#include for it is just asking for trouble.)  No complaints about long long
12521 +or off_t from Solaris 9 or recent Linuxes.  ckuus5.c, 28 Aug 2005.
12522 +
12523 +Fixed a warning in HP-UX 10 and 11 stemming from some old-style prototypes
12524 +in ckutio.c for get[re][gu]id().  ckutio.c, 29 Aug 2005.
12525 +
12526 +Updated minix3 target from Andy Tanenbaum.  makefile, 29 Aug 2005.
12527 +
12528 +PeterE confirms that "long long" and off_t are available in all HP-UX 10 and
12529 +11, and in HP-UX 9 on PA-RISC but not Motorola.  30 Aug 2005.
12530 +
12531 +Got 64-bit builds to work on HP-UX.  According to my notes, John Bigg of HP
12532 +said (in 1999) that HP-UX 10.30 and later require PA-RISC 1.1, and do not
12533 +work on PA-RISC 1.0.  But is PA 1.0 64-bit or what?  Today, Alex McKale of
12534 +HP said "The 64-bit binaries will work on all machines that have the same or
12535 +later release of HP-UX (excluding PA-RISC 1.1 machines)".  Still need
12536 +clarification...  Maybe it's that all IA64 builds can be 64-bit but I need
12537 +dual builds for PA-RISC.  Meanwhile I started transfer of a 4GB+ file from
12538 +Solaris to HP-UX 11i but it exceeded some quota on the HP long before it
12539 +approached the 2G point.  It failed cleanly and up until then it was working
12540 +fine (numbers, stats, etc).  30 Aug 2005.
12541 +
12542 +Support of large files in 32-bit builds began in 10.20.  64-bit application
12543 +support began in 11.00, but not all machines that run 11.00 support 64 bits.
12544 +About long files, see HP /usr/share/doc/lg_files.txt.
12545 +
12546 +PeterE found that certain patterns can still make Kermit loop; example:
12547 +
12548 +  if match T01011-00856-21-632-073 *[abc] { echo GOOD } else { echo BAD }
12549 +  if match T01011-00856-21-632-073 *[a-z] { echo GOOD } else { echo BAD }
12550 +
12551 +The minimum offending pattern is * followed immediately by an [xxx]
12552 +construction, followed by anything else, including nothing.  Previous
12553 +versions of Kermit handled this one correctly, without looping (but failed
12554 +certain matches that should have succeeded).  The new section of code I
12555 +added on 15 June, upon failure to match, advances the string pointer and
12556 +backs up the pattern to the previous pattern, and starts again
12557 +(recursively).  However, there needed to be a corresponding check at entry
12558 +for an empty target string.  ckmatch(): ckclib.c, 12 Sep 2005.
12559 +
12560 +PeterE discovered that "kermit -y filethatdoesnotexit" gives an erroneous
12561 +error message that names the user's customization, rather than the name
12562 +given on the command line.  doinit(): ckuus5.c, 12 Sep 2005.
12563 +
12564 +FREAD does not get an error if it tries to read a record or file or piece of
12565 +file that is too big for its buffer.  In particular, FREAD /SIZE:xxx seems
12566 +to succeed even if less than xxx was read.  It should fail unless, perhaps,
12567 +it successfully read up to the end of the file.  Furthermore, if xxx is
12568 +bigger than the file buffer size, it should complain.  The buffer is
12569 +line[LINBUFSIZ], 32K.  The lack of failure was due to code in dofile() that
12570 +adjusted the given size silently if it was greater than the buffer size,
12571 +which I removed, and also added a check when parsing the /SIZE: switch.
12572 +dofile(): ckuus7.c, 12 Sep 2005.
12573 +
12574 +That still didn't help with FREAD /SIZE:n returning less than n bytes, even
12575 +when they were available.  That's because the underlying routine, z_in(),
12576 +didn't check fread()'s return code, which is the number of bytes read.
12577 +If fread() has smaller buffers, it needs to be called in a loop.  z_in():
12578 +ckuus7.c, 12 Sep 2005.
12579 +
12580 +Flen() fails on strings of length 8192 or more.  The limitation is in the
12581 +callers of zzstring, which seem to be specifying an 8K buffer, in this case
12582 +fneval().  The operable symbols are FNVALL (max length of value returned by
12583 +a function) and MAXARGLEN (maximum length of an argument to a function).  I
12584 +changed both of these for BIGBUFOK builds to be CMDBL.  Buffers can never be
12585 +infinite, there has to be a limit.  It's important to make everything work
12586 +consistently within that limit, and to make something useful happen when the
12587 +limit is exceeded.  At this point, I can probably also increase the limits
12588 +for modern 32-bit systems, and certainly for 64-bit ones.  Also there's no
12589 +point in worrying about 16-bit platforms any more; earlier C-Kermit versions
12590 +can still be used on them if necessary. ckuusr.h, 12 Sep 2005.
12591 +
12592 +Special #ifdefs for finding resolv.h and nameser.h in MINIX3 from Andy
12593 +Tanenbaum.  ckcnet.c, 20 Sep 2005.
12594 +
12595 +PeterE noticed that ckmatch(), even though it works pretty well now, does a
12596 +lot of extra and unnecessary recursion after determining the string and
12597 +pattern do not match, at least when the pattern is of the form *[abc].
12598 +After several false starts I was able reduce this effect to a minor level
12599 +(but not eliminate it all together) by changing a while loop into a do loop.
12600 +ckmatch(): ckclib.c, 15 Oct 2005.
12601 +
12602 +Added -DNOLONGLONG to HP-UX 8.00 and earlier builds, and to Motorola-based
12603 +HP-UX 9.00 builds.  This is simply to inhibit the test for whether "long
12604 +long" is supported by the compiler, since when it isn't, the module
12605 +containing the test won't compile.  makefile, ckuus5.c, 16 Oct 2005.
12606 +
12607 +Making ASKQ always echo askterisks is a bad idea, because when it doesn't
12608 +echo, it's the perfect way to read silently from stdin, e.g. in a CGI script
12609 +(INPUT can also be used for this but it's not as straightforward).  So I put
12610 +the default for ASKQ back to no echoing, then gave ASKQ its own switch
12611 +table, which is the same as for ASK with the addition of an /ECHO:x switch,
12612 +which tells what character to echo.  ckucmd.c, ckuus[26].c, 17 Oct 2005.
12613 +
12614 +Fixed a bug in FTP GET /COMMAND filename commandname; it always dumped core
12615 +dereferencing a null string (the nonexistent local asname).  ckcftp.c,
12616 +17 Oct 2005.
12617 +
12618 +For docs: if you don't like the funny business that happens when you type
12619 +an IF command at the prompt, use XIF instead and it won't happen.  Also note
12620 +that commands like "if xxx { echo blah } else { echo blah blah }" don't
12621 +work when typed at the prompt; you have to use XIF for this. 
12622 +
12623 +Back to ckmatch()...  Under certain conditions (e.g. patterns like *[abc])
12624 +failure to match would not stop the recursion because the string and pattern
12625 +arguments are on the stack, as they must be, so there was no way for level
12626 +n-1 to know that level n had detected a definitive nonmatch and that no
12627 +further attempts at matching were required.  The right way to handle this is
12628 +to recode the whole thing as coroutines, the cheap way out is with a global
12629 +static flag.  Works perfectly, in the sense that the match.ksc test results
12630 +are identical to what they were before and the extra backing up and
12631 +recursion are eliminated.  (The Oct 15th fix wasn't really a fix, it broke
12632 +a couple of cases.)  ckclib.c, 20 Oct 2005.
12633 +
12634 +ckuus7.c(2987): warning #267: the format string requires additional arguments
12635 +(in PURGE command); fixed 20 Oct 2005.
12636 +
12637 +From Andy Tanenbaum, final changes for MINIX3: #ifdef out the inline
12638 +definitions for gettimeofday() and readlink().  ckutio.c, 23 Oct 2005.
12639 +
12640 +From Jeff: struct gss_trials initializers changed from gss_mech_krb5 to
12641 +ck_gss_mech_krb5.  ckcftp.c, 23 Oct 2005.
12642 +
12643 +From Jeff: some improvements to K95 GUI SHOW TERMINAL.  ckuus5.c, 23 Oct 2005.
12644 +
12645 +Found and corrected some misplaced #ifdefs in shofeat(), ckuus5.c, 23 Oct 2005.
12646 +
12647 +--- Dev.03 ---
12648 +
12649 +Fixed a compiler warning in a debug() statement in zzstring() by adding
12650 +parens.  ckuus4.c, 24 Oct 2005.
12651 +
12652 +Added -DNOLONGLONG to sv68r3v6 target, makefile, 25 Oct 2005.
12653 +
12654 +New makefile targets for HP-UX from PeterE to handle the 'long long'
12655 +situation.   26 Oct 2005.
12656 +
12657 +From Jeff: changes to support OpenSSL 0.9.8, ck_ssl.h.  ckcasc.h has had
12658 +short names defined for ASCII control characters for 20-some years but now
12659 +they are causing conflicts, so EM becomes XEM (also for OpenSSL 0.9.8).
12660 +Changed K95's default terminal type from VT320 to VT220 because VT320
12661 +termcaps/terminfos are disappearing from Unix hosts: ckuus7.c.  Reorganize
12662 +the data-types section of SHOW FEATURES to add more macro tests for integral
12663 +sizes and to provide for the proper printf formatting in order to allow the
12664 +sizes to be output ("You are going to need to be careful because %llx is not
12665 +supported on all platforms.  On Windows, it is the same as %lx, 32 bits"):
12666 +ckuus5.c, 26 Oct 2005.
12667 +
12668 +Defined NOLONGLONG ckcdeb.h for various old platforms where we know we are
12669 +never going to need 64-bit ints (even if they support a long long datatype,
12670 +chances are pretty slim they supported 64-bit file sizes).  ckcdeb.h,
12671 +26 Oct 2005.
12672 +
12673 +PeterE noticed that GOTO targets can only be 50 characters long.  This was
12674 +by design, a long time ago, on the assumption that nobody would make longer
12675 +labels.  But in SWITCH statements, case labels can be variables that expand
12676 +to anything at all.  If we chop them off at 50, we might execute the wrong
12677 +case.  Changed the maximum label size to be 8K, and added code to dogoto()
12678 +to check when a label or target is too long and fail, to prevent spurious
12679 +GOTO or SWITCH results.  ckuusr.h, ckuus[r6].c, 26 Oct 2005.
12680 +
12681 +Testing revealed there was still a problem with SWITCH case labels that were
12682 +variables that expanded into long strings.  Turns out that I was being
12683 +too clever when I decided that, if the SWITCH macro was n1 characters long
12684 +and the case-label search target was n2 characters long, I only had to
12685 +search the first n1-n2+1 characters of the macro definition.  That was true
12686 +before I allowed case labels to be variables, but not any more!  Fixed in
12687 +dogoto(): ckuus5.c, 26 Oct 2005.
12688 +
12689 +--- Dev.04 ---
12690 +
12691 +Dev.04 didn't actually contain Jeff's data-type changes to shofeat(),
12692 +I think I saved the wrong buffer in EMACS...  Fixed now.  27 Oct 2005.
12693 +
12694 +PeterE corrected a typo in the HP-UX 7.00 makefile target.  27 Oct 2005.
12695 +
12696 +PeterE had been reporting problems stress-testing the new SWITCH code, but
12697 +only on HP-UX 9, primarily stack overrun.  Turns out to be the HP-UX 9
12698 +optimizing compiler's fault.  No optimization, no problems.
12699 +
12700 +PeterE found that even when dogoto() detects a string that is too long
12701 +and fails, this does not stop SWITCH from producing a result, which can not
12702 +possibly be trusted.  Changed the part of dogoto() that handles this to
12703 +not just fail, but also to exit the script immediately and return to top
12704 +level.  ckuus6.c, 28 Oct 2005.
12705 +
12706 +An idea popped into my head after having typed too many commands like "dir
12707 +ck[cuw]*.[cwh]" to check the list of matching files, and then having to
12708 +retype the same filespec in a SEND command: Why not unleash some unused
12709 +control character such as Ctrl-K to spit out the most recently entered input
12710 +filespec?  It was easy, just a few lines in cmifi2() and gtword(), plus a
12711 +couple declarations.  To see all the changes, search for "lastfile" (all the
12712 +new code is protected by #ifndef NOLASTFILE).  ckucmd.c, 28 Oct 2005.
12713 +
12714 +I added a new variable \v(lastfilespec) that expands to the same last
12715 +filespec, for use in scripts.  ckuusr.h, ckuus4.c, 28 Oct 2005.
12716 +
12717 +The Unix version of C-Kermit failed to put anything in the session log if
12718 +SET TERMINAL DEBUG ON.  Rearranged the pertinent clause so logging happens
12719 +independent of TERMINAL DEBUG.  For now, since the user who noticed this
12720 +wanted debug format to go into the session log, that's what I do.  The
12721 +alternative would be to just log the raw incoming stream as usual, or to add
12722 +Yet Another SET Command to choose.  ckucns.c, 11 Nov 2005.
12723 +
12724 +Fixed HELP INTRO text.  ckuus2.c, 11 Nov 2005.
12725 +
12726 +Added NOLONGLONG for SV68.  ckcdeb.h, 11 Nov 2005.
12727 +
12728 +--- Dev.05 ---
12729 +
12730 +Added a debug() statement in FTP secure_getbyte() to see what's going on
12731 +with Muhamad Taufiq Tajuddin's 205-byte-per-second FTP/SSL downloads.
12732 +
12733 +--- Dev.06 ---
12734 +
12735 +Result: nothing, SSL_get_error() does not report any errors.  Suggested
12736 +testing SSL_read()'s return code, if 0 don't update the screen.
12737 +
12738 +Created a new data type CK_OFF_T in ckcdeb.h that will eventually resolve
12739 +to whatever each platform uses for file sizes and offsets.  ckcdeb.h,
12740 +17 Nov 2005.
12741 +
12742 +Made a new library routine ckfstoa() that converts a file size or offset to
12743 +a string.  This is to solve the problem with having to use different
12744 +printf() formats for different representations of file size (int, long, long
12745 +long, off_t, signed, unsigned, etc).  Replaced a few printf("%l",size) with
12746 +printf("%s",ckfstoa(size)) with the expected results.  This is just a start,
12747 +the definitions will need adjustment for many platforms, variables need to
12748 +be redeclared, and all the offending printf's (and printw's) will have to
12749 +hunted down and converted.  ckclib.[ch], ckuus4.c, 17 Nov 2005.
12750 +
12751 +Built a minimal version on Linux with:
12752 +make linux "KFLAGS=-DNOLOCAL -DNOICP -DNOCSETS -DNODEBUG"
12753 +Worked fine, result was 260K on i686.  21 Nov 2005.
12754 +
12755 +Discovered that Kermit's date parser, contrary to the documentation, failed
12756 +to handle strings like "Wed, 13 Feb 2002 17:43:02 -0800 (PST)", which are
12757 +commonly found in email.  This was because of an overzealous and misguided
12758 +check in the code; once removed, all was well.  ckucmd.c, 26 Nov 2005.
12759 +
12760 +Added a new format code 4 to \fcvtdate() to emit asctime() format, used in
12761 +BSD-format email message envelopes (i.e. the "From " line).  shuffledate(),
12762 +ckucmd.c, ckuus[24].c, 26 Nov 2005.
12763 +
12764 +Added a new function \femailaddress().  Given a From: or Sender: header line
12765 +from an RFC2822-format email address, extracts and returns the actual email
12766 +address, such as kermit@columbia.edu.  ckuusr.h, ckuus[42].c, 26 Nov 2005.
12767 +
12768 +Using the new functions, I wrote a script to fetch mail from a POP3 server
12769 +over a TLS connection.  But the line-at-a-time input (needed for changing
12770 +line terminators and byte-stuffing text lines that start with "From ") is
12771 +slow, 17 sec to read 29 messages totaling 175K.
12772 +
12773 +Added INPUT /CLEAR so INPUT can be started with a clean buffer without
12774 +requiring a sepearate CLEAR INPUT command.  ckuusr.h, ckuus[r24].c,
12775 +27 Nov 2005.
12776 +
12777 +One thing that INPUT was never able to do well was read and save the
12778 +complete incoming data stream.  That's because, while waiting for its
12779 +target, the buffer might overflow wrap around.  Yet there was never a way to
12780 +tell it to stop when its buffer fills up and let me save it.  I added a
12781 +/NOWRAP switch that does this.  If the buffer fills up before any other
12782 +completion criterion is met, INPUT returns failure, but with \v(instatus)
12783 +set to 6 (the next available instatus value).  Thus a program that wants to
12784 +read and save (say) an email message from a POP server, which could be any
12785 +length at all, and which terminates with <CRLF>.<CRLF> could do this:
12786 +
12787 +  set flag off
12788 +  while open connection {
12789 +      input /nowrap 10 \13\10.\13\10 # Wait for <CRLF>.<CRLF>
12790 +      if success {
12791 +          frwrite /string \%o {\freplace(\v(input),\13\10.\13\10,\13\10)}
12792 +          set flag on
12793 +          break
12794 +      } else if ( == \v(instatus) 6 || == \v(instatus) 1 ) {
12795 +          frwrite /string \%o {\v(input)}
12796 +          continue
12797 +      }
12798 +      break
12799 +  }
12800 +  if flag (handle success)
12801 +
12802 +Note carefully the braces around the FWRITE text; without them, trailing
12803 +spaces would be lost.
12804 +
12805 +Previously the only way to INPUT an entire data stream without losing
12806 +anything (assuming it was ordinary lines of text that were not "too long"),
12807 +was line-by-line:
12808 +
12809 +  while open connection {
12810 +      input /clear 10 \13\10
12811 +      if fail break
12812 +      if eq "\v(input)" "$ \13\10" break
12813 +      fwrite /string \%o {\freplace(\v(input),\13\10,\10)}
12814 +  }
12815 +
12816 +The new code is 3 times faster using the default INPUT buffer length of 4K.
12817 +Raising it to 16K makes it 3.6 times faster (not worth it).  Changing the
12818 +POP3 script to use INPUT /NOWRAP makes it about twice as fast (it does more;
12819 +it has to do all the byte-stuffing and unstuffing).  27 Nov 2005.
12820 +
12821 +Changed ssl_display_xxx() to just return if SET QUIET ON.  Otherwise there
12822 +is no way to suppress the messages.  Also protected a previously unprotected
12823 +printf("[SSL - OK]\r\n"); by if ( ssl_verbose_flag ).  ck_ssl.c,
12824 +28 Nov 2005.
12825 +
12826 +Discovered that FOPEN /APPEND doesn't work if the file doesn't exist.  It
12827 +uses cmiofi() which is a super-hokey front end to cmifi2().  I had code to
12828 +call it but for some reason it was commented out, with a note to the effect
12829 +it didn't work.  I uncommented it but that didn't help much.  So I wrote an
12830 +entirely new cmiofi() that works exactly as it should, using chained FDBs,
12831 +_CMIFI to _CMOFI (I think the original cmiofi() predated chained FDBs).
12832 +ckuus7.c, ckucmd.c, 29 Nov 2005.
12833 +
12834 +Getting rid of the awful hacks required to call cmiofi() meant I also had to
12835 +change the EDIT command, which is the only other place where it's used.
12836 +Unfortunately now it's no longer possible to give EDIT without a filename
12837 +(to just start an empty editor) but I doubt anyone will notice.  ckuusr.c,
12838 +29 Nov 2005.
12839 +
12840 +IF KERBANG didn't always work right.  If a kerbang script TAKEs another
12841 +kerbang script, the second one should have IF KERBANG false, but it didn't.
12842 +Added a check for \v(cmdlevel) == 1.  Now you can write a wrapper that runs
12843 +a kerbang script in a loop, and the latter can use IF KERBANG to know
12844 +whether to EXIT (if called at top level) or END (if called by another
12845 +script, thus allowing -- in this case -- the loop to continue).  ckuus6.c,
12846 +29 Nov 2005.
12847 +
12848 +Changed \flop() and flopx() functions to take a third argument, a number
12849 +signifying at which occurrence of the break character to lop, so:
12850 +
12851 +  \flopx(sesame.cc.columbia.edu) = edu
12852 +  \flopx(sesame.cc.columbia.edu,,2) = columbia.edu
12853 +
12854 +ckuus[24].c, 1 Dec 2005.
12855 +
12856 +Built OK on VMS 7.2-1 with MultiNet 4.4.  Built with and without OpenSSL on
12857 +Linux OK, ditto Solaris 9.  Built OK on RH Linux AS4 on X86_64 (64-bit);
12858 +"show var fsize" (using new ckfstoa()) works OK there.  Also Mac OS X 10.3.9
12859 +(32-bit), Tru64 UNIX 4.0F (64-bit), HP-UX 11iv2 (64-bit) (picky new compiler
12860 +spews out tons of useless warnings), FreeBSD 6.0 on ia64 (64-bit).
12861 +
12862 +--- Dev.07 ---
12863 +
12864 +Changed "make netbsd" to be a synonym for "make netbsd2" because the
12865 +original netbsd target was ancient.  Renamed it to netbsd-old.  makefile,
12866 +3 Dec 2005.
12867 +
12868 +Updated INPUT and MINPUT help text.  ckuus2.c, 3 Dec 2005.
12869 +
12870 +Discovered that on a SET PORT /SSL connection, Kermit treats incoming
12871 +0xff data bytes (e.g. sent from the POP server) as IACs and goes into Telnet
12872 +negotiations.  Jeff says "You will need to implement NP_SSLRAW and NP_TLSRAW
12873 +that do the same as NP_TCPRAW but negotiate SSL or TLS as appropriate."
12874 +This was not as easy as it sounded, because apparently a lot of the Telnet
12875 +code is used by SSL and TLS even when Telnet protocol is not being executed.
12876 +I wound up doing this as follows: I added /SSL-RAW and /TLS-RAW to the
12877 +switch table.  Rather than disable Telnet, they do exactly what the /SSL and
12878 +/TLS switches do, but also set a special flag.  This flag is checked in only
12879 +two place: netclos() (to prevent Kermit from sending TELNET LOGOUT when
12880 +closing the connection), and tn_doop() (to prevent Kermit from reacting to
12881 +incoming IACs; it makes tn_doop() return(3), which means "quoted IAC", which
12882 +causes the caller to keep the IAC as data).  ckcnet.h, ckctel.h, ckctel.c,
12883 +ckuus7.c, 4 Dec 2005.
12884 +
12885 +The INPUT command did not account for tn_doop() returning 3.  Fixed in
12886 +doinput(), ckuus4.c, 4 Dec 2005.
12887 +
12888 +Added another debug() statement in FTP secure_getbyte() to see what's going on
12889 +with Muhamad Taufiq Tajuddin's 205-byte-per-second FTP/SSL downloads, plus
12890 +new code to test SSL_read()'s return code (byte count); if 0 don't update
12891 +the screen.  ckcftp.c, 4 Dec 2005.
12892 +
12893 +--- Dev.08 ---
12894 +
12895 +Fixed a typo in the non-ANSIC definition of ckfstoa().  ckclib.c, 7 Dec 2005.
12896 +
12897 +Our Ctrl-C trap (the ON_CTRLC macro) wasn't working for kerbang files.
12898 +Rearranged some code to make it work.  ckcmai.c, 8 Dec 2005.
12899 +
12900 +Started converting code to use CK_OFF_T for file sizes and offsets, and
12901 +all [s]printf's to replace "%ld" or whatever with "%s", and the size
12902 +variable with a call to ckfstoa().  Since I haven't actually changed the
12903 +definition of CK_OFF_T from what all the size variables were to begin
12904 +with (i.e. long), it shouldn't do any harm.  So far just ckcfn3.c
12905 +10 Dec 2005.
12906 +
12907 +An updated HP-UX 9.xx makefile target from PeterE to fix a core dump that
12908 +happens on that platform due to insufficient resources.  14 Dec 2005.
12909 +
12910 +Added debug() statements to http_blah() routines to tell whether the
12911 +connection is "chunked".  There seems to be a bad performance problem.
12912 +ckcnet.c, 14 Dec 2005.
12913 +
12914 +PeterE complained about ugly DIRECTORY error message, ?No files match -
12915 +"{blah}".  The braces are used internally in case the user typed more than
12916 +one filespec.  I changed the error message to remove them.  Ditto DELETE.
12917 +ckuus6.c, 15 Dec 2005.
12918 +
12919 +The problem with HTTP downloads is that Kermit always does single-character
12920 +read() or socket_read() calls (or the SSL equivalent); see http_inc().  I
12921 +added buffering code for non-SSL connections only but it's gross because it
12922 +has to swap ttyfd and httpfd before calling nettchk().  I tried making a
12923 +nettchk() clone that accepts a file descriptor as an argument but it didn't
12924 +work because too many other routines that are invoked directly or implicitly
12925 +by nettchk() (such as in_chk()) are still hardwired to use ttyfd.  HTTP GETs
12926 +are now 20 times faster on the local network (the improvement is less
12927 +dramatic over a clogged Internet).  ckcnet.[ch], 15 Dec 2005.
12928 +
12929 +--- Dev.09 ---
12930 +
12931 +HTTP file-descriptor swapping is not thread safe.  Doing it right, of
12932 +course, is a big deal, so for now I just don't define HTTP_BUFFERING for
12933 +Windows.  ckcnet.c, 15 Dec 2005.
12934 +
12935 +Noticed that HTTP not included in FreeBSD and OpenBSD builds.  Fixed in
12936 +ckcdeb.h, 22 Dec 2005.
12937 +
12938 +Fleshed out 32/64-bit data type definitions and changed struct zattr
12939 +(file attribute structure) members length and lengthk to have the new
12940 +CK_OFF_T type.  Changed final arguments of debug() and tlog() to be the new
12941 +LONGLONG type.  ckcdeb.h, 22 Dec 2005.
12942 +
12943 +Changed ckfstoa() to return a signed number in string form, rather than an
12944 +unsigned one.  That's because off_t is signed (thank goodness).  Added the
12945 +inverse function, ckatofs() so we can convert file sizes and offsets back
12946 +and forth between binary number and string.  ckclib.c, 22 Dec 2005.
12947 +
12948 +Changed Attribute Packet reader to convert incoming file size attribute
12949 +with ckatofs() rather than atol().  ckcfn3.c, 22 Dec 2005.
12950 +
12951 +Converted debug(), tlog(), ckscreen(), etc, to handle potentially "long long"
12952 +arguments by making their "n" argument CK_OFF_T.  ckuusx.c, ckcdeb.h,
12953 +22 Dec 2005.
12954 +
12955 +Converted the rest of the source files to use CK_OFF_T for all file size
12956 +and offset and byte-count related variables, and converted all references to
12957 +these variables in printfs to go through ckfstoa().  Then I built it on
12958 +Linux/i386 with:
12959 +
12960 +  make linux "KFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
12961 +
12962 +which makes off_t be 64 bits and magically makes all the regular file APIs
12963 +use 64-bit sizes and offsets without changing the API calls in the source
12964 +code.  It's going to be a lot of work to get through all the kinks but I was
12965 +able to send a long file, do directory listings of long files, do
12966 +\fsize(longfile), etc.  When it sends a file, the length is shown correctly
12967 +in the A packet.  If the receiver does not support big numbers, it receives
12968 +the file OK anyway, without showing the size, the thermometer, or percent
12969 +done (and then will get an error when the file keeps coming after the 2G
12970 +mark).  Kermit 95 actually refuses long files for "Size", but only if the
12971 +announced is less than 2^63 bytes.  When today's Linux version receives a
12972 +file, it shows the length correctly in the file-transfer display, as well as
12973 +percent done, thermometer, etc.  Also built this version on true 64-bit
12974 +Linux, and it worked fine.  Many files changed, 22 Dec 2005.
12975 +
12976 +For the record, this API is specified in X/Open's Single UNIX Specification
12977 +Version 2, which is branded as UNIX 98.  It is called Large File Support, or
12978 +LFS, and was developed at the Large File Summit.
12979 +
12980 +It looks like the operative feature-test macro in glibc for transitional
12981 +large file support is __USE_LARGEFILE64.  So if this is defined, we can also
12982 +supply _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64 automatically for 32-bit
12983 +Linux builds.  But there's a Catch-22, you don't know if this is defined
12984 +until you read the header files, but you have to define _LARGEFILE_SOURCE
12985 +and _FILE_OFFSET_BITS before you read the header files.  Maybe it's good
12986 +enough to grep through <features.h> for __USE_LARGEFILE64.  makefile,
12987 +23 Dec 2005.
12988 +
12989 +Checked this on true 64-bit Linux.  The same symbols are defined in CFLAGS,
12990 +but they do no harm; it builds without complaint and works fine.  24 Dec 2005.
12991 +
12992 +Built it on Red Hat Linux 6.1 from 1999.  This picked up the long file
12993 +support too.  Guess 6.1 isn't old enough to not have it!  Kermit seems to
12994 +work OK on regular files but I don't have enough disk space to create a long
12995 +file, and my bigfile.c program (which creates a long file containing only 1
12996 +byte) doesn't work ("fseeko: invalid argument").  It looks like parts of
12997 +this API were visible in Linux before they were actually working.
12998 +24 Dec 2005.
12999 +
13000 +Converted all fseek() and ftell() to macros that expand to fseek() and ftell()
13001 +or fseeko() and ftello() depending on whether _LARGEFILE_SOURCE is defined.
13002 +ckufio.c, ckuus7.c, ckuusx.c, 24 Dec 2005.
13003 +
13004 +Made a CK_OFF_T version of cmnum().  It would be a very big deal to just
13005 +change cmnum() to return a new type, so another idea is to rename cmnum() to
13006 +something else, cmnumw(), change its result argument to CK_OFF_T, and then
13007 +make a stub cmnum() to call it to get an int, then call cmnumw() explicitly
13008 +any time we need a big number.  ckucmd.c, 24 Dec 2005.
13009 +
13010 +Calling cmnumw() directly requires changes to each routine that uses it.
13011 +The INCREMENT and DECREMENT commands, for example, required changes to
13012 +doincr(), varval(), and incvar(), and all references to them.  ckuusr.[ch],
13013 +ckuus[56].c, 24 Dec 2005.
13014 +
13015 +Calling cmnumw() in chained FDBs required defining a new function code,
13016 +_CMNUW, adding a new member to the OFDB struct for returning wide results,
13017 +and adding a new case to cmfdb().  ckucmd.[ch], 24 Dec 2005.
13018 +
13019 +Changed FSEEK and FCOUNT to use the new chained FDB interface, now we can
13020 +seek and look past 2GB.  ckuus7.c, 24 Dec 2005.
13021 +
13022 +Next come switches, which store their results in a struct stringint.  This
13023 +struct was defined in each module where it was used (ckuus[r367].c, ckcftp.c).
13024 +I moved the definition to ckuusr.h and added a wval member, which can be
13025 +referenced by any switch-parsing code that calls cmnumw().  24 Dec 2005.
13026 +
13027 +Changed SEND /CALIBRATE:n to allow big values of n.  This makes it possible
13028 +to test the protocol aspects of long-file transfer without actually having a
13029 +long file handy.  ckuusr.c, 24 Dec 2005.
13030 +
13031 +SEND /SMALLER-THAN:n, SEND /LARGER-THAN:n, and and SEND /START:n also now
13032 +allow large values of n.  ckuusr.c, 24 Dec 2005.
13033 +
13034 +Changed the algebraic expression evaluator to use wide values.
13035 +ckuus5.c, 24 Dec 2005.
13036 +
13037 +Fixed ckfstoa() to handle the case when n is negative and (0 - n) is also
13038 +negative, which happens for numbers 2^(n-1) or greater, where n is the
13039 +number of bits in the word size we're dealing with, e.g. 64, in which case
13040 +2^63 has its sign bit set so seems to be negative.  In such cases, ckfstoa()
13041 +returns "OVERFLOW" instead of a numeric string.  We'll have to see how this
13042 +plays out but I think it's better to cause a parse error and stop things
13043 +dead than to return a spurious number.  ckclib.c, 24 Dec 2005.
13044 +
13045 +Converted the S-Expression handler to use wide integers. ckuus3.c, 24 Dec 2005.
13046 +
13047 +Took all the LONGLONG stuff out of ckcdeb.h, we don't need it.
13048 +
13049 +All of these changes result in 64-bit arithmetic (more or less) on 32-bit
13050 +Linux, as well as on true 64-bit platforms.
13051 +
13052 +Rebuilt today's code on Solaris 9 in the 32-bit and 64-bit worlds, on Red
13053 +Hat 6.1, Red Hat AS4.2.  I haven't bothered trying a 32/64 hybrid build for
13054 +Solaris, since I can build a pure 64-bit version there.  Quick tests show
13055 +the large-number arithmetic works OK in all cases except, of course, on pure
13056 +32-bit builds (unfortunately I can't find a running Linux system old enough
13057 +to verify this for Linux, but it's true for other 32-bit platforms).
13058 +24 Dec 2005.
13059 +
13060 +Tried building a hybrid version on Solaris 9 after all since the LFS API is
13061 +ostensibly the same as for Linux:
13062 +
13063 + make solaris9 "KFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
13064 +
13065 +It built smoothly and the resulting binary is 2.5MB compared to 3.4MB for
13066 +the 100% 64-bit version.  Looks like a keeper.  For now, added solaris9lfs
13067 +and solaris10lfs entries to the makefile but if these work on PCs we can
13068 +make these the regular entries for Solaris 9 and 10.  27 Dec 2005.
13069 +
13070 +Built on Mac OS X 10.4 with the regular target.  It seems that in that case,
13071 +off_t is 64 bits anyway.  Noticed that a lot of stuff didn't work, like
13072 +exponentiation in S-Expressions.  Tried building it as above, which worked,
13073 +and now CK_OFF_T is 64 bits instead of 32, but (^ 2 30) is still 2.0.  In
13074 +fact 2-to-the-any-power is 2.0.  It seems that the Mac OS X version did not
13075 +have FNFLOAT defined.  It also seems that every test in dosexp() like:
13076 +
13077 +  if (result != fpresult) fpflag++;
13078 +
13079 +should have been protected by #ifdef FNFLOAT..#endif /* FNFLOAT */ -- a
13080 +double-ended break, as they say in the nuclear power industry.  ckuus3.c,
13081 +27 Dec 2005.
13082 +
13083 +Added GREP /EXCEPT:pattern.  ckuus[26].c, 27 Dec 2005.
13084 +
13085 +Fixed a problem with uninitialized pv[].wval (switch-parsing parameter-value)
13086 +members that showed up on certain platforms or with certain compilers.  Now
13087 +the Mac OS X 10.4 version works.  ckuus[r367].c, ckcftp.c, 28 Dec 2005.
13088 +
13089 +Built on Unixware 7.1.1, a pure 32-bit build, seems fine.  Rebuilt on Red
13090 +Hat AS 4.2 just to make sure I didn't break anything, it's OK.  No testing
13091 +on HP-UX, etc, because HP testdrive file sytem is full, can't upload anything.
13092 +29 Dec 2005.
13093 +
13094 +Commented out the SHOW FEATURES section that displays constants like
13095 +INT_MAX, CHAR_MAX, etc, because printing each value in the appropriate
13096 +format is too tricky, and we don't need them anyway.  ckuus5.c, 29 Dec 2005.
13097 +
13098 +Updated ckvfio.c to use CK_OFF_T for the relevant variables.  Built and
13099 +tested on VMS/Alpha 7.2: file transfer in remote mode; making a Telnet
13100 +connection and then local-mode file transfer; S-Expressions, all OK.  Also
13101 +built a no-net version OK.  29 Dec 2005.
13102 +
13103 +Built and tested on Red Hat AS4 AMD X86_64, used it to upload new sources to
13104 +FreeBSD 4.11.  Built on FreeBSD 4.11/i386.  Here's another one where off_t
13105 +is 64 bits, even though long is 32 bits.  But it seems to work ok, not sure
13106 +why, when CK_OFF_T is 32 bits.  There is no _LARGEFILE_SOURCE stuff in the
13107 +header files.  29 Dec 2005.
13108 +
13109 +Built on Mac OS X 10.3.9 using the new macosx10.4 target to pick up LFS.
13110 +Works fine.
13111 +
13112 +Built on Red Hat Linux 4WS on IA64 (64-bit).  Now this one is odd, stat()
13113 +fails on big files.  It happens also if I use the "linuxnolfs" target, which
13114 +does not define _USE_LARGEFILE or _FILE_OFFSET_BITS=64.  DIRECTORY BIGFILE
13115 +shows the size as -1, but if "log debug", it says "no files match", i.e.
13116 +different behavior, observer effect.  I hate when that happens.
13117 +
13118 +Let's see if that's an anomoly...  Built on Tru64 Unix 4.0F (64-bit Alpha).
13119 +It sees long files just fine.  Rebuilt and checked on x86_64 again... fine.
13120 +OK, let's not worry about IA64 yet.
13121 +
13122 +Another small fix to the HP-UX 9.0 target from PeterE.  makefile, 29 Dec 2005.
13123 +
13124 +---Dev.10---
13125 +
13126 +Code adjustments from Jeff, mainly to the SSL and TLS Raw mode code from
13127 +several weeks ago, plus changing some data types in the security code to
13128 +CK_OFF_T, plus a different data type for CK_OFF_T for K95 because Windows
13129 +size_T isn't signed.  This presumably will allow large-number arithmetic but
13130 +it will not give large file access because that will require replacing all C
13131 +library file i/o calls (esp. in ckofio.c) with native Windows APIs.  Build
13132 +on Solaris 9 with and without SSL and on Linux RH AS4.2 with and without
13133 +SSL.  ck_crp.c, ck_ssl.c, ck_ssl.h, ckcdeb.h, ckcftp.c, ckcmai.c, ckcnet.c,
13134 +ckcnet.h, ckctel.c, ckuat2.h, ckuus4.c, ckuus7.c, ckuusr.c, 30 Dec 2005.
13135 +
13136 +It was reported that WRITE SESSION always returned a failure status, even
13137 +when it succeeded.  The problem was that Unix versions of zsout() and
13138 +zsoutl(), for the session log only, were using write() and returning
13139 +write()'s return code, which is different from what zsout() and zsoutl() are
13140 +documented to return.  Also plugged a couple potential holes in zsoutx()
13141 +that I noticed while I was in the neighborhood.  ckufio.c, 30 Dec 2005.
13142 +
13143 +Added FSEEK /FIND:pattern.  This form of FSEEK accepts all the other
13144 +switches and arguments and performs the desired seek.  Then, if the seek was
13145 +successful, it starts from that point and reads through the file, line by
13146 +line, searching for the first line that contains the given string or matches
13147 +the given (unanchored) pattern and, if found, sets the file pointer to the
13148 +beginning of that line.  Useful, e.g., for very long timestamped logs, where
13149 +you want to start processing at a certain date or time; searching for a
13150 +particular string is much faster than doing date comparisons on each line.
13151 +ckuus[27].c, 30 Dec 2005.
13152 +
13153 +It was annoying me that FILE STATUS (FSTATUS) required a channel number to
13154 +be given even if only one file was open, so I supplied the correct default
13155 +in that case.  ckuus7.c, 30 Dec 2005.
13156 +
13157 +INPUT /NOWRAP, added recently, is used for efficiently copying the INPUT
13158 +stream intact, but it's not good for matching because if the INPUT target is
13159 +broken between the end of the previous buffer and the beginning of the next
13160 +one, the context is lost and the match does not occur.  I thought of several
13161 +ways around this, but they all involve saving a huge amount of context --
13162 +old input buffers, the arrays of target strings and corresponding match
13163 +positions, etc.  The alternative is fairly simple but it's not transparent
13164 +to the user.  Here's what I did in a POP script:
13165 +
13166 +    .eom := "\13\10.\13\10"
13167 +    set flag off                           # FLAG ON = success
13168 +    while ( open connection && not flag ) {
13169 +        .oldinput := \fright(\v(input),8)  # Save tail of previous INPUT buffer
13170 +        input /clear /nowrap 4 \m(eom)     # Get new INPUT buffer
13171 +        if success {                       # INPUT matched - good
13172 +            .s := {\freplace(\v(input),\m(eom),\13\10)}
13173 +            set flag on
13174 +        } else {                           # No match
13175 +            .s := \v(input)                # Check if target crossed the border
13176 +            .oldinput := \m(oldinput)\fsubstr(\v(input),1,8)
13177 +            if \findex(\m(eom),\m(oldinput)) set flag on
13178 +        }
13179 +        ...
13180 +    }
13181 +
13182 +I think this will be easier to explain than any dangerous and grotesque
13183 +magic I might put into doinput() itself.  For now, added a few words about
13184 +this to HELP INPUT.  ckuus2.c, 30 Dec 2005.
13185 +
13186 +Back to the pattern matcher.  Noticed that "IF MATCH index.html [a-hj-z]*"
13187 +succeeded when it should have failed.  In ckmatch(), the clist section
13188 +needed one more clause: it can't float the pattern if an asterisk does not
13189 +occur in the pattern before the clist.  This change fixes the problem
13190 +without breaking any other cases that weren't already broken, most of which
13191 +involve slists, i.e. {string,string,string,...}.  ckclib.c, 30 Dec 2005.
13192 +
13193 +Tried FSEEK /FIND: on a largish file (over 100,000 lines), using it to seek
13194 +to a line near the end.  It took 0.756 seconds, compared with Unix grep,
13195 +which did the same thing in 0.151 sec.  That's because C-Kermit is using
13196 +ckmatch().  But if the search target is not a pattern, it should be a bit
13197 +faster to use ckindex().  Yup, 0.554 sec, a 36% improvement.  Can't expect
13198 +to compete with grep, though; it's highly tuned for its single purpose.
13199 +ckclib.[ch], ckuus7.c, 1 Jan 2006.
13200 +
13201 +Updated visible copyright dates to 2006: ckcmai.c, ckuus2.c, ckuus5.c,
13202 +1 Jan 2006.
13203 +
13204 +Noticed that NetBSD 2.0.3 has 64-bit off_t, and that _LARGEFILE_SOURCE is
13205 +mentioned in <stdio.h>.  Tried building Kermit with _LARGEFILE_SOURCE added
13206 +to CFLAGS, it's good.  Added it to the netbsd target.  makefile, 1 Jan 2006.
13207 +
13208 +Fixed typo, #ifdef CK_NOLONGLONG in ckuus5.c should have been #ifndef
13209 +CK_LONGLONG (which, it turns out, we don't use anyway).  2 Jan 2005.
13210 +
13211 +Observed that FreeBSD 4.x has a 64-bit off_t, but does not use the
13212 +_LARGEFILE_SOURCE convention.  Reasoning that all versions of FreeBSD have
13213 +off_t (I was able to check back to FreeBSD 3.3), I simply #define CK_OFF_T
13214 +to be off_t in ckcdeb.h within #ifdef __FreeBSD__ .. #endif.  Another one
13215 +down.  This can be done for any platform that is guaranteed to have off_t.
13216 +Turns out FreeBSD 3.3 has 64-bit off_t too.  2 Jan 2005.
13217 +
13218 +OpenBSD, same as FreeBSD.  Also, added OS-version-getting thing to makefile
13219 +target for the program herald, as in the other BSDs.  Built on OpenBSD 2.5
13220 +from 1998, it has 64-bit off_t too.  ckcdeb.h, makefile, 2 Jan 2005.
13221 +
13222 +Dumping the command stack every time there's an error is really too much.
13223 +I added SET COMMAND ERROR-DISPLAY {0,1,2,3} to set the verbosity level of
13224 +error messages.  Only level 3 dumps the stack.  ckuus[235].c, 2 Jan 2005.
13225 +
13226 +Built on HP-UX 11.11 with _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64.  The
13227 +result works fine as far as I can tell.  It sees big files, it can open
13228 +them, seek to positions past the 2^31 boundary.  It can send large files.
13229 +It can do large-number arithmetic (^ 2 62).  The only problem is that during
13230 +compilation, every single modules warns:
13231 +
13232 +  cc: "/usr/include/sys/socket.h", line 504: warning 562: Redeclaration of
13233 +  "sendfile" with a different storage class specifier: "sendfile" will have
13234 +  internal linkage.
13235 +  cc: "/usr/include/sys/socket.h", line 505: warning 562: Redeclaration of
13236 +  "sendpath" with a different storage class specifier: "sendpath" will have
13237 +  internal linkage.
13238 +
13239 +These warnings should be perfectly harmless since they are not coming from
13240 +C-Kermit code, nor does C-Kermit use either one of those functions.  These
13241 +warnings don't come out in HP-UX 11i v2, but on that one we get tons and tons
13242 +of picky compiler warnings (variables set but not used, defined but not
13243 +referenced, etc).  A couple, however, turned out to be valid; one case of
13244 +"expression has no effect", and two of "string format incompatible with
13245 +data type" (I missed a couple file-size printfs).
13246 +
13247 +There were also numerous warnings about signedness mismatch or sign
13248 +conversion of constants like IAC (0xff).  Does the HP-UX Optimizing Compiler
13249 +have a compiler flag to make all chars unsigned?  Yes, +uc, but the man page
13250 +says "Be careful when using this option.  Your application may have problems
13251 +interfacing with HP-UX system libraries and other libraries that do not use
13252 +this option".  Sigh, better not use it.
13253 +
13254 +After reviewing "HP-UX Large Files White Paper Version 1.4" and HP's
13255 +"Writing Portable Code" documents, I added -D_LARGEFILE_SOURCE
13256 +-D_FILE_OFFSET_BITS=64 to the hpux1000 target, which is the basis for all
13257 +HP-UX 10.00 and later builds.  Large files are available in HP-UX 10.20 and
13258 +later.  10.00 and 10.10 were not real releases, and anyway these flags
13259 +should be harmless there unless the large-file implementation was only
13260 +partly done.  Built OK on both PA-RISC and IA64, optimized and plain.
13261 +makefile, 4 Jan 2006.
13262 +
13263 +Built on FreeBSD 6.0 on IA64.  All OK except I got a warning about the
13264 +argument passed to time() in logwtmp() in ckufio.c.  This section had
13265 +already been partially fixed; thus I put the improved version into
13266 +#ifdef CK_64BIT, which is our newly available symbol that should be
13267 +automatically defined for any true 64-bit build.  ckufio.c, 4 Jan 2006.
13268 +
13269 +Finally got around to testing Jeff's changes to SSL/TLS RAW mode from
13270 +December 30th against our POP server.  It didn't work, couldn't log in.
13271 +Tried backing off the ckctel.c changes first; that allowed login and
13272 +communication, but it did not suppress activation of Telnet protocol
13273 +whenever a 0xff byte arrived.  Backed off the rest of the changes and now
13274 +all is OK again.  ckctel.c, ckcnet.c, ckuus7.c, 9 Jan 2006.
13275 +
13276 +Built on NetBSD 1.4.1 (1999), found that it did not like the large file
13277 +assumption -- fseeko() and ftello() do not exist; added a clause to the
13278 +netbsd target to check for fseeko and not define _LARGEFILE_SOURCE if not
13279 +found.  Oddly enough, off_t is 64 bits anyway, but it doesn't look like the
13280 +APIs are half-done.  For example, stat() uses off_t (64 bits) for the file
13281 +length, but fseek() uses long (32 bits) and there is no 64-bit analog.
13282 +Anyway the new netbsd target works on both 1.4.1 and 1.5.2 (no large files)
13283 +and on 2.0.3 (large files).  makefile, 9 Jan 2006.
13284 +
13285 +Built on QNX-32 4.25, which has no large file support.  Got a few strange
13286 +compiler (WatCom) warnings, but it built and runs OK.  Noticed that file
13287 +transfers into QNX over a Telnet connection can't use streaming, but that's
13288 +nothing new to this version; same thing happens with C-Kermit 7.0.  9 Jan 2006.
13289 +
13290 +Built on IRIX 6.5.  I didn't bother with large files there because it does
13291 +not support the _LARGEFILE_SOURCE interface; you have to change all the APIs
13292 +at the source level from blah() to blah64().  Seems to work fine as a 32-bit
13293 +app even though its off_t is 64 bits.  Tried a pure 64-bit IRIX 6.5 build
13294 +but it dies in ckcnet.c when it hits SOCKOPT_T and GSOCKNAME_T with "The
13295 +identifier 'socklen_t' is undefined".
13296 +
13297 +Looks like I no longer have access to SCO OSR5.
13298 +
13299 +Made a pure 32-bit build on SCO UnixWare 7.1.4, all OK.  Found that this
13300 +version also supports LFS, added it to the uw7 target.  makefile, 9 Jan 2006.
13301 +
13302 +--- Dev.11 ---
13303 +
13304 +Evidently the HP-UX bundled (non-ANSI non-optimizing) compiler doesn't like
13305 +long integers in switch expressions.  Changed three examples of these in the
13306 +S-expression code.  ckuus3.c, 10 Jan 2006.
13307 +
13308 +A section of tstats() where GFTIMER isn't defined (e.g. on Motorola
13309 +sv68r3v6) was garbled.  Fixed in ckcfn2.c, 10 Jan 2006.
13310 +
13311 +A fix for setting 921600 bps on Linux from Paul Fulghum, Microgate Systems Ltd.
13312 +ttgspd(): ckutio.c, 11 Jan 2006.
13313 +
13314 +Noticed that when I changed the compact substring notation code back on
13315 +August 9th, I broke the ability to use arithmetic expressions within the
13316 +brackets, which explains some rather odd behavior I saw with some of my
13317 +scripts.  Looking more deeply into this, I also see that all the parsers I
13318 +have been using up to now for this, as well as for array bounds pairs, have
13319 +been inadequate because they never allowed for nested constructions, such as
13320 +a member of a bounds pair that itself was an array element, possibly with
13321 +another array element as a subscript.  I wrote a new routine for this,
13322 +called boundspair(), which is like arraybounds() except it accepts an extra
13323 +argument, an array of characters that can serve as bounds-pair delimiters,
13324 +and it returns the pair separator that was encountered in another new
13325 +argument.  For the alternative substring notation for [startpos-endpos] I
13326 +had to change the delimiter from '-' to '_' because '-' can be used in
13327 +arithmetic but '_' is not a recognized operator.  This is so I can parse,
13328 +e.g. [a:b] or [a_b] in the same context, and then find out which form was
13329 +used, e.g. \s(line[9:12]) or \s(line[9_12]); the first string is 4 bytes
13330 +long, the second is 12.  Everything seems to be OK now.  \s(line[10]) gives
13331 +everything starting at 10, but \s(line[10:0]) gives the null string.  Bad
13332 +syntax in the bounds pairs results in a null string; missing pieces of the
13333 +bounds pair result in defaults that should be compatible with previous
13334 +behavior.  ckuus[45].c, ckuusr.h, 13 Jan 2005.
13335 +
13336 +Changed arraybounds() to call boundsdpair().  This was a rather drastic
13337 +change, not strictly necessary, but I think I got all the kinks out.
13338 +ckuus5.c, 13 Jan 2005.
13339 +
13340 +Changes from PeterE to the makefile for HP-UX 6 and 7, to accommodate bigger
13341 +symbol tables, etc.  19 Jan 2005.
13342 +
13343 +Determined that SCO OSR5.0.6 (and earlier) do(es) not support large files.
13344 +Don't know about 5.0.7.  30 Jan 2005.
13345 +
13346 +Created a new build target for SCO OSR6.0.0.  Gets the exact 6.x.x version
13347 +dynamically.  Supports large files and big-number arithmetic via CK_OFF_T.
13348 +The sockopt() family of functions changed the data types of some of their
13349 +arguments since OSR5.  It was already possible to define SOCKOPT_T and
13350 +GSOCKNAME_T from the command line but I had to add code to also allow this
13351 +for GPEERNAME_T too.  ckcnet.c, makefile, 30 Jan 2005.
13352 +
13353 +Apparently, ever since C-Kermit 7.0 was released, it has never been possible
13354 +to use a variable for the as-name in a RECEIVE command in Kermit 95.  This
13355 +is because evaluation of the as-name field was deferred until after we could
13356 +check whether it might be a directory name (which, in Windows, could start
13357 +with a backslash).   This little bit of magic was not a good idea, magic
13358 +hardly ever is.  I changed the code to evaluate both as-name fields in the
13359 +normal way.  If they want to receive to a directory called "\%1", they'll
13360 +just have to spell it differently.  The workaround is to turn the whole
13361 +command into a macro and evaluate it before executing it, e.g.:
13362 +
13363 +  assign xx receive /as-name:\%1
13364 +  do xx
13365 +
13366 +ckuus6.c, 1 Feb 2006.
13367 +
13368 +Built OK on FreeBSD 6.1 on AMD64.  Adjusted some copyrights and date stamps.
13369 +ckcmai.c, makefile, 8 Feb 2006.
13370 +
13371 +--- Dev.12 ---
13372 +
13373 +Fixed a signed/unsigned char warning in the new boundspair() calling code
13374 +in the compact substring notation handler.  ckuus4.c, 9 Feb 2006.
13375 +
13376 +Removed a spurious extra linux+openssl label from the makefile, added
13377 +solaris10g_64 synonym.  9 Feb 2006.
13378 +
13379 +Satisfied myself that LFS is OK on Solaris 10 i386, and I'm going to assume
13380 +it's also OK on Solaris 9.  Made LFS standard for all Solaris 9 and 10
13381 +builds (including the secure ones) except the explicitly 64-bit ones, and
13382 +made the provisional solarisXXlfs targets into synonyms.  makefile, 9 Feb 2006.
13383 +
13384 +--- Dev.13 ---
13385 +
13386 +Further attempts at SSL/TLS message suppression when QUIET is ON.
13387 +ck_ssl.c, 16 Feb 2006.
13388 +
13389 +From J.Scott Kasten: (quote...) I just uploaded a patch to /kermit/incoming.
13390 +The file name is "jsk-patch-for-cku211.diff".  I have also included the
13391 +patch as ASCII text in this email below.  This patch may be applied to the
13392 +cku211.tar.gz source code via:
13393 +  cd cku211, patch -p1 <../jsk-patch-for-cku211.diff
13394 +The patch adds 4 new build targets:
13395 +  netbsdwoc - a stripped no curses target for iksd used.
13396 +  netbsdse  - security enhanced target with srp, ssl, and zlib.
13397 +  irix65gcc - build on SGI Irix 6.5 platform using gcc.
13398 +  irix65se  - security enhanced target with srp, ssl, and zlib.
13399 +The patch fixes one build target:
13400 +  irix64gcc - The "-s" option is not supported by gcc under Irix.
13401 +I thank all of you in the Kermit Project for such a fine utility.  I
13402 +recently had to get a 16 MB file overseas across a spotty communications
13403 +link to repair a computer remotely.  Kermit was the only thing that could do
13404 +the job, so I wanted to contribute these patches back to the mainstream to
13405 +say thanks.  This digitally signed email is a binding contract that
13406 +officially assigns the rights to the source code patch (shown below) that I
13407 +developed to the Kermit Project at Columbia University. (...end quote)
13408 +ck_ssl.c, makefile, 23 Feb 2006.
13409 +
13410 +Changed the new NetBSD target names to be consistent with the conventions
13411 +used in most other targets:
13412 +
13413 +  netbsdwoc -> netbsdnc
13414 +  netbsdse  -> netbsd+ssl+srp+zlib
13415 +  irix65se  -> irix65+ssl+srp+zlib
13416 +
13417 +and removed old, now superfluous, NetBSD targets (old-netbsd, netbst15,
13418 +netbst16), leaving synonym labels in their place.  Also updated (crudely)
13419 +the Linux target variations (curses instead of nocurses, no curses at all)
13420 +to be (appropriately modified) copies of the current linux target.  It would
13421 +be nicer to combine them, but this gets the job done.  makefile, 23 Feb 2006.
13422 +
13423 +--- Dev.14 ---
13424 +
13425 +Fixed the HELP command when used with tokens like @, ^, #, and ;.  The first
13426 +two had been omitted from the table.  The second two required a new path
13427 +into the guts of the parser, since comments are normally stripped at a very
13428 +low level.  ckuus[r2].c, ckucmd.c, 24 Feb 2006.
13429 +
13430 +Built on AIX 5.1 ("make aix51") without incident.  Then I tried:
13431 +
13432 + make aix51 "KFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
13433 +
13434 +This had no effect.  I found the relevant document ath the IBM website.  It
13435 +says to use -D_LARGE_FILES instead.  I added this to the AIX 4.2 target
13436 +since (a) IBM says large files are supported by AIX 4.2 and later, and (b)
13437 +all Kermit AIX targets past 4.2 use the 4.2 one.  Plus a clause to make
13438 +sure CK_OFF_T is defined appropriately.  ckcdeb.h, makefile, 6 Mar 2006.
13439 +
13440 +Added a 32-bit aix51+openssl target.  Builds OK, works fine (tested against
13441 +our SSL POP server).  Tried I tried adding -D_LARGE_FILES.  It seems to work
13442 +fine, so we'll keep it.  Cleaned up the other aix5blah entries a bit also.
13443 +makefile, 6 Mar 2006.
13444 +
13445 +Fixes from J. Scott Kasten to the IRIX 6.4 and 6.5 makefile targets.  They
13446 +were badly wrong.  makefile, 6 Mar 2006.
13447 +
13448 +The reason Kermit was looping on directories in IRIX was a classic
13449 +"double-ended break".  The makefile targets failed to define DIRENT so
13450 +Kermit was open/read on directories rather than opendir()/readdir().  But
13451 +then it was also failing to account for the fact that read() would return -1
13452 +on error.  The makefile fix adds -DDIRENT, and the read() case in traverse()
13453 +now properly terminates its loop on error.  ckufio.c, 6 Mar 2006.
13454 +
13455 +--- Dev.14 ---
13456 +
13457 +In response to a complaint that C-Kermit would not build on HP-UX 11 with
13458 +OpenSSL, I tried it myself on both 11.11/PA-RISC and 11i v2/Itanium.  It built
13459 +OK on both but I had to add a new target (hpux1000o+openssl-nozlib) for no
13460 +Zlib since these boxes did not have it installed.  makefile, 9 Mar 2006.
13461 +
13462 +Added OpenSSL version number display to SHOW FEATURES.  ckuus5.c, 9 Mar 2006.
13463 +
13464 +Gavin Graham noticed that FTP [M]GET /DELETE /MOVE-TO: was rejected with
13465 +"?Sorry, /DELETE conflicts with /MOVE or /RENAME".  This check belongs in the
13466 +PUT code but not in the GET code.  Commented it out and tested the result.
13467 +The combination is now accepted but then Kermit refuses the incoming file as
13468 +if it had been given a /SMALLER-THAN: or /LARGER-THAN: switch, which it didn't
13469 +happen.  Turns out there was one more place where I wasn't initializing the
13470 +new "wide int" member of the switch-parsing pv[] struct.  Once this was fixed,
13471 +the /MOVE-TO part still didn't work.  Turned out the /DELETE case was part of
13472 +a long if-else-if-else- chain, which effectively made /DELETE and /MOVE-TO: or
13473 +/RENAME-TO: mutually exclusive.  Fixed this, now it works fine.  ckcftp.c,
13474 +13 Mar 2006.
13475 +
13476 +Got access to AIX 5.3, built there, all OK, including large files. 13 Mar 2006.
13477 +
13478 +--- Dev.16 ---
13479 +
13480 +Patches from Mark Sapiro to suppress getsockopt() and getsockname() warnings
13481 +in Mac OS X.  ckcnet.[ch], 18 Mar 2006.
13482 +
13483 +In response to a complaint from Clarence Dold, tried "make redhat9" (which
13484 +is the rather dated target that tried to include all forms of security) on
13485 +RH Linux AS4.3, it failed miserably.  I made a new makefile target, removing
13486 +Kerberos IV and got a lot farther.  But then in ckcftp.c, the following
13487 +struct definition:
13488 +
13489 +  struct {
13490 +      CONST gss_OID_desc * CONST * mech_type;
13491 +      char *service_name;
13492 +  } gss_trials[] = {
13493 +      { &ck_gss_mech_krb5, "ftp" },
13494 +      { &ck_gss_mech_krb5, "host" },
13495 +  };
13496 +
13497 +refers to a variable, ck_gss_mech_krb5, that is not defined anywhere.  Up
13498 +above, however, is a static definition for gss_mech_krb5, so I changed the
13499 +struct definition to match.  Next, in ckuath.c, the compiler could not find
13500 +the com_err.h file.  Turns out in Linux this is in a subdirectory, et, so we
13501 +have to add a -I clause to the makefile target for this.  Made a target for
13502 +Linux+SSL only.  Made a target for Linux+Krb5 only; this required moving an
13503 +#ifdef in ckuus7.c to prevent an unguarded reference to SSLEAY_VERSION.
13504 +New targets: linux+krb5+ssl, linux+krb5, linux+krb5.  ckcftp.c, ckuus7.c,
13505 +makefile, 27 Mar 2006.  
13506 +
13507 +New targets of HP-UX 10/11 with OpenSSL from PeterE.  makefile, 27 Mar 2006.
13508 +
13509 +Added large file/integer support to SHOW FEATURES.  ckuus5.c, 27 Mar 2006.
13510 +
13511 +Built OK on Solaris 9 and 10 with gcc (someone was complaining that this
13512 +didn't work, but that was 8.0.211).
13513 +
13514 +Started build on a Sun 3/80 mc68030 with NetBSD 2.0 and gcc 3.3.3.  But it
13515 +died with an assembler error in ckcfn2.c (compiler bug).  27 Mar 2006.
13516 +
13517 +--- Dev.17 ---
13518 +
13519 +NebBSD 2.0 build completed by turning off optimization on ckcfn2.c
13520 +("KFLAGS=-O0").  Result supports 64-bit ints and, presumably, large files.
13521 +uname -p = "m68k", -m = "sun3". 29 Mar 2006.
13522 +
13523 +Corrected an omission in applying PeterE's updates to the HP-UX targets.
13524 +makefile, 28 Mar 2006.
13525 +
13526 +solaris2xg+krb5+krb4+openssl+shadow:
13527 +
13528 +Tried resurrecting the solaris2xg+krb5+krb4+openssl+shadow target.  It asks
13529 +to link with libdes but there is no libdes.  Removed -ldes from the target,
13530 +now at least it builds and runs wart.  The compilation blows up in ckcftp.c
13531 +for missing header files:
13532 +
13533 +  ckcftp.c:462: kerberosIV/krb.h: No such file or directory
13534 +  ckcftp.c:500: gssapi/gssapi_generic.h: No such file or directory
13535 +  ckcftp.c:501: gssapi/gssapi_krb5.h: No such file or directory
13536 +
13537 +Got a bit farther by adding appropriate -I's and -L's to KFLAGS but it still
13538 +dies compiling (or linking?) ckcftp.c, but it doesn't say exactly why.  OK,
13539 +deferred.
13540 +
13541 +Added SET SEXPRESSION TRUNCATE-ALL-RESULTS { ON, OFF }.  This can be used
13542 +for force integer arithmetic in any kind of calculation that requires it,
13543 +such as date calculations.  This is a global setting, not on any kind of
13544 +stack.  Also, updated SHOW SEXP and added HELP SET SEXP which wasn't there
13545 +before.  ckuus[23].c, 30 Mar 2006.
13546 +
13547 +To make the RENAME command a bit more useful, need to add some switches.
13548 +But it shares a switch table, qvswtab[], with some other commands.  Broke
13549 +this off into its own switch table.  ckuus6.c, 17 Apr 2006.
13550 +
13551 +Added RENAME switch values that can be used in the same table with the DELETE
13552 +switch values, which are shared by many commands.  ckuusr.h, 17 Apr 2006.
13553 +
13554 +Discovered that the RENAME command could be entered without any arguments
13555 +and it would still succeed.  Fixed in dorenam(): ckuus6.c, 17 Apr 2006.
13556 +
13557 +Added parsing for RENAME /UPPER:option (to uppercase the file name(s)),
13558 +/LOWER:option (to lowercase), and /REPLACE:{{s1}{s2}} (to do string
13559 +replacement on the filename(s)), but not the semantics.  When any of these
13560 +switches is given, the target ("to") name is not parsed; they act on the
13561 +source name.  The /LOWER: switch takes keyword args to specify whether it
13562 +should act only only files that have all UPPER case latters, or on ALL files
13563 +(i.e., including files with mixed-case names); similarly for the /UPPER:
13564 +switch.  There is some creative parsing allowing these to be given with or
13565 +without a colon and keyword argument, which works fine except if you include
13566 +the colon but no argument, execute the command (which works fine), and then
13567 +recall the command.  I haven't yet decided about the interaction among these
13568 +switches.  Clearly if /UPPER is given after /LOWER, it overrides.  But if
13569 +/UPPER (or /LOWER) is given with /REPLACE, what should happen?  ckuus6.c,
13570 +17 Apr 2006.
13571 +
13572 +Filled in actions for RENAME /UPPER: and /LOWER: for the single file case,
13573 +and tested all combinations of switch values and filename configurations.
13574 +Once that was OK, moved the code out into a separate routine, renameone(),
13575 +and then called it from both the single-file case and the multifile case.
13576 +ckuus6.c, 19 Apr 2006.
13577 +
13578 +Added RENAME /SIMULATE.  Filled in the code for string replacement, needs
13579 +testing.  ckuus6.c, 20 Apr 2006.
13580 +
13581 +Changed /REPLACE options to allow a negative number to specify an occurrence
13582 +from the right, so -1 means the last occurrence, -2 means the next-to-last,
13583 +etc.  ckuus6.c, 24 Apr 2006.
13584 +
13585 +Added RENAME /COLLISION:{OVERWRITE,PROCEED,FAIL}.  This is implemented but
13586 +not tested.  ckuus6.c, 24 Apr 2006.
13587 +
13588 +Worked on RENAME /COLLISION:FAIL.  I decided it was less than useful to ...
13589 +
13590 +Added SET RENAME { COLLISION, LIST } to let user change default collision
13591 +and listing actions.  ckuusr.[ch], ckuus[36].c, 25 Apr 2006.
13592 +
13593 +Experimented with parsing for /CONVERT:cset1:cset2.  The problem here is
13594 +that there is no straightforward way for a switch to have multiple
13595 +arguments.  Or is there...?  If I parse cset1 with cmswi() rather than
13596 +cmkey(), it almost works; the only problem is that the character-set
13597 +keywords don't have CM_ARG set, so they don't know to stop on, and ignore, a
13598 +colon.  If I make a copy of the table and set CM_ARG in the flags field for
13599 +each keyword, it works fine: if I Tab in the first name, it fills itself
13600 +out, supplies a colon, and waits for the second name.  So in the code, the
13601 +first time that RENAME /CONVERT is invoked, I put code to copy fcstab[] and
13602 +set CM_ARG in each flags field.  Works fine, and now we know how to make a
13603 +switch that takes multiple arguments.  ckuus6.c, 24 Apr 2006.
13604 +
13605 +I thought I had a function to convert the character set of a string but I
13606 +don't, so actually implementing /CONVERT: will be difficult.
13607 +
13608 +Actually the parsing wasn't that easy either.  It works OK interactively,
13609 +but not in a TAKE file.  To make a long story short, I had to change
13610 +gtword() and cmkey2() to not require "/" at the beginning of a switch, and
13611 +then to parse arguments-that-are-followed-by-other-arguments as if they were
13612 +switches, so that they can end with colon rather than space.  This might
13613 +seem dangerous, but switches always have "/" at the beginning, so the check
13614 +is superfluous.  ckucmd.c, 26 Apr 2006.
13615 +
13616 +Back to /CONVERT...  Once I was able to get the code to call cvtstring() I
13617 +was able to debug it (at first it was skipping every second character).  And
13618 +now we have a general-purpose string-translating function we can call from
13619 +anywhere.  Requires that C-Kermit be built with Unicode support.
13620 +ckuus6.c, 26 Apr 2006.
13621 +
13622 +Added SHOW RENAME.  ckuusr.h, ckuus[r5].c, 26 Apr 2006.
13623 +
13624 +Conditionalized some Unix/Windows assumptions in renameone() so the code
13625 +could work in VMS.  ckuus6.c, 2 May 2006.
13626 +
13627 +Added RENAME /FIXSPACES to change all spaces in the filename(s) to
13628 +underscore or any other character or string that is given.  This is just a
13629 +special case of RENAME /REPLACE:{{ }{x}} with easier syntax.
13630 +ckuusr.h, ckuus6.c, 2 May 2006.
13631 +
13632 +Added an "all-but" control to the /REPLACE options:
13633 +/REPLACE:{{.}{_}{~1}} means replace all but the first (this one works);
13634 +/REPLACE:{{.}{_}{~-1}} means replace all but the last (this one not yet).
13635 +ckuus6.c, 2 May 2006.
13636 +
13637 +Filled in the second one ("all but" the given occurrence).  The algorithm is
13638 +simply to reverse the three strings and then use the same code as we use in
13639 +the left-right-case, and then unreverse the result.  At first I used
13640 +yystring() for this but yikes, what a bad design!  So I made a better
13641 +string-reversal routine, gnirts(), for this (luckily yystring() is only used
13642 +in one place, for which its design is appropriate). ckuus6.c, 3-4 May 2006.
13643 +
13644 +Added code to handle the case where the file being renamed includes a path
13645 +specification.  In this case we separate the path, apply the renaming
13646 +functions to the filename only, and then at the end rejoin the original
13647 +filename with the path, and join the new name with same path or, if a
13648 +destination directory was given, with that.  ckuus6.c, 4 May 2006.
13649 +
13650 +Added HELP SET RENAME and updated HELP RENAME.  ckuus2.c, 4 May 2006.
13651 +
13652 +"Tom Violin" (Tom Hansen) noticed that the first time you FOPEN a file,
13653 +Kermit's memory consumption goes way up.  In fact there's a warning to that
13654 +effect in the code, where, upon first open, a potentially big array of
13655 +potentially big structs is allocated.  I rewrote the code to allocate each
13656 +array member (struct ckz_file) as needed, i.e. when a file is opened, and to
13657 +free it when the file is closed (or the open fails).  This was actually
13658 +quite a lot of work, which is why I didn't do it the first time around:
13659 +every single "."  had to be changed to "->".  Every check for a valid
13660 +channel first had to check if the channel's struct was allocated and every
13661 +other reference to z_file[i]->anything had to be prechecked that z_file[i]
13662 +was not a NULL pointer.  Also I made some improvements to FILE STATUS, and I
13663 +fixed FILE CLOSE to default the channel number if only one channel was open,
13664 +as I did for FILE STATUS a while back.  ckuus7.c, Cinco de mayo 2006.
13665 +
13666 +Ran my old BUILDS script that builds C-Kermit with about 100 different
13667 +combinations of feature-selection switches.  Fixed a few small glitches so
13668 +now they all build OK (except can't do NOANSI builds any more on recent
13669 +Linuxes because of varargs()).  ckuus3.c, ckuus5.c, ckuus6.c, ckuus7.c,
13670 +ckucmd.c, ckcfns.c, 6 May 2006.
13671 +
13672 +Fixed RENAME /LOWER and /UPPER, when given with no colon or agrument, to
13673 +default to ALL.  ckuus6.c, 13 May 2006.
13674 +
13675 +Built on VMS 7.2-1, tested new RENAME command there; seems to be OK.
13676 +13 May 2006.
13677 +
13678 +--- Dev.18 ---
13679 +
13680 +I wanted to test large files against RESEND but I don't have access to any
13681 +system that can run C-Kermit and that also has enough space for a large
13682 +file.  I created a "fake" large file on Linux (3G hole plus 1 byte), and
13683 +sent it over a localhost connection, and interrupted it repeatedly and then
13684 +initiated a RESEND at the sender.  In each case, it picked up where it left
13685 +off.  But before the 2G boundary was crossed the disk filled up.
13686 +Inconclusive.  14 May 2006.
13687 +
13688 +PeterE got a warning in the new FILE OPEN code when building in HP-UX 9.
13689 +I added a cast, built on HP-UX 11, no more complaint.  However there
13690 +are warnings about internal vs external bindings of sendpath and sendfile
13691 +in every module.  Too bad, these are not Kermit tokens, it's a conflict in
13692 +HP's header files.  Marc Sapiro doesn't see them; probably it's something
13693 +on the HP testdrive site.  ckuus7.c, 17 May 2006.
13694 +
13695 +Fixed the tru64-51b+openssl target -- the terminating doublequote of KFLAGS
13696 +was missing -- and also the osf target, which failed to import the LIBS
13697 +definition from whatever other target invoked it.  Now the SSL build goes OK
13698 +on Tru64 5.1B.  Replaced x.tar.z in the download areas without declaring a
13699 +new Dev number.  The new one has a makefile with today's date.  Software
13700 +engineering at its best!  makefile, 18 May 2006.
13701 +
13702 +Scott Kasten noted that the estimated-time-remaining calculation would go
13703 +bonkers on LFS systems when RESENDing a large file.  It looks like the
13704 +shocps() and shoetl() functions escaped the CK_OFF_T conversion.  I made
13705 +what seemed to be the right adjustments, and then was lucky enough to find a
13706 +computer that had enough free disk space for me to send a large file,
13707 +interrupt it several times, resend it, all seems to be OK.  28 May 2006.
13708 +Later Scott verified these changes independently for Linux, but the problems
13709 +in IRIX remain.
13710 +
13711 +Patches from Scott Kasten for large files on IRIX 6.5: ckcdeb.h, makefile,
13712 +12 Jun 2006.
13713 +
13714 +--- Dev.19 ---
13715 +
13716 +Added a new function for dealing with JPGs and GIFs:
13717 +
13718 +\fpicture(filename,&a)
13719 +  returns 0 if file not recognized or can't be opened;
13720 +  returns 1 if landscape, 2 if portrait or square.
13721 +  If array given, element 1 is width, element 2 is height.
13722 +
13723 +ckuusr.h, ckuus4.c, 19 Jun 2006.
13724 +
13725 +Scott Kasten reports that the FTP client can transfer large files OK, at
13726 +least in Linux, but has trouble with recovery:
13727 +
13728 + . Kermit takes a very long time to start the transfer, sometimes over
13729 +   30 minutes.  Suspect the ftp server is counting the bytes in a long file?
13730 +   Or maybe it's a text-mode transfer and it's counting the lines?  Probably
13731 +   in response to Kermit's SIZE command.
13732 +
13733 + . The size shown in the FT display is wrong by a random amount.  And of
13734 +   course so are the progress bar, percent done, and time remaining.
13735 +
13736 + . The file, however, is transferred correctly.  REGET works correctly too.
13737 +
13738 +I tried setting up a test scenario locally but our Solaris FTP server does
13739 +not support large files:
13740 +
13741 +  FTP SENT [SIZE BIGFILE]
13742 +  FTP RCVD [550 BIGFILE: not a plain file.]
13743 +  FTP SENT [PASV]
13744 +  FTP RCVD [227 Entering Passive Mode (128,59,48,24,246,37)]
13745 +  FTP SENT [RETR BIGFILE]
13746 +  FTP RCVD [550 BIGFILE: Value too large for defined data type.]
13747 +
13748 +Created the same 3GB on a Tru64 Unix system that allows FTP access.  Made
13749 +the connection from C-Kermit on Solaris (32-bit with LFS):
13750 +
13751 +  16:46:12.908 FTP SENT [SIZE BIGFILE]
13752 +  16:46:12.947 FTP RCVD [213 3000000001]
13753 +
13754 +Note that it takes less than half a second to get the reply.  Now I start
13755 +the download and then interrupt it at about 2%:
13756 +
13757 +  16:46:12.979 FTP SENT [TYPE I]
13758 +  16:46:13.174 FTP RCVD [200 Type set to I.]
13759 +  16:46:13.226 FTP SENT [PASV]
13760 +  16:46:13.262 FTP RCVD [227 Entering Passive Mode (15,170,178,171,11,37)]
13761 +  16:46:13.299 FTP SENT [RETR BIGFILE]
13762 +  16:46:13.337 FTP RCVD [150 Opening BINARY mode data connection for BIGFILE..]
13763 +  16:47:24.895 FTP RCVD [426 Transfer aborted. Data connection closed.]
13764 +  16:47:24.934 FTP RCVD [226 Abort successful]
13765 +  16:47:24.991 FTP SENT [MDTM BIGFILE]
13766 +  16:47:25.028 FTP RCVD [213 20060706204458]
13767 +
13768 +Now I do a REGET:
13769 +
13770 +  16:51:55.321 FTP SENT [PASV]
13771 +  16:51:55.357 FTP RCVD [227 Entering Passive Mode (15,170,178,171,11,43)]
13772 +  16:51:55.394 FTP SENT [REST 122736640]
13773 +  16:51:55.430 FTP RCVD [350 Restarting at 122736640. Send STORE or RETRIEVE..]
13774 +  16:51:55.431 FTP SENT [RETR BIGFILE]
13775 +  16:51:55.469 FTP RCVD [150 Opening BINARY mode data connection for BIGFILE..]
13776 +
13777 +This worked perfectly, as far as I can tell; the FT display picked up in the
13778 +right place; the thermometer, percent done, and estimated time remaining
13779 +were the same as when we left off last time.  I did the same thing several
13780 +more times, everything was OK.  It would have taken a really long time to
13781 +let this run to completion, but I think this demonstrates that Scott's
13782 +symptoms are server-dependent.  No changes.  6 July 2006.
13783 +
13784 +Checked current code on VMS 8.2-1 on IA64 / UCX 5.5, builds fine.
13785 +No changes.  Updated listing at HP.  6 July 2006.
13786 +
13787 +Checked FTP GET of large file in ASCII mode against Tru64 FTP server.  It
13788 +was fine, and there was no delay in the server's response to our SIZE command
13789 +(as there would be if it were scanning the entire file to count how many
13790 +bytes would be required to send it in text mode).  7 Jul 2006.
13791 +
13792 +Tested FTP PUT big file against Tru64, OK.  Ditto FTP RESEND big file:
13793 +
13794 +  C-Kermit>resend BIGFILE
13795 +   PUT BIGFILE (binary) (3000000001 bytes)---> PASV
13796 +  227 Entering Passive Mode (15,170,178,171,13,186)
13797 +  ---> SIZE BIGFILE
13798 +  213 343211280
13799 +  ---> MDTM BIGFILE
13800 +  213 20060707141243
13801 +  ---> APPE BIGFILE
13802 +  150 Opening BINARY mode data connection for BIGFILE (128.59.59.56,45470).
13803 +
13804 +Made REPUT a synonym for RESEND.  ckuusr.c, 7 Jul 2006.
13805 +
13806 +Added FTP REPUT and FTP RESEND since previously there was no FTP-prefixed
13807 +command for recovering uploads, only the regular RESEND command, which might
13808 +not have been obvious to people.  ckcftp.c, 7 Jul 2006.
13809 +
13810 +Added help text for FTP RESEND and REPUT and amended RESEND help text.
13811 +ckcftp.c, ckuus2.c, 7 Jul 2006.
13812 +
13813 +Changed name of \fpicture() to \fpictureinfo() and added help text.  By the
13814 +way, ImageMagick can do this too: identify -format "%w %h" dscf0520.jpg.
13815 +The advantage of having it in Kermit is that not everybody has ImageMagick.
13816 +ckuus[24].c, 7 Jul 2006.
13817 +
13818 +Changed the numeric comparisons = < > <= >= != to allow long integers by
13819 +changing the data type to CK_OFF_T, etc.  ckuus6.c, 7 Jul 2006.
13820 +
13821 +Noticed that \fkeywordvalue(foo=this is a string) only kept the first word.
13822 +Fixed it to keep the whole definition.  Also added \fkwvalue() as a briefer
13823 +synomym.  ckuus4.c, 7 Jul 2006
13824 +
13825 +Sometimes we want to check if a file's status before we've FOPEN'd it, in
13826 +which case the channel variable is likely to be empty and \f_status(\%c)
13827 +would get an error.  Making the obvious change didn't fix this, however.  It
13828 +turns out that the function evaluator failed to adjust argn (argument count)
13829 +when trailing arguments were empty, and argn was being used in this case,
13830 +and probably others, to test whether an argument existed.  I added code to
13831 +adjust argn to reflect the number of aruments up to and including the
13832 +rightmost non-empty one.  ckuus4.c, 7 Jul 2006.
13833 +
13834 +Fixed \fstripb() to not dump core if second argument is missing.
13835 +ckuus4.c, 7 Jul 2006.
13836 +
13837 +Discovered that it was not obvious what pattern to use to match strings
13838 +enclosed in square brackets.  "if match [abc] \[*\]" didn't work.  Neither
13839 +did various other tricks like NCRs for the brackets.  However, "if match
13840 +[abc] \\[*\\]" does work.  Trying to fix this would no doubt break 100 other
13841 +things, so let's call it a feature.  7 Jul 2006.
13842 +
13843 +Added \fgetpidinfo(n) to return info about a process ID; for now it simply
13844 +returns 1 if the process is alive and 0 if not (or -1 if the argument is
13845 +bad or missing or on any kind of error).  ckuusr.h, ckuus[24].c, 7 Jul 2006.
13846 +
13847 +The "where-did-my-file-go" message seemed to be ending with a LF rather
13848 +than CRLF, probably because the terminal modes had not yet been restored,
13849 +leaving the next prompt hanging below it, rather than on the left margin,
13850 +if C-Kermit exited immediately after the transfer.  Fixed by changing
13851 +all \n's to \r\n's in wheremsg(): ckcpro.w, 8 Jul 2006.
13852 +
13853 +Added \v(lastkwval) so we can retrieve programmatically the keyword most
13854 +recently processed by \fkeywordval().  ckuusr.h, ckuus4.c, 9 Jul 2006.
13855 +
13856 +--- Dev.20 ---
13857 +
13858 +Added #ifdef SV68, #include <unistd.h>, #endif because Unix System V/68 on
13859 +Motorola choked on the SEEK_CUR reference without it.  ckuus4.c, 10 Jul 2006.
13860 +
13861 +Make \fkeywordval(xxx) undefine xxx (i.e. when a keyword is given with no
13862 +value).  This way command-line keywords will always override preexisting
13863 +default definitions, whether they have a value or not, which makes it easier
13864 +to parse command lines like "foo=bar blah xx=yy".  ckuus[24].c, 12 Jul 2006.
13865 +
13866 +On 29 Nov 2005 I changed IF KERBANG to solve a problem (see entry for that
13867 +date), but introduced a new one; namely that you can't have (e.g.)  a FATAL
13868 +macro that uses IF KERBANG to decide whether to EXIT all the way or STOP
13869 +back to the prompt.  Changed it again, this time to require not that the
13870 +command level be 1, but that the command *file* level be 0 (i.e. that we are
13871 +in the top-level command file, irrespective of the command or macro level,
13872 +but not in a subfile).  ckuus6.c, 12 Jul 2006.
13873 +
13874 +It is unhelpful when Kermit gets a syntax error in the middle of a big
13875 +compound statement block (e.g. FOR or WHILE loop) and dumps out the whole
13876 +thing in an error message.  I changed the two places where this can happen
13877 +to call a new routine that, instead of dumping out the entire cmdbuf,
13878 +checks its length first and if it's more than a line long, truncates it
13879 +and adds an ellipsis.  ckuus6.c, 12 Jul 2006.
13880 +
13881 +The new RENAME command didn't give very good error messages, e.g. if the
13882 +filespec didn't match any files.  Fixed in dorenam(): ckuus6.c, 12 Jul 2006.
13883 +
13884 +Fixed DIR /TOP to work if the /TOP:n argument was omitted, defaulting
13885 +to 10.  domydir(): ckuus6.c, 12 Jul 2006.
13886 +
13887 +Added DIR /COUNT:v to count the number of files that match the given
13888 +criteria and store result in the variable v.  ckuusr.h, ckuus[r26].c,
13889 +24 Aug 2006.
13890 +
13891 +Added HDIRECTORY as an invisible synonym for DIR /SORT:SIZE /REVERSE.
13892 +Can be used with other switches, of course, so (e.g.) HD /TOP shows the
13893 +ten biggest files.  ckuusr.h, ckuus[r26].c, 24 Aug 2006.
13894 +
13895 +DIR /FOLLOWLINKS and /NOFOLLOWLINKS always did the same thing; the switch
13896 +was ignored, a symlink is always followed.  Fixed in ckuus6.c, 24 Aug 2006.
13897 +
13898 +Added DIR /NOLINKS, which means don't show or count symlinks at all.
13899 +ckuusr.h, ckuus[r26].c, 24 Aug 2006.
13900 +
13901 +Build on Solaris 9 and NetBSD 3.0, 24 Aug 2006.
13902 +
13903 +Added a missing definition for LOCK_DIR in the Linux HAVE_BAUDBOY case,
13904 +suggested by Gerry Belanger.  ckutio.c, 6 Oct 2006.
13905 +
13906 +Suggested by Jim Crapuchettes: \v(dialmessage) is the text string
13907 +corresponding to \v(dialstatus).  ckuusr.h, ckuus4.c, 6 Oct 2006.
13908 +
13909 +Soewono Effendi sent code for exit sequence to leave DTR on; this amounted
13910 +to unsetting HPUCL in c_cflag.  I did it a simpler way, hopefully portable
13911 +to all Unixes, but who knows at this late date.  The code is inside
13912 +#ifndef CK_NOHUPCL..#endif in case it causes trouble.  It is executed if
13913 +SET EXIT HANGUP is OFF and a serial port was open at the time Kermit exits
13914 +(or closes it explicitly).  ttclos(): ckutio.c, 6 Oct 2006.
13915 +
13916 +Built on Solaris9/Sparc; FreeBSD 6.2/AMD64; NetBSD 3.0/i386; HP-UX 11i v2;
13917 +SCO OSR6.00.
13918 +
13919 +--- Dev.21 ---
13920 +
13921 +Added netbsd+openssl target to makefile.  Built OK (NetBSD 3.0, OpenSSL
13922 +0.9.7d) except with some warnings in ck_crp.c.  Connects and logs in OK to a
13923 +secure site.  10 Oct 2006.
13924 +
13925 +Added a debug statement to ftp_hookup() to record the TCP port that was used.
13926 +ckcftp.c, 11 Oct 2006.
13927 +
13928 +Built with OpenSSL 0.9.7l on Solaris 9.  Built with OpenSSL 0.9.8d on
13929 +Solaris 9; connects and logs in to a secure site.  11 Oct 2006.
13930 +
13931 +The new RENAME command didn't work if both the source and destination names
13932 +included directory segments, e.g. "rename /tmp/foo ~/bar" (see notes of
13933 +4 May 2006).  This was fixed in renameone() by a special case in which
13934 +the second argument is given but it is a filename, not a directory name.
13935 +ckuus6.c, 11 Oct 2006.
13936 +
13937 +Fixed unguarded reference to dialmsg[] for \fdialmessage(), noticed by
13938 +Gerry Belanger.  ckuus4.c, 12 Oct 2006.
13939 +
13940 +Added a TOUCH command that does what UNIX touch does: creates the file if it
13941 +does not exist, updates the timestamp if it does.  If a wildcard is given,
13942 +it operates only on existing files.  It shares the DIRECTORY command parser,
13943 +so all the same file selection switches can be given.  ckuusr.[ch],
13944 +ckuus[26].c, 12 Oct 2006.
13945 +
13946 +PeterE noticed that if you FOPEN a file, do some seeks or reads, then FCLOSE
13947 +it, then FOPEN it again (or open a different one), some of the old
13948 +information is still there (e.g. current line number).  This is an artifact
13949 +of the changes of May 4th.  Now the file closing and opening routines are a
13950 +bit more careful about scrubbing and initializing the file info struct.
13951 +ckuus7.c, 12 Oct 2006.
13952 +
13953 +--- Dev.22 ---
13954 +
13955 +Built OK on Red Hat Linux AS4 with both "make linux" and "make linuxnc". 
13956 +15 Oct 2006.
13957 +
13958 +DIRECTORY /BRIEF ignored file selection switches and always listed all
13959 +files.  This was because of how I cleverly called filhelp() (the routine
13960 +that lists matching files when ? is typed in a filename field) and, of
13961 +course, filhelp() doesn't know anything about the DIRECTORY command's file
13962 +selections.  Changed filhelp() to accept all the args needed for passing
13963 +along to fileselect(), renamed it to xfilhelp(), and made a filhelp() stub
13964 +that chains to xfilhelp() with null selections.  ckcker.h, ckucmd.[ch],
13965 +ckuus6.c, 29 Nov 2006.
13966 +
13967 +SHOW CONNECTION for an SSH connection said the connection type was "NET"
13968 +rather than "SSH".  Fixed in dolognet(): ckuus3.c, 29 Nov 2006.
13969 +
13970 +SHOW CONNECTION didn't show the TCP port number.  This command works by
13971 +parsing the current connection log entry string, which doesn't have a field
13972 +for this, but which sometimes shows the port number as part of the hostname
13973 +(but more often not).  Added code to dolognet() to log the TCP port number,
13974 +if known.  This involved adding a gettcpport() function to ckcnet.c.
13975 +ckcnet.[ch], ckuus3.c, 29 Nov 2006.
13976 +
13977 +This was impossible: def \%1 upper, echo \f\%1(abc) -- i.e. to "compose" a
13978 +function name.  Fixed in zzstring().  But note that it's still not possible
13979 +to do this: def \%1 \fupper, echo \%1(abc) -- because at the point where
13980 +"\fupper" is encountered, which is automatically fed to fneval(), the
13981 +argument list hasn't been read yet.  ckuus4.c, 29 Nov 2006.
13982 +
13983 +The meaningless Lisp command (=) would cause Kermit to hang.  Due to some
13984 +idiosyncracy in the parser, it would see this as ((=) and would go into
13985 +"wait for the closing paren" mode.  There was already a hack in the code to
13986 +compensate for this, but it didn't work.  I fixed the hack but I don't
13987 +understand the real problem.  Anyway, comparing Kermit with real (Franz)
13988 +Lisp I discovered that comparison operators do not require two arguments, as
13989 +Kermit has been doing, although they do require at least one.  I changed
13990 +Kermit to not require two, so now all the comparison predicates behave
13991 +exactly like Franz Lisp, including getting an error if there are no args).
13992 +ckuus[r3].c, 29 Nov 2006.
13993 +
13994 +From to-do list: Make a way to inhibit pattern matching in SWITCH labels.
13995 +It's already there; just quote the wildcard characters; the only trick is
13996 +that for some reason (such as that SWITCH is really an internally defined
13997 +macro), a double quote is needed:
13998 +
13999 +  switch \%1 {
14000 +    :a\\*z, echo literally "a*z", break
14001 +    :abcxyz, echo literally "abcxyz", break
14002 +    :a*z, echo a...z, break
14003 +    :default, echo NO MATCH
14004 +  }
14005 +
14006 +In first case, the asterisk is taken literally; in the third it's a
14007 +metacharacter and the label matches any string that starts with 'a' and
14008 +ends with 'z'.
14009 +
14010 +Array initializion would quit early if any initializers were undefined,
14011 +e.g. "decl \&a[] = \%a \%b \%c" would stop at the first element if \%b
14012 +was not defined, even though \%c might be defined.  Fixed in dodcl():
14013 +ckuusr.c, 30 Nov 2006.
14014 +
14015 +DIR /ARRAY:a filespec, when the filespec does not match any files,
14016 +terminates with the array undeclared.  It would be better to return a
14017 +declared but empty array (\&a[0] = 0).  The code is already there to do
14018 +that, but isn't working.  And yet "declare \&a[0]" does indeed create a
14019 +0-element array ("show array" shows a dimension of 0).  Turns out there were
14020 +two problems; one was the careless recycling of a local variable ("array"),
14021 +resulting in failure to create \&a[] (but not any other array).  Fixed in
14022 +domydir(): ckuus6.c, 30 Nov 2006.
14023 +
14024 +The other problem was that dclarray(), when called with an array name and a
14025 +dimension of zero, does two different things depending on whether the array
14026 +already existed.  There is still a fair amount of confusion about whether a
14027 +dimension of 0 indicates an array with 1 element (as it should) or a
14028 +nonexistent array.  We call dclarray() with a size of 0 to undeclare an
14029 +array but we also need to able able to declare an array with only element 0.
14030 +I changed dclarray() to treat a negative dimension as a command to destroy
14031 +the array, and 0 or positive as a command to create the array with the given
14032 +dimension.  ckuus[r56].c, 30 Nov 2006.
14033 +
14034 +Next problem: when chkarray() returns 0, this should not be interpreted to
14035 +mean the array does not exist.  Looks like the only place this happened was
14036 +in \fcontents(); fixed in ckuus4.c, 30 Nov 2006.
14037 +
14038 +If we include file selectors with DIR /ARRAY:&a and some of the files that
14039 +match the given filespec but don't fit the selectors, the array's dimension
14040 +is bigger than its number of elements.  Added code at the end of domydir()
14041 +to resize the array so \fdim() returns the number of filenames in the array,
14042 +and also made sure that element 0 contains that number too.  ckuus6.c,
14043 +30 Nov 2006.
14044 +
14045 +This would be a nice elegant way to loop over a bunch of files, if it worked:
14046 +
14047 +  for \%i 1 \ffiles(*) 1 { rename \fnextfile() xxx_\flpad(\%i,3,0) }
14048 +
14049 +But in this loop, Kermit skips every other file (beginning with the first)
14050 +and then runs out of files halfway through the loop.  Why?  Because in
14051 +commands like RENAME and DELETE, the filename parser is in a chained FDB
14052 +with the switch parser.  First the switch parser, cmswi(), gets its hands on
14053 +\fnextfile(), passing it through the evaluator and thus getting the first
14054 +filename, which it then sees is not a switch, so now the field is parsed by
14055 +the next parser in the chain, cmifi(), which causes \fnextfile() to be 
14056 +executed again.  In fact, the FOR loop has nothing to do with; the same
14057 +thing happens like this:
14058 +
14059 +  void \ffiles(*)
14060 +  delete \fnextfile()
14061 +
14062 +This deletes not the first file, but the second one.  Obviously users can be
14063 +told not to refer to \fnextfile() in chained-fdb fields:
14064 +
14065 +  for \%i 1 \ffiles(*) 1 { .f := \fnextfile(), delete \m(f) }
14066 +
14067 +but this is hardly intuitive.  I had some clever ideas of how to make
14068 +\fnextfile() work as expected in this context but it's way too much magic.
14069 +Better to simply document that \fnextfile() is "deprecated" and the array
14070 +format should be used:
14071 +
14072 +  for \%i 1 \ffiles(*,&a) 1 { delete \&a[\%i] }
14073 +
14074 +The difference is, an array element doesn't change every time it's referred to!
14075 +
14076 +Added a /PRESERVE switch to the COPY command to preserve the timestamp and
14077 +permissions of the file.  I did this using the Kermit APIs so it should work
14078 +for any version of C-Kermit or K95.  ckuus[26].c, 30 Nov 2006.
14079 +
14080 +Added COPY /OVERWRITE:{ALWAYS,NEVER,OLDER,NEWER} to control name collisions
14081 +when copying across directories.  ckuus[26].c, 1 Dec 2006.
14082 +
14083 +--- Dev.23 ---
14084 +
14085 +Fixed a bug in SET TELNET PROMPT-FOR-USERID, SET AUTH KERBEROS[45] PROMPT,
14086 +and SET AUTH SRP PROMPT in which the user's string was compared with a
14087 +literal (s == ""), reported by Pavol Rusnak.  Worse, empty strings (if the
14088 +test succeeded) were turned into null pointers, and then fed to strlen().
14089 +Fixed in ckuus3.c, 5 Dec 2006.
14090 +
14091 +Added an optional 4th argument to \findex(), \frindex(), \fsearch(), and
14092 +\frsearch(): the desired occurrence number of the searched-for string.
14093 +\frsearch() was a bit tricky.  ckuus[24].c, 7 Dec 2006.
14094 +
14095 +Added \fcount(s1,s2) to tell the number of occurrences of s1 in s2.
14096 +ckuus[24].c, 8 Dec 2006.
14097 +
14098 +Added \ffunction(s1) to tell if a given built-in function is available.
14099 +ckuus[24].c, 8 Dec 2006.
14100 +
14101 +Changed RENAME /COLLISION:PROCEED to be /COLLISION:SKIP, which is clearer.
14102 +ckuus[26].c, 8 Dec 2006.
14103 +
14104 +For communication protocols: INPUT /COUNT:n to read exactly n characters
14105 +without any matching.  Can be used, for example, with CONTENT_LENGTH in CGI
14106 +scripts; NUL characters are counted but not collected.  ckuusr.[ch],
14107 +ckuus4.c, 8 Dec 2006.
14108 +
14109 +There was a bad bug in the date-parsing routines; it's been there for years.
14110 +If a date string includes a timezone, e.g. "Sat, 9 Dec 2006 19:26:23 EST",
14111 +and converting to GMT changes the date, the variables for day, month, and
14112 +year (which are used later) were not updated, and the final result was a day
14113 +off.  Fixed in cmcvtdate(): ckucmd.c, 10 Dec 2006.
14114 +
14115 +Built OK with SSL/TLS.  Tested with the POP script, found that I broke INPUT
14116 +when adding the /COUNT feature; there was a path through the code that could
14117 +leave the "anychar" variable unset and therefore random.  Fixed in
14118 +doinput().  The POP script, which does not use /COUNT, works again and so
14119 +does a new CGI script, which does use /COUNT.  ckuus4.c, 10 Dec 2006.
14120 +
14121 +Supplied a missing comma in the help-text array for HELP SET TERMINAL, which
14122 +resulted in bad formatting in K95 around SET SNI-FIRMWARE-VERSIONS.
14123 +ckuus2.c, 10 Dec 2006.
14124 +
14125 +Made "help locus" a synonym for "help set locus".  ckuusr.[ch], ckuus2.c,
14126 +11 Dec 2006.
14127 +
14128 +This morning the Columbia FTP server was malfunctioning in a perfect way
14129 +for me to implement and test an FTP timeout mechanism.  The server would
14130 +close the data connection after sending the file, but the client never saw
14131 +the close and was stuck forever in a recv().  I added code to do a select()
14132 +on the data connection prior to entering the recv(), with a timeout on the
14133 +select() that the user can establish with SET FTP TIMEOUT.  Built and tested
14134 +on Solaris 9, clear-text FTP.  Also built cleanly for FTPS and tested
14135 +against a server that does not hang; I don't have access to an FTPS server
14136 +that would tickle the timeout code.  ckcftp.c, 11 Dec 2006.
14137 +
14138 +--- Dev.24 ---
14139 +
14140 +Fixed a bug in the INPUT /COUNT: parser: the array of search strings was
14141 +never initialized, which didn't matter before, but with /COUNT:, if the
14142 +first element was not a NULL pointer, we'd treat it as a search string, and
14143 +then if it happened to match something in the input stream, the operation
14144 +would stop before the count was exhausted.  Fixed by (a) initializing the
14145 +array, and (b) ignoring any search strings if /COUNT: was given.  ckuusr.c,
14146 +13 Dec 2006.
14147 +
14148 +Removed a debug() statement from zsattr() that suddenly started making some
14149 +version of gcc complain, reported by Gerry Belanger.  ckufio.c, 13 Dec 2006.
14150 +
14151 +--- Dev.25 ---
14152 +
14153 +Some casts for the 3 interior args of the new select() call in ckcftp.c
14154 +for HP-UX 9.  14 Dec 2006.
14155 +
14156 +Changed \fkeywordvalue() to accept a string rather than a single word
14157 +as its second argument, so that more than one separator could be specified,
14158 +and to return -1 on error, 0 if it found nothing, 1 if given a kewyord but
14159 +no value, and 2 if there was a keyword and a value.  dokwval(): ckuus[24].c,
14160 +14 Dec 2006.
14161 +
14162 +Checked FTP timeout on command channel with FTP DIRECTORY of a big directory
14163 +using a path into our ftp server that preserves the hanging behavior.  The
14164 +timeout was actually working, but the failure condition wasn't propogating
14165 +back to the user, and there was no error message.  Fixed in doftprecv2() and
14166 +failftprecv2(): ckcftp.c, 15 Dec 2006.
14167 +
14168 +Added the obvious timeout checks for FTP uploads, but I have no way to test
14169 +the code since our misbehaving FTP server does not hang when receiving
14170 +files, only when sending them.  But uploads work both with and without a
14171 +timeout set, so at least no harm is done.  ckcftp.c, 17 Dec 2006.
14172 +
14173 +When downloading with FILE DESTINATION NOWHERE (= /CALIBRATE), Kermit still
14174 +checked the size of the incoming file and refused it if there wasn't enough
14175 +free disk space, on platforms (such as VMS) where zchkspa()) actually works;
14176 +reported by Bob Gezelter.  ckcfn3.c, 18 Dec 2006.
14177 +
14178 +Built on Mac OS X 10.4.8 and NetBSD 3.1_RC3, all OK.  19 Dec 2006.
14179 +
14180 +--- Dev.26 ---
14181 +
14182 +Built on VMS 7.3-2/Alpha.  Had to squelch a couple compiler warnings by
14183 +changing some ints in the new \fpictureinfo() code from unsigned to signed,
14184 +and fix a typo in the prototype for the new gettcpport() function.
14185 +ckcnet.h, ckuus4.c, 22 Dec 2006.
14186 +
14187 +--- Dev.27 ---
14188 +
14189 +Parameterized pty routines and all references to them for file descriptor,
14190 +rather than to use global ttyfd, thus allowing ptys to be created for
14191 +different purposes.  Tested on Solaris 9 and Mac OS X 10.4.8, with "set host
14192 +/connect /pty emacs" (fine in both cases), and (more to the point) "set host
14193 +/connect /pty kermit" -- here we make a connection from one Kermit process
14194 +to another and transfer a file; works fine and wasn't especially slow either;
14195 +a good sign.  ckcdeb.h, ckutio.c, ckupty.c, 22 Dec 2006.
14196 +
14197 +Created a new version of ttruncmd() called ttyptycmd(), which works by
14198 +calling do_pty() to get a pty to run the command on, and then in a loop,
14199 +reads from the pty and writes to the net and reads from the net and writes
14200 +to the pty, using select() to which of those it should do on each pass.
14201 +First cut just uses single-byte reads and writes.  Tested using Kermit
14202 +itself as an external protocol.  Works but slowly: 6000cps.  Zmodem doesn't
14203 +work at all.  ckutio.c, 24 Dec 2006.
14204 +
14205 +Changed single-character read() and write() to buffered reads and writes,
14206 +with ttxin() and ttol() used for network i/o.  Using Kermit as the external
14207 +protocol, this gives 450Kcps (about 1/3 normal on this connection).  
14208 +
14209 +But now there's a problem: the loop doesn't know when to stop.  How does it
14210 +know when the process that is running on the pty has exited?  With single
14211 +character read()'s that are executed unconditionally when select() says the
14212 +pty has data waiting, as in the first pass, I get EIO if there actually
14213 +isn't any, and can exit the loop.  But now, to avoid blocking, I call
14214 +in_chk() to see how much data is waiting, and I don't try to read anything
14215 +if it says nothing is waiting.  If the process associated with the pty file
14216 +descriptor has terminated, in_chk() would presumably get some kind of error,
14217 +but it doesn't.  I changed do_pty to return the pid of the fork where it
14218 +execs its command so we can check the pid with kill(pid,0) when in_chk() of
14219 +the pty says 0, but this doesn't help either; it seems like the process is
14220 +not exiting, but of course it is.
14221 +
14222 +I could not find any legitimate way to test when the pty fork terminated.
14223 +Select() always says the pty file descriptor was ready, no matter what.
14224 +Select() never reports an exception on the pty file descriptor;
14225 +in_chk(ptyfd) returns 0 and not an error.  read(ptyfd,...) gets 0 but not an
14226 +error.  fcntl(ptyfd,...) doesn't get an error.  Finally I tried
14227 +write(ptyfd,c,0) and this indeed gets EIO (i/o error).  With this, using
14228 +Kermit as the external protocol works fine in Solaris but I tend to think
14229 +this trick will not be very portable (it isn't).  24 Dec 2006.
14230 +
14231 +Made ttptycmd() use a more intelligent buffering scheme, fixed a few things
14232 +about how I was setting up the select() call that should address some of
14233 +yesterday's problems.  Still doesn't work but it's progress.  A: 25 Dec 2006.
14234 +
14235 +Debugging yesterday's code...  Still, the error conditions are never set,
14236 +we never detect when the pty closes.  In Solaris, if select() says ptyfd is
14237 +ready to read but in_chk() says there are no characters there, we can treat
14238 +this as a loop-exit condition.  But in NetBSD, in_chk() always says 0 when
14239 +used on a pty (but works OK on a serial or net connection).
14240 +
14241 +Realized I could not use in_chk() on the pty because there is too much
14242 +baggage with the communication path -- myread(), etc etc) -- so I replaced
14243 +this with a simple ioctl(ptyfd,FIONREAD,&n).  This works fine in Solaris but
14244 +always returns 0 in NetBSD, despite what the man page says (i.e. that this
14245 +function can be used on any file descriptor).
14246 +
14247 +OK, let's see.... select() does not return useful results.  It says
14248 +characters are waiting on ptyfd when they are not, and it never detects the
14249 +closure of the pty.....  Well of course not, because we are the ones who
14250 +have to close it.  Just because the process has stopped doesn't mean the pty
14251 +is closed.  So we're back to square one, how do we know when to close it?
14252 +ckupty.c seems to keep the process ID in a global variable, pty_fork_pid
14253 +(which is not the same as the pid now returned by do_pty(), which is
14254 +useless, but I don't understand why).  But it doesn't matter because when we
14255 +kill(pty_fork_pid,0), we still get no error of any kind, even after we know
14256 +the process has exited.  I am completely flummoxed.  select() lies, and even
14257 +if it didn't, there is simply no completion criterion.  In the loop,
14258 +select() always says that the pty is ready to read.  To be continued.
14259 +26 Dec 2006.
14260 +
14261 +Back to Square One, single-byte reads and writes.
14262 +
14263 + . This works for both ripple and Kermit.
14264 + . Doesn't work for Zmodem but we'll deal with that later.
14265 + . In this case FD_ISSET(ptyfd) is still true after pty closes.
14266 +
14267 +But the ensuing read() gets EIO so we know the pty is gone.  That means the
14268 +same thing should happen in the buffered version, no?  Yes; I went back to
14269 +the buffered version and replaced all the other nonworking tests by a
14270 +blocking read of 1 byte on the pty and this detects the termination.  Now:
14271 +
14272 + . ripple works perfectly (of course it's only one-way).
14273 + . Kermit fails
14274 +
14275 +Let's call the remote, forked, redirected, external Kermit A and its
14276 +local partner B.  A sends its S-packet, B receives it OK and Acks.
14277 +A apparently does not receive the ACK in time, so sends the S again, but OK.
14278 +followed immediately by the F.  B Acks the F.  A sends the A, B Acks it.
14279 +But now A sends a piece of the previous F packet and the the first piece
14280 +of a D packet.
14281 +
14282 +Clearly the buffering is messed up.  Sure enough, there was an extraneous
14283 +statement incrementing a read pointer in a write section.  Removing that
14284 +cleared up the problems with Kermit, now we can send and receive substantial
14285 +files efficiently in remote mode.  Zmodem seems to work too, except that at
14286 +the beginning a bunch of "**B0800000000022d"'s are stuffed into Kermit's
14287 +command buffer, so after the transfer we get some error messages.
14288 +
14289 +In local mode, over a Telnet connection, Kermit works fine.  Zmodem works
14290 +OK too except it doesn't finish right, so at the very end rz on the far end
14291 +is still waiting for something; if I cancel out of it with ^X^X^X^X^X, it
14292 +deletes the file.  So there still is something wrong with the termination
14293 +test.
14294 +
14295 +Also you don't see anything on your screen when running Kermit or Zmodem
14296 +this way.  That's to be expected, since they are using stdio for the
14297 +transfer, so they can't also be displaying progress or other messages.
14298 +
14299 +Built this on NetBSD again...  Seems to work this time, but has trouble
14300 +finishing, like Zmodem.  Hmmm, on closer examination, it turns out that
14301 +since in_chk() always returns 0 on the ptyfd, we fall into our new
14302 +single-byte read code, so it's really slow, like 10K cps on a connection
14303 +where 1M is the norm.  27 Dec 2006.
14304 +
14305 +Switched the pty from buffer peeking (FIONREAD) and blocking reads to to
14306 +nonblocking reads (O_NONBLOCK / O_NDELAY).  Works just fine on NetBSD except
14307 +now we no longer get EIO at the end when trying to read from the pty process
14308 +that has exited.  In fact, we're back to square one again.  not ioctl(), not
14309 +fcntl(), not select(), not even read() gets an i/o error after the pty
14310 +process exits.  But in NetBSD, we have to use nonblocking reads because ...
14311 +Hmmmm, maybe switch the fd between blocking and nonblocking for the test...
14312 +Nope, NetBSD seems to be hopeless (later, Ed Ravin confirmed that similar
14313 +problems have been observed with other applications that try to do this).
14314 +
14315 +Switching to Linux, I see that yesterday's Solaris code (blocking reads)
14316 +works exactly the same way on Linux.
14317 +
14318 +Tried today's O_NDELAY method on Solaris.  It works perfectly.  And then I
14319 +moved this one to Linux and it works perfectly there too.  Except in both
14320 +cases we have the wierd thing with Zmodem at the end, but I think that's
14321 +because rz/sz don't use standard i/o.  On NetBSD, it still hangs at the end.
14322 +
14323 +Turns out that testing the pid works in NetBSD, even though it didn't in
14324 +Solaris.  Turns out read() gets an i/o error in Solaris and Linux but not
14325 +in NetBSD.  So checking the read result first, and then checking the pid
14326 +if read() got zero bytes catches all three.  28 Dec 2006.
14327 +
14328 +Now the question of return code.  In the original ttruncmd() function, we do
14329 +a fork() and a wait().  When the external protocol program finishes, wait()
14330 +gives us its return code and we can pass it on through \v(pexitstat) as well
14331 +ttruncmd's own return code.  But ttptycmd() has to interact with the pty
14332 +continuously, so it can't just sit back and wait() for it.  Instead we have
14333 +to detect when the process has exited and then call waitpid() on the fork
14334 +pid, before shutting down the pty.  Tested on Solaris using Kermit as the
14335 +external protocol and then inducing failure, or letting it run to
14336 +completion.  FAILURE and SUCCESS set appropriately in each case.  Tested
14337 +with Zmodem too, works OK except for the aforementioned cosmetic glitch at
14338 +the end.  Tested on NetBSD, all OK.
14339 +
14340 +To make K5 connection to Panix from Spam:
14341 +
14342 + set telnet debug on
14343 + authenticate K5 init /realm:PANIX.COM /password:xxxxx
14344 + set host shell.panix.com 23 /k5login
14345 +
14346 +Good...  Now I try to send a file from Spam to Panix over the K5 connection
14347 +using Kermit itself as the external protocol.  It fails.  Inspection of the
14348 +debug log on the far side shows that the S-Packet was received correctly,
14349 +good!  This means we are reading the clear-text S-Packet from the external
14350 +Kermit program, and that ttol() is encrypting appropriately.
14351 +
14352 +The remote Kermit sends the Ack and goes to read the next packet: ttinl()
14353 +calls myfillbuf() and:
14354 +
14355 +  SVORPOSIX myfillbuf calling read()
14356 +  SVORPOSIX myfillbuf=0                <-- read returns 0
14357 +  SVORPOSIX myfillbuf ttcarr=2
14358 +  SVORPOSIX myfillbuf errno=0          <-- and reports no error
14359 +  HEXDUMP: mygetbuf read (-3 bytes)
14360 +  mygetbuf errno=0
14361 +  ttinl myread failure, n=-3
14362 +  ttinl myread errno=0
14363 +  ttinl non-EINTR -3[closing]
14364 +
14365 +This happens because myfillbuf() deliberately returns -3 when read() gets 0
14366 +bytes.  I don't understand why this happens but the real problem is yet to
14367 +come.  The local Kermit (the one that has made the secure connection and is
14368 +running the external protocol through ttptycmd()) eventually figures out
14369 +that the transfer failed and when we reconnect, we get total garbage -- the
14370 +encryption either stopped happening, or got out of sync.
14371 +
14372 +Looking at the local debug log, ttol() is doing its job, converting the
14373 +initial "kermit -r\13" from plaintext to cyphertext, as shown by the
14374 +hexdumps.  Then it enters ttptycmd()...  Hmmmm, wait, how can it send the
14375 +"kermit -r" before it starts the external protocol?  Never mind, worry about
14376 +that later...  Anyway, ttptycmd() says:
14377 +
14378 +  ttptycmd loop top have_pty=1
14379 +  ttptycmd loop top have_net=1
14380 +  ttptycmd FD_SET ptyfd in
14381 +  ttptycmd FD_SET ttyfd in
14382 +  ttptycmd nfds=5
14383 +  ttptycmd select=1
14384 +  ttptycmd FD_ISSET ttyfd in
14385 +  ...
14386 +  ttptycmd in_chk(ttyfd) n=11
14387 +  ttptycmd ttxin n=11
14388 +
14389 +ttxin() asks for 11 bytes, myfillbuf() gets 11 bytes, and hexdump() shows
14390 +the cyphertext, there doesn't seem to be any decrypting going on.  Hmmm, it
14391 +looks like the regular code calls ttinc() in a loop, rather than ttxin().
14392 +Maybe ttxin() doesn't have decryption hooks.  No, that's not it, the code is
14393 +there, but the Kermit packet reader does not use ttxin(), it uses ttinl().
14394 +But of course we can't use that for external protocols because it's designed
14395 +only to read Kermit packets.  Substituting a loop of ttinc()s for the ttxin()
14396 +call fixes things (and stangely enough, it seems to be faster).  And now we
14397 +have our first external protocol transfer over a secure connection (external
14398 +Kermit program, Linux over Kerberos 5 to NetBSD).  Zmodem worked too for a
14399 +short file but "something happens" with longer ones.  29 Dec 2006.
14400 +
14401 +New makefile target for Linux with Kerberos 5, linux+krb5, that doesn't
14402 +include anything extra from SSL or other security methods (but apparently it
14403 +is still necessary to include -DOPENSSL_097 in order to get the right names
14404 +for the DES routines?).  Ditto netbsd+krb5 for NetBSD, except in this case
14405 +-DOPENSSL_097 is not necessary.  makefile, 30 Dec 2006.
14406 +
14407 +Note to myself: On Panix:
14408 +
14409 +  export LD_LIBRARY_PATH=/usr/local/kerblib
14410 +  make netbsd+krb5 "K5LIB=-L/usr/local/kerblib" "K5INC=-I/usr/local/include"
14411 +
14412 +Can't telnet-k5 from newly built Kermit on NetBSD; partway through the
14413 +negotiations, just after "TELNET RCVD SB ENCRYPTION SUPPORT DES_CFB64
14414 +DES_OFB64 IAC SE" it dumps core.  The last two lines in debug.log after
14415 +this are:
14416 +
14417 +  tn_sb[len]=5
14418 +  encrypt_support[cnt]=2
14419 +
14420 +Rebuilding with -DOPENSSL_097 doesn't change anything.  Ed Ravin said they
14421 +have two different Kerberos installations, Heimdahl and MIT; maybe some
14422 +mixup between the two explains the problem (Jeff concurs). The core dump
14423 +occurs in ck_crp: encrypt_support():
14424 +
14425 +   debug(F100,"XXX ep not NULL","",0);
14426 +   type = ep->start ? (*ep->start)(DIR_ENCRYPT, 0) : 0; <-- Here
14427 +   debug(F101,"XXX new type","",type);
14428 +
14429 +Anyway, I can log in with Kerberos 5 to Panix OK from Columbia (sesame)
14430 +using 8.0.201.  So let's try to resurrect the Solaris version with everything:
14431 +
14432 +  solaris9g+krb5+krb4+openssl+shadow+pam+zlib
14433 +
14434 +I hunted around to find where the current library and header file
14435 +directories were...  Last time I tried this (March 2006) it bombed, not
14436 +finding libdes.  Instead we have /opt/kerberos5125/lib/libdes425.a.  Made a
14437 +new cu-specific target that includes this; now we get farther; it blows up
14438 +in ckcftp.c with tons of errors and warnings, which we can worry about
14439 +later.  Building again with -DNOFTP, it gets to ckuath.c (the first security
14440 +module) and:
14441 +
14442 +  ckuath.c:151:18: error: krb5.h: No such file or directory
14443 +  ckuath.c:152:21: error: profile.h: No such file or directory
14444 +  ckuath.c:153:21: error: com_err.h: No such file or directory
14445 +  ckuath.c:176:28: error: kerberosIV/krb.h: No such file or directory
14446 +  In file included from /opt/openssl-0.9.8d/include/openssl/des.h:101,
14447 +                  from ckuath.c:219:
14448 +
14449 +Found krb5.h in /opt/kerberos5125/include/krb5.h, added a -I for this
14450 +directory ...  Now we get lots of warnings in ckuath.c, but it completes OK,
14451 +then we wind up bombing out in ck_crp.c; I don't know why -- there are all
14452 +the same warnings (related to argument passing to DES functions), but no
14453 +errors.  I have no clue.
14454 +
14455 +Tried to resurrect the solaris2x+krb4 target; this required changing -lkrb
14456 +to -lkrb4 and -ldes to -ldes425.  Lots of warnings in ckutio.c, ckcnet.c,
14457 +ckctel.c, then it bombs out in ckcftp.c because it can't find krb.h.  I
14458 +found it, adjusted the -I flags, but now it bombs because krb.h itself
14459 +#includes <kerberosIV/des.h>, which of course it can't find because the
14460 +brackets mean it's looking in /usr/include/kerberosIV/, which, of course,
14461 +the sys folks have removed.  Giving up on Solaris again.  Later, Jeff said
14462 +"Solaris does not publicly export the krb5 libraries.  You need to build
14463 +the MIT Kerberos libraries separately and link to them."  30 December 2006.
14464 +
14465 +Changed copyright date to 2007.  ckcmai.c, 1 Jan 2007.
14466 +
14467 +With Ed Ravin's help, successfully built C-Kermit with Kerberos 5 and
14468 +OpenSSL (netbsd+krb5+openssl+zlib), but it does not make K5 connections; it
14469 +gets hung up in the Telnet negotiations.  3 Jan 2007.
14470 +
14471 +Downloaded MIT Kerberos 5 v1.4.4 to Solaris 9, 54MB worth.  This is just so
14472 +I can build a Kerberized C-Kermit for testing ttyptycmd().  Ran the
14473 +configure program, got a few warnings but it didn't fail (should it?)  Did
14474 +"make install", specifying a private directory but it failed immediately
14475 +with "cannot stat libkrb5support.so.0.0: No such file or directory".
14476 +OK, I tried.  3 Jan 2007.
14477 +
14478 +Made a new makefile target for Mac OS X, macosx10.4+krb5+ssl, ran it on Mac
14479 +OS X 10.4.8.  It bombs out in ckcftp.c with: ckcftp.c:551: error: static
14480 +declaration of 'gss_mech_krb5' follows non-static declaration
14481 +/usr/include/gssapi/gssapi_krb5.h:76: error: previous declaration of
14482 +'gss_mech_krb5' was here".  Ditto for gss_mech_krb5_old, gss_nt_krb5_name,
14483 +and gss_nt_krb5_principal.  Tried again with -DNOFTP.  We get lots of
14484 +warnings in the network modules, but they complete.  But ck_ssl.c bombed
14485 +with a conflict between its own declarations of encrypt_output and
14486 +decrypt_input and the ones in ckuat2.h; removed the prototypes from the
14487 +latter (as Jeff advised) it built OK and it works OK too.  Built with FTP
14488 +too, but with link-time warnings about the aformentioned gss_* symbols.
14489 +#ifdef'd them out (gss_mech_krb5, gss_mech_krb5_old, gss_mech_name, and
14490 +gss_mech_principal) for MACOSX, where these symbols are exported by the
14491 +library.  Now it all compiles and links OK, and runs OK too.  3 Jan 2007.
14492 +
14493 +Spent a day hunting around for a version of Zmodem that would build and
14494 +execute on Mac OS X, finally found one.  Now at last I could try a Zmodem
14495 +external-protocol transfer over a secure connection.  But phooey, C-Kermit's
14496 +pty support didn't work on this box.  Kermit finds master /dev/ptypa OK,
14497 +then in ptyint_void_association() tries to open /dev/tty but gets ERRNO=6
14498 +"device not configured" (which is apparently OK, because the same thing
14499 +happens on other platforms where this works), then tries to open slave
14500 +/dev/ttypa and gets ERRNO=13 "permission denied" because, indeed, I don't
14501 +have r/w permission on the device.  Left a message.  4 Jan 2007.
14502 +
14503 +Changed TRANSMIT /BINARY output buffer size from 252 to 508 to avoid
14504 +TCP fragmentation.  Need to add a SET command for this later.
14505 +ckuus4.c, 5 Jan 2007.
14506 +
14507 +Found another Mac where the ptys weren't protected against me, make a K5
14508 +connection and transferred a largish file with Zmodem with zero glitches,
14509 +except it was kind of slow, 84K cps.  Well, we're doing single-character
14510 +reads on the net (ttinc()'s instead of ttxin()).  Hmmm, but then I did it
14511 +again and got 2.2Mcps.  Success was reported, but it actually didn't work;
14512 +it only sent the first quarter of the file....  Oh well, at least now we
14513 +have a testbed.  5 Jan 2007.
14514 +
14515 +Tried again, saw that the file is actually transferred instantly but then
14516 +we're not picking up the protocol at the end.  Theory: after the transfer
14517 +finishes, we come back to the prompt on the remote host, which means we have
14518 +something to read from the net and write to the pty, but the pty has already
14519 +exited.  AFTER THE PTY IS GONE, WE DO NOT WANT TO READ FROM THE NET ANY
14520 +MORE.  Adding this test makes Kermit succeed right away when sending the
14521 +same largish file, with a transfer rate of 4M cps, that's better.  But the
14522 +rz program on the far end is evidently not receiving the goodbye handshake
14523 +from the receiver, because it sits there foreever in its *B09002402009418
14524 +mode until I ^X^X^X^X^X out of it, at which point it deletes the file it
14525 +already received, not very helpful.  In the code, I read from the pty if the
14526 +pty is open and there is room in the buffer.  This means that when we get to
14527 +the end, either there is no room in the buffer (unlikely) or the last bit
14528 +sent by sz before exiting was cut off when the fork closed.  Why do we get
14529 +in this fix only with Zmodem and not with Kermit?
14530 +
14531 +In Mac OS X, after sz exits, we get ERRNO=5 if we try to write to the pty,
14532 +but we still get no errors after that if we try to read from it.  Still,
14533 +prior to this we did more than 20 unproductive nonblocking reads from the
14534 +pty (no error, no bytes) without incident; there did not seem to be anything
14535 +waiting.  In fact, the last thing we read from the pty were the text
14536 +messages that are issued at the end of the transfer: "rz 3.73 1-30-03
14537 +finished."  After which it pauses a second and spits out a message about
14538 +UNREGISTERED COPY.
14539 +
14540 +Figured out how to build lrzsz, in hopes that the previous problems were
14541 +with rzsz and crzsz's fiddling with file descriptors, but I get the same
14542 +behavior.  Which is good, I guess, because if I can fix one, I fix them all.
14543 +Or not...  Testing lrz by itself (not under C-Kermit), I see that it doesn't
14544 +work at all with Kermit's own Zmodem implementation.
14545 +
14546 +OK, here's one problem: at the end of the transfer, the Omen Zmodems print
14547 +stuff like "Please read the license agreement", Kermit dutifully reads this
14548 +from the pty and sends it to the host, the host shell says "Please: command
14549 +not found", issues its prompt again, which Kermit reads, feeds to the pty,
14550 +and apparently the pty echoes it, so we send it back to the host, and there
14551 +ensues an infinite loop of getty babble until the pty closes.  Now, there
14552 +ought to be a way to make the external protocol shut up, like Kermit's
14553 +-q(uiet) flag, but these are unregistered versions so you can't shut up the
14554 +messages.  In fact, the transfer works, but the getty babble at the end
14555 +ruins the experience.  Now I'm beginning to wonder how any of these programs
14556 +ever worked as external protocols.  Hmmm, now that I try it, I see the
14557 +same thing happens the old way, when using ttruncmd() rather than ttptycmd().
14558 +
14559 +Reading the crzsz documentation I see it says that messages come out on
14560 +stderr.  OK, that's progress.  In ckupty.c I try redirecting 2 to /dev/null.
14561 +Well good, this filters out the messages from csz, but we still get getty
14562 +babble on the prompt.  In the debug log, we read the last bunch of stuff
14563 +from net, 618 bytes of Zmodem stuff...   Now what happens?
14564 +
14565 +Zmodem on the remote exits, the host prints its prompt.  Kermit, of course,
14566 +reads the prompt from the net, now come to the bottom of the loop and we
14567 +have 7 bytes to write to the pty, and no error condition, so we continue the
14568 +loop.  select() says that the pty is ready for writing.  We write the 7
14569 +bytes and and get no error.  Loop again, this time select() says the pty has
14570 +data waiting.  Sure enough we get the prompt back, and send it to the net,
14571 +and thus begins the getty babble.  There are two causes for this:
14572 +
14573 +  1. crzsz does not exit immediately; it sleeps for 10 seconds after
14574 +     printing its nag message.
14575 +
14576 +  2. During this interval the pty seems to be echoing what is sent to it.
14577 +     csz is not echoing; I checked.  Anyway, removing the pause doesn't
14578 +     seem to make a difference.
14579 +
14580 +ttptycmd() needs to:
14581 +
14582 + . TELL the pty module to redirect stderr to /dev/null
14583 + . SET PTY TO NOECHO (master or slave?)
14584 +
14585 +Tried setting the pty to noecho:
14586 +
14587 +  termbuf.c_lflag &= ~(ECHO|ECHOE|ECHOK);
14588 +
14589 +and this seemed to stop the getty babble.  After the file transfer, I read
14590 +back the prompt from the host shell, I write the prompt bytes to the pty;
14591 +there is no error.  And now select() simply hangs forever (or times out if
14592 +a timeout is set).  The question here is: why didn't writing to the pty
14593 +produce an error?  And, because we never detect the pty has exited, we can't
14594 +set a good return code.  5 Jan 2007.
14595 +
14596 +Moved pty fork testing to a separate routine, pty_get_status(), and 
14597 +added a call to it from the place where we time out, in case the fork
14598 +terminated; then we can get and return its status.  6 Jan 2007.
14599 +
14600 +Added calls to pty_get_status() to every place where we suspect a pty error,
14601 +tried again with lrzsz, crzsz, and regular rzsz.  All three work, but in
14602 +each case waitpid() indicates that the sz program gave exit code 1 (failure).
14603 +ckutio.c, 7 Jan 2007.
14604 +
14605 +Changing the subject...  On my test system, every time I execute ttptycmd(),
14606 +I get "permission denied" on /dev/ttyp3.  Then I run it again and get to
14607 +ttyp4 which is OK.  I wanted to skip past any pty for which I lack
14608 +permission and try the next without raising an error.  Added debugging code:
14609 +
14610 +  16:25:23.524 pty_getpty() pty master open error[/dev/ptyp0]=5
14611 +  16:25:23.524 pty_getpty() pty master open error[/dev/ptyp1]=5
14612 +  16:25:23.524 pty_getpty() pty master open error[/dev/ptyp2]=5
14613 +  16:25:23.524 pty_getpty() found pty master[/dev/ptyp3]
14614 +  16:25:23.524 pty_getpty() slavebuf [2][/dev/ttyp3]
14615 +
14616 +So it already was skipping past open errors; ttyp3 was opened successfully.
14617 +The problem is that ptyp3 is rw-rw-rw-, but the corresponding master,
14618 +ttyp3, is rw--r----.  It seems the code assumes that if the master can be
14619 +opened, then so can the corresponding slave.  Unfortunately, the code is
14620 +not structured to allow us to skip ahead to the next master if the slave
14621 +can't be opened.  7 Jan 2007.
14622 +
14623 +Spent a couple hours trying to rearrange the code in the pty module to skip
14624 +past inaccessible slaves but it was a rabbit hole, not worth it, backed off.
14625 +8 Jan 2008.
14626 +
14627 +Tried an upload over a secure connection using lsz.  Unexpectedly, this time
14628 +it worked; not only was the file (about 0.5MB) transferred correctly, but
14629 +Kermit detected the fork's termination and got the pid's exit status, and,
14630 +for the first time, correctly reported a successful transfer.  I have no
14631 +idea why this works today and not yesterday.  More tests; it works most of
14632 +the time.  It works with csz and with regular sz too.
14633 +
14634 +(days later...)
14635 +
14636 +ckucns.c seems to do the right thing; it recognize the ZSTART string,
14637 +activates the Zmodem-Receive APC, and returns.  doconect() sees the APC and
14638 +begins to execute it.  The RECEIVE command results in a call to the GET
14639 +command parser, doxget() (IS THAT RIGHT?), then comes a ttflui(), which
14640 +throws away a bunch of stuff.  Finally we get to ttptycmd(), we get a pty
14641 +and run lrz in it, select() says stuff is waiting from the pty, but read
14642 +returns 0, errno 0.  Skipping the ttflui() in doxget() if the protocol was
14643 +not Kermit didn't seem to make difference.  ckuus6.c, 8 Jan 2007.
14644 +
14645 +The problem is that in this case, reads from the pty never get anything (no
14646 +data, no error), write always gets an error.  It's as if the pty was not
14647 +being set up right, or we're using the wrong file descriptor.  And if we
14648 +skip the autodownload?  Same thing.
14649 +
14650 +OK, putting downloads aside for a moment, let's get uploads working as well
14651 +as possible.  At this point we have the odd situation (at least in this
14652 +configuration) that the upload succeeds, but now for some reason we are
14653 +unable to read the exit status from the process, even though this was
14654 +working before, so ttptycmd() returns 0 (failure), yet Kermit reports
14655 +success.
14656 +
14657 +Well, it turns out that kill(pty_fork_pid,0) was gumming up the works.
14658 +If we use only waitpid() all is well, I think.  waitpid() with WNOHANG
14659 +returns -1 with status -1 errno 0 if the pid has not exited, and it returns
14660 +the pid and status > -1 if the process has exited.  Fixed pty_get_status()
14661 +to do it this way.  ckutio.c, 7 Jan 2007.
14662 +
14663 +Let's move this from Mac OS to NetBSD and see how it works.  Well, the file
14664 +transfer was just fine, but then I used some sexps to calculate the elapsed
14665 +time and transfer rate, and Kermit hung in dosexp().  Fine, ignoring that...
14666 +The debug log shows that ttptycmd() gets the pty OK, master and slave, the
14667 +i/o goes smoothly, and waitpid() does its job perfectly.  Solaris, same
14668 +deal; ttruncmd() goes smoothly, but then the sexps afterward get "Arithmetic
14669 +exception".  Turns out there was a BAD bug in dosexp() that allowed an
14670 +integer division by 0 to occur under certain circumstances; it's always been
14671 +there.  Fixed in dosexp(): ckuus3.c, 8 Jan 2007.
14672 +
14673 +After noticing a few problems running the pop.ksc script in production over
14674 +the past year, rewrote \femailaddress() to be more reliable and a lot
14675 +simpler.  ckuus4.c, 9 Jan 2007.
14676 +
14677 +Back to ttptycmd()...  When we left off, we could send but not receive.  Set
14678 +up a test case using Kermit as the external protocol for receiving a short
14679 +file.  If I SET STREAMING OFF and use short packets, it actually does work,
14680 +so it's not a complete failure to function, but apparently a lack of flow
14681 +control for the pty.  Began by completing the parameterization of the pty
14682 +module, so it can be called for interactive use (fc 0) or for running
14683 +protocols (1).  Confirmed that everything works at least as well as before
14684 +(e.g. "set host /pty emacs" vs external protocols).  ckcdeb.h, ckutio.c,
14685 +ckupty.c, 9 Jan 2007.
14686 +
14687 +Found in HP-UX "man 7 pty" a description of ioctl(fd,TIOCTTY,fc) which is
14688 +exactly what we want: fc 0 turns off all termio processing and guarantees an
14689 +ininterrupted, unmolested, flow-controlled stream of bytes in both
14690 +directions.  This function also exists in Linux, but not in Solaris, NetBSD,
14691 +or Mac OS X (TIOCNOTTY is not what we want, it does something else entirely).
14692 +
14693 +Another possibility is TIOCREMOTE, which "causes input to the pseudoterminal
14694 +to be flow controlled and not input edited, regardless of the terminal
14695 +mode".  This one exists in at least HPUX, NetBSD, Solaris, and Mac OS X.
14696 +
14697 +Solaris: builds OK, but at runtime we get ENOTTY ("Inappropriate ioctl for
14698 +device").  By the time this happens, it's hard to tell from the code whether
14699 +the fd we're using is for the master or the slave; TIOCREMOTE can be used
14700 +only on the master.  Close inspection shows that I am indeed doing that;
14701 +ptyfd as seen by ttptycmd() is truly the master, i.e. the /dev/ptyXX device,
14702 +not the /dev/ttyXX device (the slave fd can't be seen at all, as it exists
14703 +only in a separate fork).  OK, so now we know that TIOCREMOTE can't be used
14704 +on Solaris.
14705 +
14706 +NetBSD: Somehow, whether as a result of today's fiddling or the phase of the
14707 +moon, the code in pty_open_slave() that tries to open /dev/tty started
14708 +failing on NetBSD ("Device not configured").  Changing it to be run only if
14709 +fc == 0 (which doesn't seem to hurt anything), once again I get ENOTTY on
14710 +the TIOCREMOTE ioctl.  Zmodem works but Kermit totally fails (the fork exits
14711 +immediately with an exit code of 0, even though it didn't do anything).
14712 +
14713 +Mac OS X: Exactly the same sequence and results as NetBSD.
14714 +
14715 +Linux:  It did not execute the new ioctl at all; apparently the TIOC symbols
14716 +are hidden or not exported or something.
14717 +
14718 +Where we stand:
14719 + . Downloads don't work
14720 + . Uploads got slow again
14721 + . Kermit doesn't work at all as an external protocol
14722 +
14723 +Actually if I take the debugging out it goes fast, but it doesn't finish.
14724 +
14725 +All today's work on ttptycmd() looks like a dead end.  To roll back to
14726 +yesterday:
14727 +
14728 +  cp ckutio.c-20070108 ckutio.c
14729 +  cp ckupty.c-20070108 ckupty.c
14730 +  cp ckupty.h-20070108 ckupty.h
14731 +
14732 +or to continue with today's:
14733 +
14734 +  cp ckutio.c-20070109 ckutio.c
14735 +  cp ckupty.c-20070109 ckupty.c
14736 +  cp ckupty.h-20070109 ckupty.h
14737 +
14738 +Comparing Monday's and Tuesday's pty-related code, the differences are:
14739 + 1. Passing of function code to and among pty modules.
14740 + 2. Skipping the TIOCSCTTY ioctl and the open("/dev/tty") test.
14741 + 3. Attempting to put pty in TIOCTTY or TIOCREMOTE mode.
14742 +
14743 +Commenting out 2 and 3 should put us back where we were on Monday if the
14744 +parameterization was done right.  And with this, on Solaris, downloading
14745 +with Kermit external protocol works but slowly, 8K cps, with or without
14746 +debugging.  Debug log does not show any obvious bottlenecks; select() takes
14747 +anywhere between no time at all and 0.1 seconds to return.  If I increase
14748 +the pty-net buffer size from 1K to 4K, the rate goes up to 55K cps.  If I
14749 +make it 8K I get 136K cps.  With 16K I get 346K cps.  32K: 395K cps -- this
14750 +last one isn't worth the doubling.  But at 24K I get 490K cps, sometimes
14751 +twice that.  Let's stick with 24K for now.  Downloading with Zmodem (rzsz)
14752 +works at the same rate, but now we're back to seeing the getty babble
14753 +(Several "**B0800000000022d") at the end. 10 Jan 2007.
14754 +
14755 +Moving to Mac OS X, everything works the same as on Solaris, except I don't
14756 +get the Zmodem getty babble there, not even with Omen rzsz.  Tested sends
14757 +in both remote and local mode, the latter over a secure Kerberos 5 Telnet
14758 +connection, using C-Kermit, rzsz, lrzsz, and crzsz, all good.  10 Jan 2007.
14759 +
14760 +Now we're back where we were yesterday morning, but with better throughput.
14761 +The big issue then was receiving files.  But yikes, now it works!  Not only
14762 +that, I got a transfer rate of 2.1M cps.  That's using Kermit protocol,
14763 +streaming, and big (4K) packets.  Which didn't work before.  Not a fluke
14764 +either, I uploaded bigger and bigger files up to 6MB, they all went
14765 +smoothly, at rates between 1 and 2 MBps.  10 Jan 2007.
14766 +
14767 +Not so great in Zmodem land, however.  If I start the external-protocol
14768 +receiver on the far end, escape back and start a Zmodem send... nothing.
14769 +If I leave the remote C-Kermit at its prompt (where it supposed to recognize
14770 +the Zmodem start string), still nothing.  On the other hand, if I do it
14771 +with a script instead of by hand:
14772 +
14773 +  def xx output take blah\13, send /proto:zmodem \%1
14774 +  
14775 +it works, at least intermittently.  But that's in remote mode.  We won't be
14776 +using this in remote mode.  In local mode, where we have a secure connection
14777 +to another computer, it seems we can read from the pty and write to the net,
14778 +but we time out waiting to read from the net; nothing arrives.  Well, we
14779 +know that i/o works both ways, so there is some kind of screwup with the
14780 +Zmodem protocol start itself.  Increasing the (still hardwired timeout) from
14781 +5 to 22sec and driving the whole process with a script so as to avoid
14782 +autodownload as well as manual dexterity effects...  It just sits there
14783 +forever, way longer than 22 sec.  ^C'ing out, I see that sz was indeed
14784 +started on the far end and the protocol was executing.  But it looks like
14785 +the receiver (the one running under ttptycmd()) is getting trashed packets,
14786 +because (a) it seems to be sending the same thing over and over again, and
14787 +(b) sometimes it waits as long as 10 seconds before anything arrives from
14788 +the remote.  Maybe I was too impatient; I interrupted it after 4 minutes but
14789 +it seems to have been making some progress.  Whenever there was data
14790 +available to read from the net, it was always 65 bytes, and it was not
14791 +actually the same data over and over.  This is using lrz as the external
14792 +protocol.  crz gets a bit farther.  In this case we read up to 24K at a
14793 +gulp, but the amount varies a lot.  It looks like we took in about 1.2MB of
14794 +Zmodem protocol data, but were only able to output the first 20K of the
14795 +file.  Clearly there were lots of errors.  In the end, the crz exits with
14796 +status 1 (failure).
14797 +
14798 +Anyway it looks like we're back at needing to find a way to accomplish
14799 +something like TIOCREMOTE on the pty, which is where we came in.  10 Jan 2007.
14800 +
14801 +Without any way to make the pty transparent and flow controlled, it would
14802 +seem to make sense to write to the pty in smaller chunks than we do to the
14803 +net.  I left the read-from-pty-write-to-net buffer at 24K and changed the
14804 +read-from-net-write-to-pty buffer to 48 bytes.
14805 +
14806 +Upload using lsz worked but took about 3 minutes.  Actually it didn't work.
14807 +On the local end it seemed to work, but the file did not appear on the
14808 +remote end.  Tried this several times, each time with different results,
14809 +adding more debugging each time.  The problem this time was that the pty
14810 +read could get EWOULDBLOCK.  Changed the code to not treat this as an error,
14811 +now Zmodem uploads are solid again except I never got EWOULDBLOCK again
14812 +either, even though I repeated the same upload about 1000 times (with
14813 +throughput of over 2MBps even with debugging on), so the test for it has
14814 +not been exercised.
14815 +
14816 +OK, uploads still work.  Back to downloading...  The very first pty read
14817 +gets 0 bytes, followed by the fork test that shows that it exited with
14818 +exit status 2. 
14819 +
14820 +Next we try starting sz with some different options on the far end:
14821 +
14822 + -q: quiet (no messages):
14823 +     for some reason this gets totally stuck.
14824 +     it looks as if this option is misdocumented;
14825 +     sz seems to be sending the letter C (as in Xmodem 1K or whatever)
14826 +
14827 + -e: escape (all control chars):
14828 +     first attempt to read pty finds the process gone with exit status 2.
14829 +
14830 + -k: send 1k blocks:
14831 +     this one didn't stop immediately.  It reads 48 bytes from net, writes
14832 +     48 to the pty with no error.  Then reads 21 bytes from the pty, writes
14833 +     them to the net OK.  Then reads 48 bytes from net, writes them to pty OK,
14834 +     reads 21 from pty, writes to net OK, etc etc...  It appears to have
14835 +     worked but (final read from pty returned 0, fork test showed lrz exited
14836 +     with status 0), but only 754 bytes were received from the net when the
14837 +     file is 420K...
14838 +
14839 +Well this only goes to show that the faster we shove stuff into the pty, the
14840 +worse it gets.  Zmodem downloads won't work unless we can make the pty
14841 +transparent and flow-controlled.  So to summarize today's developments:
14842 +
14843 + . separated in/out buffer sizes
14844 + . handled EWOULDBLOCK
14845 + . found out that sz options don't help much
14846 +
14847 +11 Jan 2007.
14848 +
14849 +Next day.  This has got to be the most delicate code ever, it's like
14850 +Whack-A-Mole, fix A and B pops up.  Even without touching it, something that
14851 +worked perfectly a 2:00 doesn't work at all an hour later.  Maybe I could
14852 +have used pipes instead of ptys, but pipes have problems of their own.
14853 +There has to be a way to do this.  The telnet server, the SSH server, etc --
14854 +they all run on ptys, and we can upload files to them with Kermit.  Why?
14855 +Because Kermit puts its terminal into all the right modes using the
14856 +time-honored methods of ttpkt() and ttvt().  Perhaps all we need is a copy
14857 +of ttpkt() that operates on the pty.
14858 +
14859 +On that theory, let's go back to Kermit as the external protocol.
14860 +It's important to suppress all messages and displays.  With that,
14861 +uploads work fine, no hitches.
14862 +
14863 +Downloads:  We fail right away.  The debug log shows the Kermit program that
14864 +we are starting in the pty says:
14865 +
14866 +  "" - Invalid command-line option, type "kermit -h" for help.
14867 +
14868 +But of course we are not giving it an invalid command-line option.
14869 +Switching to gkermit for the external protocol, now we see that no matter
14870 +command-line options we use, we read 0d 0d 0a from the pty and then the
14871 +next time we go to read from the pty we get 0 bytes and waitpid() says the
14872 +program has exited with status 1.
14873 +
14874 +Why should downloading be different from uploading?  ttptycmd has no idea,
14875 +it does everything the same.  The only difference would seem to be which
14876 +side sends first, but even that tends to get washed out by each program's
14877 +startup messages.
14878 +
14879 +Downloading with Kermit worked 2 days ago, what's different now?  The buffer
14880 +sizes.  Putting the net-to-pty back up to 24K (from 48 bytes)...  Now it
14881 +works again.
14882 +
14883 +Conclusion: Kermit conditions the pty correctly, Zmodem does not.  Therefore
14884 +ttruncmd() must duplicate what ttpkt() does.
14885 +
14886 +Or not.  Because rz works fine on ssh/telnet ptys too.  But not on our pty.
14887 +lrz exits immediately with status code 2 = 01000 but there are no clues in
14888 +the lrz.c source code, I don't even see this exit status set anywhere.
14889 +Unredirecting stderr, I see that the error is "lrz: garbage on command line".
14890 +
14891 +Why do both Kermit and Zmodem sometimes think they are receiving an invalid
14892 +command line?  If I could capture the garbage...
14893 +
14894 +Side trip #1: ("pty.log",O_WRONLY) gives "no such file or directory".
14895 +Changed this to ("pty.log",O_CREAT,0644) and now it doesn't get an error,
14896 +and it creates the file, but not with 0644 permissions, and with nothing
14897 +written in it.  How come nothing works?
14898 +
14899 +Fine, the debug log shows that ttptycmd() receives the correct string
14900 +(e.g. "lrz -v").  It passes it to do_pty() correctly, and do_pty() passes it
14901 +to exec_cmd(), which runs cksplit() on it, coming up (in this case) with
14902 +"lrz" and "-v", which is right, and then:
14903 +
14904 +    args = q->a_head + 1;
14905 +    execvp(args[0],args);
14906 +
14907 +execvp() wants the args array to have a null element at the end.  cksplit()
14908 +does indeed do that, or at least the code is there.  Added code to exec_cmd()
14909 +to verify the argument list and that it is null-terminated.  So far it is.
14910 +
14911 +Anyway, we have traffic between the Zmodem partners, but no joy.
14912 +Commenting out the bit that redirects stderr, now I can see it on my screen
14913 +in real time:
14914 +
14915 +  lrz waiting to receive.Retry 0: Bad CRC
14916 +  Retry 0: Got ERROR
14917 +  Retry 0: TIMEOUT
14918 +  Retry 0: TIMEOUT
14919 +  Retry 0: TIMEOUT
14920 +  Retry 0: TIMEOUT
14921 +
14922 +etc etc, forever.  Trying sz -e on the far end, I get:
14923 +
14924 +  Retry 0: Bad CRC
14925 +  Retry 0: Garbage count exceeded
14926 +  Retry 0: Garbage count exceeded
14927 +  Retry 0: Garbage count exceeded
14928 +  Retry 0: Garbage count exceeded
14929 +  Retry 0: Garbage count exceeded
14930 +  Retry 0: Garbage count exceeded
14931 +  Retry 0: Garbage count exceeded
14932 +  ...
14933 +  Retry 0: Got ERROR
14934 +  Retry 0: Bad CRC
14935 +  Retry 0: Got ERROR
14936 +  Retry 0: Got ERROR
14937 +  lrz: xxufio.c removed.
14938 +
14939 +So apparently it's not a matter of escaping.  Trying some other stuff, I
14940 +caught the command-line problem in the act:
14941 +
14942 +  lrz: garbage on commandline
14943 +  Try `lrz --help' for more information.
14944 +
14945 +Debug log shows:
14946 +
14947 +  cksplit result[lrz]=1
14948 +  cksplit result[-v]=2
14949 +  exec_cmd arg[lrz]=0
14950 +  exec_cmd arg[-v]=1
14951 +  exec_cmd arg[]=2
14952 +
14953 +An empty string at the end instead of a null pointer.  I really do not see
14954 +any way that could happen, but rather than dig into cksplit() again after
14955 +all these years I added a test for this in exec_cmd(), which, of course
14956 +after adding it, never encountered this behavior again.
14957 +
14958 +Fiddled with pty buffer size again.  Made it 512 bytes instead of 24K.
14959 +Zmodem downloads are the same (Rety 0: TIMEOUT, over and over).  But I don't
14960 +see what the problem is -- every time we receive n bytes from the net, we
14961 +write n bytes successfully to the pty and there are no errors.  But it also
14962 +looks like the remote sender is sending the file header over and over
14963 +because it's not receiving an acknowledgment.  If we're not losing data,
14964 +then maybe it's a transparency problem.
14965 +
14966 +Tried uncommenting the TIOCblah stuff I commented out before.  Now instead
14967 +of only timeouts I get:
14968 +
14969 +  lrz waiting to receive.Retry 0: Bad CRC
14970 +  Retry 0: Got ERROR
14971 +  Retry 0: Bad CRC
14972 +  Retry 0: Got ERROR
14973 +  Retry 0: Bad CRC
14974 +  Retry 0: Got ERROR
14975 +  Retry 0: TIMEOUT
14976 +
14977 +which is odd because the TIOCREMOTE ioctl failed with errno 14, EFAULT,
14978 +bad address, which should indicate it had no effect.  We're still receiving
14979 +data from the remote in tiny chunks (from 12 to 65 bytes), apparently the
14980 +same stuff (file header), and writing them to the pty successfully but
14981 +nothing...
14982 +
14983 +Looked at cloning ttpkt() for the pty, but these stupid routines use global
14984 +tty mode structs so it's not going to be easy.
14985 +
14986 +Well, we got exactly nowhere today, but I think I'll leave stderr as it is
14987 +so users will see some feedback; no reason not to.
14988 +
14989 +WHY DO KERMIT DOWNLOADS WORK AND ZMODEM NOT?
14990 +
14991 +Is it 8-bit transparency?  Up til now I've been testing with text files.
14992 +If I try to download a binary what happens?  Fails after 99 seconds.  Packet
14993 +log from the far end shows that as soon as the first packet containing 8-bit
14994 +data is sent, everything stops.  At least I got one of these:
14995 +
14996 +  17:23:56.475 exec_cmd arg[gkermit]=0
14997 +  17:23:56.475 exec_cmd arg[-qr]=1
14998 +  17:23:56.475 exec_cmd arg[]=2
14999 +  17:23:56.475 exec_cmd SUBSTITUTING NULL=2  <-- the code I just added
15000 +
15001 +Doing this again shows the same thing on the near end.  All the 7-bit-only
15002 +packets are sent and acknowledged OK.  Three 8-bit data packets arrive and
15003 +nothing else happens after that.  This is with G-Kermit.
15004 +
15005 +The same thing happens with C-Kermit receiving.  But if I change C-Kermit's
15006 +.kermrc to turn off streaming and use a short packet length:
15007 +
15008 +The transfer works, even though it's sending 8-bit bytes.  So the problem is
15009 +not 8-bit data after all, per se.  Facts:
15010 +
15011 + . Kermit can receive streaming transfers of 7-bit files.
15012 + . Kermit can not receive streaming transfers of 8-bit files.
15013 + . Kermit can receive nonstreaming transfers of 8-bit files with short packets.
15014 + . Kermit can receive nonstreaming transfers of 8-bit files with 1K packets.
15015 + . Kermit can receive nonstreaming transfers of 8-bit files with 4K packets.
15016 +
15017 +So it's the combination of streaming and 8-bit data?  12 Jan 2007.
15018 +
15019 +As a test I made a new routine pty_make_raw() that does cfmakeraw() (a
15020 +nonportable "POSIX-like" function known to be used on ptys in applications
15021 +that do approximately what we're attempting).  Results:
15022 +
15023 + Solaris: errno 25 - inappropriate ioctl for device.
15024 +
15025 +This happens even when we try to get the terminal modes with tcgetattr(),
15026 +which is completely nuts.  We pass it the file descriptor of the pty master,
15027 +which is supposed to work.  But in Mac OS X, there are no errors.  But
15028 +downloads still don't work; lots of errors but the pattern is different.
15029 +Using a very small buffer:
15030 +
15031 +  Retry 0: Bad CRC
15032 +  Retry 0: Garbage count exceeded
15033 +  Retry 0: Garbage count exceeded
15034 +  Retry 0: Got TIMEOUT
15035 +  Retry 0: TIMEOUT
15036 +  Retry 0: Bad CRC
15037 +  Retry 0: Bad CRC
15038 +  Retry 0: Garbage count exceeded
15039 +  Retry 0: Garbage count exceeded
15040 +  Retry 0: TIMEOUT
15041 +  Retry 0: Got ERROR
15042 +  Retry 0: TIMEOUT
15043 +  Retry 0: Garbage count exceeded
15044 +  Retry 0: Garbage count exceeded
15045 +  Retry 0: Bad CRC
15046 +
15047 +Using a bigger buffer:
15048 +
15049 +  Retry 0: Garbage count exceeded
15050 +  Retry 0: Garbage count exceeded
15051 +  Retry 0: Garbage count exceeded
15052 +  Retry 0: Garbage count exceeded
15053 +  Retry 0: Garbage count exceeded
15054 +  Retry 0: Garbage count exceeded
15055 +  (several screensful)
15056 +
15057 +Various other combinations... Nothing seems to work.
15058 +
15059 +Insight: telnetd does exactly what we want to do, sort of.
15060 +But it uses TIOCPKT, so every time it reads from pty, it receives
15061 +one control byte and then the data bytes, which would complicate our
15062 +buffering scheme considerably.  Anyway the TIOCPKT ioctl() fails on
15063 +Mac OS X with 14 "Bad address".
15064 +
15065 +Also see: snoopserver.c (found in Google).  It seems to do things in a
15066 +slightly different way -- it sets stdout to raw and then dups it to the
15067 +slave side of the pty?
15068 +
15069 +Maybe it's a mistake to use the ckupty.c routines.  They are designed for
15070 +creating and accessing an interactive session.  Maybe just copy one of the
15071 +other programs.
15072 +
15073 +18 Jan 2007.  Tried going back to blocking rather than nonblocking reads
15074 +to see if it would make a difference, after all the other changes.  Nope.
15075 +OK, let's look at some of these other programs...
15076 +
15077 +snoopserver.c.  I don't know exactly what this is or where it's from or what
15078 +platform it runs on and there are no comments to speak of, but it does
15079 +approximately what ttptycmd() does.  To get a pty it uses openpty():
15080 +
15081 +  if (openpty(&pty, &tty, NULL, NULL, NULL) == -1)
15082 +
15083 +then creates a fork.  In the fork, it closes the pty (master) and
15084 +manipulates the modes of the tty (slave), dups tty to be stdio, and then
15085 +doex execv() on the command.  Meanwhile the upper fork closes the tty
15086 +(slave), gets the attributes of stdin, using atexit() to have them
15087 +automatically restored on exit.  Then it sets stdin to raw mode and enters
15088 +the select() loop on stdin, the pty master, and the net.  It uses regular
15089 +blocking reads.  It does not use TIOCPKT or anything like it.
15090 +
15091 +openpty() is supported on: Linux, Mac OS X, NetBSD, FreeBSD, ...
15092 +openpty() is NOT supported on: Solaris, HP-UX, ...
15093 +
15094 + 1. Try copying the pty code, but keep everything else the same.
15095 +
15096 +I did this; it compiles and starts OK, upper fork (ttptycmd) debug log shows
15097 +no errors, but nothing happens.  Logs show that the Kermit program that is
15098 +started in the subfork seems to die as soon as it reaches eof on its init
15099 +file.  The good news, at least, is that select() doesn't report report that
15100 +the pty is ready to be read.  Clearly the file descriptors aren't being
15101 +assigned as expected, or as before.
15102 +  
15103 +In ckupty.c getptyslave() dup2's the slave fd to 0 and 1.  The new code
15104 +does exactly the same thing.  Debug log makes it look like the forked kermit
15105 +is not receiving its command line.  But now I'm not even sure that the
15106 +forked kermit started at all.  ps from another terminal doesn't show it.
15107 +
15108 +19 Jan 2007: Noticed that in snoopserver, the select() calls use standard
15109 +input and output file descriptors, rather than the pty master.  Made that
15110 +change...  In doing that I had to look at every file descriptor in every
15111 +line of code and discovered a couple mistakes, fixed them, put back the
15112 +original code but with the fixes, tried it, but no change; can upload OK but
15113 +still can't download with Zmodem without lots of errors and ultimate
15114 +failure.  Going back to the alternative version and trying to get the the
15115 +file descriptors sorted out, now it appears that the external Kermit program
15116 +never even starts in the lower fork.  After a bit more fiddling I sort that
15117 +out, but now when the lower Kermit program goes to open "/dev/tty" it gets
15118 +errno 6 "Device not configured".  Forcing it to use stdio with "-l 0", it
15119 +gets past this and actually sends its first packet.  But the Kermit on top
15120 +reads nothing from the pty.
15121 +
15122 +Next, I change the pty fd from STDIN_FILENO and STDOUT_FILENO to slavefd.
15123 +No difference.  Next I comment out the dup2() calls.  This time I get some
15124 +action.  The transfer starts, but only one packet comes.  Log shows that
15125 +the lower Kermit sends its S packet.  The upper Kermit receives the ACK
15126 +but the lower Kermit never gets it.  The write to the pty succeeds, no
15127 +error.  Different combinations give different results.  If write to master
15128 +and read from the slave, I get packets in both directions but tons of
15129 +errors....  This happens only if I comment out the dup2()'s.
15130 +
15131 +25 Jan 2007: After leaving it sit for a while, and realizing that what I'm
15132 +trying to do has to be possible because so much other software does the same
15133 +thing (e.g. Telnet servers), I put things back to how they were originally
15134 +-- the upper fork (Kermit) uses the master and the lower fork the slave.
15135 +The upper fork puts the master in raw mode, the lower fork puts the slave in
15136 +raw mode.  The lower fork dup2's the slave fd to stdin/out.  Send file in
15137 +remote mode using external Kermit: works OK but select() times out at the
15138 +end.  This means that the self-contained pty code in ttptycmd() is sorted
15139 +out -- all the file descriptors go to the right place, etc, and now we can
15140 +use this routine as a testbed, rather than the original ckupty.c-based one.
15141 +
15142 +But send with lsz, csz, and regular rz: Nothing happens, times out after 0
15143 +bytes of i/o.  Once again, Kermit works, Zmodem doesn't.  The reason for
15144 +running Zmodem in a pty is so its i/o will work as it does on a terminal,
15145 +no matter how it may fiddle the file descriptors.  So why don't we see a
15146 +single byte come out?
15147 +
15148 +Commenting out pty_make_raw(), I get a successful Zmodem send using lsz.
15149 +csz manages to get the filename across, but then gets stuck.  regular sz, on
15150 +the other hand, works perfectly.  Testing csz by itself (not under Kermit),
15151 +I see it fails in exactly the same way ("Got phony ZEOF", etc).  OK, forget
15152 +crzsz.
15153 +
15154 +OK, let's move to local mode over a Kerberized Telnet connection...
15155 +Uploading (sending) with external Kermit protocol... works.
15156 +Downloading (receiving) with external Kermit protocol... works.
15157 +Uploading with sz... works.
15158 +Downloading with lrz...  Gets tons of errors and fails.
15159 +
15160 +Running pty_make_raw() on the slave but not on the master: no difference.
15161 +Running pty_make_raw() on the master but not on the slave: no difference.
15162 +
15163 +Back where we started...  Either:
15164 +
15165 + . Zmodem is overdriving the pty, no matter what modes we put it in.  
15166 + . It's a transparency problem.
15167 +
15168 +Theoretically we should be able to test these by using different sz switches:
15169 +  -q:    quiet (should always use this)
15170 +  -e:    escape all control characters
15171 +  -B n:  Buffer n bytes (rather than whole file)
15172 +  -L n:  Packet length
15173 +  -l n:  Frame length (>= packet length)
15174 +  -w n:  Window size
15175 +  -4:    4K blocksize (doesn't help)
15176 +
15177 +-q by itself doesn't help.
15178 +-q -e, this one worked but still got about 100 errors and was very slow.
15179 +-q -e -l 200 -L 100, failed fast and bad.
15180 +-q -e -w 1.  Failed quickly.
15181 +-q -e -w 1 -B 100.  Eventually failed.
15182 +-q -w 1, Eventually failed.
15183 +-q -l 1024, this gets much more errors, definitely need -e.
15184 +-q -e -l 1024, got pretty far before failing.
15185 +-q -e -w 1 -l 1024, also got pretty far before failing.
15186 +-q -e, this one got farthest of all, about 48K, before getting errors.
15187 +
15188 +In the latter combinations that work somewhat better, we always get up to
15189 +16K, or 32K, or 48K, before the errors start coming out and piling up.
15190 +Sometimes the errors are recoverable and we receive as much as 300K
15191 +successfully before giving up.
15192 +
15193 +Now that we have data flowing pretty well (but not well enough), tried
15194 +reinstating pty_make_raw(), but it hurt more than helped.
15195 +
15196 +As a sanity check, I tried transferring from the same host over the same
15197 +kind of connection (Kerberized Telnet) directly to K95's built-in Zmodem
15198 +protocol, and that worked fine.  So the problem is definitely in the pty.
15199 +Or more precisely, where Kermit writes incoming net data to the pty master.
15200 +
15201 +26 Jan 2007: Tried changing the size of the net-to-pty buffer from 24K to
15202 +1K.  Result: total failure.  Set both buffers to 1K.  Still total failure.
15203 +Set both to 4K: now we get about 45K of data, then failure.  Put them both
15204 +back to 24K, still fails totally -- the same code that worked pretty well
15205 +yesterday.  Actually, no downloads work, not even Kermit, not even of
15206 +text files.
15207 +
15208 +27 Jan 2007: Since I have not been able to find a way to make ptys work for
15209 +this, I made a third copy of this routine, this time using pipes instead of
15210 +ptys.  The disadvantage here is that if the external protocol does not use
15211 +stdio, the pipes won't work, but one thing a time...
15212 +
15213 +Inferior Kermit starts in lower fork, but when it tries to send its first
15214 +packet it gets errno=9 EBADF, Bad File Descriptor.  Substituting G-Kermit as
15215 +the external protocol, which is simpler, reveals that the problem is that
15216 +the external protocol gets errors when it tries to manipulate the its stdio
15217 +file descriptors with ioctls, etc; these are not valid for a pipe.  The pipe
15218 +mechanism itself works.  If I take out the test for ttpkt() failing in
15219 +gkermit, the file transfer works OK.  Trying Zmodem... Sending works OK;
15220 +receiving works a lot better than with ptys (it got 360K into the file
15221 +before failing).  Making the buffers smaller, doesn't help.
15222 +
15223 +I'm starting to wonder if the problem might be in my buffering code, rather
15224 +than in the pty or pipe interface...  Try making a version that does
15225 +single-character reads and writes.
15226 +
15227 +This one reads the first packet from the lower Kermit and sends it.  It is
15228 +recognized by the other Kermit, which sends an ACK.  We see the ^A of the
15229 +ACK, but then select() times out on the next character -- OF COURSE: because
15230 +at a lower level, it has already been read.  We have to check the myread
15231 +buffer, and then call select() only if it's empty.  Making this change:
15232 +
15233 + . SEND with G-Kermit works (but very slowly).
15234 + . SEND with lsz works but gets a lot of errors, eventually succeeds.
15235 +
15236 +Let's work our way back...  With the same changes to the buffered pipe version:
15237 +
15238 + . SEND with G-Kermit/streaming works (fast).
15239 + . SEND with lsz works too (fast), but we get gubbish at the end.
15240 + . RECEIVE with Kermit fails because "/dev/tty is not a terminal device".
15241 + . RECEIVE with rsz... lots of errors ("garbage count exceeded") but succeeded.
15242 +
15243 +But maybe now we're seeing pipe artifacts, so going back one more step to
15244 +the version that gets its own pty and starts its own fork:
15245 +
15246 + . SEND with G-Kermit/Streaming works (fast) but select() times out at the end.
15247 +
15248 +Another breakthrough: Moved the write pieces to below the read pieces.  This
15249 +is what was preventing the buffer reset code from working -- with the writes
15250 +done before the reads, we never catch up and can never reset the buffers.
15251 +
15252 + . SEND with G-Kermit/streaming works (fast) (but there's a pause at the end)
15253 + . SEND with lsz works (fast) (but there's a pause at the end)
15254 + . RECEIVE with rsz... lots of errors ("garbage count exceeded") and fails.
15255 + . RECEIVE with Kermit -- nothing happens (it thinks it succeeded), then we
15256 +     reconnect, terminal sees S packet and goes into autodownload
15257 +
15258 +From the log it looks like ttpkt() fails in the lower Kermit.  Switching
15259 +this with the hacked G-Kermit...  it gets "transmission error on reliable
15260 +link".  Tried again with real Kermit below, this time with "-l 0" and not
15261 +streaming.  This was actually working, but slowly, I don't see any NAKs in
15262 +the packet log, but then select() timed out.
15263 +
15264 +28 Jan 2007: Restored both the calls to pty_make_raw():
15265 +
15266 + . SEND with C-Kermit streaming works, but slow (54Kcps)
15267 + . Ditto, but with debugging off -- hangs forever.
15268 + . Ditto, but using G-Kermit instead of C-Kermit -- also hangs forever.
15269 +
15270 +Backed off on calling pty_make_raw().  Same thing.
15271 +Reduced size of net-to-pty buffer.  Same thing.
15272 +
15273 +15 Feb 2007...  Decided to give up on this and publish it as is, in hopes
15274 +that somebody with more experience with ptys can make it work, because I'm
15275 +just going in circles.  So today I just have to get the code into shape so
15276 +people could choose among the three alternative routines.  The second one,
15277 +yttyptycmd(), is the one that uses openpty(), which is not portable, so it
15278 +can be enabled only for Mac OS X, NetBSD, FreeBSD, and Linux, or by also
15279 +defining HAVE_OPENTPY at compile time.  Anyway, if you build Kermit in the
15280 +normal way, you get the regular behavior -- ttruncmd() is used to execute
15281 +external protocols.  If you build it with -DXTTPTYCMD, you get the first
15282 +version of ttptycmd(); with -DYTTPTYCMD the second, and with -DZTTPTYCMD the
15283 +third.
15284 +
15285 +(Then some interruptions, then...)
15286 +
15287 +From Jeff, fix hostname comparison in X.509 certificate checking to work
15288 +right in the case of names that contain no periods.  dNSName_cmp(): cl_ssl.c,
15289 +21 Feb 2007.
15290 +
15291 +John Dunlap noticed some strange behavior when transferring files between
15292 +home base and the EM-APEX oceanographic floats via satellite... long story,
15293 +but every so often the transfer would get stuck for a long time, and it
15294 +happened only when C-Kermit was sending a file and received two or more
15295 +packets (Ack or Nak) back to back from the float.  Years ago I added some
15296 +lookahead code to ttinl() to clear the input buffer of any interpacket junk
15297 +so that, in the windowing case, we wouldn't be tricked next time around into
15298 +thinking a packet was waiting to be read when there wasn't.  The code, which
15299 +has been there for a while, was a bit fractured; luckily, it would be
15300 +executed only when the debug log was active so it didn't have much effect.
15301 +The problem was that if the SOP came immediately after the EOP, it could be
15302 +missed because the loop read the next character before checking the current
15303 +one.  Fixed by rearranging the loop.  Also I changed it so it would execute
15304 +in all cases, not only when the debug log was active.  Also, cleaned up a
15305 +bunch of confusing #ifdefs and removed some chunks that had been commented
15306 +out for years, decades maybe.  ttinl(): ckutio.c, 21-22 Feb 2007.
15307 +
15308 +Added NOW keyword info to HELP DATE, plus a tip about how to convert to UTC;
15309 +suggested by Arthur Marsh.  ckuus2.c, 22 Feb 2007.
15310 +
15311 +When an FTP client sends NLST to the server and no matching files are found,
15312 +the server is supposed to respond with an error message on the control
15313 +channel and nothing on the data channel.  However it seems that at least one
15314 +server sends the error message back on the data channel, as if it were a
15315 +filename ("/bin/ls: blah: No such file or directory"), and on the control
15316 +channel there is no error indication ("226 ASCII Transfer complete").  At
15317 +this point remote_files() has a listfile and, if a match pattern was given,
15318 +it looks through list to see if any of the lines match the given filename,
15319 +e.g. "blah".  This makes FTP CHECK give false positives.  The problem
15320 +(diagnosed by Jeff) is that the match pattern was not given in this case, so
15321 +it takes some random default action, resulting in the spurious success
15322 +return.  Fixed by using the user's string as the pattern.  Not tested,
15323 +however, since I don't have access to a server that behaves this way.
15324 +ckcftp.c, 22 Feb 2007.
15325 +
15326 +If an external-protocol file transfer fails, don't print Kermit-specific
15327 +hints.  ckuus5.c, 22 Feb 2007.
15328 +
15329 +One more time with ttinl().  Got rid of the "csave" junk, which never could
15330 +have worked (which is no doubt why it was in a debugging section).  The
15331 +problem was that saving the beginning of the next packet locally did not
15332 +synchronize with the buffer clearing (ttflui()) done at a higher level,
15333 +between calls to ttinl().  So now, the lookahead code, if it finds the
15334 +beginning an as-yet unread packet, puts it back at the head of the input
15335 +queue.  This way, if the protocol engine clears the input buffer, it will
15336 +get the whole packet, not just the part after the SOH.  ckutio.c, 24 Feb 2007.
15337 +
15338 +From Steven M Schweda, Saint Paul, MN: adaptation of large file support to
15339 +VMS (it was already possible to transfer large files in VMS C-Kermit but the
15340 +file-transfer display and statistics were wrong).  And a minimal adaptation
15341 +of the FTP client to VMS -- no RMS, no special VMS file stuff, Stream_LF and
15342 +binary files only, developed and tested only with UCX.  SSL/TLS is
15343 +supported.  The source-code changes are minimal; most have nothing to do
15344 +with VMS, but with header files, prototypes, and data types (e.g. ftp_port
15345 +int rather than short, various signed/unsigned conflicts) to shut up
15346 +compiler warnings.  Some of these could be dangerous in terms of
15347 +portability; I've marked them with /* SMS 2007/02/15 */.  ckcfns.c,
15348 +ckcnet.h, ck_ssl.h, ckuus3.c, ckuus4.c, ckvfio.c, ckcftp.c, ckvker.mms
15349 +(which was rewritten to actually reflect the source module dependencies),
15350 +ckvker.com (also heavily modified).  ckvker.com (the "makefile" for VMS
15351 +C-Kermit) now indludes "F" and "I" option flags for the large File and
15352 +Internal ftp features, plus better handling of Vax/Alpha/IA64 distinction.
15353 +26 Feb 2007.
15354 +
15355 +Changed NetBSD targets to include -DHAVE_OPENPTY and -lutil, so they
15356 +can use openpty().  makefile, 26 Feb 2007.
15357 +
15358 +Built on Solaris without and with SSL OK.
15359 +Built on NetBSD with Kerberos 5, OK.
15360 +Built on Mac OS X 10.4, regular version, OK.
15361 +Built on Mac OS X 10.4 with SSL and Kerberos 5, OK.
15362 +
15363 +On VMS 7.2-1/Alpha with MultiNet 4.4A-X...
15364 +
15365 +'CC' 'CCOPT' KSP:ckuus3
15366 +%DCL-W-TKNOVF, command element is too long - shorten
15367 + \CKUUS4.OBJ "'CC' 'CCOPT' KSP:ckuus4" "KSP:ckuus4.c KSP:ckcsym.h KSP:ckcdeb.h
15368 + KSP:ckclib.h" "KSP:ckcasc.h KSP:ckcker.h KSP:ckcnet.h KSP:ckvioc.h"
15369 +"KSP:ckctel.h KSP:ckuusr.h KSP:ckucmd.h KSP:ckuver.h" "KSP:ckcxla.h
15370 + KSP:ckuxla.h KSP:ckcuni.h KSP:ckuath.h"
15371 +
15372 +The new rule for ckuus4.c was too long.  I removed one file from the
15373 +dependency list (ckcxla.h, which will probably never change again) and that
15374 +made it OK.  Built Nonet and Net versions OK, but this is without the new
15375 +stuff.
15376 +
15377 +"make f" (large-file support) on VMS 7.2-1...
15378 +'CC' 'CCOPT' KSP:ckuus4
15379 +                    if (CKFSEEK(fp,(CK_OFF_T)j,SEEK_CUR) != 0) {
15380 +........................^
15381 +%CC-I-IMPLICITFUNC, In this statement, the identifier "fseeko" is implicitly
15382 +declared as a function.
15383 +
15384 +Ditto for ftello and fseeko in various other places, and then fseeko and
15385 +ftello come up up undefined at link time.
15386 +
15387 +The rule for ckcftp in "make i" (Internal FTP support) had the same problem.
15388 +I removed ckcxla.h from its dependency list too, but "utime" comes up
15389 +undeclared at compile time and undefined at link time.
15390 +
15391 +Verdict: neither one of the two new features can be used in VMS 7.2 or
15392 +earlier, but the code still builds OK if you don't ask for them.
15393 +
15394 +VMS 8.3 on IA64...  Can't build anything:
15395 +%MMS-F-BADTARG, Specified target (WERMIT) does not exist in description file
15396 +
15397 +27 Feb 2007: Changed CKVKER.COM to keep all its dependencies but use a
15398 +shorter logical name (Steven M Schweda).  The problem on VMS 8.3 is that MMS
15399 +now supports case-sensitive file systems, and so it can't find anything.
15400 +Workaround: bypass MMS (include "m" in P1).  With this, "@ckvker.com ifm"
15401 +builds OK on HP Testdrive, but I can't test the new features since outbound
15402 +connections are not allowed there.  As for fseeko(), ftello(), and utime(),
15403 +they simply are not availble prior to VMS 7.3.  It would probably be a good
15404 +idea to test for this in CKVKER.COM, but actually it is possible to install
15405 +newer C's and CRTLs on older VMS versions, so don't stand in their way.
15406 +
15407 +28 Feb 2007: With additional chages from SMS, and then some further
15408 +adjustments, I was able to build the FTP version on VMS 7.2-1.  First I
15409 +tested it with GET of a binary file, but it transferred it in text mode.
15410 +After a few more attempts with PUT and GET, it crashed with "floating/decimal
15411 +divide by zero" in ckscreen, ckuusx.c line 27859.  Of course, that's the
15412 +listing line, not the source line, and I don't have a listing.
15413 +
15414 +To get a listing, I deleted CKUUSX.OBJ and then did:
15415 +
15416 +  $ make i "" "" "/LIST"
15417 +
15418 +Surprisingly, it recompiled everything.
15419 +
15420 +Anyway, the divide by zero happened in a section of code where the divisor
15421 +was not checked, but it was a section of code we should not have been
15422 +executing at all, since the file-transfer display was fullscreen, and this
15423 +was in the "brief" section.  Anyway, I added the needed check.  Again, it
15424 +recompiles everything.  Maybe there's no MMS on grumpy -- right, there isn't.
15425 +
15426 +ANYWAY... Try to GET a binary file like this:
15427 +
15428 +  binary
15429 +  ---> TYPE I
15430 +  200 Type set to I.
15431 +  get gkermit
15432 +  ---> TYPE A
15433 +  200 Type set to A.
15434 +  ---> SIZE gkermit
15435 +  550 gkermit: file too large for SIZE.
15436 +  GET gkermit (text) (-1 bytes)---> TYPE A
15437 +
15438 +Anyway... "get /binary gkermit" downloads it, seemingly correctly (the byte
15439 +count is right).
15440 +
15441 +But "put /binary gkermit.;1" results in a 0-length GKERMIT file being sent.
15442 +Here's the debug log:
15443 +
15444 +FTP PUT gnfile[DISK$MSA4:[C.FDC.NET]gkermit.;1]=1
15445 +ftp putfile flg[DISK$MSA4:[C.FDC.NET]gkermit.;1]=0
15446 +zltor fncnv[DISK$MSA4:[C.FDC.NET]gkermit.;1]=-1
15447 +FTP PUT nzltor[GKERMIT]
15448 +zfnqfp 1[DISK$MSA4:[C.FDC.NET]gkermit.;1]=675
15449 +zfnqfp 2[DISK$MSA4:[C.FDC.NET]GKERMIT.;1]=31
15450 +zfnqfp 3[DISK$MSA4:[C.FDC.NET]GKERMIT.;1]=31
15451 +zrelnam result 2[gkermit.;1]
15452 +ftp sendrequest restart[DISK$MSA4:[C.FDC.NET]gkermit.;1]=0
15453 +openi name[DISK$MSA4:[C.FDC.NET]gkermit.;1]
15454 +openi sndsrc=-1
15455 +openi file number=2
15456 +zopeni[DISK$MSA4:[C.FDC.NET]gkermit.;1]=2
15457 +zopeni fp=0
15458 +chkfn=2
15459 +chkfn return=0
15460 +zopeni fixed file format - using blk I/O
15461 +zopeni binary flag at open=1
15462 +zopeni ifile_bmode=1
15463 +zopeni binary=1
15464 +zopeni RMS operations completed ok
15465 +openi zopeni 1[DISK$MSA4:[C.FDC.NET]gkermit.;1]=1
15466 +ftpcmd cmd[PASV]
15467 +FTP SENT [PASV]
15468 +FTP RCVD [227 Entering Passive Mode (166,84,1,2,233,216)]
15469 +initconn connect ok
15470 +FTP SENT [STOR GKERMIT]
15471 +FTP RCVD [150 Opening BINARY mode data connection for 'GKERMIT'.]
15472 +doftpsend2 ftpcode[STOR]=150
15473 +
15474 +  Here is where the file is supposed to be read and sent but there is nothing
15475 +  in the log between the "doftpsend2 ftpcode" line and the following line.
15476 +
15477 +rftimer status=1
15478 +gftimer status 1=1
15479 +gftimer status 2=1409025
15480 +gftimer status 3=1409025
15481 +gftimer s[0.000000]
15482 +zclose n=2
15483 +chkfn=2
15484 +chkfn return=1
15485 +zclose ZIFILE RMS operations completed ok
15486 +ftp getreply lcs=0
15487 +ftp getreply rcs=-1
15488 +ftp getreply fc=0
15489 +FTP RCVD [226 Transfer complete.]
15490 +ftp getreply[226 Transfer complete.]=2
15491 +doftpsend2 ok=0
15492 +
15493 +Everything is OK up until we go to send the file, then it behaves as if we
15494 +got EOF immediately and so closes the data connection, and reports success;
15495 +an empty copy of the file is left on the far end.
15496 +
15497 +Starting over with a text file....  PUT LOGIN.COM gets another divide by
15498 +zero.  But it happened in the code I just fixed, which is impossible.  Swell.
15499 +I recompiled everything and this time the upload worked, and downloading it
15500 +again worked too.
15501 +
15502 +But a binary file still can't be uploaded.  Trying to upload a text file
15503 +after doing this seems to succeed (reports the right number of bytes sent)
15504 +but nothing appears on the far side.
15505 +
15506 +SUMMARY:
15507 +
15508 +  To download a text file: GET /ASCII blah.txt    (/ASCII is optional)
15509 +  To download a binary file: GET /BINARY blah.bin (/BINARY is required)
15510 +  To upload a text file: PUT blah.txt             (/ASCII switch not needed)
15511 +  To upload a binary file: PUT /BINARY blah.bin   (doesn't work)
15512 +
15513 +Problems:
15514 +  . Why doesn't BINARY "stick"?
15515 +  . Why don't binary uploads work?
15516 +
15517 +The culprit seems to be the VMS version of zxin().  In the FTP module,
15518 +zxin() is called only when sending binary files.  In VMS, zxin() is just
15519 +a front end for C-Library fread().  It probably needs to do just do
15520 +zminchar() in a loop, like binary mode does, but calling zzout instead
15521 +of xxout.  Or something like that.  FINISH THIS TOMORROW (debug on grumpy).
15522 +
15523 +2 Mar 2007: New logs from John Dunlap.
15524 +
15525 +ema-1636-log-0175.dbg: C-Kermit uploads a short file. It receives an Ack for
15526 +the Z packet it just sent, tailgated by the beginning of a Nak for the next
15527 +packet.  When the second SOH is encountered, it is put back in the myread
15528 +queue.  Then the protocol engine, to which we return the Ack, says, "I have
15529 +the packet I wanted so I'm clearing the buffer", and away go the first two
15530 +bytes of the Nak from the myread buffer.  Then, having just received the Ack
15531 +of our Z packet, we send our B, and go to read the reply.  in_chk finds 0 in
15532 +the myread buffer (which we just cleared) and 6 waiting to be read from the
15533 +comms channel, which it does, obtaining the remaining 6 bytes of the Nak,
15534 +which it properly discards.  (The reason this is proper is that, having
15535 +already received the Ack for the last packet it sent, no Ack or Nak that
15536 +arrives subsequently -- in the non-windowing case -- could possibly affect
15537 +what it does next.)  Since it hasn't yet found a good packet, it keeps
15538 +reading, and now it finds the Ack to the B, as soon as it showed up.  This
15539 +is how it's supposed to work.  No time was lost because of anything that
15540 +C-Kermit did.
15541 +
15542 +ema-1636-log-0174.dbg: C-Kermit uploads a short file. It sends Data packet
15543 +#3 and receives the Ack followed immediately by the first 3 bytes of a Nak
15544 +for packet 4.  When it gets to the SOH of the second packet, it pushes it
15545 +back in the queue.  Again, input() flushes the input buffer (myread queue
15546 +and device buffer).  C-Kermit detects EOF on the file it is sending, and
15547 +sends the Z packet.  Then it reads the remaining bytes of the Nak,
15548 +which it discards, and then it finds the Ack for Z which comes in 23 seconds
15549 +later, sends the B, gets a Nak for the B, sends the B again, gets the Ack
15550 +for the B 4 seconds later, and done.  Again, it's working right and losing
15551 +no time.
15552 +
15553 +The question remains: what would happen if the protocol engine did not clear
15554 +the buffer?  Would ttinl() retrieve all packets in sequence even when they
15555 +come back to back?  To test this, I had C-Kermit send a file using 30 window
15556 +slots and observed the stream of Acks in the reverse direction:
15557 +
15558 +  HEXDUMP: mygetbuf read (16 bytes)
15559 +  01 25 23 59 2f 52 39 0d | 01 25 24 59 2b 26 31 0d  .%#Y/R9. .%$Y+&1.
15560 +  ttinl lookahead my_count=9
15561 +  ttinl lookahead removed=^M
15562 +  ttinl lookahead pushback SOP=^A
15563 +  HEXDUMP: ttinl got (7 bytes)
15564 +  01 25 23 59 2f 52 39    |                          .%#Y/R9
15565 +  RECEIVE BUFFERS:
15566 +  buffer inuse address length data type seq flag retries
15567 +     0     1     29212 9667     0   Y    3     0
15568 +  [\ 1%#Y]
15569 +  ...
15570 +  in_chk my_count=8
15571 +  ...
15572 +  ttinl lookahead my_count=1
15573 +  ttinl lookahead removed=^M
15574 +  HEXDUMP: ttinl got (7 bytes)
15575 +  01 25 24 59 2b 26 31    |                          .%$Y+&1
15576 +  RECEIVE BUFFERS:
15577 +  buffer inuse address length data type seq flag retries
15578 +     0     1     29212 9667     0   Y    4     0
15579 +  [\ 1%$Y]
15580 +
15581 +Here we can see that the pushed-back SOH was properly retrieved next time
15582 +around, and the tailgating Ack was not lost.  This scenario repeats itself
15583 +212 times in the log, and there are no screwups.
15584 +
15585 +Back to VMS FTP...  The problem with sending binary files is that zxin()
15586 +uses C-Library fopen()/fread() instead of RMS, so it can't access the input
15587 +file, which was opened by zopeni(), which is totally RMS-ified in VMS
15588 +C-Kermit.  For VMS only, I replaced the zxin() loop by a zminchar() loop
15589 +like the one used in text mode, except without the character set or
15590 +record-format conversion.  Tested by PUT /BINARY of some binary files, which
15591 +worked fine.  ckcftp.c, 2 Mar 2007.
15592 +
15593 +Next problem...  VMS C-Kermit ftp client sending binary files in text mode.
15594 +Variation 1: We just send the file.  zopeni() is supposed to detect that
15595 +it's a binary file and automatically set the mode.  And it does:
15596 +
15597 +  zopeni fixed file format - using blk I/O
15598 +  zopeni binary flag at open=0
15599 +  zopeni ifile_bmode=1
15600 +  zopeni binary=0
15601 +  zopeni autoswitch from TEXT to BINARY
15602 +  zopeni RMS operations completed ok
15603 +
15604 +but then in gnfile():
15605 +
15606 +  if (!server || (server && ((whatru & WMI_FLAG) == 0)))
15607 +    binary = gnf_binary;       /* Restore prevailing transfer mode */
15608 +
15609 +Well, since VMS sets text/binary mode automatically when sending files,
15610 +this code can (and should) be skipped in VMS.  gnfile(): ckcfns.c, 2 Mar 2007.
15611 +
15612 +Variation 2: BINARY or SET FILE TYPE BINARY doesn't force binary mode.  But
15613 +SET FTP TYPE BINARY does.  But BINARY does indeed call doftptyp() so what's
15614 +the problem?  We do indeed set ftp_typ to 1 but it gets reset somewhere
15615 +before we call zopeni().  But then zopeni() puts it back to 1.  Tracing
15616 +through a transfer, it looks like all of this works right, it's only that
15617 +the file transfer display says TEXT when the transfer is really in binary
15618 +mode.  This is because screen() is called before openi().  I wonder if we
15619 +can call scrft() from the ftp module...  No, that would be too easy.  OK,
15620 +sendrequest calls openi() and sets the file mode; putfile() calls
15621 +screen(SCR_FN), which prints the transfer mode.  But putfile calls
15622 +sendrequest() after it puts up the screen that says the file type.  So it
15623 +looks like sendrequest() has to call screen(SCR_FN) again if it changes the
15624 +file type.  OK, that did it.  ckuusx.c, ckcftp.c, 2 Mar 2007.
15625 +
15626 +The BINARY and TEXT (ASCII) commands do not inhibit automatic type switching
15627 +in VMS.  They don't in Unix either.  They never have.  Should they?  I think
15628 +so, otherwise what good are they?  Plus we want the Kermit FTP client to
15629 +behave like the others.  I added code for this but it doesn't work, due to
15630 +the layers and layers of text/binary detection and switching and
15631 +if-this-but-then-if-that...  Anyway, no harm done.  The normal rule is:
15632 +when you PUT a file, Kermit figures out on a per-file basis whether to use
15633 +text or binary mode unless you include a /TEXT (/ASCII) or /BINARY switch
15634 +in the PUT (or MPUT) command.  ckuus[r3].c, ckcftp.c, 2 Mar 2007.
15635 +
15636 +Wed Mar 7 16:21:13 2007 WROTE SHORT TEST PROGRAM for ttruncmd (the openpty
15637 +version) on Mac OS X.  On dulce: ~/kermit/ttpty.c / ttpty.sh.  It starts the
15638 +external protocol in the lower fork.  The command to run is a command-line
15639 +argument.  Sending and receiving files with Kermit works OK.  But again, the
15640 +standalone program totally fails when I use sz or lsz as the external
15641 +protocol.  So it looks like we can rule out any environmental effects of
15642 +running the code inside C-Kermit.
15643 +
15644 +Mon Mar 12 16:52:20 2007: Put some effort into making ttpty.c more useful;
15645 +added a debug log.  Found that for some reason, at least on Mac OS X,
15646 +select() always timed out at the the end.  I added a SIGCHLD alarm and that
15647 +seems to handle the fork exit condition very nicely.  Now we can send (say)
15648 +a 3MB file at good speed on Ethernet (1Mcps) considering the debugging, etc,
15649 +and it terminates instantly.  But when sending a file into ttptycmd (with
15650 +"gkermit -r"), things go wrong at the end -- the Z packet is never
15651 +acknowledged.  This is reproducible.  Maybe this is a good lead....  The log
15652 +shows that select() timed out, even though the gkermit fork had not yet
15653 +exited (or finished).  It looks like gkermit sent the Ack, ttpty.c read it
15654 +from the pty and sent it out the net:
15655 +
15656 +  0003: read pty=8                <-- read Ack from pty
15657 +  0003: loop top have_pty=1
15658 +  0003: loop top have_net=1
15659 +  0003: FD_SET pty_in
15660 +  0003: FD_SET ttyfd in
15661 +  0003: FD_SET ttyfd out=8
15662 +  0003: nfds=5
15663 +  0003: select=1
15664 +  0003: FD_ISSET ttyfd out
15665 +  0003: write net=8               <-- send ack to net
15666 +  0003: loop top have_pty=1
15667 +  0003: loop top have_net=1
15668 +  0003: FD_SET pty_in
15669 +  0003: FD_SET ttyfd in
15670 +  0003: nfds=5
15671 +  0009: select=0
15672 +  0009: select timeout - have_pty=1
15673 +
15674 +But Ack never arrived.  This is a streaming transfer.  But nope, streaming
15675 +is not the problem.  If I disable streaming ("gkermit -Sr"), we hang in in
15676 +the middle of sending the data.  If I use small packets, we don't hang:
15677 +1000 is OK, 2000 is not.  In fact, the cutoff is 1024.  OK, TBC...
15678 +
15679 +Wed 14 Mar 2007: Receiving a file thru ttpty "gkermit -e 1200 -Srd"
15680 +produces a debug log that shows that gkermit gets a lot of EAGAIN errors
15681 +when it tries to read from its stdin.  In fact, it takes 6 tries (read()
15682 +calls) to read the S packet (27 bytes).  Then when the first data packet
15683 +arrives (1200 bytes), read() never returns even one single byte.  The
15684 +timeout interval is 15 seconds and it times out repeatedly.  Added a
15685 +primitive hex dump to the ttpty debug log for each read/write (showing only
15686 +the first 24 characters and the last character, so it fits on one line).
15687 +Tried uploading a file.  The S, F, and A packets (short) are received and
15688 +Ack'd OK, but then ttpty select() times out, never receiving even one byte
15689 +from the D packet.  Clearly, when the pty driver receives a burst of > 1K
15690 +bytes, stops working.  As before, if I limit the packets to < 1K, it works
15691 +fine.
15692 +
15693 +Can I send an 8-bit binary file?  Nope.  ttpty reads the binary data just
15694 +fine from the net and writes it exactly as it was received to the pty, but
15695 +the first time we write an 8-bit byte, we never hear back from the PTY
15696 +again.  But the log shows that when the initial 7-bit packets from the pty,
15697 +it looks like the PTY is not in rawmode, because these packets end with ^J
15698 +rather than ^M.  Calling pty_make_raw() on the masterfd and slavefd
15699 +explicitly, however, doesn't change anything.  It doesn't matter if I do
15700 +this in the lower fork or the upper fork.  So maybe it's the actual
15701 +semantics of pty_make_raw() that are wrong.
15702 +
15703 +Thu 15 Mar 2007: Went thru all the terminal mode flags in Mac OS X; didn't
15704 +help.  Changed hex dump to show whole packet.  Put hex dump routine in a
15705 +private copy of G-Kermit.  Tried to transfer an 8-bit file, logging both
15706 +ttpty and gkermit.  Compared what ttpty received on stdin with what it sent
15707 +to the pty (same) and what was received by G-Kermit (same).  Then I realized
15708 +that my little test program was not putting its controlling terminal into
15709 +raw mode; when I did that, I could upload binary files (streaming, 2MB/sec).
15710 +And with Zmodem too (with rz; lrz doesn't work for some reason).  Looking
15711 +back at the original in ckutio.c, I see that ttptycmd() never called
15712 +ttpkt().  Maybe that was the trouble all along.  (Yup, but maybe not the
15713 +whole trouble.)
15714 +
15715 +Moving back to C-Kermit and the original ttptycmd() routine, adding the call
15716 +to ttpkt(), and stripping out a lot of cruft, and moving the pty_make_raw()
15717 +code to ckupty.c, Kermit uploads and downloads (streaming) work fine in
15718 +Solaris.  Zmodem sends a file, but then the transfer hangs at the very end,
15719 +as if the signoff protocol were lost.  This happens on Solaris.  If I move
15720 +back to Mac OS X, everything works just fine.  Then, making a Kerberized
15721 +connection from the Mac to NetBSD, I can send files from the Mac with both
15722 +Zmodem and Kermit.  Receiving...  Kermit OK.  Zmodem...  Nope.  "rz:
15723 +Persistent CRC or other ERROR" (and created a 265MB debug.log!)
15724 +
15725 +Fri 16 Mar 2007: ttptycmd() was for sending files with Zmodem across
15726 +encrypted connections.  But it occurred to me that it's necessary for
15727 +clear-text connections too; e.g. Telnet, where 0xff has to be doubled.  Of
15728 +course Zmodem doesn't do that itself, so there's no way Zmodem external
15729 +protocol could work when executed over a Telnet connection, and in fact
15730 +it doesn't.  I wonder why I ever thought it did.
15731 +
15732 +Wed 21 Mar 2007: Back to where we left off a week ago.  Trying C-Kermit's
15733 +ttptycmd() on the Mac again, in remote mode:
15734 +
15735 + . G-Kermit send txt (kst): OK  832Kcps  
15736 + . G-Kermit recv txt (kr):  OK  425Kcps  
15737 + . G-Kermit send bin (ksb): OK 1000Kcps  
15738 + . G-Kermit recv bin (kr):  OK  188Kcps  
15739 +
15740 +And Zmodem:
15741 +
15742 + . sz txt (zst): OK  563Kcps  
15743 + . sz bin (zsb): OK  714Kcps  
15744 + . rz txt (zr):  OK  863Kcps  
15745 + . rz bin (zr):  OK  198Kcps  
15746 +
15747 +So in remote mode, everything works.  Now let's try a clear-text Telnet
15748 +connection...
15749 +
15750 + . G-Kermit send txt (kst): OK  841Kcps
15751 + . G-Kermit recv txt (krt): OK  391Kcps
15752 + . G-Kermit send bin (ksb): OK  811Kcps
15753 + . G-Kermit recv bin (krb): OK  171Kcps
15754 +
15755 +And Zmodem over the same clear-text telnet connection:
15756 +
15757 + . sz txt (zst): OK  91Kcps (*)
15758 +
15759 +Kermit is sending sz messages like "sz 3.73 1-30-03 finished." to the
15760 +host, which tries to execute them, after the transfer is finished.
15761 +Of course "sz" is a command, but:
15762 +
15763 +  sz: cannot open 3.73: No such file or directory
15764 +  sz: cannot open 1-30-03: No such file or directory
15765 +  sz: cannot open finished.: No such file or directory
15766 +
15767 +Did I lose that code that dis-redirects stderr when I went back to using the
15768 +pty code from the ckupty module?  No, it's there and it's being executed.
15769 +Apparently the copy of sz I have is writing its "finished" message to stdout
15770 +because "sz blah 2> /dev/null" does not suppress it.  Starting again with
15771 +lsz instead of sz:
15772 +
15773 + . sz txt (lzst): OK  413Kcps
15774 + . sz bin (lzsb): OK  FAILED (*)
15775 + . rz txt (lzrt): OK  
15776 + . rz bin (lzrb): OK
15777 +
15778 +(*) Sigh.  Using lsz, we get "garbage count exceeded" errors and eventual
15779 +failure.  But using regular sz, we get the extraneous message that starts
15780 +sz on the far tend, and the resulting getty babble.
15781 +
15782 +But even without changing the code, it will work one minute, and then fail
15783 +consistently the next.  For example, I was able to send files with sz
15784 +successfully over and over, but with the getty babble at the end.  Then,
15785 +after trying lsz and then going back to sz, every attempt at sending a file
15786 +quits with "Got ZCAN".  The difference has to be that Kermit always does at
15787 +least some minimal encoding of C0/C1 control characters such NUL and DEL and
15788 +IAC, and I doubt that Zmodem does.
15789 +
15790 +http://zssh.sourceforge.net/ says:
15791 +
15792 +  If file transfer is initiated but never completes (ie a line like :
15793 +
15794 +     Bytes Sent:      0/    513   BPS:0        ETA 00:00  Retry 0: Got ZCAN
15795 +
15796 +   can be seen, but transfer never completes), chances are the pty/tty on one
15797 +   of the systems are not 8-bit clean.  (Linux is 8-bit clean, NetBSD is not).
15798 +   Using the -e (escape) option of rz should solve this problem.
15799 +
15800 +It doesn't, at least not with lrz.  And yes, the receiving end happens to be
15801 +NetBSD.  But it looks like the zssh people have been down this road too.
15802 +
15803 +But with rz and sz, it worked.  Once.  Twice.  Three times.  But of course,
15804 +with the getty babble at the end.  This can be taken care of by doing:
15805 +
15806 +  rz -eq ; cat > foo
15807 +
15808 +which puts "sz 3.73 1-30-03 finished" and any other messages in foo (but you
15809 +have to type ^D to finish the cat).  Using this method I was also able to
15810 +send an 8K binary file that contained a test pattern of all 256 possible byte
15811 +values.  Then I tried a 3MB binary executable.  All OK.  So here we go again:
15812 +
15813 + . sz txt (zst): OK
15814 + . sz bin (zsb): OK
15815 + . rz txt (zrt): 
15816 + . rz bin (zrb): 
15817 +
15818 +Downloading fails about halfway through a fairly large file.  I tried an
15819 +even bigger file, guaranteed to be 100% ASCII; same thing -- halfway
15820 +through: "rz: Persistent CRC or other ERROR".  But it worked with a smaller
15821 +version of the same file (82K versus 2MB).  Tried again with the bigger
15822 +version, it failed in exactly the same way at exactly the same spot: byte
15823 +number 1048320.  But this is just ASCII text so it can't be a transparency
15824 +problem.  Substituting another plain ASCII file of the same size but totally
15825 +different contents, it doesn't fail (2.36MB).  Back to the previous file, it
15826 +fails again, but in a different spot (832960).  So it's not totally
15827 +deterministic.
15828 +
15829 +To round things out, I tried downloading the binary test-pattern file; it's
15830 +only 8K.  This failed.
15831 +
15832 +  -4, --try-4k                go up to 4K blocksize
15833 +  -B, --bufsize N             buffer N bytes (N==auto: buffer whole file)
15834 +  -e, --escape                escape all control characters (Z)
15835 +  -E, --rename                force receiver to rename files it already has
15836 +  -L, --packetlen N           limit subpacket length to N bytes (Z)
15837 +  -l, --framelen N            limit frame length to N bytes (l>=L) (Z)
15838 +
15839 +Tried again with "sz -L 256 -B 256 -4aeq".  Doesn't change anything.
15840 +
15841 +NOTE: Mac OS X rz 3.73 1-30-03 does not support -e.
15842 +NetBSD rz 0.12.20 does support -e.
15843 +
15844 +Thu 22 Mar 2007: It occurs to me that ttpkt() might still be a problem;
15845 +maybe it's the network connection and not the pty that is not transparent
15846 +enough.  To test this theory I did "stty raw ; stty -a" and then copied all
15847 +of the flag values into ttpkt in the BSD44ORPOSIX section:
15848 +
15849 + . rz txt (zrt): OK (2.36MB file, worked 2 out of 3 times)
15850 + . rz bin (zrb): "rz: Persistent CRC or other ERROR"
15851 +
15852 +A little more fiddling with the flags and I got the 8K binary test pattern
15853 +to SEEM to download OK (in the sense that rz gave a 0 return code) but the
15854 +file itself was truncated, always at 224.  If I changed the test pattern
15855 +file to not include any bytes with value 224 (0xe0) or 255 (0xff), the
15856 +download worked.  So we have a transparency problem somewhere.  The debug
15857 +log shows that all byte values are being received from the network correctly
15858 +so the problem has to occur when we try to feed them to the pty.
15859 +
15860 +But no amount of twiddling with the termios flags seems to let these
15861 +characters pass through.  Of course, since they are not in the C0 or C1
15862 +control range, "sz -e" doesn't quote them (which it does by prefixing with
15863 +Ctrl-X and then adding 0x40 to the byte value so (e.g.) NUL becomes ^X@.
15864 +Note that 255 does not cause problems because it coincides with the IAC
15865 +character; the remote Telnet server doubles outbound IACs, and Kermit's
15866 +ttinc() undoubles them automatically (as the log shows).
15867 +
15868 +Trying to send a different file (a C-Kermit binary) shows that 255 is the
15869 +real killer; the file is truncated where the first one appears (at about
15870 +6K), even though some 224's precede it.  Going back to the remote-mode test,
15871 +I see the same thing happens with the binary test-pattern file, if I send it
15872 +from K95 direct to rz-under-C-Kermit-in-remote-mode.  So it has nothing to
15873 +do with C-Kermit having a network connection.  Yet if I send the same file
15874 +direct from K95 to rz, it goes OK and the result is not truncated, so it's
15875 +not Zmodem either.  The data arrives to C-Kermit intact, so the failure is
15876 +definitely in writing it to the rz process through the slave and master ptys.
15877 +
15878 +BUT if I send the same file from K95 to rz-under-ttpty, that works.  What's
15879 +the difference?  Suppose I just transplant ttpty literally into C-Kermit...
15880 +It makes no difference.  When receiving the test-pattern, it truncates it
15881 +in exactly the same place.
15882 +
15883 +Well, all this is on Mac OS X.  What if I move it to a different platform?
15884 +OK, building on Solaris and following the exact same procedure, ttptycmd()
15885 +doesn't even use the network connection.  I think that's because rzsz on
15886 +Solaris is hardwired to use the controlling terminal and can't be
15887 +redirected, even in a pty?
15888 +
15889 +Moved to NetBSD.
15890 +
15891 + . sz txt (zst): Failed ("Got ZCAN")
15892 + . sz bin (zsb): 
15893 + . rz txt (zrt): OK
15894 + . rz bin (zrb): 
15895 +
15896 +Well, this is a big mess.  Sending doesn't work (or sometimes it does but
15897 +reports that it didn't).  Receiving...  well, actually it's the same thing;
15898 +the file is completely transferred but then the final protocol handshake is
15899 +lost.  The local C-Kermit returns to its prompt, but rz is still running:
15900 +
15901 +  Retry 0: Got TIMEOUT
15902 +  Retry 0: TIMEOUT
15903 +  Retry 0: Got TIMEOUT
15904 +  Retry 0: TIMEOUT
15905 +  Retry 0: Got TIMEOUT
15906 +  Retry 0: TIMEOUT
15907 +  Retry 0: Got TIMEOUT
15908 +  Retry 0: TIMEOUT
15909 +  Retry 0: Got TIMEOUT
15910 +  Retry 0: TIMEOUT
15911 +  Retry 0: Got TIMEOUT
15912 +
15913 +I don't see how that is even possible.  Even after I exit from Kermit the
15914 +messages keep coming, even though ps doesn't show the rz process anywhere.
15915 +Looking at the code, I see a place where end_pty() was still commented out
15916 +from the ttpty.c episode, I uncommented it.  But still:
15917 +
15918 + . sz txt (zst): Fails ("Got ZCAN")
15919 + . sz bin (zsb): Fails instantly (but with no diagnostic)
15920 + . rz txt (zrt): OK
15921 + . rz bin (zrb): Fails with tons of "Bad CRC", "Gargage Count exceeded"
15922 +
15923 +Conclusion for the day: I think this is hopeless.  Even if I can get it to
15924 +work somewhere, the results depend on the exact Zmodem software, how it uses
15925 +stdin/out vs stderr versus getting its own nonredirectable file descriptor,
15926 +versus the Zmodem version on the other end and which options are available
15927 +on each, versus the pty and select() quirks on each platform, and on and on.
15928 +It will be so hard to explain and to set up that nobody would ever use it.
15929 +It would be better to just implement Zmodem internally.
15930 +
15931 +Fri 23 Mar 2007: Went back to the small test program, ttpty.c.  Tried
15932 +setting both the master and the slave pty to rawmode, even though I have
15933 +never seen any other software that did this.  I had it receive the binary
15934 +test pattern file; it worked.  I made a bigger test-pattern file, 3MB,
15935 +containing single, double, and triple copies of each byte in byte order and
15936 +in random order, this one was accepted too.
15937 +
15938 +So it would seem that the ckupty.c module is something to avoid after all.
15939 +It's full of stuff I don't understand and probably should not undo.  So
15940 +changing C-Kermit's ttptycmd() to manage its own pty again, using openpty()
15941 +(which is not portable), I got it all to work in remote mode: Kermit
15942 +text/binary up/down and Zmodem text/binary up/down.  But in local mode on
15943 +the client side of a Telnet connection...
15944 +
15945 +  zst: OK, but we still get the getty babble at the end that starts sz.
15946 +  zsb: OK, ditto.  This is with the 3MB test-pattern file.
15947 +  zrt: Not OK -- "Persistent CRC or other ERROR"
15948 +  zrb: Not OK -- got the cutoff at 224 again "Persistent CRC or other ERROR"
15949 +
15950 +It's close.  But actually this was still with USE_CKUPTY_C defined.  When I
15951 +undefined it, it was back to being totally broken.  Start over.  (Check the
15952 +new cfmakeraw() code.)
15953 +
15954 +Tue 27 Mar 2007: Starting over.  Back to ttpty.c.  Let's verify, VERY
15955 +CAREFULLY, that it really does work, using the most stressful of the four
15956 +tests: sending the big (3.2768MB) binary test pattern from K95 into rz
15957 +through ttpty, logging everything.  ttpty definitely receives the big file
15958 +smoothly with no errors or hiccups when I have it set to use the master side
15959 +of the pty for i/o.  The application program (Zmodem in this case) runs on
15960 +the slave, and the network and/or control program communicates with the
15961 +master.  This implies that Zmodem controls the terminal modes of the slave,
15962 +and ttpty should be concerned with those of the master.  Doing it this way
15963 +in ttpty confirms this.
15964 +
15965 +Fine.  But if I tell ttpty to SEND a file with sz, nothing happens.  Ditto
15966 +with lsz.  Select times out waiting for input from the pty.  But if I
15967 +manually tell K95 to RECEIVE /PROTOCOL:ZMODEM it works OK.  Somehow sz's
15968 +initial B000000 string is being swallowed somewhere, and it's waiting for
15969 +a reply from the receiver.  sigh...  But "ttpty gkermit -s filename" works
15970 +fine.  What's the difference?  It has nothing to do with stdout vs stderr;
15971 +sz is not writing to stderr at all.  Is it some timing thing between the
15972 +forks?  Aha.  It's that I change the modes of the pty master in one fork
15973 +while sz is already starting in the other fork.
15974 +
15975 +OK, good, now for the first time we have Kermit and Zmodem both able to
15976 +upload and download a large worst-case binary test-pattern file... in
15977 +remote mode.  Now taking today's lessons and fitting them back into
15978 +C-Kermit so I can try it local mode...
15979 +
15980 +Using G-Kermit as the external protocol, first in remote mode...  All good:
15981 +text/binary up/down.  The "halting problem" is solved by SIGCHLD, which
15982 +catches fork termination instantly and lets ttptycmd() know there is no more
15983 +pty.  Zmodem:
15984 +
15985 +  zst: OK
15986 +  zsb: OK
15987 +  zrt: OK
15988 +  zrb: OK
15989 +
15990 +That's a first.  Next, repeat in local mode, in which C-Kermit is the client
15991 +and has made a Telnet connection to another host over a secure (Kerberos V)
15992 +connection:
15993 +
15994 +  kst: OK     zst: ...
15995 +  ksb: OK
15996 +  krt: OK  
15997 +  krb: OK
15998 +  
15999 +It seems we can never end a day on a high note.  Somehow I seem to have
16000 +broken regular internal Kermit protocol transfers over encrypted connections
16001 +-- the en/decryption engine loses sync.  But they still work OK over a
16002 +clear-text Telnet connection.
16003 +
16004 +Today's code in ~/80/dulce.tar (27 Mar 2007).
16005 +
16006 +Added makefile target solaris10g+openssl.  Gathered all the standard CFLAGS
16007 +for Solaris into cdcdeb.h so they don't have to be included in every single
16008 +makefile target for Solaris.  On local Solaris 10 host OpenSSL is in
16009 +/opt/openssl-0.9.8e/.  Tried the new makefile target, works OK.  Also made
16010 +solaris10+openssl for Sun CC, but couldn't test it because I can't find any
16011 +Solaris 10 host that has Sun CC.  Built with gcc at another site that has
16012 +OpenSSL 0.9.8f-dev, all OK.  ckcdeb.h, makefile, 24 Jun 2007.
16013 +
16014 +It occurs to me that Kermit transfers on secure connections might have been
16015 +broken by the changes I made back in February to ttinl() for John Dunlap.
16016 +Here, for the first time, we invoke myunrd() to push a byte back into the
16017 +input queue, and there is also some funny business with "csave", which
16018 +changed, and which an old comment notes that it has to be treated specially
16019 +when encrypting.  So it could be that the broken Kermit transfer has nothing
16020 +to do with the work on external protocols, and that putting back the
16021 +previous ttinl() will fix it.  But now I can't seem to make a Kerberized
16022 +connection from Panix to Panix, even though I can make one from Columbia to
16023 +Panix.  This means I have to build a Kerberized binary from the current
16024 +source code on either Solaris or Mac OS X.  Trying Solaris
16025 +first... [~/solaris9k5/mk5.sh] This didn't work the first time due to
16026 +undefined krb5_init_ets, which is referenced if MIT_CURRENT is not defined
16027 +(it should be for Kerberos 5 1.05 and later and we have 1.42 here), tried
16028 +again with -DMIT_CURRENT=1...  Nope, that one totally blew up in ck_crp.c.
16029 +Later, Jeff says krb5_init_ets is a no-op in Kerberos 1.4.x and later,
16030 +so I added an #ifdef (NO_KRB5_INIT_ETS) for skipping it; now it builds and
16031 +runs OK.  ckuath.c, makefile, 9 Jul 2007.
16032 +
16033 +Meanwhile, using C-Kermit on Mac OS X, which makes the Kerberized connection
16034 +just fine, but still has the problem transferring files over it.  Packet log
16035 +shows:
16036 +
16037 +  s-00-01-^A9 Sz/ @-#Y3~Z! z0___F"U1@A^M 
16038 +  r-00-01-^A9 Y~/ @-#Y3~^>J)0___J"U1@I
16039 +  s-01-01-^A(!Fx.x)(V^M
16040 +  r-xx-08-<timeout>
16041 +  S-01-08-^A(!Fx.x)(V^M
16042 +  r-xx-08-<timeout>
16043 +  S-01-08-^A(!Fx.x)(V^M
16044 +  r-xx-16-<timeout>
16045 +
16046 +Note that S packet is sent, received, and Ack'd OK.  The F packet is sent but
16047 +is never Ack'd.  Tried this several times and noticed that it's just
16048 +receiving that is screwed up, not sending.  After ^C'ing out of the
16049 +transfer, I can still type commands, and they are executed on the far end,
16050 +but the results coming back are gibberish.  Mon Jul 9 16:08:22 2007 (come
16051 +back to this later... substitute Dev.27 ttinl for current one and see if
16052 +the problem goes away, and if so, conditionalize the new code for clear-text
16053 +connections).
16054 +
16055 +Built C-Kermit with Kerberos 5 on Solaris with a version of ckutio.c that
16056 +uses the old ttinl() and transferred a file OK over a Kerberized connection.
16057 +So now it's just a matter of reconciling the old and new ttinl.  The easiest
16058 +way to do this is to have new ttinl() chain to old ttinl() if the connection
16059 +is encrypted, which is what I did and it works fine.  At some point the two
16060 +versions of ttinl() should be reconciled.  ckutio.c, 12 Aug 2007.
16061 +
16062 +There was a function, islink(), used in only one place (ckuus6.c) that had
16063 +the same name as a commonly used scalar variable, and it was missing a
16064 +prototype.  Changed its name to isalink() and added the prototype (Unix
16065 +only), ckuus6.c, ckufio.c, ckcdeb.h. 12 Aug 2007.
16066 +
16067 +Revisiting the ASCII and BINARY top-level commands, which are supposed to
16068 +be like in other FTP clients, but don't seem to have any effect.  I added a
16069 +new routine to the FTP module, doftpglobaltype(), that sets the global,
16070 +sticky, permanent transfer mode (ASCII or BINARY) (TENEX could be added to
16071 +if anybody asks).  These commands (now that they work) are different from
16072 +SET FTP TYPE { ASCII, BINARY }, which set the *default* transfer mode when
16073 +automatic switching fails for a given file.  ckuusr.c, ckcftp.c, 12 Aug 2007.
16074 + (notify: Matt <mlist@cmcflex.com>)
16075 +
16076 +Even though the code hasn't changed, suddenly we're getting:
16077 +
16078 +  "ckuusx.c", line 5682: warning: implicit function declaration: tgetent
16079 +  "ckuusx.c", line 6183: warning: implicit function declaration: tgetstr
16080 +  "ckuusx.c", line 6262: warning: implicit function declaration: tputs
16081 +  "ckuusx.c", line 6266: warning: implicit function declaration: tgoto
16082 +
16083 +in ckuusx.c on Solaris 9.  <curses.h> is still in /usr/include, dated 2002.
16084 +A quick search shows the missing functions are hiding in <term.h>, which
16085 +until now was included only in Linux.  Added a USE_TERM_H clause.  No, that
16086 +doesn't help, the prototypes are not selected at compile time; there are
16087 +#ifdefs in that file that skip over these prototypes.  I had to put them in
16088 +the code under #ifdef BUG999..#endif (I could have used a longer name like
16089 +#ifdef ADD_PROTOTYPES_FOR_CURSES_FUNCTIONS, but that would not be portable).
16090 +ckuusx.c, 12 Aug 2007.
16091 +
16092 +Also:
16093 +
16094 +  "ckuusx.c", line 9232: warning: implicit function declaration: creat
16095 +
16096 +This is called in the IKSD dababase code, used for getting a lockfile.
16097 +creat() is a Unixism in code that is supposed to be portable.  But IKSD only
16098 +runs on Unix and Windows, so I assume the Windows C library has a creat()
16099 +function.  Anyway, suddenly the Solaris header files seem to have blocked
16100 +whatever path previously existed to the creat() prototype (which is in
16101 +<fcntl.h>), so I added an #include in the appropriate spot.  ckuusx.c,
16102 +12 Aug 2007.
16103 +
16104 +Kermit functions for converting the number base -- \fradix(), \fhexify(),
16105 +\unfhexify() -- did not work with big numbers; ckradix() was missed in the
16106 +CK_OFF_T conversion.  Fixed in ckclib.c, 12 Aug 2007.
16107 +
16108 +Updated the help text for ASCII, BINARY, and SET FTP TYPE to clarify the
16109 +semantics.  ckuus2.c, ckcftp.c, 12 Aug 2007.
16110 +
16111 +Error messages were printed upon failure to open any of the four log file,
16112 +even with SET QUIET ON.  Fixed in ckuus4.c, 12 Aug 2007.
16113 +
16114 +Built OK on NetBSD 1.3_RC3.  Tried to build secure version but the libraries
16115 +had disappeared.  13 Aug 2007.
16116 +
16117 +Built OK on Mac OS X 10.4.9.  Tried the secure version, macosx10.4+krb5+ssl.
16118 +Here we get the usual pile of "pointer targets in passing argument 1 of
16119 +(function name) differ in signedness", regarding security functions, but it
16120 +built OK.  13 Aug 2007.
16121 +
16122 +Reconciling the two ttinl's...  On encrypted connections myread() returns
16123 +encrypted bytes; ttinl() has to decrypt them; it wasn't doing this in the
16124 +lookahead section so I fixed it.  The new code works on both encrypted and
16125 +clear-text connections.  I removed the chaining to oldttinl(), and
16126 +oldttinl() itself.  ckutio.c, 13 Aug 2007.
16127 +
16128 +  (Wouldn't it make more sense and be more efficient and less confusing
16129 +  for myfillbuf() to do the decrypting?)
16130 +
16131 +When C-Kermit uses Zmodem as an external protocol, it doesn't seem to scan
16132 +files before sending them to set text or binary mode appropriately.  It's
16133 +that external protocols bypass Kermit's whole "get next file" mechanism; the
16134 +(possibly wild) filespec is simply passed to the external protocol program.
16135 +Changing this would be a very big deal.  But if only one file is being sent
16136 +(the filespec is not wild) it's easy enough to check.  I added this to the
16137 +external protocols section of the protocol module.  It can be overridden in
16138 +any of the regular ways (/TEXT or /BINARY switch on SEND command, SET
16139 +PATTERNS OFF, SET TRANSFER MODE MANUAL, etc).  ckcpro.w, 13 Aug 2007.
16140 +
16141 +[FTP SEND /RECURSIVE]
16142 +Peter Crowley reported a problem with FTP recursive uploads getting the
16143 +directory tree wrong when the previous pathname was a left substring of the
16144 +new pathname (e.g. foo/bar/ and foo/bar2/).  The logic did not handle this
16145 +case and created the bar2 directory as a subdirectory of bar, rather than as
16146 +a parallel directory.  Fixed in syncdir() and tested with various edge cases.
16147 +ckcftp.c 14 Aug 2007.
16148 +
16149 +  notify <peter.crowley@alumni.utexas.net>
16150 +
16151 +Added CD messages to FTP BRIEF display to track the ups and downs of
16152 +recursive uploads.  ckcftp.c, 14 Aug 2007.
16153 +
16154 +The OUTPUT command gave a misleading error message ("Connection to xxx not
16155 +open") when used on a serial port that was, indeed, open but was not
16156 +presenting the Carrier signal, when CARRIER-WATCH was not OFF.  Added a new
16157 +message for this, and some others.  ckuus5.c, 14 Aug 2007.
16158 +
16159 +Sending from the command line, e.g. kermit -s foo, did not give an
16160 +informative error message if the file could not be found or opened.  Fixed
16161 +in ckuusy.c, 14 Aug 2007.
16162 +
16163 +OK, back to ttptycmd....  It seems that back on March 27th, I got everything
16164 +working but I thought that there was still something wrong with it because
16165 +an unrelated problem so I put it aside.  The version of ttpty.c from that
16166 +date worked OK, and it looks like I updated ckutio.c from it, but that
16167 +version of ckutio.c was put aside.  Since then I have been working on the
16168 +ckutio.c version that was NOT put aside and so now I have to reconcile the
16169 +two:
16170 +
16171 +  ~/80/ttypty/20070327/ckutio.c
16172 +  ~/80/ckutio.c
16173 +
16174 +As a first cut I did this simply by replacing the contents of the #ifdef
16175 +CK_REDIR section of the latter with that of the former.  Of course in
16176 +Solaris this comes up with openty() implicitly declared at compile time and
16177 +unresolved at link time.  So the first task is to get HAVE_OPENPTY defined
16178 +for platforms that have it and have the others use the ttruncmd().  For
16179 +starters I put an #ifdef block in ckcdeb.h that defines HAVE_OPENPTY for
16180 +Linux, FreeBSD, NetBSD, OpenBSD, and Mac OS X.  Ones that don't have
16181 +openpty() include AIX, HP-UX, and Solaris.  Others like SCO I don't know but
16182 +I doubt it.  The real solution is to get the ckupty.c module to work but one
16183 +thing at a time...  This version is supposed work with secure builds on the
16184 +openpty() platforms, and on the others like Solaris, if an external protocol
16185 +is attempted on a secure (encrypted) connection, an error message is
16186 +printed and the command fails.  ckutio.c, 14 Aug 2007.
16187 +
16188 +How to test?  Apparently I did all my testing on Panix before, and that's
16189 +where all my Zmodem builds are, but now when I build a Kerberized version
16190 +(which works if I do it on the right pool host), it won't make a local
16191 +connection, and there is no other place I can connect to that has a
16192 +Kerberized Telnet server.  I can, however, connect to Panix from here, using
16193 +the same code, but on Mac OS X...
16194 +
16195 +Slight detour: Got access to AIX again (5.3.0.0).  Picky compiler, some
16196 +things needed fixing....  Also it says "1506-507 (W) No licenses available.
16197 +Contact your program supplier to add additional users. Compilation will
16198 +proceed shortly" and of course it goes kind of slow.  For some reason, I
16199 +can't do streaming transfers into AIX over a local network (to its SSH
16200 +server), but windowed transfers are OK.  Anyway, noting that we've been
16201 +using the same basic makefile target since AIX 4.2, changing nothing but the
16202 +version herald, I made a new target, simply "aix", that picks up the AIX
16203 +version automatically and sets the herald from it.  Ditto for aix+openssl,
16204 +but on this host requires setting SSLINC and SSLLIB to /opt/ssl/include and
16205 +/opt/ssl/lib.  Also the make program here was extremely sensitive to spacing
16206 +so I had to make some minor edits to get the link step to work for the SSL
16207 +version.  ckuusy.c, makefile, 14-15 Aug 2007.
16208 +
16209 +Got rid of the special Panix secure NetBSD target, replaced it with a
16210 +regular one, which is invoked in the normal way by defining K5INC and K5LIB
16211 +to point to to where the stuff is hidden.  Cleaned up and modernized the
16212 +comments in the makefile a bit.  makefile 15 Aug 2007.
16213 +
16214 +Changed some data types and added some casts to ckctel.c to do away with
16215 +tons of "pointer targets in passing argument 1 of 'xxx' differ in signedness"
16216 +warnings.  15 Aug 2007.
16217 +
16218 +Set up Mac OS X as the testbed for ttptycmd(), with Panix as the remote
16219 +partner over a Kerberos 5 connection.  The first test is to send a 300K
16220 +text file with gkermit as the external protocol.  It worked fine, and the
16221 +debug log showed all the right components were active (namely encryption and
16222 +ttptycmd) [kermit/zmodem send/receive text/binary]:
16223 +
16224 +  Kermit    Zmodem
16225 +  kst OK    zst OK
16226 +  ksb OK    zsb OK
16227 +  krt OK    zrt OK
16228 +  krb OK    zrb Failed "rz: Persistent CRC or other ERROR"
16229 +
16230 +We've seen this before.  The problem is 0xff, Telnet IAC, as I proved to
16231 +myself by constructing a 3MB file that contained every byte but 0xff in every
16232 +mixture and order and transferring it successfully over the same connection.
16233 +Presumably the Telnet server is doubling IACs, whereas of course rz is not
16234 +undoubling, thus the CRC error.  This is progress.  15 Aug 2007.
16235 +
16236 +Log shows that indeed every IAC in the source file arrives doubled.  Adding
16237 +code to remove the first IAC of every adjacent pair, a small test file with
16238 +different-length runs of IACs transfers OK.  The 3MB all.bin file does not.
16239 +
16240 +Starting over...  I can receive a big text file with Zmodem OK.  The 3.2MB
16241 +binary test pattern that contains no IACs failed after 1.8MB, but the part
16242 +that it transferred was OK.  A second try, almost the whole thing arrived,
16243 +it stopped just 584 bytes short of the end.  Could be that file size is a
16244 +separate problem.  Making a new copy exactly 1MB long...  Well, that's
16245 +interesting, this one too stopped just short of the end.  And again, the
16246 +same thing.  When connecting back to the host, the last Zmodem packet can
16247 +be seen on the screen; it's as if the local Zmodem exited before reading
16248 +the last packet...  But OK, if I change the options on the remote sz
16249 +sender to use small blocks, etc, then it works.
16250 +
16251 +Now, changing from the 1MB no-IAC-binary test pattern, to the 1MB all-values
16252 +test pattern, we fail after 81K.  But the part that was transferred is
16253 +correct.  Second try, same thing, but 57K.  Third: 40K.  Each time, upon
16254 +connecting back, the session is completely dead.
16255 +
16256 +IF I HAVE TO undouble IACs for incoming files, don't I have to double them
16257 +going out?  To send a block to net we just call ttol(), but ttol() doesn't
16258 +do any doubling (because Kermit protocol always quotes 0xff).  To see what
16259 +happens, I changed the ttol() call to ttoc() in a loop that doubles IACs.  I
16260 +tested this by sending the full 3.2MB test pattern, which worked fine.
16261 +
16262 +For receiving, it's slow but it works OK with files that don't contain IACs
16263 +(my concern was that IACs might appear in outbound files or in Zmodem
16264 +protocol messages).  It receives the 1MB no-IAC test pattern, so there are
16265 +no problems with protocol or timing.  But the full test pattern always gets
16266 +cut off, but at different points, as before, with the remote session dead.
16267 +Changing the Zmodem receiver from rz to lrz on the local end (since the
16268 +sender on the remote end is lsz) does not change the behavior.
16269 +
16270 +Anyway, I went back and replaced the byte loop with something more
16271 +efficient, and it goes about 20 times faster.  But this doesn't help either,
16272 +it only makes it fail faster.  But aha, what if a doubled IAC is broken
16273 +across successive pty reads -- we have to make the "previous character"
16274 +memory persistent.  Well, that was a good insight, but it still didn't fix
16275 +it.  The log shows the IAC handling code is working fine.
16276 +
16277 +What does sz say?  Capturing its stderr to a file... "Retry 1: Got ZCAN".
16278 +Next time: "Retry 1: Got TIMEOUT".  Next time: Got ZCAN.
16279 +
16280 +Trying different Zmodem options...  apparently I don't need to use short
16281 +blocks.  But I do need to use -e, probably because of Telnet NVT treatment
16282 +of carriage return; without -e, there is a "persistent CRC error".  -O
16283 +disables timeouts, but this makes no difference.
16284 +
16285 +OK, we still have two Big Problems:
16286 +
16287 + 1. When a long file has no IACs, the final < 1K of the file is not received.
16288 + 2. When a long file has IACs, the transfer generally stops very early.
16289 +
16290 +Problem 1: the transfer consistently fails less than 1K from the end of the
16291 +file.  Upon CONNECT back to the host, a big Zmodem packet is sitting there
16292 +waiting to be read, which means ttptycmd()'s copy of rz is terminating
16293 +early.  Can we catch it in the debug log?  Doing this takes forever and
16294 +writes a GB to the disk...  And then the problem doesn't happen.  Also, I
16295 +can receive a HUGE text file almost instantly with no errors at all.
16296 +
16297 +Switching to lrz on the receiving end, now I see the error messages, about
16298 +300 lines like this:
16299 +
16300 +  Retry 0: Garbage count exceeded
16301 +  Bytes received:  872352/1000000   BPS:85464  ETA 00:01  Retry 0: Bad CRC
16302 +  Bytes received:  892448/1000000   BPS:86690  ETA 00:01  Retry 0: Bad CRC
16303 +  Retry 0: Garbage count exceeded
16304 +  Retry 0: Garbage count exceeded
16305 +  Retry 0: Garbage count exceeded
16306 +  Retry 0: Garbage count exceeded
16307 +  Retry 0: Garbage count exceeded
16308 +  Retry 0: Garbage count exceeded
16309 +  Retry 0: Got ERROR
16310 +  Bytes received:  898336/1000000   BPS:84293  ETA 00:01  Retry 0: Bad CRC
16311 +  Retry 0: Garbage count exceeded
16312 +  Retry 0: Garbage count exceeded
16313 +  Bytes received:  900384/1000000   BPS:83751  ETA 00:01  Bad escape sequence
16314 +  2fRe
16315 +  try 0: Bad data subpacket
16316 +  Bytes received:  941472/1000000   BPS:86191  ETA 00:00  Retry 0: Bad CRC
16317 +  Retry 0: Garbage count exceeded
16318 +
16319 +Even when it succeeds, it gets these.  But if I receive a text file, no
16320 +matter how big, no errors or retries or timeouts at all.  So it appears that
16321 +there is only one problem: a big-time lack of transparency regarding 8-bit
16322 +and/or control characters.  The odd thing is, it's not that the characters
16323 +can't get through -- they all can -- but they seem to cause transitory
16324 +blockages.  16 Aug 2007.
16325 +
16326 +Cleaned up the remaining pointer signedness warnings in ckutio.c, but this
16327 +was a mistake, it broke Kerberos connections completely.  Undid the changes.
16328 +ckutio.c, 17 Aug 2007.
16329 +
16330 +Changed all return() in the fork()==0 section of ttptycmd() to exit().
16331 +ckutio.c, 17 Aug 2007.
16332 +
16333 +Tried explicitly setting the slave pty to rawmode.  Makes no difference.
16334 +Tried using the Mac OS X (curses) raw() function, and also system("stty
16335 +raw"); still no difference.  Tried doing all of these in different
16336 +combinations and orders.  I found one combination that cuts the errors about
16337 +in half, and the transfer of the no-IAC test pattern almost always succeeds
16338 +(but it's slow).  Anyway, it doesn't help much with the test pattern that
16339 +contains IACs.  Well, the code is more solid than it was before but
16340 +functionally we have not advanced much if we can't download a binary file
16341 +with Zmodem!  On the other hand, we can upload them, and we can transfer
16342 +text files in both directions, which is an improvement over the previous
16343 +situation, in which the entire session would hang due to loss of
16344 +synchronization of the encryption stream.
16345 +
16346 +Tried adding -funsigned-char to CFLAGS of Mac OS X target.  It does not
16347 +make the "signedness" warnings go away and it doesn't change the runtime
16348 +symptoms.
16349 +
16350 +I tried a simpler version of pty_make_raw(), the one from Serg Iakovlev, but
16351 +it was a total failure.  That's encouraging though, because it indicates
16352 +that pty_make_raw() is the right place to be working.
16353 +
16354 +Then I made pty_make_raw() set or unset every single terminal flag
16355 +explicitly.  This made no difference, but didn't hurt anything either.
16356 +
16357 +Then I made pty_make_raw() explicitly set all the c_cc[] characters to 0
16358 +(but left c_cc[VMIN] as 1).  This made no difference either.
16359 +
16360 +I checked pty_make_raw() against ttpkt() and the only difference I found in
16361 +the terminal flags is that ttpkt() sets IGNPAR thinking it means "ignore
16362 +parity errors" when really it means "discard any character that has a parity
16363 +error" (at least according to Iakovlev) -- exactly the opposite.  But I
16364 +tried it both ways, no difference.  17 Aug 2007.
16365 +
16366 +I noticed that even Zmodem text receives can fail.  They don't get any
16367 +errors, they just get cut off shortly before the end.  (But usually they
16368 +succeed, and fast too, like 500K cps).
16369 +
16370 +What if I don't call pty_make_raw() at all on the slave pty?
16371 +
16372 +zrt: EESSSSSSSS: 80% good (E = stopped just before end but no other errors)
16373 +
16374 +zrb no-IAC test pattern, short blocks:
16375 + 1. S/5 (success with 5 screens of errors.
16376 + 2. S/7
16377 + 3. S/7
16378 + 4. S/6
16379 + 5. E/7 (failed just before end)
16380 + 6. S/7
16381 + 7. S/6
16382 + 8. S/6
16383 + 9. S/6
16384 +10. S/4
16385 +
16386 +So, lots of errors, but it recovered 90% of the time.
16387 +Next, same thing, but without requesting short blocks:
16388 +
16389 + 1. E/5
16390 + 2. S/5
16391 + 3. E/4
16392 + 4. S/5
16393 + 5. S/5
16394 + 6. S/5
16395 + 7. X/0 (hard failure right away: "Got ZCAN"
16396 + 8. S/5
16397 + 9. S/5
16398 +10. S/5
16399 +
16400 +So it doesn't look like short blocks make that much difference.  Now what if
16401 +I turn off prefixing?  Bad CRC, fails immediately every time.  Putting back
16402 +pty_make_raw(slave), it still fails hard.
16403 +
16404 +Tried a new strategy with pty_make_raw(): rather than modify existing flags,
16405 +I set all flags to 0, and then turn on only those few that we need like CS8.
16406 +Now we get only 2.5 screens of errors instead 4-7 and the transfer rate is
16407 +higher for binary files (all of the previous ones were under 100K CPS, while
16408 +for text files it was 400-500K CPS):
16409 +
16410 + 1. S/2 195669 CPS
16411 + 2. S/2 194720
16412 + 3. E/3
16413 + 4. S/2 192550
16414 + 5. S/3 192325
16415 + 6. S/3 145066
16416 + 7. S/2 200689
16417 + 8. S/3 188948
16418 + 9. S/2 209461
16419 +10. S/3 181991
16420 +
16421 +I noticed that there was no TIOCSTTY ioctl in the pty/fork setup sequence,
16422 +which is recommended somewhere, so I tried that and it was a disaster; the
16423 +entire session hung.  I took it back out.  18 Aug 2007.
16424 +
16425 +Tried some transfers over a clear-text (not encrypted) connection with the
16426 +same results: smooth, fast transfer of a big text file (400K cps); rocky but
16427 +successful transfer of the no-IAC binary pattern file (135K cps).  Switching
16428 +back to ttruncmd(), the same binary file is received at 1.5M cps, and the
16429 +no-IAC binary file totally fails after too many "Bad CRC"s; and we already
16430 +know that any file that contains IACs will fail.  One might say that
16431 +ttptycmd() is better in every respect than ttruncmd() except in speed
16432 +(when it works).
16433 +
16434 +Let's see if ttyptycmd still works in remote mode (to local K95):
16435 + . sz / text works, but slowly.
16436 + . lsz / text works but some wierd errors are reported.
16437 + . lsz / binary / no IAC doesn't work at all (CRC-32 mismatch for a header;
16438 +        Unexpected control character ignored: 13, etc).
16439 + . sz / binary / no IAC works OK but slow.
16440 + . sz / binary / full test pattern with IAC works OK but slow.
16441 + . Sending text into rz fails completely.
16442 +
16443 +What about ttruncmd() in remote mode?
16444 + . send /text works, fast.
16445 + . send /binary works, fast. 
16446 + . receive /text works, not so fast but not bad.
16447 + . receive /binary works, not so fast but not bad.
16448 +
16449 +So we use ttruncmd() for remote mode, and we use it for local mode
16450 +serial-port and modem connections, and we use ttptycmd() on network
16451 +connections because (a) they might be encrypted, and (b) even if they are
16452 +not, they use some protocol that we have to handle, e.g. Telnet, Rlogin.
16453 +19 Aug 2007.
16454 +
16455 +Discovered that Sending binary files no longer works.  Text is OK, binary
16456 +transfers don't even start.  This happens on both encrypted and clear-text
16457 +connections.  ttptycmd() is being used in both cases.  But oddly enough,
16458 +receiving binary still works as before.  What did I break, and when?
16459 +Oh, it was just the script, when I changed it from using sz to lsz.  Putting
16460 +it back to sz makes it work, even with the full 3.2MB binary pattern with
16461 +IACs.
16462 +
16463 +I backed off the changes I made to ckctel.c to suppress some warnings, in
16464 +view of the fact that similar changes to ckutio.c broke things so badly.
16465 +19 Aug 2007.
16466 +
16467 +If sz is not given the -e flag, it sends control characters bare, except ^P,
16468 +^Q, ^S, and ^X.  ^X is the control prefix, so ^A is sent ^X followed by A.
16469 +With -e, all C0 control chars are prefixed, but with ^X, which is, of
16470 +course, a control character.  Interestingly, the C1 analogs of ^P, ^Q, ^S
16471 +(but not ^X and, unfortunately, not IAC) are also prefixed.  -e makes no
16472 +difference for 8-bit characters.
16473 +
16474 +If we have a Telnet connection and the server is in ASCII (NVT) mode, CR is
16475 +always followed by LF or NUL.  Well, it seems the server is putting us
16476 +(Kermit) in binary mode in this case, but staying in ASCII mode itself.
16477 +Added code to handle NVT byte stuffing and unstuffing in each direction
16478 +independently, according to the TRANSMIT_BINARY state in that direction.  I
16479 +made a file containing just the bytes 0-31 and 127 and 128-159 and 255 (66
16480 +bytes all together) and sending it from the host to C-Kermit, the local log
16481 +shows that every control character was received correctly and all TELNET
16482 +conversions were done right -- NUL removed after CR (and only after CR); IAC
16483 +removed after IAC (and only after an IAC meant as a quote).  For the first
16484 +time, I can receive the 1MB all-values test pattern, but there are still
16485 +tons of (correctable) CRC errors, so the transfer rate is really awful, like
16486 +about 5% of what we get with a text file (25Kcps instead of 500).
16487 +
16488 +Further experimentation shows that the fundamental transparency problem is
16489 +fixed; we can receive short files (say, 1K or less) containing absolutely
16490 +any byte values in any combination with no errors at all.  But once the file
16491 +size reaches (say) 10K, we get CRC errors, like one every 2 or 3K of data.
16492 +These are not deterministic.  In successive transfers of the same file, they
16493 +come in different spots.  It's tempting to blame pty buffer overruns, but
16494 +then text files would show the same behavior.  When a binary file size
16495 +exceeds, say, 1MB, the chances of successful completion go way down,
16496 +independent of whether my external protocol is rz or lrz.  I like lrz better
16497 +because the error reports come out on the screen as the transfer is going
16498 +on.  Trying to download a real-world binary file -- a 2.2MB C-Kermit
16499 +executable -- I get 4500 error messages but the transfer evenually succeeds,
16500 +with an effective throughput of 21Kcps.
16501 +
16502 +Actually it turns out that "sz -a somebigtextfile" (2.2MB) also gets a lot
16503 +of CRC errors.  The -e flag (escape all control characters) makes the same
16504 +big text file transfer with few or no errors.  It's not sure-fire.
16505 +Sometimes no errors, sometimes one or two, and sometimes a fatal error that
16506 +kills the transfer.
16507 +
16508 +With binary files... a 32K binary file seems to make it every time.  40K
16509 +fails about 50% of the time.  48K fails 60% and every time it fails, it has
16510 +created a partial file of exactly 32K (32768 bytes).  96K fails 9 out of 10
16511 +times, when it fails, the partial file is always 0 bytes, or 32768, or
16512 +65536, but that just means that rz's file output buffer is 32K.
16513 +
16514 +Why, then, do binary files cause trouble if it is not a solid transparency
16515 +problem?  If a certain file can get through once, why can't it get through
16516 +every time?  When a character arrives at the pty, the pty driver probably
16517 +takes a different path through its code, checking the terminal flags that
16518 +would affect that character.  I tried making Kermit's network read buffers
16519 +very small but, surprisingly, this made things worse.  I also tried making
16520 +them very much bigger, which didn't help either.  24K still seems to be the
16521 +right size.
16522 +
16523 +So, is it that some characters take longer to process than others?  So long
16524 +that data is lost due to lack of flow control between TCP and the pty?  One
16525 +way to test this theory is to slow Zmodem down.  I tried "-l 32" which,
16526 +according to the man page, tells sz to "wait for the receiver to acknowledge
16527 +correct data every N (32 <= N <= 1024) characters.  This may be used to
16528 +avoid network over-run when XOFF flow control is lacking."  Makes no
16529 +difference.  I also tried the -w (Window) switch, ditto.  In fact there are
16530 +all sorts of options to set the "window size", "packet length", "block
16531 +size", and "frame length", but with no explanation of what these mean or how
16532 +they are related.  If I crank everything down to minimum value:
16533 +
16534 +  lsz q -L 32 -l 32 -w 1
16535 +
16536 +I get 50% success with the 96K file instead of 10%.  Adding -e, oddly
16537 +enough, made it worse.  I also tried setting the environment variable
16538 +ZNULLS to different numbers like 512, no help there either.
16539 +
16540 +I tried making the read-from-net-write-to-pty buffer small (1K) but leaving
16541 +the pty-to-net one big.  This improves chances of success, but it's
16542 +intolerably slow (3Kcps when the connection is capable of 500K).
16543 +
16544 +I also changed the write-to-pty operation from a single write() call of
16545 +possibly many K characters to a byte loop, one write() per byte.  Same
16546 +result: success (but still about 300 recoverable errors), throughput 3Kcps.
16547 +20 Aug 2007.
16548 +
16549 +With ttptycmd() configured to write to the pty in a byte loop, it is
16550 +possible to delay each write.  Adding a 10msec delay per character results
16551 +in a transfer that runs at about 20 cps and (for the 96K test file) would
16552 +take about 80 minutes to complete.  And yet it still gets just as many
16553 +errors.  So it's not a matter of timing either.  The errors come, on
16554 +average, every file 388 bytes, but not at regular intervals.
16555 +
16556 +I tried the TIOCREMOTE ioctl on the pty master, as discussed somewhat
16557 +obliquely in the Mac OS X "man pty" page; "This mode causes input to the
16558 +pseudo terminal to be flow controlled and not input edited (regardless of
16559 +the terminal mode)" -- sounds like just the ticket but it made no
16560 +difference.  Actually, looking at a man page on another OS (Solaris), it
16561 +says this is only for lines of text, EOLs are supplied, so that would mess
16562 +up the protocol.  So remember: don't use this.
16563 +
16564 +Tried without O_NDELAY; the behavior was the same but the speed was much
16565 +slower.
16566 +
16567 +Tried switching back to the ckupty.c routines on Mac OS X and found that it
16568 +works now the same as with openpty(), except that I seem to get more getty
16569 +babble at the end.  But this means I can run some tests on Solaris.  I moved
16570 +the entire test environment from Mac OS X 10.4.9 to Solaris 9.  But it
16571 +doesn't work at all.
16572 +
16573 +Trying to figure out the ckupty.c modules again.
16574 + . do_pty() calls pty_getpty() which returns in arg1 the fd of the pty master.
16575 + . Then it creates a pipe as a way to tell when the child dies
16576 + . Then it creates a fork:
16577 +    - The parent does a blocking read from the pipe
16578 +    - The child calls getptyslave() to get the pty slave
16579 +      and writes one byte to the pipe
16580 +      and then execs the command it's supposed to run
16581 +Note that the file descriptor of the slave is known only to the lower fork.
16582 +Therefore the lower fork is the one that has to set all the tty modes, etc.
16583 +I took care of all that but the ckupty.c method doesn't work at all on
16584 +Solaris.  But it works "fine" on Mac OS X (the 32K all-bytes test file
16585 +transfers instantly with no errors, but the 96K one errors out).
16586 +
16587 +The problem on Solaris is that pty_make_raw() fails on the masterfd (but not
16588 +on the slavefd) with errno 25 "ioctl inappropriate for device".  It doesn't
16589 +matter whether I do it in ckupty.c or ckutio.c.  I found a web page on
16590 +kde.org that says Solaris does not allow tcget/setattr() on a pty master.
16591 +But the Sun "knowledge base" is not open to the public.  Well, presumably
16592 +changes made to the slave are reflected in the master (comments in Solaris
16593 +telnetd seem to confirm this...)  Let's come back to Solaris later.
16594 +
16595 +Moving to a Linux with lrzsz installed...  Built a Kerberos 5 version with
16596 +USE_CKUPTY_C.  Like on Mac OS X, it transfers short files OK and chokes on
16597 +longer ones.  Switched to openpty(), it behaves the same.  So the problems
16598 +on Mac OS X are evidently not OS-specific, which is good I guess, since that
16599 +means finding the way around them will apply to more than one platform.
16600 +21 Aug 2007.
16601 +
16602 +Look into TIOCSCTTY again.  On System V based OS's, opening a pty acquires a
16603 +controlling terminal automatically.  On BSD-based OS's, no; you have to use
16604 +the TIOCSCTTY on the slave file descriptor to give it one.  I'm not sure why
16605 +a controlling terminal would be needed, except that without one, the virtual
16606 +device "/dev/tty" does not exist for the process that runs on the pty, and
16607 +maybe the application that runs there (e.g. rzsz) checks for it.  On the
16608 +downside, having a controlling terminal opens the process up to terminal
16609 +interrupts like SIGINT and SIGQUIT.  Until now I have not been using this
16610 +ioctl().  Results (in Linux):
16611 +
16612 +  With TIOCSCTTY: 96K all-bytes test: 11 screens of errors, then success
16613 +  Without TIOCSCTTY: exactly the same.
16614 +
16615 +Tried the same thing with TIOCNOTTY instead of TIOCSCTTY, with exactly the
16616 +same results (no effect whatsoever).
16617 +
16618 +There has to be a way to make this work, because Zmodem works through
16619 +telnetd, which basically the same thing as ttptycmd(): a relay between the
16620 +network and a pty.  ttptycmd() is like telnetd backwards.  Modern telnetds
16621 +are not much help; they don't access ptys or the network directly, they go
16622 +through "mux" devices so I can't see what they're doing to get transparency
16623 +and flow control.  An old BSD telnetd uses packet mode but that would be a
16624 +big deal...
16625 +
16626 +I tried ignoring various signals like SIGTTOU and SITSTP, since some Telnet
16627 +clients do this.  No effect, no difference.  Anyway, in Linux the transfers
16628 +almost always finish OK despite the many errors.  There is just some trick
16629 +I'm missing to make the pty accept a stream of arbitrary bytes without
16630 +hiccuping.
16631 +
16632 +What about Solaris, which uses ckupty.c?  In streams-based OS's, where line
16633 +disciplines and whatnot are pushed on top of the pty, it looks like the pty
16634 +module saves the file descriptor of the "bare" slave pty (as 'spty') before
16635 +pushing things onto it, and then later uses spty rather than the regular
16636 +slave pty file descriptor when getting/setting terminal modes.  I'm not sure
16637 +what this is all about but it's definitely SysVish...  It happens if
16638 +STREAMSPTY is defined, but I noticed that STREAMSPTY is never defined
16639 +anywhere.  I tried defining it so we take an entirely different path through
16640 +the code.  It made absolutely no difference.
16641 +
16642 +Then I noticed that HAVE_STREAMS is not defined for Solaris either.  Tried
16643 +defining it, but the session didn't work at all, no i/o.  Removing the
16644 +HAVE_STREAMS definition but keeping the STREAMSPTY defined, I rebuilt and
16645 +tried "set host /connect /pty emacs".  I got an EMACS screen but could not
16646 +type anything into it, which means that STREAMSPTY should not be defined
16647 +either.  Removed the definition and "set host /pty" works again.  So what's
16648 +the problem with ttptycmd()?
16649 +
16650 +In fact, ttptycmd() works on Solaris with Kermit as the external protocol,
16651 +but not with Zmodem, not even with text files.  So again, there is no
16652 +fundamental problem with the code or the logic, it's Just A Matter Of
16653 +Transparency to control and/or 8-bit characters -- some trick I don't know
16654 +about.
16655 +
16656 +Looking at the Solaris debug log...  I see that ckupty.c is calling
16657 +init_termbuf() to set the tty modes of the master, not the slave, and
16658 +set_termbuf() to set them, but you can't do that in Solaris, error 25.  This
16659 +is in getptyslave().  Shouldn't getptyslave() be setting the tty modes of
16660 +the slave, not the master?  I changed it to do this, but like all other
16661 +changes, it made no difference.  I checked to make sure that after the change,
16662 +"set host /pty /connect emacs" still worked and it did.
16663 +
16664 +And then what...  I had some code to redirect stderr in ckupty.c that was
16665 +not being executing due to a typo.  When I fixed the typo, poof, Zmodem
16666 +binary transfers started working, or working as well as they work in Linux
16667 +and Mac OS X.  It turns out that if I don't redirect stderr, sz and rz
16668 +just don't work.  But lsz and lrz do.  But if I do redirect it, I don't see
16669 +the progress messages from lsz/lrz.  22 Aug 2007.
16670 +
16671 +Built on HP-UX 11i v3 (B.11.31 U ia64) with optimizing compiler, got tons of
16672 +picky warnings, but it finished and linked and runs OK.  Many of the
16673 +warnings were like this:
16674 +
16675 +  "ckucns.c", line 1606: warning #2068-D: integer conversion resulted in a
16676 +  change of sign:   tnopt[0] = (CHAR) IAC;
16677 +
16678 +IAC is defined as 255 in ckctel.h.  If I define it as 0xff, I don't get the
16679 +warnings.  I changed the definitions of all the Telnet commands to be in hex
16680 +notation rather than decimal.  If cuts way down on the HP-UX warnings and
16681 +doesn't seem to cause problems elsewhere.  ckctel.h, 23 Aug 2007.
16682 +
16683 +Now it looks like Solaris is working but then it hangs at the end.  It
16684 +appears as if the ckupty.c module is blocking SIGCHLD.  Debug log shows that
16685 +when the transfer is complete, we received IAC DM (Telnet Data Mark) after
16686 +sz's last gasp and before the shell prompt is printed.  But calling
16687 +tn_doop() in this case is a mistake because we are reading the number of
16688 +bytes that we know are available in a counted loop, but tn_doop() would
16689 +consume an unknown number of bytes and we would never know when to exit the
16690 +loop.  Anyway, C-Kermit doesn't do anything with DM.  Skipping over
16691 +tn_doop() (and not writing out the Telnet command bytes) fixes the hanging
16692 +condition at the end, even though SIGCHLD is never raised.  ckutio.c,
16693 +23 Aug 2007.
16694 +
16695 +Some tests, Solaris to NetBSD over K5.
16696 +zst sends ascii.txt, a 2.36MB ascii text file (Kcps / Errors).
16697 +zrt receives the same file:
16698 +
16699 +  zst 587/0 526/0 542/0 434/0 423/0
16700 +  zrt 827/0 800/0 847/0 FAIL  610/0
16701 +
16702 +So text is good.  Binary not so good.  Here we transfer the 1MB all-bytes
16703 +pattern file.  zrb receives it successfully, but with 1248 errors, at only
16704 +15Kcps.  Sending the same file out always fails:
16705 +
16706 +  Begin 20070823 16:32:07: SEND BINARY all2.bin [sz]
16707 +  Sending: all2.bin
16708 +  Bytes Sent:   5600/1000000   BPS:12446    ETA 01:19   FAILURE
16709 +  End 20070823 16:32:13
16710 +  Elapsed time: 6.617992999999842
16711 +  cps = 151103.2121067556
16712 +  lsz: caught signal 1; exiting
16713 +
16714 +Decided to move to Linux but found that something is screwed up in Linux
16715 +C-Kermit with tilde expansion:
16716 +
16717 +  send ~/testfiles/all.bin
16718 +
16719 +doesn't expand at all (but it did yesterday!).  The problem was in the
16720 +ancient, ancient realuid/setuid handling code; real_uid() no longer works in
16721 +Linux.  I worked around this in whoami() by setting ruid to getuid() if
16722 +real_uid() returned a negative number.  Maybe dangerous, worry about it
16723 +later.  ckufio.c, 23 Aug 2007.
16724 +
16725 +ANYWAY... after fixing that, I tested zsb on Linux, and it's broken there
16726 +too, using openpty(), so it's nothing to do with ckupty.c.  After sending
16727 +the first Zmodem data packet, it just hangs, nothing comes back.  In text
16728 +mode it gets farther, but then the same thing happens.  Captured stderr from
16729 +rz on the far end:
16730 +
16731 +  Bytes received:     608/1000000   BPS:21137  ETA 00:47  Retry 0: Bad CRC
16732 +  Bytes received:     864/1000000   BPS:23540  ETA 00:42  Retry 0: Bad CRC
16733 +  Bytes received:    1120/1000000   BPS:25003  ETA 00:39  Retry 0: Bad CRC
16734 +  Bytes received:    5696/1000000   BPS:56988  ETA 00:17  Retry 0: Bad CRC
16735 +  Bytes received:    9120/1000000   BPS:62227  ETA 00:15  Retry 0: Bad CRC
16736 +  Bytes received:    9376/1000000   BPS:60766  ETA 00:16  Retry 0: Bad CRC
16737 +  Bytes received:    9632/1000000   BPS:60361  ETA 00:16  Retry 0: Got TIMEOUT
16738 +  Retry 0: Sender Canceled
16739 +  Retry 0: Got ZCAN
16740 +
16741 +The local sz, however, doesn't give any error message.  ZCAN means: "other
16742 +end canceled session by sending 5 ^X's" (or user typed them).  What actually
16743 +happens is that ttptycmd()'s select() times out waiting for something from
16744 +the Zmodem partner and ttptycmd() itself kills the sz fork with SIGHUP.
16745 +When lsz receives SIGHUP it sends the ZCAN.  So the real problem is that
16746 +after some point we're not receiving anything.
16747 +
16748 +I changed the timeout from 4 seconds to 30 seconds and now I see it just
16749 +stops for long periods of time and then resumes.  The lrz log on the
16750 +receiving end shows tons of timouts, CRC errors, and other errors.  The
16751 +local log shows that lsz wound up sending ZCAN (2 x (10 x ^H, 10 x ^X)).
16752 +
16753 +Moving on to another problem...  Turns out Ctrl-C (SIGINT) is working right
16754 +after all.  Since I'm using my test scripts like kerbang scripts, Ctrl-C
16755 +exits through trap(), as it should, closing the connection and cleaning up.
16756 +If I start Kermit and tell it to TAKE the script, then Ctrl-C brings me back
16757 +to the prompt with the connection still open (as it should).  However, until
16758 +now I haven't done anything about the fork or the ptys.  Added code to
16759 +trap() to kill the fork and close the master pty.  ckuusx.c, 24 Aug 2007.
16760 +
16761 +Added code to try to break the deadlock.  If select() times out, but we have
16762 +stuff to write either to the pty or the net, try to do it anyway, even
16763 +though select() did not say we could.  But this doesn't help because when
16764 +select() times out we don't have anything to write.  The problem is that
16765 +after receiving that last packet from the remote rz, the local lsz doesn't
16766 +seem to do anything, as if the lower fork wasn't running (and to confirm
16767 +this hypothesis, sometimes I noticed that when I Ctrl-C'd out of this, the
16768 +transfer would take off again).
16769 +
16770 +Backing up and testing with gkermit rather than zmodem:
16771 +
16772 + kst ripple.txt [824K] OK
16773 + kst ascii.txt [1359K] OK
16774 + krt ripple.txt -- FAILED
16775 +
16776 +It seems that we can't handle streaming.  If I set up krt to disable
16777 +streaming on receipt, it works OK.
16778 +
16779 + krt ripple.txt [824K] OK
16780 + krb all2.bin  [1000K] OK
16781 +
16782 +So here we have no trouble sending but big trouble receiving unless we
16783 +disable streaming.  Whereas with Zmodem we have trouble receiving.
16784 +
16785 +But this wasn't happening before, what changed?  Using C-Kermit on the far
16786 +end to receive the file with debug log on, I see that it is sending 4K data
16787 +packet after 4K data packet, with the local gkermit silent, as expected.
16788 +About midway through the transfer, the local Kermit sends an error packet
16789 +"Transmission error on reliable link".  Looking at G-Kermit's debug log...
16790 +It receives the first five 4K data packets OK, but gets a CRC error on the
16791 +fifth one, and sends the Error packet.  So it has received a stream of
16792 +20-some thousand bytes OK and then messes up.  That number sounds a lot like
16793 +ttptycmd()'s buffer size.  I changed the buffer sizes to be different:
16794 +
16795 +  Read from pty and write to net: 4K  
16796 +  Read from net and write to pty: 1K
16797 +
16798 +This time it received the first 4K packet and failed on the second one.
16799 +Then I increased the buffers to 98K each, expecting to receive lots more
16800 +packets successfully but it bombed out on the 5th one.  But that's good, it
16801 +confirms there's no logic error in the buffer management.  Just to make
16802 +sure, though, let's set the buffer size smaller than the packet size and
16803 +disable streaming.  In this case we get 4 good data packets and a CRC error
16804 +on the 5th one and so we request retransmission, and the next 8 times it
16805 +arrives it gets a different CRC error, but the 9th copy is OK.  Then the
16806 +next packet comes and it gets a CRC error every time.  And this is nothing
16807 +but plain ASCII text.
16808 +
16809 +Switching to remote mode:
16810 +
16811 +  REMOTE=1 kk kst
16812 +
16813 +(after tricking myself because it was using ttruncmd() for this...) I see
16814 +that nothing works at all.  What did I break?  24 Aug 2007.
16815 +
16816 +Fixed ttptycmd() to restore console modes after a remote-mode transfer.
16817 +ckutio.c, 25 Aug 2007.
16818 +
16819 +Noticed that error codes like ESRCH are not available in all modules.
16820 +That's because of some complicated in #ifdefs in ckcdeb.h that wind up not
16821 +always #including <errno.h>.  But I notice that ckutio.c includes it
16822 +unconditionally with no ill effects, and so does ckvfio.c.  Does any version
16823 +of Unix at all not have <errno.h>?  Added a catch-all clause to ckcdeb.h to
16824 +#include <errno.h> (in UNIX only) if, after the other clauses, ESRCH was
16825 +still not defined.  ckcdeb.h, 25 Aug 2007.
16826 +
16827 +Now back to debugging ttptycmd()...  Remote-mode transfers with ttptycmd()
16828 +were broken in two places, maybe as long as 2 weeks ago (this would have
16829 +affected non-network transfers too, which I can't test any more).
16830 +The logic was missing in a couple places for the non-network and/or
16831 +non-Telnet and/or non-encrypting connections (if statements with no else
16832 +parts).  Fixed in ckutio.c, 25 Aug 2007.
16833 +
16834 +Testing remote mode:
16835 +
16836 + kst OK   zst OK
16837 + ksb OK   zsb OK
16838 + krt OK   zrt OK
16839 + krb OK   zrb OK
16840 +
16841 +Functionally it all works but there are hitches with Zmodem as always.
16842 +When sending to K95:
16843 +
16844 + . If I send with lsz, there are hundreds of "Subpacket too long" errors,
16845 +   and the transfer is very slow, but it succeeds.
16846 +
16847 + . If I send with the 1994 Omen version of sz, transmission is instantaneous
16848 +   and without errors, but then it hangs at the end.
16849 +
16850 + . If I bypass C-Kermit and send direct from lsz or sz, both work fine.
16851 +
16852 +So clearly the ptys are getting in the way.  The hanging at the end would be
16853 +caused by the sz process closing before its last output reached the master
16854 +pty.  It would need to do some form of flushing and/or pausing at the end
16855 +but there's nothing I can do about that; these programs were not designed to
16856 +be used in this way.  Anyway, it only seems to happen with files longer than
16857 +100K.
16858 +
16859 +For local mode, testing in Solaris over our Kerberos 5 connection again:
16860 +
16861 + gkermit  lrzsz
16862 + kst OK   zst FAIL
16863 + ksb OK   zsb FAIL
16864 + krt OK   zrt OK but with errors
16865 + krb OK   zrb FAIL
16866 +
16867 +If I use Omen rzsz as the external protocol (e.g. with zst), it blocks
16868 +redirection and it sends the file to my terminal, rather than over the
16869 +connection.  This would probably be because it finds out the device name of
16870 +the job's controlling terminal and opens it, to prevent redirection.  This
16871 +is hard to prevent in Solaris because there is no TIOCSTTY ioctl().
16872 +Supposedly the same thing is accomplished by closing and reopening the slave
16873 +pty after doing setsid().  I added code to do this, but it made no
16874 +difference.  (If I use lsz instead of sz, it is indeed redirected, but jams
16875 +up after about 15K.)  ckupty.c, 27 Aug 2007.
16876 +
16877 +On Mac OS X with sz 3.73 1-30-03, however, the redirection works, so I
16878 +assume it would also work in Linux, FreeBSD, NetBSD, etc, too.  Doing the
16879 +full test suite on Mac OS X:
16880 +
16881 + gkermit   lrzsz          rzsz
16882 +  kst OK   zst FAIL (1)    OK
16883 +  ksb OK   zsb FAIL (2)    OK
16884 +  krt OK   zrt OK   (3)    OK for 100K file, fails for longer.
16885 +  krb OK   zrb FAIL (4)    OK (1MB all-bytes test pattern)
16886 +
16887 +(1) 64K file OK every time; 100K file fails every time.
16888 +(2) 10K file fails every time.
16889 +(3) Succeeds with 800K file but gets a few recoverable errors.
16890 +(4) Succeeds with 48K binary file with some errors, fails with longer ones.
16891 +
16892 +So actually it looks pretty good, it's just that lrzsz messes up.  When
16893 +sending with lsz if I include -L 512 it sends the 100K test file with no
16894 +errors, but still chokes on longer ones.
16895 +
16896 +Testing on Mac OS X again, but this time over a clear-text Telnet connection:
16897 +
16898 + gkermit        lrzsz    rzsz
16899 +  kst OK   zst  FAIL(1)   OK
16900 +  ksb OK   zsb  FAIL(2)   OK
16901 +  krt OK   zrt  OK(3)     OK
16902 +  krb OK   zrb  FAIL(4)   OK 
16903 +
16904 +(1) Almost worked, finished 777K out of 824K without errors.
16905 +(2) Got tons of errors, failed in first 30K out of 1000K.
16906 +(3) OK for 100K file but fails for larger.
16907 +(4) OK for 48K binary fail but fails for larger.
16908 +
16909 +Maybe see if we can do without the OPENPTY part.
16910 +
16911 +TOMORROW -- just clean up the code, add some SET / SHOW / HELP commands,
16912 +document it, and move on.
16913 +
16914 +Note: In K95, SET WINDOW sets the Zmodem packet length, 32 - 1024, multiple
16915 +of 64.
16916 +
16917 +SEE ~/80/external.txt
16918 +
16919 +Changed ftp port from int to unsigned int.  ckcftp.c, 30 Aug 2007.
16920 +
16921 +Tried again to build KRB4/KRB5/SSL/TLS version for Solaris 9.  Had to update
16922 +the build procedure again, of course, because of new file and directory
16923 +names, but ran into problems anyway because the
16924 +cu-solaris9g+krb5+krb4+openssl+shadow+pam+zlib target was calling another
16925 +target that did not know about the hardwired pathnames.  Integrated the two
16926 +targets and tried building again.  It actually compiled ok (but with lots of
16927 +warnings from the security modules), but failed at link time with
16928 +krb5_init_ets not found; fixed that with an #ifdef NO_KRB5_INIT_ETS, now it
16929 +builds OK but without the ftp client.  Tried building it WITH the FTP and
16930 +that was OK too, no changes needed except to the build procedure.  12 Feb
16931 +2008, that is: C-Kermit 8.0.212 : 20080212.
16932 +
16933 +Tried to build with -DCK_SRP and -lsrp but:
16934 +
16935 +  hash_supported                      ckcftp.o
16936 +  hash_getdescbyname                  ckcftp.o
16937 +  hash_getdescbyid                    ckcftp.o
16938 +  cipher_getdescbyname                ckcftp.o
16939 +  krypto_delete                       ckcftp.o
16940 +  krypto_new                          ckcftp.o
16941 +  cipher_supported                    ckcftp.o
16942 +  krypto_msg_priv                     ckcftp.o
16943 +  krypto_msg_safe                     ckcftp.o
16944 +  hash_getlist                        ckcftp.o
16945 +  cipher_getlist                      ckcftp.o
16946 +  cipher_getdescbyid                  ckcftp.o
16947 +
16948 +Sent mail to Tom Wu and backed off for now.  makefile, 14 Feb 2008.
16949 +(Tom Wu never answered; seems like SRP is defunct.)
16950 +
16951 +The ".blah = xxx" form of variable assignment only worked for variables
16952 +names of length 22 or less, noticed and fixed by Wolfram Sang.  ckucmd.c,
16953 +5 Mar 2008.
16954 +
16955 +In "set host /pty ssh ..." connections, the INPUT command suddenly stopped
16956 +working.  This is in Solaris 9.  It happens with all 8.0.* versions of
16957 +C-Kermit, so it's nothing to do with ttptycmd().  Added some debug()
16958 +statements but they don't show anything.  Turns out there wasn't a problem
16959 +after all.  Wed Mar 26 16:04:53 2008
16960 +
16961 +Changed cmifi() to not print "?No files match" (or whatever) if SET QUIET ON.
16962 +ckucmd.c, 26 Mar 2008.
16963 +
16964 +Added \v(remoteip) for the IP address of the host we're connected to,
16965 +and \v(inmessage) for INPUT status messages corresponding to \v(instatus).
16966 +ckuusr.h, ckcmai.c, ckuus[24].c, 26 Mar 2008.
16967 +
16968 +Made \fkeywordval() strip braces/quotes from the right-hand side so we can
16969 +handle things like:
16970 +
16971 +  password="stringwithspaceatend "
16972 +
16973 +ckuus4.c, 6 Aug 2008.
16974 +
16975 +Added invisible PUTENV command for UNIX only.  Value should not be enclosed
16976 +in doublequotes.  Requires lge \v(buildid) 20080826.  ckuusr.[ch], 26 Aug 2008.
16977 +
16978 +Added SET VARIABLE-EVALUATION { RECURSIVE, SIMPLE }.  This is highly
16979 +experimental, but also highly desirable if it works out.  SIMPLE inhibits
16980 +the default recursive method of evaluating \%x and \&x[] variables, which
16981 +is, quite frankly, nuts and makes programming in Kermit at best
16982 +counterintuitive.  I made an exception in the case of array subscripts,
16983 +because changing how they are evaluated could break a lot of scripts, and
16984 +anyway there should never be any harm in evaluating them recursively because
16985 +their final value is always (or should be) numeric, not some string that
16986 +might contain backslashes.  The SET VAR setting is on the stack, just like
16987 +SET QUIET (it follows the quiet/xquiet code in ckuus[356].c), so macros or
16988 +command files that change it can't break the script that invokes them.
16989 +Added \frecurse() to force recursive evaluation of a \%x or \&x[] variable
16990 +regardless of the VARIABLE-EVALUATION setting.  Added \v(vareval) to allow
16991 +programmatic setting to current setting.  Tested on Solaris 9 but should be
16992 +totally portable.  ckuusr.[ch], ckuus[356].c, 11 Sep 2008.
16993 +
16994 +From Günter Knauf: 64-bit builds were failing on SuSE Linux because
16995 +libresolv and libcrypt were in lib64 rather than lib; updated the tests in
16996 +the linux makefile target to find them.  makefile, 12 Jan 2009.
16997 +
16998 +Tried building on Red Hat Enterprise Linux Server release 5.3 64-bit.
16999 +There is no curses or ncurses.  "make linuxnc" compiled OK but collapsed at
17000 +link time looking for crypt(), res_search(), and dn_expand().  Turned out
17001 +the linuxnc (and linuxc) targets needed the same treatment as the Linux one
17002 +for 64-bit Linuxes.  makefile, 3 Mar 2009.
17003 +
17004 +Consolidated the linux targets so we no longer need three separate ones for
17005 +curses, ncurses, and no curses.  "make linux" works ok on computers with and
17006 +without (n)curses.  "make linux+ssl", ditto.  "linux+krb5+ssl builds OK but
17007 +needs -DNO_KRB5_INIT_ETS".  Makefile, 3 Mar 2009.
17008 +
17009 +Fixed copyright date announced in herald, ckuus5.c, 3 Mar 2009.
17010 +
17011 +Patch from Seth Therault to avoid deprecation warning for utmp references
17012 +in ckufio.c in Mac OS X 10.5 (later, this became a consolidated makefile
17013 +target that works automatically for at least Mac OS X 10.3.9 through
17014 +10.5.6).  makefile, ckufio.c, 28 April 2009.
17015 +
17016 +zshcmd() (the function used by RUN and ! to run external commands) was not
17017 +falling back as expected in Linux RHEL4/5 if SHELL was not defined in the
17018 +environment.  Also in all Unix versions, there was no indication if a RUN/!
17019 +command failed (other than the return code) because the specified shell
17020 +didn't exist or was not executable (e.g. the SHELL environment variable was
17021 +misdefined).  Now it prints the name of the offending shell and the reason
17022 +it couldn't be executed (Not found, Permission denied, etc).  ckufio.c,
17023 +28 April 2009.
17024 +
17025 +There is no easy way to get the last field of string; for example, the
17026 +extension from a filename, which might have any number of fields.  In
17027 +general we want to be able to get "word number n" counting from the right;
17028 +\fword() lacks this ability.  Now if you give it a negative word number,
17029 +that says to count from the right; for example \fword(one two three four
17030 +five, -2) returns "four".  ckclib.c, ckuusr.c, 14 May 2009.
17031 +
17032 +Fixed a typo in the aix51+openssl (SSLLIBS should have been SSLLIB).
17033 +From Jason Lehr.  makefile, 27 May 2009.
17034 +
17035 +Updated the linux+openssl+zlib+shadow+pam target to chain to the new main
17036 +Linux target.  A bunch of other ones remain un-updated. makefile, 12 Jun 2009.
17037 +
17038 +Updates to the new Mac OS X 10.5 target from Seth Therault (which is
17039 +supposed to work on all Mac OS 10-point-anything) to avoid warnings
17040 +that came up on on Mac OS 10.4.11/Intel.  Once this one is proven we should
17041 +be able to remove/consolidate lots of other ones.  makefile, 12 Jun 2009.
17042 +
17043 +C-Kermit disables SSL with the message "?OpenSSL libraries do not match
17044 +required version." if the version of OpenSSL that Kermit was built with is
17045 +not exactly the same as the version that is loaded dynamically at runtime.
17046 +This is actually the proper behavior, since APIs are not guaranteed not to
17047 +change between OpenSSL versions prior to 1.0.0.  Made the error message more
17048 +informative.  ck_ssl.c, 26 Aug 2009, and again 28 Aug 2009.
17049 +
17050 +AIX 6.1 is out, it is really just a new name for AIX 5.4.  Added makefile
17051 +targets, plus for the first I made AIX 4.2 and later figure out its version
17052 +number in the makefile target so we don't have to keep adding new -DAIXnn
17053 +sections to the code, and also get its hardware name (e.g. "powerpc") from
17054 +uname at make time, rather than hardwiring "rs6000" as I did before.
17055 +Consolidated all AIX 4.2 and later targets so now just "make aix" or "make
17056 +aix+ssl" can be used.  Except not the gcc ones as they have some quirks so
17057 +I'd rather not disturb them.  Tested this on AIX 5.3.
17058 +makefile, 28 Aug 2009.
17059 +
17060 +From Kinjal Shah, a correction to the Linux makefile entry that allows it
17061 +find the 64-bit curses or ncurses library.  makefile, 29 Aug 2009.
17062 +
17063 +Renamed aix4[23]: to oldaix4[23]: in makefile to fix the warning messages
17064 +I didn't notice before.  I didn't want to remove them because they have
17065 +some special things that might still be needed, if anybody still has these 
17066 +AIX versions.  makefile, 29 Aug 2009.
17067 +
17068 +Built on RHEL 5.3 64-bit, regular and with OpenSSL 0.9.8e.  31 Aug 2009.
17069 +
17070 +Built on NetBSD 5.0.1/i386, regular and with OpenSSL 0.9.9-dev, 1 Sep 2009.
17071 +
17072 +Changed SSL message to mention LD_LIBRARY_PATH (Solaris), SHLIB_PATH (HP-UX),
17073 +LIBPATH (AIX), or LD_LIBRARY_PATH (Linux).  ck_ssl.c, 3 Sep 2009
17074 +
17075 +Noticed that "make linux+openssl" fails to include -lutil a link time, which
17076 +it needs for openpty().  That's because this target is obsolete.  I renamed
17077 +it to be oldlinux+openssl and added linux+openssl as a synonym for
17078 +linux+ssl.  makefile, 3 Sep 2009.
17079 +
17080 +Tested linux+openssl+zlib+shadow+pam, it's OK.  Also linux+krb5.  Also
17081 +linux+krb5+ssl.  makefile, 3 Sep 2009.
17082 +
17083 +Tried building on Solaris 9 with OpenSSL 0.9.8k with
17084 +solaris9g+openssl+shadow+pam+zlib, it failed like so:
17085 +
17086 +  ck_ssl.c:2875: error: conflicting types for 'inet_aton'
17087 +  /usr/include/arpa/inet.h:52: previous declaration of 'inet_aton' was here
17088 +  make[2]: [ck_ssl.o] Error 1
17089 +  make[2]: Leaving directory hmt/sirius1/prv0/kd/fdc/solaris9ssl'
17090 +  make[1]: [solaris2xg+openssl+zlib+pam+shadow] Error 2
17091 +  make[1]: Leaving directory hmt/sirius1/prv0/kd/fdc/solaris9ssl'
17092 +  make: [solaris9g+openssl+shadow+pam+zlib] Error 2
17093 +
17094 +The problem was caused by including an inet_aton() function ck_ssl.c for
17095 +the benefit of platforms that don't have one in their libraries.  This is
17096 +defeated by including NO_DCL_INET_ATON in KFLAGS.  I added this, but then
17097 +I thought it would be a good idea to automatically sense the OpenSSL
17098 +version so we can automatically set OPENSSL_097 or OPENSSL_098 rather than
17099 +bombing out, so I added code to do that too, and also to set the Solaris
17100 +version number: 9, 10, or 11.  The new entry is solaris9g+openssl.
17101 +ckcdeb.h, makefile, 3 Sep 2009.
17102 +
17103 +Fixed a complaint in ckufio.c about implicit declaration of initgroups.
17104 +ckufio.c, 4 Sep 2009.
17105 +
17106 +Built on Solaris 10 with gcc and Sun CC using new solaris{9,10,11} target
17107 +that is like the new solaris{9,10,11}g one but without the gccisms.
17108 +makefile, 4 Sep 2009.
17109 +
17110 +Changed solaris{9,10,11}g+ssl target to set only the SSL-specific things and
17111 +then chain to the main solaris{9,10,11}g target.  Tested OK on Solaris 9 and
17112 +10.  makefile, 4 Sep 2009.
17113 +
17114 +Created solaris{9,10,11}+ssl target that is exactly like the
17115 +solaris{9,10,11}g+ssl except it chains to the solaris{9,10,11} target
17116 +instead of the solaris{9,10,11}g one.  That is, it builds an SSL version of
17117 +C-Kermit using Sun CC rather than gcc.  makefile, 4 Sep 2009.
17118 +
17119 +Tried building on HP-UX 10.20, bundled (non-ANSI) compiler ("make
17120 +hpux1000").  This failed until I:
17121 +
17122 + . Moved a struct inititialization out of setextern(), ckuus3.c.
17123 + . Removed an ANSIism from the declaration of sigchld_handler() in ckutio.c
17124 + . Added a cast to strcmp() in zvuser(), ckufio.c.
17125 +
17126 +Builds OK now.  Built OK with "hpux1000o" (the ANSI compiler) too.
17127 +And with "hpux1000gcc".  Couldn't test "hpux1000o+openssl".  21 Sep 2009.
17128 +
17129 +The Sony Playstation 2 and 3 are 64-bit PowerPC platforms that can run Linux
17130 +if it is installed as an "other OS" on its hard disk; and the Linux kernel
17131 +since 2.6.21 supports the PS3 without any patching required.  Pawel Rogocz
17132 +reported that "make linuxppc" (one of the old targets that has not yet been
17133 +integrated into the main "linux" target) compiles OK on 2.6.29-ydl61.3
17134 +(Yellow Dog Linux release 6.2 'Pyxis'), but fails at link time because
17135 +'openpty' isn't found, because -lutil was not included, because that part
17136 +was added only to the main linux target.  I asked him to try "make linux"
17137 +and he sent back a transcript in which there were thousands of errors from
17138 +the curses code ckuusx.c.  Later I tried it myself and it built without a
17139 +hitch.  My theory is that between then and now, a missing piece of the
17140 +ncurses library (/usr/include/ncursesw) was installed.  21 Sep 2009.
17141 +
17142 +HP-UX 9.05 on PA-RISC 9000/712 building with hpux0900 (bundled compiler):
17143 + . ckutio.c compilation failed with PENDIN and FLUSHO not defined in
17144 +   pty_make_raw().  I dummied definitions for them to handle this situation
17145 +   on this or any other platform where it might crop up.
17146 +   ckutio.c, 24 Sep 2009.
17147 + . Ditto for the PTY module, + IMAXBEL.  ckupty.c, 24 Sep 2009.
17148 + . References to endusershell() were fatal in the bundled compiler.  Changed
17149 +   the hpux0900 target to define NODCLENDUSERSHELL, and put a special case
17150 +   in ckufio.c to not put a cast in front of the call if NODCLENDUSERSHELL
17151 +   is defined.  Now it builds and links OK.  makefile, ckufio.c, 24 Sep 2009.
17152 +
17153 +HP-UX 9.05 on PA-RISC 9000/712 building with hpux0900o (optimizing compiler):
17154 + . Warnings in ckutio.c at line 14860 about arguments to select (pointers
17155 +   are not assignment-compatible).  "man select" says arguments are ints.
17156 +   Defining INTSELECT fixes these warnings but results in fatal errors later
17157 +   around line 14881 and others in the area involving FD_SET.  This was too
17158 +   involved so I put it back as it was.  24 Sep 2009.
17159 +
17160 +Built OK on Solaris 10 with Sun CC.  A couple warnings about implicit
17161 +function declarations for curses routines because apparently they aren't
17162 +declared in curses.h.  Tuff.  25 Sep 2009.
17163 +
17164 +Tried building on Solaris 10 with Sun CC and OpenSSL 0.9.8k, and this
17165 +uncovered various loose ends in the solaris9+openssl target, which I fixed.
17166 +makefile, 25 Sep 2005.
17167 +
17168 +Fixed four typos in printfs in ck_ssl.c, \% instead of just %.  25 Sep 2009.
17169 +
17170 +Squelched 20-some complaints about a character array being referred to
17171 +directly instead of by a pointer, plus several other similar nits to get rid
17172 +of all the compilation warnings on Solaris 10 with Sun C 5.8 Patch 121015-06
17173 +2007/10/03.  ckctel.c, ckctel.h, 25 Sep 2009.
17174 +
17175 +Built the result on the same Solaris 10 system with gcc 4.2.4 using the
17176 +new solari10g+openssl target, working out a few kinks here too.
17177 +makefile, 25 Sep 2009.
17178 +
17179 +Made consolidated Solaris 9/10/11 64-bit targets for gcc, solaris9g64,
17180 +solaris10g64, solaris11g64, tested on Solaris 10 Sparc. makefile, 25 Sep 2009.
17181 +
17182 +Made consolidated Solaris 9/10/11 64-bit targets for Sun cc: solaris9_64,
17183 +solaris10_64, solaris11_64.  These simply set a couple flags and chain to
17184 +the main solaris9 target.  makefile, 25 Sep 2009.
17185 +
17186 +Removed a bunch of old superfluous Solaris 9 and 10 targets: oldsolaris9,
17187 +oldsolaris9lfs, solaris9g64 solaris9g_64, oldsolaris10 old solaris10lfs,
17188 +oldsolaris10+openssl, oldsolaris10g+openssl, solaris10_64, oldsolaris10g,
17189 +solaris10g_64, solaris10g64.  There are still plenty more to prune but it's
17190 +a start.  makefile, 25 Sep 2009.
17191 +
17192 +Added or fixed some missing prototypes in ckctel.h:
17193 +fwdx_send_xauth_to_xserver(), fwdx_parse_displayname.  25 Sep 2009.
17194 +
17195 +Improved the instructions for building secure versions in the makefile,
17196 +using this example:
17197 +
17198 +  make solaris9+openssl "SSLINC=-I/opt/openssl-0.9.8k/include" \
17199 +   "SSLLIB=-L/opt/openssl-0.9.8k/lib"
17200 +
17201 +makefile, http://kermit.columbia.edu/security.html, 25 Sep 2009.
17202 +
17203 +Built on HP-UX 11.11, 26 Sep 2009:
17204 + . make hpux1100 (ok)
17205 + . make hpux1100gcc (ok)
17206 + . make hpux1100o (gets a lot of warnings about sendpath and sendfile,
17207 +    because they are also declared in <sys/socket.h>, but builds OK)
17208 + . make hpux1000gcc+openssl \
17209 +    SSLINC=-I/opt/openssl/include SSLLIB=-L/opt/openssl/lib
17210 +
17211 +Note: sendpath and sendfile are not Kermit symbols.  The warnings are coming
17212 +from socket.h: 'Redeclaration of "sendfile" with a different storage class
17213 +specifier'.  This is nothing new; see notes of 2-4 Jan 2005.
17214 +
17215 +From Peter Eichhorn:
17216 + . Update to makefile to make current code build OK on HP-UX 8.00.
17217 + . Changes to format of some hints to make them more copy-and-pastable.
17218 +makefile, ckuu5.c, 28 Sep 2009.
17219 +
17220 +From Peter Eichhorn: Changes to HP-UX 7.0 target to increase the switch table
17221 +stack size, which was overflowing.  makefile, 30 Sep 2009
17222 +
17223 +HP-UX 6.5 (1989), "make hpux0650tcpc"... (8:19...)  Needed to not include
17224 +arpa/inet.h (which doesn't exist) and not use host address lists (add
17225 +-DNOHADDRLIST), which gets us past ckcnet.c, but in ckcftp.c we bomb out on
17226 +FD_SETSIZE undefined.  Somehow we worked around this in ckcnet.c.  Patched
17227 +in a definition in ckcftp.c, and also added -DINTSELECT to compiler flags.
17228 +Compiles ok, bombs at link time on bcopy, bzero, FD_ZERO, FD_SET, FD_ISSET.
17229 +Now it compiles and links OK but dumps core when started.  Added
17230 +-DNOCKGETFQHOST, rebuilt from scratch (takes 35 minutes).  It starts OK, but
17231 +it dumps core when given a "telnet xxx" command, where xxx is a hostname.
17232 +However, it works OK if an IP address is used: "telnet 123.45.6.78".  It
17233 +took all day to track this down, but now it's fixed (see the #ifdef HPUX6
17234 +sections of ckcnet.c).  So now (for the first time, I think) we have both
17235 +telnet and ftp in HP-UX 6.x, if anyone cares.  ckcnet.[ch], ckcftp.c,
17236 +makefile, 2 Oct 2009.
17237 +
17238 +Changed default SET TERMINAL TYPE type for K95 from vt320 to vt220.  This is
17239 +because Unix OS's such as Solaris have dropped vt320 as a terminal type.
17240 +settrmtyp(), ckuus7.c, 5 Oct 2009.
17241 +
17242 +I moved the PUTENV command code, which was inline, to a function, doputenv().
17243 +ckuus[r7].c, ckuusr.h, 5 Oct 2009.
17244 +
17245 +Changed the UNIX version of SET TERMINAL TYPE to take a value and then do
17246 +the equivalent of "export TERM=value" by calling doputenv().  This sets
17247 +\$(TERM) correctly and passes its value along to inferior processes.
17248 +However, to make this take effect within Kermit itself (for the fullscreen
17249 +file transfer display and for the SCREEN command, Ctrl-L, etc) I also had to
17250 +reinitialize the curses database, which is tricky because normally if you
17251 +feed it an unknown terminal name, it just exits.  ckuus7.c, 5 Oct 2009.
17252 +
17253 +Changed the little-known and little-used RESET command (which closes all
17254 +open files) to also put command echoing back to normal in case it got
17255 +messed up somehow (as in HP-UX 6.5, upon returning from PUSH).
17256 +ckuusx.c, 5 Oct 2009.
17257 +
17258 +For Unix, increased string buffer sizes for wildcard expansion for all
17259 +platforms that have BIGBUFOK defined from 500000 (0.5M) to 10000000 (10M)
17260 +bytes, and for 64-bit builds to 2000000000 (2G) bytes.  No point making
17261 +it bigger than that because malloc's argument is a size_t, which is an int.
17262 +ckufio.c, 5 Oct 2009.
17263 +
17264 +Built on Mac OS X 10.4.11, required one minor adjustment to the makefile
17265 +(-DNODCLINITGROUPS).  This was using the macosx10.5 target, which is
17266 +supposed to be universal like the linux and netbsd targets, but not yet
17267 +proven.  Also built a 64-bit version (-mpowerpc64 -mcpu=G5 -mtune=G5
17268 +-arch ppc64); it compiles and links OK but won't start: "Bad CPU Type
17269 +in executable".  Fix later...  makefile, 5 Oct 2009.
17270 +
17271 +Changes from Seth Theriault to suppress signed vs unsigned char warnings in
17272 +Mac OS 10.5.8 from gcc4, and a new makefile target for Mac OS X (presumably
17273 +10.3.9 or later) + Kerberos 5 and OpenSSL.  ckutio.c, ckuath.c, ckctel.c,
17274 +ckcnet.c, ckcftp.c, ck_crp.c, makefile, 6 Oct 2009.
17275 +
17276 +  Later I had to back out of these, because although it made for a
17277 +  clean build, in the resulting executable SSL connections didn't work.
17278 +
17279 +Tue Oct  6 17:23:27 2009
17280 +FTP address resolution is broken, but ftp_hookup() hasn't changed.
17281 +So... (see the #ifdef HPUX6 sections of ckcnet.c)  (I did, and I rolled
17282 +back some of the changes from the other day, but it made no difference.)
17283 +Putting back the ckcftp.c from a few weeks ago makes no difference.
17284 +Putting back the ckcnet.c from a few weeks ago makes no difference.
17285 +
17286 +Added patches from Seth Theriault so macosx10.5+krb5+openssl would build
17287 +on Mac OS X 10.3.9.  makefile, ckcftp.c, 7 Oct 2009.
17288 +
17289 +Built today's code on Linux RHEL4, NetBSD 5.0.1, Solaris 9, and Mac OS X
17290 +10.4.11, both with and without SSL.  The NetBSD system has OpenSSL 0.9.9-dev.
17291 +7 Oct 2009.
17292 +
17293 +In Mac OS X 10.6, the following symbols are unresolved at link time:
17294 +_des_key_sched, _des_new_random_key, _des_ecb_encrypt,
17295 +_des_init_random_number_generator, _des_fixup_key_parity.  This is
17296 +with OpenSSL 0.9.8k.  But it doesn't happen on other platforms that
17297 +have 0.9.8k.
17298 +
17299 +Added SET SESSION-LOG NULL-TERMINATED-TEXT.  This is for the benefit of a
17300 +speech synthesizer that will speak a line of text only after receiving a
17301 +NUL character.  A more general solution would be to define a filter or
17302 +whatever, but who has time.  ckuus[23x].c, 7 Oct 2009.
17303 +
17304 +Consolidated Mac OS X targets, and removed experimental 64-bit ones, because
17305 +they never could work in 10.5 and earlier because 64-bit libs are missing,
17306 +and 10.6 and later are 64-bit automatically.  makefile, 8 Oct 2009.
17307 +
17308 +Built on Mac OS X 10.6.1.  It came out automatically as a 64-bit build
17309 +because __LP64__ is defined somewhere that I can't find.  But this explains
17310 +why the 0.9.8k on 10.6 comes up with missing symbols when the 0.9.8k lib
17311 +10.5 (or on Solaris or on Linux) does not: it's a different library: "Mach-O
17312 +64-bit dynamically linked shared library x86_64", rather than "Mach-O
17313 +dynamically linked shared library ppc".  Probably the 64-bit version has
17314 +some things #ifdef'd out.  Added -m32 to the CFLAGS and LNKFLAGS for the
17315 +macosx+krb5+openssl targets, and it built OK one time.  But then the errors
17316 +came back.  makefile, 8 Oct 2009.
17317 +
17318 +Updated C-Kermit installation for Mac OS X in ckuwr.html on the website.
17319 +8 Oct 2009.
17320 +
17321 +Tried some things to get around the problem with OpenSSL in Mac OS X 10.6,
17322 +to no avail.  Asked Jeff.  He said, "MacOS X no longer includes DES anywhere
17323 +on the system.  Not for SSL, not for Kerberos, not for anything.  This will
17324 +increasingly become the situation on new operating systems.  Windows 7 and
17325 +2008 R2 will also ship with no DES."  Sure enough, the Mac OS X Server
17326 +Upgrading and Migrating document for 10.6 says, "Mac OS X Server v10.6 does
17327 +not support single DES encryption. It supports AES 128 and 256 encryption
17328 +types. However, during a migration or upgrade from v10.4 to v10.6, servers
17329 +that were Kerberized by the v10.5 Open Directory server will not use the AES
17330 +128 or 256 encryption types. To use the AES 128 or 256 encryption types you
17331 +must re-Kerberize all servers."  12 Oct 2009.
17332 +
17333 +DES and 3DES encryption can be excluding removing the -DCK_DES flag.  I
17334 +removed this one and -DLIBDES (and -m32) and this makes a working 64-bit
17335 +version.  Then I added code to the macosx+krb5+openssl target to use these
17336 +flags if the Mac OS X version was 10.5 or less and leave them out for 10.6
17337 +or later.  Tested on 10.4.11 and 10.6.1.  A better way to do it might have
17338 +been "nm -gj libssl.dylib | grep des_", but that gives the same results on
17339 +10.4 and 10.6.  Also, 10.6 still has /usr/include/ssl/des.h.
17340 +makefile, 13 Oct 2009.
17341 +
17342 +Next issue:
17343 +  In file included from ckutio.c:15674:
17344 +  /usr/lib/gcc/i386-redhat-linux/3.4.6/include/varargs.h:4:2: #error "GCC no
17345 +  longer implements <varargs.h>."
17346 +  /usr/lib/gcc/i386-redhat-linux/3.4.6/include/varargs.h:5:2: #error "Revise
17347 +  your code to use <stdarg.h>."
17348 +
17349 +The problem occurs when trying to force a non-ANSIC build with GCC.
17350 +Changing the source file to include <stdarg.h> instead of <varargs.h>
17351 +doesn't help because evidently <stdarg.h> requires an ANSI C compiler.
17352 +Nothing can be done about this.  13 Oct 2009.
17353 +
17354 +Next issue: Can't compile ckcftp.c with -DNOCSETS or -DNOSPL; some
17355 +#ifdef/#endif doesn't match up.  Sigh, this is the hardest kind of thing to
17356 +debug.  There's 17,622 lines of code in this module and no tool that I know
17357 +of.... Wait, I wrote one.  But it shows all the #if/#ifdef/#ifndef's and
17358 +#endifs matching up just fine.  Backing off to ckcftp.c of a few days ago
17359 +(before char / unsigned char casts were added), I see that it builds OK, so
17360 +I backed off to that one, but put back the special case #ifdef for MACOSX103
17361 +declaring CONST gss_OID_desc, and it builds OK (the other stuff was purely
17362 +cosmetic, when will I learn?).  ckcftp.c, 13 Oct 2009.
17363 +
17364 +Protected cvtstring() and related functions with #ifdef NOCSETS..#endif,
17365 +and ditto for the character-set conversion code in dorename().
17366 +ckuus6.c, 13 Oct 2009.
17367 +
17368 +Fixed an #endif /* TNCODE */ that was a line too low in ttptycmd(),
17369 +causing -DNONET builds to fail.  ckutio.c, 13 Oct 2009.
17370 +
17371 +There was a reference to doputenv() that wasn't guarded by #ifndef NOPUTENV,
17372 +fixed in ckuus7.c, 13 Oct 2009.
17373 +
17374 +Moved doputenv() and settermtyp() out of an #ifdef NOLOCAL section because
17375 +these are useful even when not making connections.  ckuus7.c, 13 Oct 2009.
17376 +
17377 +Moved havelfs declaration outside of #ifdef NOXFER because it was also used
17378 +for other things.  ckcmai.c, 13 Oct 2009.
17379 +
17380 +COPY /PRESERVE depended on code from the Kermit protocol module, which
17381 +is omitted in -DNOXFER builds.  Disabled COPY /PRESERVE in -DNOXFER
17382 +builds.  ckuus6.c, 14 Oct 2009.
17383 +
17384 +SHOW PROTOCOL code for external protocols had to be #ifdef'd out for
17385 +-DNOPUSH builds.  ckuus4.c, 14 Oct 2009.
17386 +
17387 +There was some confusion between "No XYZMODEM" and "No extermal protocols";
17388 +cleared up in ckuus3.c, 14 Oct 2009.
17389 +
17390 +After all that, 86 different combinations of feature selections built OK on
17391 +Linux.  And the Kerberized version (K5) works OK on Linux for Telnet and FTP.
17392 +14 Oct 2009.
17393 +
17394 +Changed version number to 9.0.  All modules, 16 Oct 2009.
17395 +
17396 +Need to make LOG SESSION log to a tty.  Right now "log session
17397 +/dev/ttyKeySerial1" says "Write permission denied" even though the device is
17398 +crw-rw-rw-.  This happens in zchko(), which is called by cmofi().  The
17399 +problem is that /dev/ is not writeable.  I added a Unix-only clause that
17400 +attempts to open the file for write access using open(), in order to get a
17401 +file descriptor, which then can be passed to isatty() to check if it's a
17402 +tty, and if so, to allow access.  And then close it.  I tested this on Mac
17403 +OS X as follows:
17404 +
17405 +  log session /dev/ttyKeySerial1
17406 +  telnet somehost
17407 +
17408 +The Mac's serial port was connected to the serial port of another computer
17409 +where Kermit displayed the incoming characters in CONNECT mode.  Glitches:
17410 +
17411 + 1. The port has to be set up as desired in advance, outside of Kermit.
17412 + 2. log session /dev/ttyKeySerial1 will hang if any required modem signals
17413 +    are not present when the port is opened.
17414 + 3. Bypasses lockfile mechanism - so we do this only if -DNOUUCP.
17415 +
17416 +For (2), I tried setting O_NDELAY / O_NONBLOCK, and this allowed zchko() to
17417 +continue, but then it freezes in the subsequent fopen().  So I changed
17418 +zopeno() to also check if the device is a serial port, and if so, to open()
17419 +it with O_NDELAY / O_NONBLOCK, and then convert the file descriptor into a
17420 +file pointer with fdopen().
17421 +
17422 +Now for the speaking device that needs lines to be terminated by NUL...
17423 +
17424 +  set session-log binary       <-- need to put these in SHOW LOG
17425 +  set session-log null-padded      (and in HELP SET LOG)
17426 +  set line /dev/ttyKeySerial1
17427 +
17428 +This part works.
17429 +
17430 +This feature is enabled only for -DNOUUCP builds because serial ports aren't
17431 +like other Unix files; we would have to create a lockfile, but we can't do
17432 +that...  actually, ttlock() takes a name as an argument, but ttunlck() does
17433 +not, so there would be no way to remove the lock.  Anyway, there is only one
17434 +API for configuring the port (speed, flow control, etc) and it only works
17435 +with the SET LINE device, not any random file.  To fix this would require
17436 +massive redesign and changes.  ckuus[23].c, ckufio.c, 19-20 Oct 2009.
17437 +
17438 +I made -DNOUUCP the default for Mac OS X, since everybody winds up building
17439 +it that way anyhow.  To undo this, do "make macosx KFLAGS=-UNOUUCP".
17440 +makefile, 21 Oct 2009.
17441 +
17442 +Changed SET SESSION-LOG TEXT to strip out ANSI escape sequences; 
17443 +previously there wasn't that much difference between TEXT and BINARY logs.
17444 +It's still not perfect; for example it doesn't delete characters that the
17445 +user erased.  (Made sure this still builds with -DNOESCSEQ.)
17446 +ckucns.c, 22 Oct 2009.
17447 +
17448 +Changed SHOW LOG to show the SET SESSION-LOG settings, as well as
17449 +SET DEBUG, which was not shown before.  ckuus5.c, 22 Oct 2009.
17450 +
17451 +If a series of PUTENV commands is given, each new one undoes the previous
17452 +one, so only the last definition is seen by the new fork (or by Kermit
17453 +itself).  Turns out you can't feed automatic variables to putenv(); they
17454 +have to be static, so to allow for multiple PUTENV commands Kermit has to
17455 +maintain an array of static strings.  ckuus7.c, 6 Nov 2009.
17456 +
17457 +From Seth Theriault, a better way for the makefile to determine the
17458 +Mac OS X version number; there's a program for this, sw_ver.  makefile,
17459 +6 Nov 2009.
17460 +
17461 +Peter Eichhorn reported that file-transfer failure hints were not coming
17462 +out since Dev.27.  The only change I made since then was to skip them if
17463 +the file-transfer protocol was not Kermit.  I was using the wrong variable
17464 +in the tests, 'proto' instead of 'protocol'.  ckuus5.c, 6 Nov 2009.
17465 +
17466 +Changed Mac OS X targets to correctly extract the Mac OS major version
17467 +from uname -r in order to choose correctly between utmp and utmpx; this
17468 +wasn't working in 10.6.1.  makefile, 6 Nov 2009.
17469 +
17470 +Fix from Seth T. for an oversight in the previous edit.  Also add
17471 +MACOSX103 to "show features" display.  makefile, ckuus5.c, 10 Nov 2009.
17472 +
17473 +Added REJECT as a synonym for DISCARD in SET FILE COLLISION; it's more
17474 +intuitive and more accurate.  ckuus[27].c, 15 Nov 2009.
17475 +
17476 +\fsplit() and \fword() always break on 8-bit characters unless you explicitly
17477 +put every single 8-bit value into the include set, e.g. (for a TSV file):
17478 +
17479 +  undef include
17480 +  for \%i 128 255 1 {
17481 +      if == \%i 9 continue
17482 +      .include := \m(include)\fchar(\%i)
17483 +  }
17484 +  .\%n := \fsplit(\m(line),&a,\9,\m(include))
17485 +
17486 +I changed cksplit() to treat all 8-bit bytes 128-255 as non-break characters
17487 +by default.  It might have made more sense to do this for 160-255 (since
17488 +128-159 are traditionaly C1 control characters) but thanks to Microsoft
17489 +tradition is out the window.  To treat one or more 8-bit characters as break
17490 +characters, put them in the break set.  This might break some scripts, but I
17491 +doubt it because this flaw was so awful that if anyone had come up against
17492 +they would have let me know.  ckclib.c, 16 Nov 2009.
17493 +
17494 +Changed the netbsd target to set -funsigned-char, since cc on NetBSD is
17495 +actually gcc.  makefile, 16 Nov 2009.
17496 +
17497 +Changed macosx targets to get the CPU type from the HOSTTYPE environment
17498 +variable.  Also added getenv("HOSTTYPE") as a last-resort method to set the
17499 +\v(cpu) variable at runtime (maybe it should be the first resort?)...
17500 +ckuus4.c, makefile, 16 Nov 2009.
17501 +
17502 +Made sure the solaris9_64 and solaris10 targets still work.  16 Nov 2009.
17503 +
17504 +Made sure the current source package builds OK on HP-UX 10.20...  Got a lot
17505 +of "warning 6062: Optdriver: Exceeding compiler resource limits in xxx; some
17506 +optimizations skipped. Use +Onolimit if override desired" but it builds OK.
17507 +Tested long file transfer; works OK.  17 Nov 2009.
17508 +
17509 +Built on FreeBSD 7.2 with and without OpenSSL, all OK.  17 Nov 2009.
17510 +
17511 +Built on NetBSD 5.0.1 with and without OpenSSL, all OK, but netbsd+krb5
17512 +fails with "can't find -lgssapi_krb5"; worked around this with
17513 +"K5LIB=-L/usr/local/kerblib" (where the lib actually is on this host) but
17514 +then it failed with "ckcftp.c:13868: error: 'gss_nt_service_name' undeclared".
17515 +17 Nov 2009.
17516 +
17517 +I found a VMS 6.2 system... Takes a loooong time to build there.  In
17518 +ckuusy.c, DEC C didn't like the prototypes and declarations of dorlgarg()
17519 +and dotnarg() as static so I made them not static.  But that didn't help,
17520 +now it fails at the very end, saying the final #ifdef is an invalid
17521 +statement.  It looks like an #ifdef mismatch that affects only VMS.  I ran
17522 +my #ifdef matcher, it turned up nothing.  I substituted a copy of ckuusy.c
17523 +from 2007, it comes up with the same errors.  Then I substituted the copy
17524 +from 8.0.211 from 2004, and this one compiled OK and, miraculously, the
17525 +whole mess even linked OK and runs OK.  The Alpha binary is 2.84MB.  Now I
17526 +have 4500 lines of code to compare....  I went through the two files line by
17527 +line and I can't see a single thing wrong.  I gave up and tried building the
17528 +TCP/IP version.  It builds fine except for ckuusy.c, with the utterly
17529 +useless error message:
17530 +
17531 +  #endif /* NOCMDL */
17532 +  ...................^
17533 +  %CC-E-BADSTMT, Invalid statement.
17534 +
17535 +Indicating the last line in the file.  Just for the heck of it, I put
17536 +another line after that one:
17537 +
17538 +  /* This is a test */
17539 +
17540 +and got:
17541 +
17542 +  /* This is a test */
17543 +  ....................^
17544 +  %CC-E-BADSTMT, Invalid statement.
17545 +
17546 +So it is not objecting to anything in the file.  Trying the old LISP trick,
17547 +I put an extraneous closing bracket after that.  Success!  Honestly, I don't
17548 +see anything wrong with file.  It's DEC C V5.3-006.  I suspect a C bug.
17549 +I'll leave it like this for now until I get access to some other VMS
17550 +versions.  Another clue is that when building the network version I get a
17551 +horrible warning I never saw before from a module that hasn't been touched
17552 +in a very long time (ckvrtl.c).  Also, in the network version, I note that
17553 +the FTP code is not compiled in.  We have to try this again with some
17554 +command-line switches, but it'll do for now.  ckuusy.c, 18 Nov 2009.
17555 +
17556 +---C-Kermit 9.0 Alpha.01---
17557 +
17558 +From Steven Schweda (SMS), the real solution for the VMS closing brace
17559 +problem, it wasn't a DECC bug, it was a me bug.  ckuusy.c, 20 Nov 2009.
17560 +
17561 +Rediscovered the new VMS build options: f for Long Files, i for Internal
17562 +FTP.  "make mnf" doesn't work on VMS 6.2, it looks like the VMS definition
17563 +for CK_OFF_T got lost.  Same thing with "make mfi".  Come back to this later.
17564 +
17565 +From Gerry Belanger, a fix to INPUT /COUNT:n.  ckuus4.c, 26 Nov 2009.
17566 +
17567 +Added \fsqueeze(s), returns string s with leading and trailing whitespace
17568 +removed, Tabs converted to Spaces, and multiple spaces converted to single
17569 +spaces.  For now, ASCII only, no options.  ckuusr.h, ckuus[24].c, 27 Nov 2009.
17570 +
17571 +I wrote a Kermit script to read a big file of addresses on Solaris 9,
17572 +\fsqueeze()ing each line.  After about 14000 lines, there was a malloc
17573 +failure in getnct() (the command-file reader).  There's nothing wrong with
17574 +\fsqueeze(), the failure is on a deeper level, because the same thing
17575 +happens if I use \fupper() (which is structurally identical to \fsqueeze())
17576 +in the same script.  The problem is not in getnct() either, because every
17577 +malloc() is freed (I checked).  On the other hand, the same script (with
17578 +\fupper() instead of \fsqueeze() completes OK in C-Kermit 8.0.201.  If I
17579 +remove the function call (\fsqueeze() or \fupper()) from the script, it also
17580 +runs OK in 9.0.  This seems to point the finger at fnevel(), which contains
17581 +countless malloc's and free's.  But comparing fneval() between 8.0.211 and
17582 +9.0, I don't see any difference that would explain this behavior -- nothing
17583 +at all that involves malloc(), makstr(), or free().  Nor any pertinent
17584 +change in the caller (zzstring) of fneval().  27 Nov 3009.
17585 +
17586 +Another problem is that when this happens, the error is not caught (e.g. by
17587 +the IF FAIL statement after the command that contains the function call);
17588 +instead, C-Kermit returns immediately to its prompt.  27 Nov 2009.
17589 +
17590 +It could simply be that some of the buffers we allocate are much bigger now.
17591 +But again, I don't see much difference between 8.0.211 and 9.0; we were
17592 +already allocating 32K command-related buffers (malloc() takes a size_t, and
17593 +size_t is an int almost everywere).  I built the same source on NetBSD and
17594 +ran the same script (with \fqueeze()), and it worked fine.  Let's worry
17595 +about this later, if it comes up.  27 Nov 2009.
17596 +
17597 +Built OK on Silicon Graphics IRIX 6.5 R10000; regular build OK, SSL and
17598 +Kerberos builds failed.  30 Nov 3009.
17599 +
17600 +Tried to build on Digital Unix 4.0F but it blew up in ckutio.c, apparently
17601 +not recognizing any of the terminal struct symbols from termios.h.  Tried
17602 +again with gcc, same thing.  Tried explicitly #including <sys/termios.h>
17603 +within #ifdef TRU64, same thing.  What could have changed?  30 Nov 2009.
17604 +
17605 +Built OK on Linux RHEL5.4/Itanium-2, make linux.  The secure build
17606 +required "FLAGS=-DNO_KRB5_INIT_ETS" and built OK.  30 Nov 2009.
17607 +
17608 +Built OK on Digital Unix 4.0F using "make osf" instead of "make tru64-40f".
17609 +I don't know why the specific target doesn't work, but it's not worth
17610 +chasing down.  2 Dec 2009.
17611 +
17612 +Built OK on MirBSD 10, despite a lot of gratuitous compiler warnings.  Built
17613 +OK on MirBSD 10, OpenBSD 4.5, and Fedora 10.  3 Dec 2009.
17614 +
17615 +(Various other successful Unix builds in these weeks...)
17616 +
17617 +Built on VMS 7.2 and 8.3 with and without TCP/IP, no problems.  11 Jan 2010.
17618 +
17619 +Built on VMS 8.3 with "make fi" to include the FTP client and long-file
17620 +support (mid Jan 2010).
17621 +
17622 +Built on VMS 8.3 with UXC 5.6 and HP SSL 1.3, which is OpenSSL 0.9.7e.
17623 +It compiled and linked OK but when I tried to make an FTP SSL connection
17624 +it crashed in SSL$LIBSSL_SHR, which is called from ssl_auth(), after having
17625 +had TLS accepted as an authentication type, but before actually
17626 +authenticating.  In Unix:
17627 +
17628 + 19. ftp open ftp.somecompany.com /user:pge.com/test_quota /password:xxxxxx
17629 +Connected to ftp.somecompany.com.
17630 +220-Somecompany FTP v6.0 for WinSock ready...
17631 +220 Welcome to the online storage FTP server.  Please check the main web
17632 +site for system announcements and AUP. (O)
17633 +---> AUTH TLS
17634 +234 AUTH command OK. Initializing SSL connection.
17635 +TLS accepted as authentication type
17636 +SSL DEBUG ACTIVE
17637 +=>START SSL/TLS connect on COMMAND
17638 +
17639 +In VMS:
17640 +
17641 + 19. ftp open ftp.somecompany.com /user:pge.com/test_quota /password:xxxxxx
17642 +Connected to ftp.somecompany.com.
17643 +220 Somecompany FTP v6.0 for WinSock ready...
17644 +---> AUTH TLS
17645 +234 AUTH command OK. Initializing SSL connection.
17646 +TLS accepted as authentication type
17647 +SSL DEBUG ACTIVE
17648 +%SYSTEM-F-ACCVIO, access violation, reason mask=04, virtual
17649 +address=FFFFFFFF8001A120, PC=000000000068B118, PS=0000001B
17650 +
17651 +Note: The Unix version received the second 220 response, the VMS version did
17652 +not.  That's odd, it's the same code...  25 Jan 2010.
17653 +
17654 +Added some essential details to the HELP FSEEK text.  ckuus2.c, 25 Jan 2010.
17655 +
17656 +Discovered that the result returned by \fsearch() is totally unreliable.
17657 +This is probably too hard to fix.
17658 +
17659 +FSEEK did not pay attention to SET CASE, searches were always case sensitive.
17660 +Fixed in ckuus7.c, 26 Jan 2010.
17661 +
17662 +FSEEK failed to find anything if the search pattern was matched in the first
17663 +line of the file.  Fixed in ckuus7.c, 26 Jan 2010.
17664 +
17665 +\fword() and \fsplit()....  Another change, but not backwards-incompatible.
17666 +One may now put the word ALL (just like that, all uppercase) as the include
17667 +set (4th argument) to indicate that there will be no break characters other
17668 +than those explicitly given in the break set, e.g. \fsplit(\m(xx),&a,:,ALL)
17669 +breaks a line only on a colon (:), nothing else.  The original rules for
17670 +cksplit() were more than a little counterintuitive: the default break set is
17671 +all non alphanums, and the default include set is all alphanums, so if you
17672 +wanted to parse (say) a CSV file, breaking only on comma, you had to think
17673 +of all the characters you wanted to keep.  This way you just say ALL.
17674 +ckclib.c, 26 Jan 2010.
17675 +
17676 +Speaking of CSV files... How can you put comma as a function argument when
17677 +comma is the function-argument separator?  Use one of these forms:
17678 +
17679 + \fsplit(\m(xx),&a,",",ALL)
17680 + \fsplit(\m(xx),&a,{,},ALL)
17681 + \fsplit(\m(xx),&a,\44,ALL)
17682 + \fsplit(\m(xx),&a,\fchar(44),ALL)
17683 +
17684 +From John Dunlap, U. of Washington Applied Physics Lab: 'When "stty -a <
17685 +/dev/ttyS0 | grep crtscts" shows "crtscts" (not "-crtscts") and when using a
17686 +three wire serial interface and when asking kermit to not use flow control
17687 +(set flow none) then "ckutio.c1" (see attachments) fails while "ckutio.c"
17688 +works.  The result of "diff -u ckutio.c1 ckutio.c" is attached as "diffs"'.
17689 +ckutio.c, 26 Jan 2010.
17690 +
17691 +Changed the year from 2009 to 2010 in the modules I worked on today and in
17692 +the heralds, etc.  ckckmai.c, ckuus5.c, ckutio.c, ckclib.c, ckuus7.c,
17693 +26 Jan 2010.
17694 +
17695 +Built on Linux Fedora Core 3, regular and with OpenSSL 0.9.7a.  Built on
17696 +Ubuntu 9.4 OK, but SSL and Kerberos builds failed due to not finding libs
17697 +and/or header files.  I'm sure this could be fixed...  27 Jan 2010.
17698 +
17699 +Added SSL, KRB4, and KRB5 to the startup herald for versions that were
17700 +built with SSL, Kerberos 4, or Kerberos 5.  Built OK on Fedora 3 with
17701 +linux+krb5+ssl and new banner shows correctly.  ckuus5.c, 27 Jan 2010.
17702 +
17703 +Set NO_KRB5_INIT_ETS by default in ckuath.h since krb5_init_ets() is a no-op
17704 +in Kerberos 1.4.x and later and in some installations it can't be found,
17705 +which clobbers the build.  ckuath.h, 27 Jan 2010.
17706 +
17707 +Adapted to MINIX 3 1.5, the first version that has virtual memory according
17708 +to Andy T, who should know.  On earlier versions (e.g. MINIX 3 1.2) any
17709 +attempt to build C-Kermit causes the compiler to crash.  Now the compiler
17710 +doesn't crash but it spews out countless warnings about old-fashioned
17711 +function declarations that I don't get anywhere else.  The real problems
17712 +came in ckutio.c where numerous symbols were undefined at compile time and
17713 +the POSIX function tcgetpgrp() was not found at link time, even though there
17714 +is a prototype for it in the MINIX header files, and there is no alternative
17715 +(since POSIX doesn't let us use ioctl()).  Also note that there is some
17716 +confusion over the compile-time symbols MINIX, MINIX2, MINIX3, and MINIX315.
17717 +You would expect MINIX to mean "any version of MINIX" but in some parts of
17718 +ckutio.c it means MINIX 1.0.  I sincerely doubt that C-Kermit 9.0 can be
17719 +built on any version of Minix before 3.1.5 so I removed the confusion and
17720 +made MINIX mean "any Minix".  It builds on 3.1.5 OK now, except for the FTP
17721 +client.  This can probably be fixed but...  Modules changed: ckcdeb.h,
17722 +ckuver.h, ckcmai.c, ckuus5.c, ckutio.c, 1 Feb 2010.
17723 +
17724 +Later.. Andy says MINIX does not support job control, so no program is ever
17725 +in the background.  That settles that!  1 Feb 2010.
17726 +
17727 +Built OK on Minix, Linux, Mac OS X, Solaris 9, NetBSD 5.0.1...  1 Feb 2010.
17728 +
17729 +---C-Kermit 9.0 Alpha.02---
17730 +
17731 +From Christian Corti at Uni-Stuttgart.de: fixes to allow building on SunOS
17732 +4.1, which once was my main development platform but which is long-gone from
17733 +here.  ckupty.c, ckutio.c, 9 Feb 2010.  (He says it is also necessary to
17734 +comment out the "struct winsize" and "struct ttysize" in sys/ioctl.h;
17735 +otherwise there will be a conflict with sys/ttycom.h (included by termios.h)
17736 +which also declares these structs. But you need both includes.')
17737 +
17738 +From John Dunlap, a fix for Kermit protocol fixed packet-timeout interval
17739 +going to a unexpected value (missing else clause in two places).
17740 +ckcfn2.c, 9 Feb 2010.
17741 +
17742 +Added an aixg target to build on AIX with gcc when gcc is not installed as
17743 +cc, and also added CC=$(CC) CC2=$(CC) clauses to the aix and aix+ssl
17744 +targets.  Wow, AIX really loses bigtime when receiving files through its ssh
17745 +server.  Streaming can't be used, sliding windows recover from errors but
17746 +there are tons of them using the default 4K packets; 500 works much better.
17747 +Built with IBM cc and gcc, and also tested (successfully) the new aix+ibmssl
17748 +target, in which the OpenSSL headers and libs are in a standard place.
17749 +makefile, 9 Feb 2010.
17750 +
17751 +In ckupty.h, make the #include <sys/ioctl.h> be #ifndef SUNOS41.
17752 +From Christian Corti.  10 Feb 2010.
17753 +
17754 +Built on VMS E8.4.  12 Feb 2010.
17755 +
17756 +Tried to build on a real VAX-11/785 but the machine seems to be seriously
17757 +wedged.  12-15 Feb 2010.
17758 +
17759 +Added note to CKVKER.COM to the effect the the 'f' option has no effect
17760 +on VAX architecture.  15 Feb 2010.
17761 +
17762 +Moved the #include "ckvrtl.h" in the FTP module to below the include for
17763 +utime.h, because building the VMS version with the 'i' option (meaning
17764 +"include internal ftp client") results in "struct utimbuf tp" erroring out
17765 +because struct utimbuf is not defined yet (at least in some version of VMS
17766 +with some version of C).  From Rob Brown, ckcftp.c, 20 Feb 2010.
17767 +
17768 +From Martin Vorlaender: new code in VMS C-Kermit build procedure to detect
17769 +OpenSSL version automatically.  ckvker.com, 22 Feb 2010.
17770 +
17771 +Added code to INPUT command to strip ANSI escape sequences.  It's activated
17772 +by SET SESSION-LOG TEXT.  ckuusr.h: added prototype for chkaes();
17773 +ckucon.c, ckucns.c: made inesc[] and oldesc[] global instead of static; 
17774 +ckuus4.c: doinput() code for skipping escape sequences.  1 Mar 2010.
17775 +
17776 +Peter Eichhorn complained that if you make an ssh connection with Kermit,
17777 +then log out from the ssh host, and then use a "connect" command to
17778 +make a new connection to the same host (which you can do with Telnet),
17779 +Kermit says (e.g.):
17780 +
17781 + DNS Lookup... Can't get address for ssh -e none somehostname
17782 + Sorry, can't open ssh -e none somehostname: Error 0
17783 +
17784 +I added code to detect and handle this case and it seems to work OK, even
17785 +though it's kind of a hack.  ckuusr.[ch], ckuus7.c, 1 Mar 2010.
17786 +
17787 +There has never been a clean way to put debugging messages (ECHO commands)
17788 +in a script which are executed only if debugging is desired and ignored
17789 +otherwise.  You'd have to set a random variable and test it, or define a
17790 +macro or whatever.  To make this more straightforward, I added SET DEBUG
17791 +MESSAGE ON/OFF/STDERR, and added a new MESSAGE (syn: MSG) command for printing
17792 +debugging messages to stdout if SET DEBUG MESSAGE is ON or to stderr if SET
17793 +DEBUG MESSAGE is STDERR.  ckcmai.c, ckuus[r23].c, 12 Mar 2010.
17794 +
17795 +Also for debugging and error messages, I added \v(lastcommmand) so that
17796 +the command that failed can be included in an IF FAIL or DEBUG error message.
17797 +This works even for commands that have syntax errors.
17798 +ckuusr.h, ckuus5.c, ckucmd.c, 12 Mar 2010.
17799 +
17800 +From SMS for VMS: 'Added/documented P3 options INTSELECT, OLDFIB, OLDIP.
17801 +Disabled (commented out) automatic definition of NOSETTIME for VMS before
17802 +V7.2 (vms_ver .lts. "VMS_V72").'  ckcdeb.h, ckcftp.c, ckcnet.c, ckuus[2567].c,
17803 +ckvfio.c, ckvker.com, ckvrtl.[ch], 15 Mar 2010.
17804 +
17805 +Exposed inesc[] and oldesc[] for VMS, so new INPUT command escape-sequence
17806 +stripping can work (really, chkaes() and related global variables should be
17807 +moved out of ck[uvd]con.c/ckucns.c and into a common module; do that later).
17808 +ckuusr.h, ckvcon.c, 15 Mar 2010.
17809 +
17810 +Built OK on Solaris9, Mac OS X 10.4.11, RHEL4 (32-bit), RHEL5 (64-bit),
17811 +AIX 5.3, SCO OpenServr 6.0.0...  15 Mar 2010.
17812 +
17813 +Not so good on VMS, turns out I made a typo in one of the VMS updates
17814 +(#ifndef OLDIP instead of #ifdef...).  ckcnet.c, 16 Mar 2010.
17815 +
17816 +More from SMS for VMS, 16 Mar 2010:
17817 + . Set MAXPATH correctly for VMS, ckcdeb.h.
17818 + . NAM -> NAML, QIO replaces system( "SET PROTECTION"), bugfixes in
17819 +   cvtdir() and nzltor(), ...  (See comments): ckvfio.c, new ckvrms.h.
17820 +   (The RMS code in ckvfio.c was almost totally rewritten)
17821 + . Moved "NAMX$*" (and related) macros to ckvrms.h, and renamed to
17822 +   "NAMX_*" (and similar "$" -> "_"), moved "FIB_*" macros from ckvrtl.c.
17823 +
17824 +These changes are mainly to accommodate the ODS5 file system, which has
17825 +longer and mixed-case filenames, and also to execute certain commands
17826 +(e.g. for setting file protection, deleting directories) directly instead
17827 +of using a system() command.
17828 +
17829 +Built OK on VMS 8.3 (with and without network support).  16 Mar 2010.
17830 +
17831 +Failed to build on VMS 6.2.  16 Mar 2010.
17832 +
17833 +FreeBSD 8.0 <libutil.h> has a hexdump() prototype that conflicts with the
17834 +hexdump macro defined in ckcdeb.h.  Since the same thing is likely to happen
17835 +elsewhere, I changed the Kermit macro to ckhexdump as well all references to
17836 +it: ckcdeb.h, ckcftp.c, ckcnet.c, ckctel.c, ckuath.c, ckutio.c, 16 Mar 2010.
17837 +
17838 +Built OK on Digital Unix Tru-64 4.0E using "make osf", 16 Mar 2010.
17839 +
17840 +Tried again to build Digital Unix Tru64 4.0E using "make tru64-40e", but
17841 +something prevents it from picking up the termios symbols and it blows up in
17842 +ckutio.c, whereas this used to work in earlier C-Kermit versions.  This is
17843 +the only Tru64 system I still have access to, so I can't tell if it's a
17844 +local peculiarity or what.  Note that POSIX is not defined for this build.
17845 +But if I define it, I get into trouble with "struct timeval".  Tried again
17846 +with "KFLAGS=-DPOSIX -DNOTIMEVAL" but that doesn't help.  Tried "make
17847 +dec-osf" and that worked OK but oddly enough it makes a Kermit with less
17848 +features than "make osf".  16 Mar 2010.
17849 +
17850 +To go with MESSAGE and SET DEBUG MESSAGE, I added IF DEBUG, which is true
17851 +if SET DEBUG MESSAGE is not OFF and false otherwise.  ckuusr.h, ckuus6.c,
17852 +16 Mar 2010.
17853 +
17854 +From SMS: Corrections to my merging of SMS's changes, ckcftp.c, ckvrtl.h.
17855 +Builds OK on VMS 6.2 now.  Also did an SSL build on VMS 8.3 with OpenSSL
17856 +m0.9.7e and "OPENSSL_DISABLE_OLD_DES_SUPPORT" was included in P3
17857 +automatically by Martin V's addition to ckvker.com.  17 Mar 2010.
17858 +
17859 +From SMS: #include <types.h> earlier for VMS in ckcdeb.h to pick up off_t
17860 +before it is referenced.  This allows C-Kermit to compile on VMS/Alpha 6.2
17861 +but linking fails on fseeko() and ftello() (and yet, a functional executable
17862 +is created, and FSEEK works right).  Builds the same way with no problems at
17863 +all on VMS 8.3 / Alpha.  In this case we get the full 64-bit arithmetic...
17864 +Well, 62 bits:
17865 +
17866 +  ATLAS::C-Kermit>( ^ 2 63)
17867 +   9223372036854775000.0
17868 +  ATLAS::C-Kermit>( ^ 2 62)
17869 +   4611686018427387904
17870 +
17871 +whereas on VMS 6.2 we get integers only up to (^ 2 30).  17 Mar 2010.
17872 +
17873 +Changed the VMS build procedure to enable large file support automatically
17874 +for non-VAX and VMS 7.3 or greater.  No reason not to include this feature.
17875 +Changed the sense of the F option to DISABLE large file support in the
17876 +unlikely case that C-Kermit is being built on a suitable platform but the
17877 +C library is older than VMS73_ACRTL-V0200, in which case fseeko() and
17878 +ftello() will come up missing at link time.  ckvker.com, 18 Mar 2010.
17879 +
17880 +Changed VMS build procedure to include the FTP client in any network build
17881 +by default.  Changed the sense of the I option to exclude the FTP client,
17882 +in case anybody would want to do that.  ckvker.com, 18 Mar 2010.
17883 +
17884 +From SMS: updated dependencies in CKVKER.COM, fix the "don't reinclude me"
17885 +clause in CKVRTL.H.  19 Mar 2010.
17886 +
17887 +Built OK on VMS 6.2 and 8.3 with and without networking.  Large file support
17888 +included automatically in VMS 8.3  FTP client included automatically in both
17889 +network builds.  19 Mar 2010.
17890 +
17891 +Changed hexdump() to ckhexdump() in ck_crp.c, which I missed before.
17892 +19 Mar 2010.
17893 +
17894 +---C-Kermit 9.0 Alpha.03---
17895 +
17896 +In HP-UX with the bundled-non ANSI compiler, we get warnings about functions
17897 +such as endusershell(), which are declared void in the header files.  But in
17898 +non-ANSI builds we defind VOID to be int rather than void, so our prototypes
17899 +are wrong.  I checked that HP-UX 9, 10, and 11 all have void datatype and
17900 +changed the definition of VOID to void in those cases.  ckcdeb.h, 29 Mar 2010.
17901 +
17902 +Fixed a typo in a debug() statement in cksplit() that was causing some
17903 +warnings.  ckclib.c, 29 Mar 2010.
17904 +
17905 +Ditto in tls_load_certs().  ck_ssl.c, 29 Mar 2010.
17906 +
17907 +"make hpux1000o+ssl" files with:
17908 +/usr/ccs/bin/ld: Unsatisfied symbols:
17909 +   __umoddi3 (code)
17910 +   __udivdi3 (code)
17911 +   __eprintf (code)
17912 +
17913 +It appears that OpenSSL (0.9.7c in this case) requires -lgcc.
17914 +And indeed hpux1000gcc+ssl builds fine.  29 Mar 2010.
17915 +
17916 +There are various warnings in the SSL code in ckutio.c, ckcftp.c, and
17917 +ckcnet.c about pointers not being assignment compatible, but I have learned
17918 +from experience not to try to fix these (see notes from 6 Oct 2009).
17919 +29 Mar 2010.
17920 +
17921 +connect(s, (struct sockaddr *)&hisctladdr, sizeof (hisctladdr)): In FTP,
17922 +this doesn't work on RHEL5 / Mac OX X 6.1/2 64-bit.  But the connect() in
17923 +Telnet works.  On Mac OS X 6.2 I tried changing the socket() call to be like
17924 +the one in ckcnet.c for Telnet, but it made no difference.  On a RHEL5.4
17925 +system on i386, FTP works fine, so it's not the Red Hat version.  On Digital
17926 +Unix 4.0E 64-bit, same thing:
17927 +
17928 +  11:23:10.722 ftp_hookup[kermit.columbia.edu]=21
17929 +  11:23:10.722 ftp hookup A[kermit.columbia.edu]
17930 +  11:23:10.722 ftp hookup C[kermit.columbia.edu]
17931 +  11:23:10.722 ftp hookup socket=4
17932 +  11:23:10.722 ftp hookup HADDRLIST
17933 +  11:23:10.723 ftp hookup connect failed=13
17934 +  11:23:10.723 ftp hookup bad
17935 +
17936 +13 = Permission denied:
17937 +
17938 +  [EACCESS] Search permission is denied for a component of the path prefix;
17939 +    or write access to the named socket is denied.
17940 +
17941 +On Gentoo Linux, also on Alpha, the errno is 51: Network is unreachable.
17942 +Clearly some data type in the sockets structs is out of whack.
17943 +
17944 +The third connect() argument is "address length".  The address is a
17945 +struct sockaddr.  About the third argument, RHEL5 "man connect" says:
17946 +
17947 +  The third argument of connect() is in reality an int (and this is what 
17948 +  4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in 
17949 +  the present socklen_t, also used by glibc.  See also accept(2).
17950 +
17951 +Building on RHEL5 on x86_64, where size_t is 8 and socklen_t is 4, I get a
17952 +warning:
17953 +
17954 +  ckcftp.c: In function 'ftp_hookup':
17955 +  ckcftp.c:14667: warning:
17956 +   comparison is always true due to limited range of data
17957 +
17958 +Referring to:
17959 +
17960 +  if (hisctladdr.sin_addr.s_addr != (unsigned long) -1)
17961 +
17962 +This seems to be the problem; if I remove the (unsigned long) cast (in two
17963 +places), the problem goes away.  Actually what I should be comparing it with
17964 +is INADDR_NONE, which is defined appropriately in some header file, e.g. as
17965 +0xffffffff.  Also I define it explicitly as -1 if it is not defined in any
17966 +header file (as is the case in Solaris 9).  Tested OK on 64-bit RHEL5,
17967 +32-bit RHEL5, Digital Unix 4.0E 64-bit, Solaris 9 32-bit, Mac OS X 10.4.11
17968 +32-bit, Mac OS X 10.6.3 64-bit, AIX 5.3, Gentoo Linux 2.6.31 on Alpha
17969 +64-bit, NetBSD 5.0.1 32-bit....  ckcftp.c, 29 Mar 2010.
17970 +
17971 +---C-Kermit 9.0 Alpha.04---
17972 +
17973 +Yesterday's VOID redefinition caused problems for HP-UX in ckuusx.c, in the
17974 +curses section where VOID is undef'd and not used to avoid a conflict with
17975 +curses.h.  As a workaround I defined a new macro CKVOID with the same
17976 +definition as VOID and used it in the offending section of ckuusx.  The real
17977 +solution is to replace all references to VOID with CKVOID (since VOID is
17978 +increasingly likely to cause conflicts), but a mass search and replace is
17979 +not without risks.  ckcdeb.h, ckuusx.c, 30 Mar 2010.
17980 +
17981 +Changed VOID and CKVOID definition to be 'void' for all HP-UX (verified by
17982 +PeterE back to HP-UX 6.5, 1989).  Still need to check this on HP-UX 5.21;
17983 +if that's an exception it can be done in the makefile.  ckcdeb.h, 30 Mar 2010.
17984 +
17985 +The change I made to allow CONNECT to reestablish a previous SSH connection
17986 +prevented a new SSH connection to a different host to be made.  Fixed in
17987 +ckuus7.c, 30 Mar 2010.
17988 +
17989 +Fixed mistaken extern declarations of krb4_errno and krb5_errno as strings
17990 +in nvlook(); they are ints. Built OK on Mac OS X 10.6.3. ckuus4.c, 30 Mar 2010.
17991 +
17992 +A fix to Trusted HP-UX makefile target from PeterE, to account for the
17993 +equivalence of +openssl and +ssl as target suffixes.  30 Mar 2010.
17994 +
17995 +Added a new function \fcvtcsets(string,cset1,cset1) that converts a string
17996 +from one character set to another.  The csets are File Character-Set names.
17997 +ckuus4.c, 31 Mar 2010.
17998 +
17999 +Added a new function \fdecodehex(string,prefix) that decodes a string
18000 +containing prefixed hex bytes.  Default prefix is %%, but any prefix of
18001 +one of two chars (such as % or 0x) can be specified.  ckuusr.h, ckclib.h,
18002 +ckclib.c, ckuusr.c, 31 Mar 2010.
18003 +
18004 +Richard Nolde reports that Kermit can't find -lpam on Fedora 12 because it's
18005 +in /lib rather than /usr/lib.  RHEL5 has symlinks, FC12 should too.  Added a
18006 +note to the makefile.  1 Apr 2010.
18007 +
18008 +Build on Solaris 11 for the first time.  Had to adjust ckuver.h to get the
18009 +version herald right.  This was on a box that reported its architecture as
18010 +i86pc.  1 Apr 2010.
18011 +
18012 +Added MIME character-set names as invisible synonyms in the file and
18013 +terminal character-set tables, fcstab[] and tcstab[].  Note that not all the
18014 +character sets known to Kermit are registered in MIME.  But at least now
18015 +MIME-registered character sets can be referred to by their MIME names, e.g.
18016 +ISO-8859-1, ISO646-ES, IBM437, WINDOWS-1252.  These are not listed if you
18017 +type ? in a field that is parsing them, unless you type a letter first,
18018 +e.g. "i?" lists ISO- and IBM set names.  Later maybe I'll make parallel
18019 +tables, or keyword attribute bit that says whether a name is MIME or not.
18020 +The real benefit of this change is that now Kermit can take its
18021 +character-set names from external sources like email headers or web logs.
18022 +ckuxla.c, 1 Apr 2010.
18023 +
18024 +Changed the IF command to accept a bare macro name its condition.  This will
18025 +parse and execute correctly if the macro is defined and if it has a numeric
18026 +value, or if it is not defined, in which case it evaluates to 0 (FALSE).  If
18027 +it is defined but has a non-numeric value, a parse error occurs.  ckuus6.c,
18028 +2 Apr 2010.
18029 +
18030 +Added \fstringtype() function.  Given a string argument, it tells whether
18031 +the string is 7bit, 8bit, utf8, binary, etc.  ckuusr.h, ckuus[4x].c,
18032 +2 Apr 2010.
18033 +
18034 +Did a few builds to make sure there were no booboos.  Solaris 9, NetBSD
18035 +5.01, Linux RHEL4, HP-UX 10.20 (non-ANSI compiler and ANSI optimizing
18036 +compiler), Mac OS X 10.4.11, SCO OSR 6.00.  5 Apr 2010.
18037 +
18038 +---C-Kermit 9.0 Alpha.05---
18039 +
18040 +Increased maximum variable name length from 4K to 16K. Verified that
18041 +too-long names are caught and recovered from correctly.  ckuusr.h, 6 Apr 2010.
18042 +
18043 +Implemented a new \fsplit() option for parsing CSV files, which turns out to
18044 +be a little complicated, because the separator is not just a comma, but a
18045 +comma and all its surrounding spaces.  Also there are special quoting rules
18046 +for fields with embedded commas and fields with embedded quotes.  ckclib.c,
18047 +7 Apr 2010.
18048 +
18049 +---C-Kermit 9.0 Alpha.06---
18050 +
18051 +VMS changes from SMS.  They build OK, Kermit file transfers are still OK,
18052 +but FTP text-mode GETs always hang on the 10th 8K network read.  Couldn't
18053 +get a debug log this time.  ckcmai.c, ckvfio.c, ckvrms.h, ckvker.com.
18054 +8 Apr 2010.
18055 +
18056 +Changing VNAML from 4K to 16K broke the build on HP-UX 9.  Put it back to
18057 +4K.  9 Apr 2010.
18058 +
18059 +John Dunlap, running days-long stress tests between E-Kermit and C-Kermit,
18060 +found a bug in the packet-reading and -decoding code: If a NAK packet
18061 +arrives with its length field corrupted to indicate a bigger size, and there
18062 +are enough bytes following in the pipeline, ttinl() will return a too-long
18063 +packet (if there are not enough bytes waiting to be read, then ttinl() will
18064 +properly time out).  In the bad case rpack() trusts the packet length, uses
18065 +it as the basis for computation of the block-check length, which is then
18066 +used to access memory that might not be there, causing (at least on John's
18067 +Linux system) a segmentation fault.  John added the normal clause to check
18068 +the result of the block-check calculation, and I changed ttinl() to always
18069 +break on the eol character (normally carriage return), since this can never
18070 +appear in a packet, even if we "set control unprefix all".  Also added a
18071 +check to ttinl() to protect against length fields corrupted into illegal
18072 +values.  ckcfn2.c, ckutio.c, 13 Apr 2010.
18073 +
18074 +From Lewis McCarthy:
18075 +  Based on code inspection, C-Kermit appears to have an SSL-related security
18076 +  vulnerability analogous to that identified as CVE-2009-3767 (see e.g.
18077 +  http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3767).
18078 +
18079 +  I'm attaching a patch for this issue relative to the revision of ck_ssl.c
18080 +  obtained from a copy of http://www.columbia.edu/kermit/ftp/test/tar/x.zip
18081 +  downloaded on 2010/07/30, which I believe is the latest.
18082 +
18083 +  When this flaw was first widely publicized at last year's Black Hat
18084 +  conference, it was claimed that some public certificate authorities had
18085 +  indeed issued certificates that could be used to exploit this class of
18086 +  vulnerability. As far as I know they have not revealed specifically which
18087 +  public CA(s) had been found issuing such certificates.
18088 +  Some references: http://www.mseclab.com/?p=180
18089 +  http://www.theregister.co.uk/2009/07/30/universal_ssl_certificate/
18090 +
18091 +Patches added to ck_ssl.c, 4 Aug 2010.
18092 +
18093 +Peter Eichhorn reported that "RENAME ../x ." didn't work.  This is a side
18094 +effect of the changes of 2006 to the RENAME command, there was a little
18095 +confusion in the renameone() routine; fixed in ckuus6.c, 4 Aug 2010.
18096 +
18097 +If only one file is FOPEN'd, FCLOSE given with no arguments would close it.
18098 +Turns out to be a bad idea. Example: program with an input and output file,
18099 +try to close the output file before it is opened by just typing FCLOSE; this
18100 +can mess up the input file.   For safety FCLOSE has to require a channel
18101 +number or ALL.  ckuus7.c, 4 Aug 2010.
18102 +
18103 +Added \fstrcmp(s1,s2,case,start,length), which has the advantage over IF
18104 +EQU,LGT,LLT that case senstivity can be specified as a function arg, and
18105 +also substrings can be specified.  ckuusr.h, ckuus[24].c, 5 Aug 2010.
18106 +
18107 +The CSV feature of Alpha.06 had a subtle flaw, namely that if the last item
18108 +in a comma separated list was enclosed within doublequotes with a trailing
18109 +space after the closing doublequote, a spurious empty final element would be
18110 +created in the result array.  Fixed in cksplit(), ckclib.c, 5 Aug 2010.
18111 +
18112 +---Alpha.07---
18113 +
18114 +The CSV feature of \fsplit() splits a comma-separated list into an array.
18115 +To turn the array back into a comma separated list, \fjoin(&a,\44,1) almost
18116 +works, except for elements contain literal doublequotes, such as:
18117 +
18118 +  Mohammad "The Greatest" Ali
18119 +
18120 +This calls for making a symbolic CSV argument for \fjoin() like the one that
18121 +was made for \fsplit(): \fjoin(&a,CSV).  Also \fjoin(&a,TSV) for
18122 +Tab-separated list.  Thus if Kermit reads a record in CSV format, splits it
18123 +into an array, and then joins the array back into a CSV record, the result
18124 +will be equivalent to the original, according to the CSV definition.  It
18125 +might not be identical, because if the result had extraneous spaces before
18126 +or after the separating commas, these are discarded, but that does not
18127 +affect the elements themselves.  Furthermore it is now possible to convert
18128 +a comma-separated list into a tab-separated list, and vice versa (which is
18129 +not a simple matter of changing commas to tabs or vice versa).  ckuus4.c,
18130 +12 Aug 2010.
18131 +
18132 +From Joop Boonen 26 Juli 2010: "Added HAVE_LOCKDEV as openSuSE >= 11.3 uses
18133 +lockdev but not baudboy.  They use ttylock directly.  The program code has
18134 +been added so the the program works without a problem."  makefile, ckcdeb.h,
18135 +ckutio.c, ckuus5.c, 23 Aug 2010.
18136 +
18137 +---Alpha.08---
18138 +
18139 +From Gary Mills at the U of Manitoba: convert Solaris version from BSD ptys
18140 +to streams ptys because there are only 48 BSD-style ptys and he was running
18141 +out.  No code changes needed, the only change necessary was to add the
18142 +following flags to the makefile target:
18143 +
18144 +  -DHAVE_STREAMS -DHAVE_GRANTPT -DHAVE_PTSNAME
18145 +  -DPUSH_PTEM -DPUSH_LDTERM -DPUSH_TTCOMPAT
18146 +
18147 +makefile, ckcmai.c, 21 Sep 2010.
18148 +
18149 +Testing this in Solaris 9 I see that the DES library disappeared.  Added
18150 +code to the solaris9 targets (also used by Solaris 10 and 11) to check for
18151 +this.  makefile, 21 Sep 2010.
18152 +
18153 +The Solaris target checked the OpenSSL version automatically to set the
18154 +right flag, the Linux target didn't.  Put the OpenSSL-version testing code
18155 +in the Linux target too.  makefile, 21 Sep 2010.
18156 +
18157 +A couple minor changes to the tru64-51b makefile targets from Steven Schweda
18158 +but there still are some problems with the Tru64 Unix builds.
18159 +makefile, 21 Sep 2010.
18160 +
18161 +---Alpha.09---
18162 +
18163 +\fcontents(\&a[3]) got an error if the array was declared but its dimension
18164 +was less than 3, which is bad when dealing with (say) an array created
18165 +dynamically by \fsplit(), which might or might not have a third element.
18166 +In case it doesn't -- i.e. in case we are referring to an out of range
18167 +element of any array that is declared -- we should just return a null
18168 +string, as we do with other types of variables that are not defined.
18169 +For that matter, ditto even if the array is not declared; what useful
18170 +purpose is served by throwing an error in this case?
18171 +ckuus4.c, 30 Dec 2010.
18172 +
18173 +cksplit() treats \ as a quoting character.  If the source string contains
18174 +backslashes, they are swallowed (or, if doubled, one is kept).  That's not
18175 +good for parsing external data, such as lines read from files, where there
18176 +are no quoting rules.  This came up when parsing CSV files; as a workaround,
18177 +I made \fsplit() treat backslash as an ordinary character for CSV and TSV
18178 +splitting (a better solution might be yet another argument that specifies
18179 +a quote character).  ckclib.c, 30 Dec 2010.
18180 +
18181 +Began converting C-Kermit to Open Source with the Simplified 3-Clause BSD
18182 +license.  Updated the text for the INTRO, LICENSE, NEWS, and SUPPORT
18183 +commands.  Fixed things so the copyright year to be displayed is defined in
18184 +one place (ck_cryear in ckcmai.c), rather than hardwired into text strings
18185 +all over the place.  COPYING.TXT, ckcmai.c, ckuus[256].c, 2 Jun 2011.
18186 +
18187 +When I added MIME synonyms for Kermit character-set names, I left a bogus
18188 +entry in the tables ("windows-1251") that was in the wrong place
18189 +alphabetically, thus preventing most references to file character-set names
18190 +from working right.  Removed the bogus entry.  ckuxla.c, 2 Jun 2011.
18191 +
18192 +Most combinations work OK, but not translating Cyrillic text from UTF-8
18193 +to Latin/Cyrillic, and probably the same would be true for any case of
18194 +converting from UTF-8 or UCS-2 to anything else.  The problem was in
18195 +xgnbyte(), which converts the input stream from the specified character to
18196 +UCS2; it needed to make a special case for when the input file was already
18197 +Unicode.  Believe it or not, this problem occurred at least as far back as
18198 +8.0.201 (9.5 years ago) and nobody noticed.  So if the fix isn't perfect
18199 +probably nobody will notice that either.  ckcfns.c, 3 Jun 2011.
18200 +
18201 +The SET BLOCK CHECK command did not parse all the items in its keyword
18202 +list.  Fixed in ckuus3.c, 3 Jun 2011.
18203 +
18204 +For EM-APEX ocean floats project, where buoys in stormy waters have to
18205 +transmit data through an earth satellite using non-error-correcting modems,
18206 +John Dunlap ran exhaustive stress tests of Kermit protocol transfers through
18207 +a simulated connection that injected errors and delays and identified a
18208 +weakness in Kermit protocol when it is used under extremely bad conditions:
18209 +If a data byte of the S packet (or its Ack) is corrupted and the 1-byte
18210 +checksum is also corrupted in such a way that that the checksum matches the
18211 +corrupted data, the two Kermit programs will disagree as to the negotiated
18212 +parameters.  For example, if file Sender's RPT field is changed from '~' to
18213 +'^', the receiver will decode the packet incorrectly.  Ditto for most of the
18214 +other parameters.  The result is that a corrupted file is received but
18215 +reported correct.  John suggested a new mode of operation in which the Type
18216 +3 block check is used for all packets.  Such a mode can not be negotiated
18217 +because the negotiation packet itself is assumed by all Kermit programs to
18218 +have a 1-byte checksum.  Added SET BLOCK-CHECK 5 to the parser (with
18219 +invisible synonym FORCE-3".  ckuus3.c, 3 Jun 2011.
18220 +
18221 +Added supporting code for SET BLOCK 5: ckcfn[23].c, ckcpro.w, ckcmai.c,
18222 +ckuus3.c, 3 Jun 2011.
18223 +
18224 +Added code to skip the heuristic that S and I packets always have block
18225 +check type 1.  File transfer OK between two C-Kermits with SET BLOCK 5.
18226 +rpack(): ckcfn2.c, 5 Jun 2011.
18227 +
18228 +Made the file receiver put "5" in the block-check-type in its ACK to the
18229 +S-Packet.  spar(): ckcfns.c, 5 Jun 2011.
18230 +
18231 +Now the question is: Can we make the file receiver automatically and safely
18232 +recognize a three-byte block check on an incoming S or I packet?  It's
18233 +tricky because the block check field is not self-identified, it's just the
18234 +last "n" characters of string indicated by the length field, so correct
18235 +decoding of the packet depends on stateful knowledge of "n".  How about this:
18236 +rpack() already knows what type of packet it is, so if it's an S or I packet
18237 +and the 8th byte of the data field is "5" and last 3 bytes, when interpreted
18238 +as the CRC, match the packet contents, then we accept the packet and switch
18239 +to BLOCK 5 mode.  
18240 +
18241 +On the other hand, if the "5" was put there by corruption, the CRC should
18242 +catch the error.  In that case we NAK the packet and presumabely get a
18243 +different version back.  There would be no reason to try to re-read the same
18244 +packet with a different block check, because the "5" could not possibly be
18245 +there legitimately unless it had a 3-byte CRC.  To be clear, this is
18246 +cheating.  We read the packet contents before we know the packet is correct,
18247 +then we check that it *is* correct.  I made the 4-line change to rpack()
18248 +and it works OK in the absense of transmission errors.  ckcfn2.c, 3 Jun 2011.
18249 +
18250 +So the various combinations should work as desired:
18251 +
18252 + . Sender and receiver both support and are told to SET BLOCK 5 ("SB5").
18253 + . Sender SB5, but receiver doesn't support it (errors out).
18254 + . Sender SB5, receiver supports it but wasn't told (auto-recognizes it).
18255 + . Receiver SB5 but sender no (errors out).
18256 +
18257 +Note in the last case, the receiver should NOT automatically fall back to
18258 +standard behavior because if the user said SET BLOCK 5 that means every
18259 +packet MUST be protected by CRC to prevent the I/S packets from being
18260 +corrupted.
18261 +
18262 +Installed new HELP SET BLOCK-CHECK text.  ckuus2.c, 5 Jun 2011.
18263 +
18264 +Autodownload didn't work when the S or I packet had a 3-byte block check
18265 +because kstart() checked it for a 1-byte checksum.  Fixed in kstart(),
18266 +ckcfn2.c, 6 Jun 2011.  However, older Kermit versions and programs that
18267 +claim to do "autodownload" will never recognize this type of packet.  No
18268 +big deal since even if they did, the transfer would fail anyway.
18269 +
18270 +Added 'FORCE 3' to E-Kermit, called it EK 1.7.  The option is "-b 5".  Works
18271 +OK for sending and receiving, both with and without the new option.  Also
18272 +works with "-b 5" if you send an S packet to it with '5' in the BCT field.
18273 +Changes were minimal, I have them all in ek17.diff.
18274 +
18275 +I could probably also make a new G-Kermit in about 10 minutes, but who cares
18276 +about G-Kermit...  We already have two useful Kermit programs that
18277 +interoperate with the new protocol.  6 Jun 2011.
18278 +
18279 +Replaced the very inadequate help texts for functions \fword() and
18280 +\fsplit() with new ones.  ckuus2.c, 6 Jun 2011.
18281 +
18282 +There were a couple reports of file corruption that I was saving for later.
18283 +Now that now is later I dug up the messages, files, and logs and it turns
18284 +out that nobody had reported a reproducible case of Kermit corrupting a
18285 +file.  There have been non-reproducible cases though, almost certainly due
18286 +to corruption of the S or I packet or its ACK, which is why we now have SET
18287 +BLOCK 5.  Even with BLOCK CHECK 5, there is no guarantee that the same thing
18288 +won't happen, it is just far less likely.  Even if we added a 32-bit CRC or
18289 +even 64-bit one, there would still be a small chance it could happen.
18290 +
18291 +7 Jun 2011:
18292 +
18293 +Corrected various #ifdefs (or lack of them) when building C-Kermit with
18294 +different combinations of feature-selection options such as NOCSETS, NOICP,
18295 +NOLOCAL, NOSPL, NOUNICODE, etc.  ckcfns.c ckcmai.c ckcxla.h ckuus2.c
18296 +ckuus4.c ckuus5.c ckuus6.c ckuusr.c, 7 Jun 2011.  After running the script
18297 +that does all these builds (84 of them) I ran it again to make sure that
18298 +none of the changes broke builds that succeeded before the changes were made.
18299 +
18300 +Built OK on Solaris9 ("make solaris9")
18301 +Ditto with Krb5 and OpenSSL 0.9.8q  ("make solaris9g+openssl+shadow+pam+zlib")
18302 +
18303 +Built OK on Mac OS X 10.4.11 ("make macosx").
18304 +Also "make macosx+krb5+openssl.
18305 +
18306 +Built OK on Linux RHEL4 ("make linux").
18307 +Built OK on Linux RHEL4 with OpenSSL 0.9.7a ("make linux+ssl").
18308 +Built OK on Linux RHEL5 ("make linux").
18309 +
18310 +"make linux+ssl" fails on RHEL5 because of DES, even though the target
18311 +tests for the presence or absence of the DES libraries.  In this case the
18312 +libraries are there but they lack the functions des_ecb3_encrypt,
18313 +des_random_seed, and des_set_odd_parity.  The build succeeds as:
18314 +
18315 +  make linux+ssl KFLAGS=-UCK_SSL
18316 +
18317 +Since DES is now considered harmful, Jeff Altman suggests that all OpenSSL
18318 +builds, even for old versions, should omit it ("If you are building with
18319 +openssl and no kerberos or srp, just disable DES.  Disabling DES will impact
18320 +telnet and rlogin but it won't matter if you have no ability to negotiate a
18321 +session key").
18322 +
18323 +From Ian Beckwith, patches for Debian Linux:
18324 + . Change all '-' to '\(hy' in man page (new pedantry): ckuker.nr.
18325 + . Make IKSD authentication (using PAM) ask for a password when an invalid
18326 +   username has been given, to avoid disclosing which account names are valid:
18327 +   ckufio.c, ckuus7.c.
18328 + . Fix spelling errors: ckcftp.c, ckuus2.c, ckuker.nr, ckcpro.w, ckuusr.h.
18329 + . Patch makefile to support install to a staging area with DESTDIR.
18330 + . Some other patches (mainly for typos) were for plain-text documentation
18331 +   files that were generated from Web pages; I updated the web pages.
18332 +
18333 +A big corporate C-Kermit user has an application where a local C-Kermit
18334 +makes a connection to a remote one, uploads some files, and then if the
18335 +server has any new patch files for the local, it sends the patches and
18336 +does a REMOTE HOST command to run the patch program.  This stopped working
18337 +in C-Kermit 6.0 or 7.0 when I put a check to prevent it, because "it makes
18338 +no sense to send REMOTE commands to the local end, because the results are
18339 +sent back to the remote to be displayed on its screen but it has no screen".
18340 +That may be true, but if the user needs to control the local from the
18341 +remote, they should be able to.  I removed the checks.  This doesn't solve
18342 +the problem of where the output goes; ideally it would go to the local
18343 +screen but I don't see any elegant and simple way to make that change.
18344 +However the output redirectors can still be used with the REMOTE command
18345 +so the results can be captured to a remote file, which could then be sent.
18346 +ckuus7.c, 7 Jun 2011.
18347 +
18348 +Changed SET VARIABLE-EVALUATION to SET COMMAND VARIABLE-EVALUATION, but left
18349 +the former version available.  ckuusr.c, 9 Jun 2011.
18350 +
18351 +Documented the SET COMMAND VARIABLE-EVALUATION command, which I added in
18352 +2008.  ck90.html, 9 Jun 2011.
18353 +
18354 +Renamed all old Mac OS X makefile targets to have the prefix "old" to avoid
18355 +confusing them with the current targets, and made macosx10 a synonym for
18356 +macosx, so those who used previous makefiles will get a current target
18357 +without having to know the new name.  makefile, 9 Jun 2011.
18358 +
18359 +Added XMESSAGE, which is to MESSAGE as XECHO is ECHO: prints the text
18360 +without a line terminator, so it can be continued by subsequent [X]MESSAGE
18361 +commands.  ckuusr.[ch], 9 Jun 2011.
18362 +
18363 +Back to "make linux+ssl" on RHEL5...  I took the coward's way out and added
18364 +code to the makefile target to check whether the build worked (somebody let
18365 +me know if there is a better way to check), and if not to give a message
18366 +suggesting they "make clean ; make linux+ssl KFLAGS=-UCK_DES".  makefile,
18367 +9 Jun 2011.
18368 +
18369 +Noticed that \frecurse() would dump core if called with no arguments.
18370 +Fixed in ckuus4.c, 9 Jun 2011.
18371 +
18372 +Added \q() as an alternative to the more verbose \fliteral() for quoting
18373 +strings that contain characters (like \) that would otherwise be significant
18374 +to Kermit.  It's more efficient because it isn't a function call, and 'q'
18375 +is an intuitive letter to mean 'quote'.  It also works better than
18376 +\fliteral() because functions treat commas and braces specially.  ckuus4.c,
18377 +10 Jun 2011.
18378 +
18379 +Built OK on VMS 8.3 on Alpha, no net.  DEC C caught a couple glitches in the
18380 +new code that gcc didn't catch, which I fixed.  ckuus[25].c, 10 Jun 2011.
18381 +
18382 +Built OK on VMS 8.3 on Alpha with Multinet 5.3.  The SSL build failed but
18383 +I'm not going to worry about it.  10 Jun 2011.
18384 +
18385 +Built OK on NetBSD 5.1.  10 Jun 2011.
18386 +
18387 +Tried to resurrect my old "build-all" machine, an IBM Netfinity 3500 from
18388 +1997 with 20-some mountable bootable hard disks with lots of 1990s OS's on
18389 +them.  No dice.  I can see the BIOS but not the hard disks.  The
18390 +configuration is still correct because it tries to boot from the mountable
18391 +hard disk, but it fails (I tried six different ones).
18392 +
18393 +Tried to resurrect my old Siemens Nixdorf RM 200 MIPS machine.  Booted OK,
18394 +headless even, but makes a hellish high-pitched whine, like a dentist drill.
18395 +It's pretty slow too.  "make sinix542" (for SINIX 5.4.2) bombed at link
18396 +time on no rdchk().  Fixed by #including <sys/filio.h>.  ckutio.c, 10 Jun 2011.
18397 +
18398 +Tried to resurrect my old SCO Xenix 2.3.4 machine, also headless.  Amazingly
18399 +it still works; it can't use a monitor but I can Telnet to it.  Had to tweak
18400 +some #ifdefs but I got a no-net version built successfully.  According to my
18401 +notes, it hasn't been possible to build with TCP/IP since C-Kermit 8.0,
18402 +but how many people ever had SCO Xenix 2.3.4 with TCP/IP anyway?  Anyway we
18403 +still have the binaries for C-Kermit 7.0.  ckuus4.c, 10 Jun 2011.
18404 +
18405 +Built OK on AIX 5.3.  Built OK on Solaris 10.  11 Jun 2011.
18406 +
18407 +Tried harder to revive the build-all machine, now it sort of works, but not
18408 +all of the bootable OS's work.  Built C-Kermit 9.0 OK on OpenBSD 3.0.  Built
18409 +OK on QNX 4.25 but had to #ifdef references to IXANY in ckutio.c and ckupty.
18410 +Built OK on NetBSD 1.5.1 (2000).  Tried "make netbsd+ssl" on this one, it's
18411 +OpenSSL 0.9.5a 1 Apr 2000, but it bombs out in ckuath.c, no big deal.
18412 +Another problem in NetBSD 1.5.2 is that even though off_t is 8, CK_OFF_T
18413 +is 4.  Worth noting but not worth fixing unless someone else notices.
18414 +13 Jun 2011.
18415 +
18416 +SuSE 7.0... boots OK but telnet server doesn't work.  Can telnet out but
18417 +it's too flaky, connection drops if I try to transfer a file.
18418 +
18419 +OpenBSD 2.5 [1999] OK.  Red Hat 7.1 OK.  Red Hat 7.1 with OpenSSL 0.9.6
18420 +not OK, same error as with 0.9.5a:
18421 +
18422 +ckuath.c
18423 +In file included from ck_ssl.h:48,
18424 +                 from ckuath.c:225:
18425 +/usr/include/openssl/des.h:77: warning: redefinition of `Block'
18426 +ckuat2.h:86: warning: `Block' previously declared here
18427 +/usr/include/openssl/des.h:83: redefinition of `struct des_ks_struct'
18428 +/usr/include/openssl/des.h:91: warning: redefinition of `Schedule'
18429 +ckuat2.h:90: warning: `Schedule' previously declared here
18430 +
18431 +So it appears that OpenSSL support is broken for pre-0.9.7.  Tried
18432 +building it again with -UCK_SSL (since the errors are originating from
18433 +from des.h)...  But it still failed exactly the same way.  I found
18434 +#includes for des.h in ckuath.c and and ck_ssl.h and #ifdef'd them out,
18435 +but it still fails:
18436 +
18437 +In file included from /usr/include/openssl/evp.h:89,
18438 +                 from /usr/include/openssl/x509.h:67,
18439 +                 from /usr/include/openssl/ssl.h:69,
18440 +                 from ck_ssl.h:51,
18441 +                 from ckuath.c:227:
18442 +/usr/include/openssl/des.h:77: warning: redefinition of `Block'
18443 +ckuat2.h:86: warning: `Block' previously declared here
18444 +/usr/include/openssl/des.h:83: redefinition of `struct des_ks_struct'
18445 +/usr/include/openssl/des.h:91: warning: redefinition of `Schedule'
18446 +ckuat2.h:90: warning: `Schedule' previously declared here
18447 +
18448 +Built OK on Debian 2.1.  13 Jun 2011.
18449 +
18450 +On FreeBSD 4.4, it blows up with:
18451 +ckufio.c: In function vpass':
18452 +ckufio.c:8201: conflicting types for 'initgroups'
18453 +/usr/include/unistd.h:154: previous declaration of 'initgroups'
18454 +ckufio.c:8201: warning: extern declaration of 'initgroups' doesn't match global
18455 +one.  Fixed by defining NODCLINITGROUPS for FreeBSD in ckufio.c. It might not 
18456 +be the right fix, but I don't have a lot of other FreeBSD versions to
18457 +compare with.  Anyway now it builds OK on 4.4, and also on FreeBSD 3.3.
18458 +ckufio.c, 13 Jun 2011.
18459 +
18460 +Tried to build on SCO Open Server 5.0.7 but it fails at link time because
18461 +it can't find rdchk().  But it's supposed to be there!  Come back to this
18462 +later...
18463 +
18464 +Red Hat 6.1             i386   32/64   linux          2332545
18465 +Red Hat 7.1             i386   32/64   linux          2368528
18466 +Red Hat EL4             i386   32/74   linux          2363067
18467 +Red Hat EL5.6           i386    64     linux          2371279
18468 +Solaris9                sparc  32/64   solaris9       2849896
18469 +Solaris9+ssl            sparc  32/64   solaris9       5021764
18470 +Solaris10               sparc  32/64   solaris10      2855776
18471 +QNX                     i386    32     qnx32          2012323 
18472 +NetBSD 1.5.1            i386   32/64   netbsd         2198055
18473 +NetBSD 5.1              i386   32/64   netbsd         2159863
18474 +OpenBSD 2.5             i386   32/64   openbsd        2236036
18475 +Mac OS X 10.6.7         x86_64  64     macosx         2.7M
18476 +Mac OS X 10.4.11        ppc    32/64   macosx         2496304
18477 +Debian 2.1              i386   32/64   linux          2213221
18478 +FreeBSD 4.4             i386   32/64   freebsd        2291333
18479 +FreeBSD 3.3             i386   32/64   freebsd        2147370
18480 +SINIX 5.42              mips    32     sinix542       3319325 (1995)
18481 +SCO Unixware 2.1.3      i386    32     uw213          2242176
18482 +SCO OSR6.0.0            i386   32/64   sco_osr600     2368300
18483 +
18484 +More builds, 14 June 2011:
18485 +
18486 +VMS 6.2                 alpha   32     make mn        2556928 No TCP/IP
18487 +VMS 6.2                 alpha   32     make m         3112960 UCX 4.0
18488 +Solaris 11              i386   32/64   solaris11      2823860
18489 +Solaris 11              i386   32/64   solaris11+ssl  2993660 OpenSSL 0.9.8l
18490 +NetBSD 5.1              i386   32/64   netbsd+krb5    2307855 Kerberos 5
18491 +Linux Slackware 12.1.0  i386   32/65   linux          2175754
18492 +Linux Fedora 14         i386   32/64   linux          2256514
18493 +Linux Fedora 14         i386   32/64   linux+ssl      ....... OpenSSL 1.0.0d
18494 +Linux Fedora 14         i386   32/64   linux+krb      2449614 (*)
18495 +
18496 +(*) make linux+krb5 "LIBS=$LIBS /lib/libk5crypto.so.3 /lib/libcom_err.so.2"
18497 +
18498 +Noticed that netbsd+ssl build on NetBSD 5.1 said "NetBSD 1.5" in its banner.
18499 +Fixed by replacing the old hardwired target with the new "subroutinized"
18500 +target a'la linux+ssl and adapting it to NetBSD.  makefile, 15 Jun 2011.
18501 +
18502 +Same deal for Kerberos 5, make a new netbsd+krb5 target and it builds ok,
18503 +at least once one figures out where the Kerberos headers and libs are.
18504 +makefile, 15 Jun 2011.
18505 +
18506 +Same deal for the netbsdnc target, now it simply defined NOCURSES and
18507 +chains to the main netbsd target.  makefile, 15 Jun 2011.
18508 +
18509 +Tried to build with Kerberos 5 on Solaris, fails because the DES library
18510 +no longer exists.  This one is beyond me, sorry.
18511 +
18512 +Made new targets for MirBSD, mirbsd and mirbsd+ssl, makefile 15 Jun 2011.
18513 +
18514 +In OpenSUSE 11.2 with OpenSSL 0.9.8r we bomb on undefined references from
18515 +various DES library routines.  Builds OK without DES.
18516 +
18517 +Various linux+krb5 builds fail because can't find -lgssapi_krb5
18518 +
18519 +SSL builds with OpenSSL < 0.9.7 fail even though there is code to support
18520 +the older SSL.
18521 +
18522 +Fixed some printf %ld vs int instances in the sizeofs section of SHOW FEATURES.
18523 +ckuus5.c, 15 Jun 2011.
18524 +
18525 +Fixed the new linux+ssl target to actually use the SSLINC and SSLLIBS
18526 +definitions, oops.  makefile, 15 Jun 2011.
18527 +
18528 +15 June 2011 builds (Beta.01):
18529 +
18530 +AIX 5.3                 ppc    32/64   aix+ssl        3283846 OpenSSL 0.9.8m
18531 +NetBSD 5.1              i386   32/64   netbsd         2159863
18532 +NetBSD 5.1              i386   32/64   netbsd+ssl     2350274 OpenSSL 0.9.9-dev
18533 +NetBSD 5.1              i386   32/64   netbsd+krb5    2349627 MIT Krb5 1.6.3
18534 +FreeBSD 8.2             i386   32/64   freebsd        2298414
18535 +FreeBSD 8.2             i386   32/64   freebsd+ssl    2448961 OpenSSL 0.9.8q
18536 +OpenBSD 4.7             i386   32/64   openbsd        2266132
18537 +OpenBSD 4.7             i386   32/64   openbsd+ssl    2409263 OpenSSL 0.9.8k
18538 +MirBSD 10               i386   32/64   mirbsd         2216601
18539 +MirBSD 10               i386   32/64   mirbsd+ssl     2358318 OpenSSL 0.9.8r
18540 +OpenSuse 11.2           x86_64  64     linux          2348468
18541 +OpenSuse 11.2           x86_64  64     linux+ssl (*)  2546540 OpenSSL 0.9.8r
18542 +RHEL 5.6                ia64    64     linux          4390687
18543 +RHEL 5.6                ia64    64     linux+ssl (*)  4775007 OpenSSL 0.9.8e
18544 +Ubuntu 9.10             i386   32/64   linux          2275523
18545 +Ubuntu 9.10             i386   32/64   linux+ssl      2466708 OpenSSL 0.9.8r
18546 +Gentoo 1.12.13          ppc    32/64   linux          2386597
18547 +Gentoo 1.12.13          ppc64   64     linux          2749015
18548 +Gentoo 1.12.13          ppc64   64     linux+ssl      3002150 OpenSSL 0.9.8r
18549 +Gentoo 1.12.13          sparc  32/64   linux          2478382
18550 +Gentoo 1.12.13          sparc  32/64   linux+ssl      2690499 OpenSSL 0.9.8r
18551 +Solaris 9               sparc  32/64   solaris9       2849896
18552 +Solaris 10              i386   32/64   solaris10      2837620
18553 +IRIX 6.5                R10000 32/64   irix65         2869704
18554 +
18555 +* and KFLAGS=-UCK_DES
18556 +
18557 +Tried building on NetBSD 5.1 with Heimdal Kerberos using:
18558 +
18559 +make netbsd+krb5 \
18560 + "KFLAGS=-DHEIMDAL" \
18561 + "K5INC=-I/usr/include" \
18562 + "K5LIB=-L/usr/lib"
18563 +
18564 +It found all its headers OK, but it blew up in ckuath.c.  Small wonder,
18565 +ckccfg.html says:
18566 +
18567 +HEIMDAL
18568 +    Should be defined if Kerberos V support is provided by HEIMDAL. Support
18569 +    for this option is not complete in C-Kermit 8.0. Anyone interested in
18570 +    working on this should contact kermit-support. 
18571 +
18572 +'krb5-config --version' gives the MIT Kerberos 5 version number.
18573 +
18574 +Make a new netbsd+krb5+ssl target based on the combination of the new
18575 +netbsd+ssl and netbsd+krb5 targets.  There were lots of warnings in the
18576 +compilation but no errors, but it produced an executable that starts and
18577 +does normal things but I have no idea if the SSL or Kerberos functions work.
18578 +makefile, 16 Jun 2011.
18579 +
18580 +Changed the cu-solaris9-krb5 target to test for the presence of DES because
18581 +DES isn't there, to see if this would allow a Kerberos build to proceed.
18582 +And it worked, amazing.  At least the build completed, I have no way to test
18583 +the Kerberos part.  makefile, 16 Jun 2011.
18584 +
18585 +Updated the solaris9+ssl target to do the DES testing.  makefile, 16 Jun 2011.
18586 +
18587 +Updated cu-solaris+krb5 target to test whether the GSSAPI library is called
18588 +libgassapi or libgassapi_krb5.  makefile, 16 Jun 2011.
18589 +
18590 +Added lots of tests to the Linux Kerberos 5 entries, linux+krb5 and
18591 +linux+krb5+ssl, because some have libk5crypto and some don't; some have
18592 +libcom_err and some don't; and some have libgssapi_krb5 (e.g. RHEL5,
18593 +OpenSuse 11.2) whereas others have libgssapi (Gentoo).
18594 +
18595 +16 June 2011 builds (Beta.01):
18596 +
18597 +NetBSD 5.1 i386   32/64  netbsd+krb5+ssl   2451757 OpenSSL 0.9.9 MIT Krb5 1.6.3
18598 +Solaris 9  sparc  32/64  solaris9+krb5     2543036 MIT Kerberos 5 1.7.1
18599 +Solaris 9  sparc  32/64  solaris9+ssl      5021544 OpenSSL 0.9.8q (gcc)
18600 +Gentoo...  ppc    32/64  linux             2386597
18601 +Gentoo...  ppc    32/64  linux+ssl         2593561 OpenSSL 0.9.8r 
18602 +Gentoo...  ppc64   64    linux             2749015
18603 +Gentoo...  ppc64   64    linux+ssl         3002150 OpenSSL 0.9.8r 
18604 +RHEL5      x86_64  64    linux+krb5 (*)    2563878 MIT Kerberos 5 1.6.1
18605 +RHEL5      x86_64  64    linux+krb5+ssl(*) 2563878 MIT Kerberos 5 1.6.1
18606 +Fedora 14  i386   32/64  linux+krb5+ssl    2539891 MIT Krb5 + OpenSSL 0.9.8r
18607 +
18608 +* KFLAGS=-UCK_DES
18609 +
18610 +--- C-Kermit 9.0.299 Beta.01 ---
18611 +
18612 +sizeof() can return a long or an int, so neither printf("%d",sizeof(blah));
18613 +or printf("%ld",sizeof(blah)); can be used everywhere.  Changed the
18614 +"sizeofs" section of SHOW FEATURES in the dumbest (and therefore most
18615 +portable) way to squelch the warnings.  ckuus5.c, 17 Jun 2011.
18616 +
18617 +From John Dunlap: "Watching the server screen led me to offer a cosmetic
18618 +patch for ckuusx.c.  I noticed that the server screen said it was
18619 +"RESENDING" when it really wasn't.  The attached patch emits blanks to
18620 +insure that old labels are completely erased."  ckuusx.c, 17 Jun 2011.
18621 +
18622 +Nelson Beebe found two places where I had SSLLIBS in the makefile instead of
18623 +SSLLIB.  makefile, 18 Jun 2011.
18624 +
18625 +More important he knew how to force gcc to load the right header files for
18626 +OpenSSL 1.0.0d (by using '-isystem' rather than '-I').  Previously it was
18627 +using the 0.9.8r header files but linking with the 1.0.0d libraries.  This
18628 +is not in the sources or makefile; it's done when giving the 'make' command:
18629 +
18630 +  export PATH=/usr/bin:$PATH
18631 +  export SSLINC=-isystem/usr/include
18632 +  export "SSLLIB=-L/usr/lib -Wl,-rpath,/usr/lib"
18633 +  make linux+ssl
18634 +
18635 +Folded the previous linux+openssl+zlib+shadow+pam and linux+openssl+shadow
18636 +targets into linux+ssl.  Checked the linuxso (scripting only) target, builds
18637 +OK, 600K.  Made new subroutinized linux+krb5+krb4 target but can't find
18638 +anyplace to test it.   Made new subroutinized linux+shadow+pam target, works
18639 +fine on RHEL4.  Revised comments and lists again.  makefile, 18 Jun 2011.
18640 +
18641 +For the pluggable-disk OS's that boot OK but lack a working network, I
18642 +rigged up a serial connection using a DB9-FF null modem cable, and then a
18643 +DB9-MF modem cable to make it reach.  I don't see any modem signals on
18644 +either end, but the data goes through OK.  COM1 on the desktop PC,
18645 +/dev/ttyS1 or whatever on Lab.  Since there are no modem signals, can't use
18646 +RTS/CTS.  At 57600bps with Xon/Xoff, 500-byte packets and sliding windows,
18647 +transfers work OK at about 5000cps using 5 window slots; takes 8 minutes to
18648 +transfer the gzipped C-Kermit tarball.  Kermit to the rescue.  19 Jun 2011.
18649 +
18650 +Transferred the tarball over serial ports to SCO OSR5.0.5 at 38.4Kbps, the
18651 +highest speed supported, 12 minutes, no errors, 3300cps.  Unpack, make
18652 +sco32v505udk, OK.  Also built the TCP/IP version and it almost made an
18653 +outbound connection, but only once (not a Kermit program but something with
18654 +the TCP/IP stack).  19 Jun 2011.
18655 +
18656 +Ditto for Solaris 2.6/i386, except 57.6Kbps, 4K-byte packets, no problem.
18657 +Solaris 8/i386, ditto.  19 Jun 2011.
18658 +
18659 +SCO OpenServer 5.0.5  i386   32   sco32v505udk     1940964  No TCP/IP
18660 +SCO OpenServer 5.0.5  i386   32   sco32v505udknet  2314668  With TCP/IP
18661 +Sun Solaris 2.6       i386   32   solaris26g       4661368
18662 +Sun Solaris 8         i386   32   solaris8g        4675432
18663 +
18664 +When using compact substring notation, \s(xx[4]) returns the whole string
18665 +xx starting at position 4, but \s(xx[4:]) returns an empty string.  Fixed
18666 +the latter to be like the former.  ckuus5.c, 20 Jun 2010.
18667 +
18668 +Really it would have been nicer if \s(xx[4]) returned a single character,
18669 +the 4th character of xx, but it's too late now.  Added another "separator"
18670 +character '.' (period) for that: \s(xx[4.]) is the 4th character of xx.
18671 +ckuus4.c, 20 Jun 2010.
18672 +
18673 +Back to SCO OSR5.0.7... This failed before because 'rdchk' came up unknown
18674 +at link time, unlike all previous OSR5's, that used rdchk() in place of the
18675 +FIONREAD ioctl.  Added #ifdefs to make a special case for 5.0.7.  I'm not
18676 +sure this is the best way, but this is the minimal change to get it to work.
18677 +If anybody cares, maybe the same can be done for previous OSR5 releases.
18678 +ckutio.c, 20 Jun 2010 (search for SCO_OSR507).
18679 +
18680 +SCO OpenServer 5.0.7  i386   32   sco32v507        1895724  No TCP/IP
18681 +SCO OpenServer 5.0.7  i386   32   sco32v507net     2246792  With TCP/IP
18682 +
18683 +Checked current code on RHEL4, found that my GSSAPI-lib finding makefile
18684 +target didn't look in enough places; added some more.  makefile, 21 Jun 2011.
18685 +
18686 +Got reports back on HPUX from Peter Eichhorn, almost all good on HP-UX 7, 8,
18687 +9, 10, and 11.  21-22 Jun 2011.
18688 +
18689 +Got access to Debian 5.0 and 7-to-be ("Wheezy/Sid").  Regular 'make linux' is
18690 +OK in Debian 5, but in 7 can't find crypt, res_search, or dn_expand; had
18691 +to add more library search clauses to 'make linux'.  makefile, 21 Jun 2011.
18692 +
18693 +In Debian 7.0, libk5crypto could not be found without adding another clause
18694 +to 'make linux+krb5'.  That done, the SSL build (1.0.0d) was OK, as well as
18695 +the krb5+ssl one.  makefile, 21 Jun 2011.
18696 +
18697 +I found a Linux box that had both Kerberos 4 and 5 installed and tried 'make
18698 +linux+krb5+krb4', which failed because of missing DES functions.  Tried
18699 +'make linux+krb5+krb4 KFLAGS=-UCK_DES', but that fails too, even though it
18700 +doesn't fail for Kerberos 5 alone, so probably some Krb4 code is making
18701 +unguarded calls to the DES routines.  What is really needed is a way to
18702 +completely strip all DES references from any given build, code and makefile,
18703 +a big deal.  21 Jun 2011.
18704 +
18705 +Fixed some typos in COPYING.TXT (noticed by Ian Beckwith).  24 Jun 2011.
18706 +
18707 +Got access to perhaps the last living 4.3BSD VAX system.  It doesn't have
18708 +SEEK_CUR so I had to #ifdef out the \fpicture() function.  Aside from that,
18709 +no problems.  ckuus4.c, 24 Jun 2011.
18710 +
18711 +I had been wanting the S-Expression (ROUND x) to allow a second argument n,
18712 +which, if given, tells where the rounding should occur.  If n is positive,
18713 +the number is rounded to n decimal places.  If zero, it is rounded to the
18714 +nearest integet.  If positive, the number is rounded to the nearest power of
18715 +10; e.g. -2 means "to the nearest hundred".  If ROUND is used as before,
18716 +with one argument, it works as before.  ckclib.c, ckuus3.c, 25 Jun 2011.
18717 +
18718 +From Arthur Marsh, a few more directories to test for libresolv in Linux.
18719 +makefile, 26 Jun 2011.
18720 +
18721 +From Martin Vorlaender, a fix for the VMS file-transfer display and
18722 +statistics, a place where a file length wasn't being cast to CK_OFF_T
18723 +in zchki().  ckvfio.c, 28 Jun 2011.
18724 +
18725 +Updated version to 9.0.300 and removed the Beta designation.
18726 +ckcmai.c, makefile, 28 Jun 2011.
18727 +
18728 +Removed solaris9_64 target from makefile.  It builds but it doesn't work
18729 +at all.  30 Jun 2011.
18730 +
18731 +--- C-Kermit 9.0.300 ---
18732 +
18733 +---------------------------------
18734 +***************************
18735 --- /dev/null
18736 +++ ckermit-301/ckermit70.txt
18737 @@ -0,0 +1,17661 @@
18738 +
18739 +   [1]The Columbia Crown The Kermit Project | Columbia University
18740 +   612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
18741 +   ...since 1981
18742 +   [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
18743 +   [10]Support
18744 +
18745 +Supplement to [11]Using C-Kermit , 2nd Edition
18746 +
18747 +For C-Kermit 7.0
18748 +
18749 +As of C-Kermit version:  7.0.196
18750 +This file created:  8 February 2000
18751 +This file last updated:
18752 +Mon Sep 13 08:52:41 2010
18753 +
18754 +
18755 +Authors: Frank da Cruz and Christine M. Gianone
18756 +Address: The Kermit Project
18757 +         Columbia University
18758 +         612 West 115th Street
18759 +         New York NY 10025-7799
18760 +         USA
18761 +Fax:     +1 (212) 662-6442
18762 +E-Mail:  [12]kermit-support@columbia.edu
18763 +Web:     [13]http://www.columbia.edu/kermit/
18764 +Or:      [14]http://www.kermit-project.org/
18765 +Or:      [15]http://www.columbia.nyc.ny.us/kermit/
18766 +
18767 +NOTICES
18768 +
18769 +   This document:
18770 +          Copyright Â© 1997, 2000, Frank da Cruz and Christine M. Gianone.
18771 +          All rights reserved.
18772 +
18773 +   Kermit 95:
18774 +          Copyright Â© 1995, 2000, Trustees of Columbia University in the
18775 +          City of New York. All rights reserved.
18776 +
18777 +   C-Kermit:
18778 +          Copyright Â© 1985, 2000,
18779 +          Trustees of Columbia University in the City of New York. All
18780 +          rights reserved. See the C-Kermit [16]COPYING.TXT file or the
18781 +          copyright text in the [17]ckcmai.c module for disclaimer and
18782 +          permissions.
18783 +
18784 +   When Kerberos(TM) and/or SRP(TM) (Secure Remote Password) and/or SSL
18785 +          protocol are included:
18786 +          Portions Copyright Â© 1990, Massachusetts Institute of
18787 +          Technology.
18788 +          Portions Copyright Â© 1991, 1993 Regents of the University of
18789 +          California.
18790 +          Portions Copyright Â© 1991, 1992, 1993, 1994, 1995 by AT&T.
18791 +          Portions Copyright Â© 1997, Stanford University.
18792 +          Portions Copyright Â© 1995-1997, Eric Young <eay@cryptosoft.com>.
18793 +
18794 +   For the full text of the third-party copyright notices, see
18795 +   [18]Appendix V.
18796 +
18797 +WHAT IS IN THIS FILE
18798 +
18799 +   This file lists changes made to C-Kermit since the second edition of
18800 +   the book [19]Using C-Kermit was published and C-Kermit 6.0 was released
18801 +   in November 1996. Use this file as a supplement to the second edition
18802 +   of Using C-Kermit until the third edition is published some time in
18803 +   2000. If the "most recent update" shown above is long ago, contact
18804 +   Columbia University to see if there is a newer release.
18805 +
18806 +   For further information, also see the [20]CKCBWR.TXT ("C-Kermit
18807 +   beware") file for hints, tips, tricks, restrictions, frequently asked
18808 +   questions, etc, plus the system-specific "beware file", e.g.
18809 +   [21]CKUBWR.TXT for UNIX, [22]CKVBWR.TXT for VMS, etc, and also any
18810 +   system-specific update files such as KERMIT95.HTM for Kermit 95 (in the
18811 +   DOCS\MANUAL\ subdirectory of your K95 directory).
18812 +
18813 +     This Web-based copy of the C-Kermit 7.0 update notes supersedes the
18814 +     plain-text CKERMIT2.TXT file. All changes after 19 January 2000
18815 +     appear only here in the Web version. If you need an up-to-date
18816 +     plain-text copy, use your Web browser to save this page as plain
18817 +     text.
18818 +
18819 +ABOUT FILENAMES
18820 +
18821 +   In this document, filenames are generally shown in uppercase, but on
18822 +   file systems with case-sensitive names such as UNIX, OS-9, and AOS/VS,
18823 +   lowercase names are used: [23]ckubwr.txt, [24]ckermit70.txt, etc.
18824 +
18825 +ADDITIONAL FILES
18826 +
18827 +   Several other files accompany this new Kermit release:
18828 +
18829 +   SECURITY.TXT
18830 +          Discussion of Kermit's new authentication and encryption
18831 +          features:
18832 +
18833 +          + [25]Plain-text version
18834 +          + [26]HTML (hypertext) version
18835 +
18836 +   IKSD.TXT
18837 +          How to install and manage an Internet Kermit Service Daemon.
18838 +
18839 +          + [27]Plain-text version
18840 +          + [28]HTML (hypertext) version
18841 +
18842 +          Also see [29]cuiksd.htm for instructions for use.
18843 +
18844 +   TELNET.TXT
18845 +          A thorough presentation of Kermit's new advanced Telnet features
18846 +          and controls.
18847 +
18848 +          + [30]Plain-text version
18849 +          + [31]HTML (hypertext) version
18850 +
18851 +THE NEW C-KERMIT LICENSE
18852 +
18853 +   The C-Kermit license was rewritten for version 7.0 to grant automatic
18854 +   permission to packagers of free operating-system distributions to
18855 +   include C-Kermit 7.0. Examples include Linux (GNU/Linux), FreeBSD,
18856 +   NetBSD, etc. The new license is in the [32]COPYING.TXT file, and is
18857 +   also displayed by C-Kermit itself when you give the VERSION or
18858 +   COPYRIGHT command. The new C-Kermit license does not apply to
18859 +   [33]Kermit 95.
18860 +
18861 +ACKNOWLEDGMENTS
18862 +
18863 +   Thanks to Jeff Altman, who joined the Kermit Project in 1995, for much
18864 +   of what you see in C-Kermit 7.0, especially in the networking and
18865 +   security areas, and his key role in designing and implementing the
18866 +   Internet Kermit Service Daemon. And special thanks to Lucas Hart for
18867 +   lots of help with the VMS version; to Peter Eichhorn for continuous
18868 +   testing on the full range of HP-UX versions and for a consolidated set
18869 +   of HP-UX makefile targets; and to Colin Allen, Mark Allen, Roger Allen,
18870 +   Ric Anderson, William Bader, Mitch Baker, Mitchell Bass, Nelson Beebe,
18871 +   Gerry Belanger, Jeff Bernsten, Mark Berryman, John Bigg, Volker
18872 +   Borchert, Jonathan Boswell, Tim Boyer, Frederick Bruckman, Kenneth
18873 +   Cochran, Jared Crapo, Bill Delaney, Igor Sobrado Delgado, Clarence
18874 +   Dold, Joe Doupnik, John Dunlap, Max Evarts, Patrick French, Carl
18875 +   Friedberg, Carl Friend, Hirofumi Fujii, Andrew Gabriel, Gabe Garza,
18876 +   Boyd Gerber, David Gerber, George Gilmer, Hunter Goatley, DJ Hagberg,
18877 +   Kevin Handy, Andy Harper, Randolph Herber, Sven Holström, Michal
18878 +   Jaegermann, Graham Jenkins, Dick Jones, Terry Kennedy, Robert D Keys,
18879 +   Nick Kisseberth, Igor Kovalenko, David Lane, Adam Laurie, Jeff
18880 +   Liebermann, Eric Lonvick, Hoi Wan Louis, Arthur Marsh, Gregorie Martin,
18881 +   Peter Mauzey, Dragan Milicic, Todd Miller, Christian Mondrup, Daniel
18882 +   Morato, Dat Nguyen, Herb Peyerl, Jean-Pierre Radley, Steve Rance,
18883 +   Stephen Riehm, Nigel Roles, Larry Rosenman, Jay S Rouman, David
18884 +   Sanderson, John Santos, Michael Schmitz, Steven Schultz, Bob Shair,
18885 +   Richard Shuford, Fred Smith, Michael Sokolov, Jim Spath, Peter Szell,
18886 +   Ted T'so, Brian Tillman, Linus Torvalds, Patrick Volkerding, Martin
18887 +   Vorländer, Steve Walton, Ken Weaverling, John Weekley, Martin Whitaker,
18888 +   Jim Whitby, Matt Willman, Joellen Windsor, Farrell Woods, and many
18889 +   others for binaries, hosting, reviews, suggestions, advice, bug
18890 +   reports, and all the rest over the 3+ year C-Kermit 7.0 development
18891 +   cycle. Thanks to Russ Nelson and the board of the Open Software
18892 +   Initiative ([34]http://www.opensource.org) for their cooperation in
18893 +   developing the new C-Kermit license and to the proprietors of those
18894 +   free UNIX distributions that have incorporated C-Kermit 7.0 for their
18895 +   cooperation and support, especially FreeBSD's Jörg Wunsch.
18896 +
18897 +NOTE TO KERMIT 95 USERS
18898 +
18899 +   Kermit 95 and C-Kermit share the same command and scripting language,
18900 +   the same Kermit file-transfer protocol implementation, and much else
18901 +   besides.
18902 +
18903 +   Like the book [35]Using C-Kermit, this file concentrates on the aspects
18904 +   of C-Kermit that are common to all versions: UNIX, VMS, Windows, OS/2,
18905 +   VOS, AOS/VS, etc. Please refer to your Kermit 95 documentation for
18906 +   information that is specific to Kermit 95.
18907 +
18908 +   C-Kermit 7.0 corresponds to Kermit 95 1.1.19.
18909 +
18910 +C-KERMIT VERSIONS AND VERSION NUMBERS
18911 +
18912 +   "C-Kermit" refers to all the many programs that are compiled in whole
18913 +   or in part from common C-language source code, comprising:
18914 +
18915 +     * A Kermit file transfer protocol module
18916 +     * A command parser and script execution module
18917 +     * A modem-dialing module
18918 +     * A network support module
18919 +     * A character-set translation module.
18920 +
18921 +   and several others. These "system-independent" modules are combined
18922 +   with system-dependent modules for each platform to provide the required
18923 +   input/output functions, and also in some cases overlaid with an
18924 +   alternative user interface, such as Macintosh Kermit's point-and-click
18925 +   interface, and in some cases also a terminal emulator, as Kermit 95.
18926 +
18927 +   The C-Kermit version number started as 1.0, ... 3.0, 4.0, 4.1 and then
18928 +   (because of confusion at the time with Berkeley UNIX 4.2), 4B, 4C, and
18929 +   so on, with the specific edit number in parentheses, for example
18930 +   4E(072) or 5A(188). This scheme was used through 5A(191), but now we
18931 +   have gone back to the traditional numbering scheme with decimal points:
18932 +   major.minor.edit; for example 7.0.196. Internal version numbers (the
18933 +   \v(version) variable), however, are compatible in C-Kermit 5A upwards.
18934 +
18935 +   Meanwhile, C-Kermit derivatives for some platforms (Windows, Macintosh)
18936 +   might go through several releases while C-Kermit itself remains the
18937 +   same. These versions have their own platform-specific version numbers,
18938 +   such as Kermit 95 1.1.1, 1.1.2, and so on.
18939 +
18940 +   C-Kermit Version History:
18941 +
18942 +  1.0       1981-1982         Command-line only, 4.2 BSD UNIX only
18943 +  2.0       (*)               (who remembers...)
18944 +  3.0       May 1984          Command-line only, supports several platforms
18945 +  4.0-4.1   Feb-Apr 1985 (*)  First interactive and modular version
18946 +  4C(050)   May 1985
18947 +  4D(060)   April 1986
18948 +  4E(066)   August 1987       Long packets
18949 +  4E(068)   January 1988
18950 +  4E(072)   January 1989
18951 +  4F(095)   August 1989 (*)   Attribute packets
18952 +  5A(188)   November 1992     Scripting, TCP/IP, sliding windows (1)
18953 +  5A(189)   September 1993    Control-char unprefixing
18954 +  5A(190)   October 1994      Recovery
18955 +  5A(191)   April 1995        OS/2 only
18956 +  6.0.192   September 1996    Intelligent dialing, autodownload, lots more (2)
18957 +  6.1.193   1997-98 (*)       Development only
18958 +  6.1.194   June 1998         K95 only - switches, directory recursion, more
18959 +  7.0.195   August 1999       IKSD + more (CU only as K95 1.1.18-CU)
18960 +  7.0.196   1 January 2000    Unicode, lots more
18961 +
18962 +   (*) Never formally released (4.0 was a total rewrite)
18963 +   (1) Using C-Kermit, 1st Edition
18964 +   (2) Using C-Kermit, 2nd Edition
18965 +
18966 +CONTENTS
18967 +
18968 + I.  [36]C-KERMIT DOCUMENTATION
18969 +
18970 + II. [37]NEW FEATURES
18971 +
18972 +     (0) [38]INCOMPATIBILITIES WITH PREVIOUS RELEASES
18973 +     (1) [39]PROGRAM AND FILE MANAGEMENT AND COMMANDS
18974 +         1.0.  [40]Bug fixes
18975 +         1.1.  [41]Command Continuation
18976 +         1.2.  [42]Editor Interface
18977 +         1.3.  [43]Web Browser and FTP Interface
18978 +         1.4.  [44]Command Editing
18979 +         1.5.  [45]Command Switches
18980 +               1.5.1. [46]General Switch Syntax
18981 +               1.5.2. [47]Order and Effect of Switches
18982 +               1.5.3. [48]Distinguishing Switches from Other Fields
18983 +               1.5.4. [49]Standard File Selection Switches
18984 +               1.5.5. [50]Setting Preferences for Different Commands
18985 +         1.6.  [51]Dates and Times
18986 +         1.7.  [52]Partial Completion of Keywords
18987 +         1.8.  [53]Command Recall
18988 +         1.9.  [54]EXIT Messages
18989 +         1.10. [55]Managing Keyboard Interruptions
18990 +         1.11. [56]Taming the Wild Backslash -- Part Deux
18991 +               1.11.1. [57]Background
18992 +               1.11.2. [58]Kermit's Quoting Rules
18993 +               1.11.3. [59]Passing DOS Filenames from Kermit to Shell Commands
18994 +               1.11.4. [60]Using Variables to Hold DOS Filenames
18995 +               1.11.5. [61]Passing DOS Filenames as Parameters to Macros
18996 +               1.11.6. [62]Passing DOS File Names from Macro Parameters to the D
18997 +OS Shell
18998 +               1.11.7. [63]Passing DOS Filenames to Kermit from the Shell
18999 +         1.12. [64]Debugging
19000 +         1.13. [65]Logs
19001 +         1.14. [66]Automatic File-Transfer Packet Recognition at the Command Pro
19002 +mpt
19003 +         1.15. [67]The TYPE Command
19004 +         1.16. [68]The RESET Command
19005 +         1.17. [69]The COPY and RENAME Commands
19006 +         1.18. [70]The MANUAL Command
19007 +         1.19. [71]String and Filename Matching Patterns
19008 +         1.20. [72]Multiple Commands on One Line
19009 +         1.21. [73]What Do I Have?
19010 +         1.22. [74]Generalized File Input and Output
19011 +               1.22.1. [75]Why Another I/O System?
19012 +               1.22.2. [76]The FILE Command
19013 +               1.22.3. [77]FILE Command Examples
19014 +               1.22.4. [78]Channel Numbers
19015 +               1.22.5. [79]FILE Command Error Codes
19016 +               1.22.6. [80]File I/O Variables
19017 +               1.22.7. [81]File I/O Functions
19018 +               1.22.8. [82]File I/O Function Examples
19019 +         1.23. [83]The EXEC Command
19020 +         1.24. [84]Getting Keyword Lists with '?'
19021 +     (2) [85]MAKING AND USING CONNECTIONS
19022 +         2.0. [86]SET LINE and SET HOST Command Switches
19023 +         2.1. [87]Dialing
19024 +              2.1.1. [88]The Dial Result Message
19025 +              2.1.2. [89]Long-Distance Dialing Changes
19026 +              2.1.3. [90]Forcing Long-Distance Dialing
19027 +              2.1.4. [91]Exchange-Specific Dialing Decisions
19028 +              2.1.5. [92]Cautions about Cheapest-First Dialing
19029 +              2.1.6. [93]Blind Dialing (Dialing with No Dialtone)
19030 +              2.1.7. [94]Trimming the Dialing Dialog
19031 +              2.1.8. [95]Controlling the Dialing Speed
19032 +              2.1.9. [96]Pretesting Phone Number Conversions
19033 +              2.1.10. [97]Greater Control over Partial Dialing
19034 +              2.1.11. [98]New DIAL-related Variables and Functions
19035 +              2.1.12. [99]Increased Flexibility of PBX Dialing
19036 +              2.1.13. [100]The DIAL macro - Last-Minute Phone Number Conversions
19037 +              2.1.14. [101]Automatic Tone/Pulse Dialing Selection
19038 +              2.1.15. [102]Dial-Modifier Variables
19039 +              2.1.16. [103]Giving Multiple Numbers to the DIAL Command
19040 +         2.2. [104]Modems
19041 +              2.2.1. [105]New Modem Types
19042 +              2.2.2. [106]New Modem Controls
19043 +         2.3. [107]TELNET and RLOGIN
19044 +              2.3.0. [108]Bug Fixes
19045 +              2.3.1. [109]Telnet Binary Mode Bug Adjustments
19046 +              2.3.2. [110]VMS UCX Telnet Port Bug Adjustment
19047 +              2.3.3. [111]Telnet New Environment Option
19048 +              2.3.4. [112]Telnet Location Option
19049 +              2.3.5. [113]Connecting to Raw TCP Sockets
19050 +              2.3.6. [114]Incoming TCP Connections
19051 +         2.4. [115]The EIGHTBIT Command
19052 +         2.5. [116]The Services Directory
19053 +         2.6. [117]Closing Connections
19054 +         2.7. [118]Using C-Kermit with External Communication Programs
19055 +              2.7.0. [119]C-Kermit over tn3270 and tn5250
19056 +              2.7.1. [120]C-Kermit over Telnet
19057 +              2.7.2. [121]C-Kermit over Rlogin
19058 +              2.7.3. [122]C-Kermit over Serial Communication Programs
19059 +              2.7.4. [123]C-Kermit over Secure Network Clients
19060 +              2.7.4.1. [124]SSH
19061 +              2.7.4.2. [125]SSL
19062 +              2.7.4.3. [126]SRP
19063 +              2.7.4.4. [127]SOCKS
19064 +              2.7.4.5. [128]Kerberos and SRP
19065 +         2.8. [129]Scripting Local Programs
19066 +         2.9. [130]X.25 Networking
19067 +              2.9.1. [131]IBM AIXLink/X.25 Network Provider Interface for AIX
19068 +              2.9.2. [132]HP-UX X.25
19069 +         2.10. [133]Additional Serial Port Controls
19070 +         2.11. [134]Getting Access to the Dialout Device
19071 +         2.12. [135]The Connection Log
19072 +         2.13. [136]Automatic Connection-Specific Flow Control Selection
19073 +         2.14. [137]Trapping Connection Establishment and Loss
19074 +         2.15. [138]Contacting Web Servers with the HTTP Command
19075 +     (3) [139]TERMINAL CONNECTION
19076 +         3.1. [140]CONNECT Command Switches
19077 +         3.2. [141]Triggers
19078 +         3.3. [142]Transparent Printing
19079 +         3.4. [143]Binary and Text Session Logs
19080 +     (4) [144]FILE TRANSFER AND MANAGEMENT
19081 +         4.0. [145]Bug Fixes, Minor Changes, and Clarifications
19082 +         4.1. [146]File-Transfer Filename Templates
19083 +         4.1.1. [147]Templates in the As-Name
19084 +         4.1.2. [148]Templates on the Command Line
19085 +         4.1.3. [149]Post-Transfer Renaming
19086 +         4.2. [150]File-Transfer Pipes and Filters
19087 +         4.2.1. [151]Introduction
19088 +         4.2.1.1. [152]Terminology
19089 +         4.2.1.2. [153]Notation
19090 +         4.2.1.3. [154]Security
19091 +         4.2.2. [155]Commands for Transferring from and to Pipes
19092 +         4.2.2.1. [156]Sending from a Command
19093 +         4.2.2.2. [157]Receiving to a Command
19094 +         4.2.3. [158]Using File-Transfer Filters
19095 +         4.2.3.1. [159]The SEND Filter
19096 +         4.2.3.2. [160]The RECEIVE Filter
19097 +         4.2.4. [161]Implicit Use of Pipes
19098 +         4.2.5. [162]Success and Failure of Piped Commands
19099 +         4.2.6. [163]Cautions about Using Pipes to Transfer Directory Trees
19100 +         4.2.7. [164]Pipes and Encryption
19101 +         4.2.8. [165]Commands and Functions Related to Pipes
19102 +         4.2.8.1. [166]The OPEN !READ and OPEN !WRITE Commands
19103 +         4.2.8.2. [167]The REDIRECT Command
19104 +         4.2.8.3. [168]Receiving Mail and Print Jobs
19105 +         4.2.8.4. [169]Pipe-Related Functions
19106 +         4.3. [170]Automatic Per-File Text/Binary Mode Switching
19107 +         4.3.1. [171]Exceptions
19108 +         4.3.2. [172]Overview
19109 +         4.3.3. [173]Commands
19110 +         4.3.4. [174]Examples
19111 +         4.4. [175]File Permissions
19112 +         4.4.1. [176]When ATTRIBUTES PROTECTION is OFF
19113 +         4.4.1.1. [177]Unix
19114 +         4.4.1.2. [178]VMS
19115 +         4.4.2. [179]When ATTRIBUTES PROTECTION is ON
19116 +         4.4.2.1. [180]System-Specific Permissions
19117 +         4.4.2.1.1. [181]UNIX
19118 +         4.4.2.1.2. [182]VMS
19119 +         4.4.2.2. [183]System-Independent Permissions
19120 +         4.5. [184]File Management Commands
19121 +         4.5.1. [185]The DIRECTORY Command
19122 +         4.5.2. [186]The CD and BACK Commands
19123 +         4.5.2.1. [187]Parsing Improvements
19124 +         4.5.2.2. [188]The CDPATH
19125 +         4.5.3. [189]Creating and Removing Directories
19126 +         4.5.4. [190]The DELETE and PURGE Commands
19127 +         4.6. [191]Starting the Remote Kermit Server Automatically
19128 +         4.7. [192]File-Transfer Command Switches
19129 +         4.7.1. [193]SEND Command Switches
19130 +         4.7.2. [194]GET Command Switches
19131 +         4.7.3. [195]RECEIVE Command Switches
19132 +         4.8. [196]Minor Kermit Protocol Improvements
19133 +         4.8.1. [197]Multiple Attribute Packets
19134 +         4.8.2. [198]Very Short Packets
19135 +         4.9. [199]Wildcard / File Group Expansion
19136 +         4.9.1. [200]In UNIX C-Kermit
19137 +         4.9.2. [201]In Kermit 95
19138 +         4.9.3. [202]In VMS, AOS/VS, OS-9, VOS, etc.
19139 +         4.10. [203]Additional Pathname Controls
19140 +         4.11. [204]Recursive SEND and GET: Transferring Directory Trees
19141 +         4.11.1. [205]Command-Line Options
19142 +         4.11.2. [206]The SEND /RECURSIVE Command
19143 +         4.11.3. [207]The GET /RECURSIVE Command
19144 +         4.11.4. [208]New and Changed File Functions
19145 +         4.11.5. [209]Moving Directory Trees Between Like Systems
19146 +         4.11.6. [210]Moving Directory Trees Between Unlike Systems
19147 +         4.12. [211]Where Did My File Go?
19148 +         4.13. [212]File Output Buffer Control
19149 +         4.14. [213]Improved Responsiveness
19150 +         4.15. [214]Doubling and Ignoring Characters for Transparency
19151 +         4.16. [215]New File-Transfer Display Formats
19152 +         4.17. [216]New Transaction Log Formats
19153 +         4.17.1. [217]The BRIEF Format
19154 +         4.17.2. [218]The FTP Format
19155 +         4.18. [219]Unprefixing NUL
19156 +         4.19. [220]Clear-Channel Protocol
19157 +         4.20. [221]Streaming Protocol
19158 +         4.20.1. [222]Commands for Streaming
19159 +         4.20.2. [223]Examples of Streaming
19160 +         4.20.2.1. [224]Streaming on Socket-to-Socket Connections
19161 +         4.20.2.2. [225]Streaming on Telnet Connections
19162 +         4.20.2.3. [226]Streaming with Limited Packet Length
19163 +         4.20.2.4. [227]Streaming on Dialup Connections
19164 +         4.20.2.5. [228]Streaming on X.25 Connections
19165 +         4.20.3. [229]Streaming - Preliminary Conclusions
19166 +         4.21. [230]The TRANSMIT Command
19167 +         4.22. [231]Coping with Faulty Kermit Implementations
19168 +         4.22.1. [232]Failure to Accept Modern Negotiation Strings
19169 +         4.22.2. [233]Failure to Negotiate 8th-bit Prefixing
19170 +         4.22.3. [234]Corrupt Files
19171 +         4.22.4. [235]Spurious Cancellations
19172 +         4.22.5. [236]Spurious Refusals
19173 +         4.22.6. [237]Failures during the Data Transfer Phase
19174 +         4.22.7. [238]Fractured Filenames
19175 +         4.22.8. [239]Bad File Dates
19176 +         4.23. [240]File Transfer Recovery
19177 +         4.24. [241]FILE COLLISION UPDATE Clarification
19178 +         4.25. [242]Autodownload Improvements
19179 +     (5) [243]CLIENT/SERVER
19180 +         5.0. [244]Hints
19181 +         5.1. [245]New Command-Line Options
19182 +         5.2. [246]New Client Commands
19183 +         5.3. [247]New Server Capabilities
19184 +         5.3.1. [248]Creating and Removing Directories
19185 +         5.3.2. [249]Directory Listings
19186 +         5.4. [250]Syntax for Remote Filenames with Embedded Spaces
19187 +         5.5. [251]Automatic Orientation Messages upon Directory Change
19188 +         5.6. [252]New Server Controls
19189 +         5.7. [253]Timeouts during REMOTE HOST Command Execution
19190 +     (6) [254]INTERNATIONAL CHARACTER SETS
19191 +         6.0. [255]ISO 8859-15 Latin Alphabet 9
19192 +         6.1. [256]The HP-Roman8 Character Set
19193 +         6.2. [257]Greek Character Sets
19194 +         6.3. [258]Additional Latin-2 Character Sets
19195 +         6.4. [259]Additional Cyrillic Character Sets
19196 +         6.5. [260]Automatic Character-Set Switching
19197 +         6.6. [261]Unicode
19198 +         6.6.1. [262]Overview of Unicode
19199 +         6.6.2. [263]UCS Byte Order
19200 +         6.6.2. [264]UCS Transformation Formats
19201 +         6.6.3. [265]Conformance Levels
19202 +         6.6.4. [266]Relationship of Unicode with Kermit's Other Character Sets
19203 +         6.6.5. [267]Kermit's Unicode Features
19204 +         6.6.5.1. [268]File Transfer
19205 +         6.6.5.2. [269]The TRANSLATE Command
19206 +         6.6.5.3. [270]Terminal Connection
19207 +         6.6.5.4. [271]The TRANSMIT Command
19208 +         6.6.5.5. [272]Summary of Kermit Unicode Commands
19209 +         6.7. [273]Client/Server Character-Set Switching
19210 +     (7) [274]SCRIPT PROGRAMMING
19211 +         7.0. [275]Bug Fixes
19212 +         7.1. [276]The INPUT Command
19213 +         7.1.1. [277]INPUT Timeouts
19214 +         7.1.2. [278]New INPUT Controls
19215 +         7.1.3. [279]INPUT with Pattern Matching
19216 +         7.1.4. [280]The INPUT Match Result
19217 +         7.2. [281]New or Improved Built-In Variables
19218 +         7.3. [282]New or Improved Built-In Functions
19219 +         7.4. [283]New IF Conditions
19220 +         7.5. [284]Using More than Ten Macro Arguments
19221 +         7.6. [285]Clarification of Function Call Syntax
19222 +         7.7. [286]Autodownload during INPUT Command Execution
19223 +         7.8. [287]Built-in Help for Functions.
19224 +         7.9. [288]Variable Assignments
19225 +         7.9.1. [289]Assignment Operators
19226 +         7.9.2. [290]New Assignment Commands
19227 +         7.10. [291]Arrays
19228 +         7.10.1. [292]Array Initializers
19229 +         7.10.2. [293]Turning a String into an Array of Words
19230 +         7.10.3. [294]Arrays of Filenames
19231 +         7.10.4. [295]Automatic Arrays
19232 +         7.10.5. [296]Sorting Arrays
19233 +         7.10.6. [297]Displaying Arrays
19234 +         7.10.7. [298]Other Array Operations
19235 +         7.10.8. [299]Hints for Using Arrays
19236 +         7.10.9. [300]Do-It-Yourself Arrays
19237 +         7.10.10. [301]Associative Arrays
19238 +         7.11. [302]OUTPUT Command Improvements
19239 +         7.12. [303]Function and Variable Diagnostics
19240 +         7.13. [304]Return Value of Macros
19241 +         7.14. [305]The ASSERT, FAIL, and SUCCEED Commands.
19242 +         7.15. [306]Using Alarms
19243 +         7.16. [307]Passing Arguments to Command Files
19244 +         7.17. [308]Dialogs with Timed Responses
19245 +         7.18. [309]Increased Flexibility of SWITCH Case Labels
19246 +         7.19. "[310]Kerbang" Scripts
19247 +         7.20. [311]IF and XIF Statement Syntax
19248 +         7.20.1. [312]The IF/XIF Distinction
19249 +         7.20.2. [313]Boolean Expressions (The IF/WHILE Condition)
19250 +         7.21. [314]Screen Formatting and Cursor Control
19251 +         7.22. [315]Evaluating Arithmetic Expressions
19252 +         7.23. [316]Floating-Point Arithmetic
19253 +         7.24. [317]Tracing Script Execution
19254 +         7.25. [318]Compact Substring Notation
19255 +         7.26. [319]New WAIT Command Options
19256 +         7.26.1. [320]Waiting for Modem Signals
19257 +         7.26.2. [321]Waiting for File Events
19258 +         7.27. [322]Relaxed FOR and SWITCH Syntax
19259 +     (8) [323]USING OTHER FILE TRANSFER PROTOCOLS
19260 +     (9) [324]COMMAND-LINE OPTIONS
19261 +         9.0. [325]Extended-Format Command-Line Options
19262 +         9.1. [326]Command Line Personalities
19263 +         9.2. [327]Built-in Help for Command Line Options
19264 +         9.3. [328]New Command-Line Options
19265 +    (10) [329]C-KERMIT AND G-KERMIT
19266 +
19267 +III. [330]APPENDICES
19268 +
19269 +III.1. [331]Character Set Tables
19270 +III.1.1. [332]The Hewlett Packard Roman8 Character Set
19271 +III.1.2. [333]Greek Character Sets
19272 +III.1.2.1. [334]The ISO 8859-7 Latin / Greek Alphabet
19273 +III.1.2.2. [335]The ELOT 927 Character Set
19274 +III.1.2.3. [336]PC Code Page 869
19275 +III.2. [337]Updated Country Codes
19276 +
19277 +IV. [338]ERRATA & CORRIGENDA: Corrections to "Using C-Kermit" 2nd Edition.
19278 +V. [339]ADDITIONAL COPYRIGHT NOTICES
19279 +
19280 +I. C-KERMIT DOCUMENTATION
19281 +
19282 +   The user manual for C-Kermit is:
19283 +
19284 +     Frank da Cruz and Christine M. Gianone, [340]Using C-Kermit, Second
19285 +     Edition, Digital Press / Butterworth-Heinemann, Woburn, MA, 1997,
19286 +     622 pages, ISBN 1-55558-164-1.
19287 +
19288 +   [341]CLICK HERE for reviews.
19289 +
19290 +   The present document is a supplement to Using C-Kermit 2nd Ed, not a
19291 +   replacement for it.
19292 +
19293 +   US single-copy price: $52.95; quantity discounts available. Available
19294 +   in bookstores or directly from Columbia University:
19295 +
19296 +  The Kermit Project
19297 +  Columbia University
19298 +  612 West 115th Street
19299 +  New York NY  10025-7799
19300 +  USA
19301 +  Telephone: +1 (212) 854-3703
19302 +  Fax:       +1 (212) 662-6442
19303 +
19304 +   Domestic and overseas orders accepted. Price: US $44.95 (US, Canada,
19305 +   and Mexico). Shipping: $4.00 within the USA; $15.00 to all other
19306 +   countries. Orders may be paid by MasterCard or Visa, or prepaid by
19307 +   check in US dollars. Add $65 bank fee for checks not drawn on a US
19308 +   bank. Do not include sales tax. Inquire about quantity discounts.
19309 +
19310 +   You can also order by phone from the publisher, Digital Press /
19311 +   [342]Butterworth-Heinemann, with MasterCard, Visa, or American Express:
19312 +
19313 +  +1 800 366-2665   (Woburn, Massachusetts office for USA & Canada)
19314 +  +44 1865 314627   (Oxford, England distribution centre for UK & Europe)
19315 +  +61 03 9245 7111  (Melbourne, Vic, office for Australia & NZ)
19316 +  +65 356-1968      (Singapore office for Asia)
19317 +  +27 (31) 2683111  (Durban office for South Africa)
19318 +
19319 +   A [343]German-language edition of the First Edition is also available:
19320 +
19321 +     Frank da Cruz and Christine M. Gianone, C-Kermit - Einführung und
19322 +     Referenz, Verlag Heinz Heise, Hannover, Germany (1994). ISBN
19323 +     3-88229-023-4. Deutsch von Gisbert W. Selke. Price: DM 88,00. Verlag
19324 +     Heinz Heise GmbH & Co. KG, Helstorfer Strasse 7, D-30625 Hannover.
19325 +     Tel. +49 (05 11) 53 52-0, Fax. +49 (05 11) 53 52-1 29.
19326 +
19327 +   The [344]Kermit file transfer protocol is specified in:
19328 +
19329 +     Frank da Cruz, Kermit, A File Transfer Protocol, Digital Press,
19330 +     Bedford, MA, 1987, 379 pages, ISBN 0-932376-88-6. US single-copy
19331 +     price: $39.95. Availability as above.
19332 +
19333 +   News and articles about Kermit software and protocol are published
19334 +   periodically in the journal, [345]Kermit News. Subscriptions are free;
19335 +   contact Columbia University at the address above.
19336 +
19337 +   Online news about Kermit is published in the
19338 +   [346]comp.protocols.kermit.announce and [347]comp.protocols.kermit.misc
19339 +   newsgroups.
19340 +
19341 +II. NEW FEATURES
19342 +
19343 +   Support for the Bell Labs Plan 9 operating system was added to version
19344 +   6.0 too late to be mentioned in the book (although it does appear on
19345 +   the cover).
19346 +
19347 +   Specific changes and additions are grouped together by major topic,
19348 +   roughly corresponding to the chapters of [348]Using C-Kermit.
19349 +
19350 +0. INCOMPATIBILITIES WITH PREVIOUS RELEASES
19351 +
19352 +    1. C-Kermit 7.0 uses FAST Kermit protocol settings by default. This
19353 +       includes "unprefixing" of certain control characters. Because of
19354 +       this, file transfers that worked with previous releases might not
19355 +       work in the new release (but it is more likely that they will work,
19356 +       and much faster). If a transfer fails, you'll get a
19357 +       context-sensitive hint suggesting possible causes and cures.
19358 +       Usually SET PREFIXING ALL does the trick.
19359 +    2. C-Kermit 7.0 transfers files in BINARY mode by default. To restore
19360 +       the previous behavior, put SET FILE TYPE TEXT in your C-Kermit
19361 +       initialization file.
19362 +    3. No matter whether FILE TYPE is BINARY or TEXT by default, C-Kermit
19363 +       7.0 now switches between text and binary mode automatically on a
19364 +       per-file basis according to various criteria, including (a) which
19365 +       kind of platform is on the other end of the connection (if known),
19366 +       (b) the version of Kermit on the other end, and (c) the file's name
19367 +       (see [349]Section 4, especially [350]4.3). To disable this
19368 +       automatic switching and restore the earlier behavior, put SET
19369 +       TRANSFER MODE MANUAL in your C-Kermit initialization file. To
19370 +       disable automatic switching for a particular transfer, include a
19371 +       /TEXT or /BINARY switch with your SEND or GET command.
19372 +    4. The RESEND and REGET commands automatically switch to binary mode;
19373 +       previously if RESEND or REGET were attempted when FILE TYPE was
19374 +       TEXT, these commands would fail immediately, with a message telling
19375 +       you they work only when the FILE TYPE is BINARY. Now they simply do
19376 +       this for you. See [351]Section 4.23 for additional (important)
19377 +       information.
19378 +    5. SET PREFIXING CAUTIOUS and MINIMAL now both prefix linefeed (10 and
19379 +       138) in case rlogin, ssh, or cu are "in the middle", since
19380 +       otherwise <LF>~ might appear in Kermit packets, and this would
19381 +       cause rlogin, ssh, or cu to disconnect, suspend, escape back, or
19382 +       otherwise wreck the file transfer. Xon and Xoff are now always
19383 +       prefixed too, even when Xon/Xoff flow control is not in effect,
19384 +       since unprefixing them has proven dangerous on TCP/IP connections.
19385 +    6. In UNIX, VMS, Windows, and OS/2, the DIRECTORY command is built
19386 +       into C-Kermit itself rather than implemented by running an external
19387 +       command or program. The built-in command might not behave the way
19388 +       the platform-specific external one did, but many options are
19389 +       available for customization. Of course the underlying
19390 +       platform-specific command can still be accessed with "!", "@", or
19391 +       "RUN" wherever the installation does not forbid. In UNIX, the "ls"
19392 +       command can be accessed directly as "ls" in C-Kermit. See
19393 +       [352]Section 4.5.1 for details.
19394 +    7. SEND ? prints a list of switches rather than a list of filenames.
19395 +       If you want to see a list of filenames, use a (system-dependent)
19396 +       construction such as SEND ./? (for UNIX, Windows, or OS/2), SEND
19397 +       []? (VMS), etc. See [353]Sections 1.5 and [354]4.7.1.
19398 +    8. In UNIX, OS-9, and Kermit 95, the wildcard characters in previous
19399 +       versions were * and ?. In C-Kermit 7.0 they are *, ?, [, ], {, and
19400 +       }, with dash used inside []'s to denote ranges and comma used
19401 +       inside {} to separate list elements. If you need to include any of
19402 +       these characters literally in a filename, precede each one with
19403 +       backslash (\). See [355]Section 4.9.
19404 +    9. SET QUIET { ON, OFF } is now on the command stack, just like SET
19405 +       INPUT CASE, SET COUNT, SET MACRO ERROR, etc, as described on p.458
19406 +       of [356]Using C-Kermit, 2nd Edition. This allows any macro or
19407 +       command file to SET QUIET ON or OFF without worrying about saving
19408 +       and restoring the global QUIET value. For example, this lets you
19409 +       write a script that tries SET LINE on lots of devices until it
19410 +       finds one free without spewing out loads of error messages, and
19411 +       also without disturbing the global QUIET setting, whatever it was.
19412 +   10. Because of the new "." operator (which introduces assignments),
19413 +       macros whose names begin with "." can not be invoked "by name".
19414 +       However, they still can be invoked with DO.
19415 +   11. The syntax of the EVALUATE command has changed. See [357]Section
19416 +       7.9.2. To restore the previous syntax, use SET EVALUATE OLD.
19417 +   12. The \v(directory) variable now includes the trailing directory
19418 +       separator; in previous releases it did not. This is to allow
19419 +       constructions such as:
19420 +  cd \v(dir)data.tmp
19421 +
19422 +       to work across platforms that might have different directory
19423 +       notation, such as UNIX, Windows, and VMS.
19424 +   13. Prior to C-Kermit 7.0, the FLOW-CONTROL setting was global and
19425 +       sticky. In C-Kermit 7.0, there is an array of default flow-control
19426 +       values for each kind of connection, that are applied automatically
19427 +       at SET LINE/PORT/HOST time. Thus a SET FLOW command given before
19428 +       SET LINE/PORT/HOST is likely to be undone. Therefore SET FLOW can
19429 +       be guaranteed to have the desired effect only if given after the
19430 +       SET LINE/PORT/HOST command.
19431 +   14. Character-set translation works differently in the TRANSMIT command
19432 +       when (a) the file character-set is not the same as the local end of
19433 +       the terminal character-set, or (b) when the terminal character-set
19434 +       is TRANSPARENT.
19435 +
19436 +1. PROGRAM AND FILE MANAGEMENT AND COMMANDS
19437 +
19438 +1.0. Bug Fixes
19439 +
19440 +   The following patches were issued to correct bugs in C-Kermit 6.0.
19441 +   These are described in detail in the 6.0 PATCHES file. All of these
19442 +   fixes have been incorporated in C-Kermit 6.1 (never released except as
19443 +   K95 1.1.16-17) and 7.0.
19444 +
19445 + 0001   All UNIX         C-Kermit mishandles timestamps on files before 1970
19446 + 0002   Solaris 2.5++    Compilation error on Solaris 2.5 with Pro C
19447 + 0003   All VMS          CKERMIT.INI Fix for VMS
19448 + 0004   VMS/VAX/UCX 2.0  C-Kermit 6.0 can't TELNET on VAX/VMS with UCX 2.0
19449 + 0005   All              C-Kermit Might Send Packets Outside Window
19450 + 0006   All              MOVE from SEND-LIST does not delete original files
19451 + 0007   Solaris 2.5++    Higher serial speeds on Solaris 2.5
19452 + 0008   All              C-Kermit application file name can't contain spaces
19453 + 0009   AT&T 7300 UNIXPC setuid and hardware flow-control problems
19454 + 0010   Linux on Alpha   Patch to make ckutio.c compile on Linux/Alpha
19455 + 0011   OS-9/68000 2.4   Patch to make ck9con.c compile on OS-9/68000 2.4
19456 + 0012   MW Coherent 4.2  Patches for successful build on Coherent 4.2
19457 + 0013   SINIX-Y 5.43     "delay" variable conflicts with <sys/clock.h>
19458 + 0014   VMS/VAX/CMU-IP   Subject: Patches for VAX/VMS 5.x + CMU-IP
19459 + 0015   All              XECHO doesn't flush its output
19460 + 0016   VMS              CD and other directory operations might not work
19461 + 0017   Linux 1.2.x++    Use standard POSIX interface for high serial speeds
19462 + 0018   UNIX             SET WILDCARD-EXPANSION SHELL dumps core
19463 + 0019   All              Hayes V.34 modem init string problem
19464 + 0020   All              READ command does not fail if file not open
19465 + 0021   All              Problems with long function arguments
19466 + 0022   All              Certain \function()s can misbehave
19467 + 0023   All              X MOD 0 crashes program
19468 + 0024   All              Internal bulletproofing for lower() function
19469 + 0025   OpenBSD          Real OpenBSD support for C-Kermit 6.0
19470 + 0026   All              Incorrect checks for macro/command-file nesting depth
19471 + 0027   All              ANSWER doesn't automatically CONNECT
19472 + 0028   All              Overzealous EXIT warning
19473 + 0029   All              OUTPUT doesn't echo when DUPLEX is HALF
19474 + 0030   All              Minor problems with REMOTE DIRECTORY/DELETE/etc
19475 + 0031   All              CHECK command broken
19476 + 0032   All              Problem with SET TRANSMIT ECHO
19477 + 0033   UNIX, VMS, etc   HELP SET SERVER says too much
19478 + 0034   All              READ and !READ too picky about line terminators
19479 + 0035   All              END from inside SWITCH doesn't work
19480 + 0036   All              Problem telnetting to multihomed hosts
19481 + 0037   All              Redirection failures in REMOTE xxx > file
19482 +
19483 +   REDIRECT was missing in many UNIX C-Kermit implementations; in version
19484 +   7.0, it should be available in all of them.
19485 +
19486 +1.1. Command Continuation
19487 +
19488 +   Comments that start with ";" or "#" can no longer be continued. In:
19489 +
19490 +  ; this is a comment -
19491 +  echo blah
19492 +
19493 +   the ECHO command will execute, rather than being taken as a
19494 +   continuation of the preceding comment line. This allows easy
19495 +   "commenting out" of commands from macro definitions.
19496 +
19497 +   However, the text of the COMMENT command can still be continued onto
19498 +   subsequent lines:
19499 +
19500 +  comment this is a comment -
19501 +  echo blah
19502 +
19503 +   As of version 6.0, backslash is no longer a valid continuation
19504 +   character. Only hyphen should be used for command continuation. This is
19505 +   to make it possible to issue commands like "cd a:\" on DOS-like
19506 +   systems.
19507 +
19508 +   As of version 7.0:
19509 +
19510 +     * You can quote a final dash to prevent it from being a continuation
19511 +       character:
19512 +  echo foo\-
19513 +
19514 +       This prints "foo-". The command is not continued.
19515 +     * You can enter commands such as:
19516 +  echo foo - ; this is a comment
19517 +
19518 +       interactively and they are properly treated as continued commands.
19519 +       Previously this worked only in command files.
19520 +
19521 +1.2. Editor Interface
19522 +
19523 +   SET EDITOR name [ options ]
19524 +          Lets you specify a text-editing program. The name can be a fully
19525 +          specified pathname like /usr/local/bin/emacs19/emacs, or it can
19526 +          be the name of any program in your PATH, e.g. "set editor
19527 +          emacs". In VMS, it must be a DCL command like "edit",
19528 +          "edit/tpu", "emacs", etc. If an environment variable EDITOR is
19529 +          defined when Kermit starts, its value is the default editor. You
19530 +          can also specify options to be included on the editor command
19531 +          line. Returns to Kermit when the editor exits.
19532 +
19533 +   EDIT [ filename ]
19534 +          If the EDIT command is given without a filename, then if a
19535 +          previous filename had been given to an EDIT command, it is used;
19536 +          if not, the editor is started without a file. If a filename is
19537 +          given, the editor is started on that file, and the filename is
19538 +          remembered for subsequent EDIT commands.
19539 +
19540 +   SHOW EDITOR
19541 +          Displays the full pathname of your text editor, if any, along
19542 +          with any command line options, and the file most recently edited
19543 +          (and therefore the default filename for your next EDIT command).
19544 +
19545 +   Related variables: \v(editor), \v(editopts), \v(editfile).
19546 +
19547 +1.3. Web Browser and FTP Interface
19548 +
19549 +   C-Kermit includes an FTP command, which simply runs the FTP program;
19550 +   C-Kermit does not include any built-in support for Internet File
19551 +   Transfer Protocol, nor any method for interacting directly with an FTP
19552 +   server. In version 7.0, however, C-Kermit lets you specify your FTP
19553 +   client:
19554 +
19555 +   SET FTP-CLIENT [ name [ options ] ]
19556 +          The name is the name of the FTP executable. In UNIX, Windows, or
19557 +          OS/2, it can be the filename of any executable program in your
19558 +          PATH (e.g. "ftp.exe" in Windows, "ftp" in UNIX); elsewhere (or
19559 +          if you do not have a PATH definition), it must be the fully
19560 +          specified pathname of the FTP program. If the name contains any
19561 +          spaces, enclose it braces. Include any options after the
19562 +          filename; these depend the particular ftp client.
19563 +
19564 +   The Web browser interface is covered in the following subsections.
19565 +
19566 +1.3.1. Invoking your Browser from C-Kermit
19567 +
19568 +   BROWSE [ url ]
19569 +          Starts your preferred Web browser on the URL, if one is given,
19570 +          otherwise on the most recently given URL, if any. Returns to
19571 +          Kermit when the browser exits.
19572 +
19573 +   SET BROWSER [ name [ options ] ]
19574 +          Use this command to specify the name of your Web browser
19575 +          program, for example: "set browser lynx". The name must be in
19576 +          your PATH, or else it must be a fully specified filename; in VMS
19577 +          it must be a DCL command.
19578 +
19579 +   SHOW BROWSER
19580 +          Displays the current browser, options, and most recent URL.
19581 +
19582 +   Related variables: \v(browser), \v(browsopts), \v(browsurl).
19583 +
19584 +   Also see [358]Section 2.15: Contacting Web Servers with the HTTP
19585 +   Command.
19586 +
19587 +1.3.2. Invoking C-Kermit from your Browser
19588 +
19589 +   The method for doing this depends, of course, on your browser. Here are
19590 +   some examples:
19591 +
19592 +   Netscape on UNIX (X-based)
19593 +          In the Options->Applications section, set your Telnet
19594 +          application to:
19595 +
19596 +  xterm -e /usr/local/bin/kermit/kermit -J %h %p
19597 +
19598 +          (replace "/usr/local/bin/kermit/kermit" by C-Kermit's actual
19599 +          pathname). -J is C-Kermit's command-line option to "be like
19600 +          Telnet"; %h and %p are Netscape placeholders for hostname and
19601 +          port.
19602 +
19603 +   Lynx on UNIX
19604 +          As far as we know, this can be done only at compile time. Add
19605 +          the following line to the Lynx userdefs.h file before building
19606 +          the Lynx binary:
19607 +
19608 +  #define TELNET_COMMAND "/opt/bin/kermit -J"
19609 +
19610 +          And then add lines like the following to the Lynx.cfg file:
19611 +
19612 +  DOWNLOADER:Kermit binary download:/opt/bin/kermit -i -V -s %s -a %s:TRUE
19613 +  DOWNLOADER:Kermit text download:/opt/bin/kermit -s %s -a %s:TRUE
19614 +
19615 +  UPLOADER:Kermit binary upload:/opt/bin/kermit -i -r -a %s:TRUE
19616 +  UPLOADER:Kermit text upload:/opt/bin/kermit -r -a %s:TRUE
19617 +  UPLOADER:Kermit text get:/opt/bin/kermit -g %s:TRUE
19618 +  UPLOADER:Kermit binary get:/opt/bin/kermit -ig %s:TRUE
19619 +
19620 +   But none of the above is necessary if you make C-Kermit your default
19621 +   Telnet client, which you can do by making a symlink called 'telnet' to
19622 +   the C-Kermit 7.0 binary. See [359]Section 9.1 for details.
19623 +
19624 +1.4. Command Editing
19625 +
19626 +   Ctrl-W ("Word delete") was changed in 7.0 to delete back to the
19627 +   previous non-alphanumeric, rather than all the way back to the previous
19628 +   space.
19629 +
19630 +1.5. Command Switches
19631 +
19632 +   As of version 7.0, C-Kermit's command parser supports a new type of
19633 +   field, called a "switch". This is an optional command modifier.
19634 +
19635 +1.5.1. General Switch Syntax
19636 +
19637 +   A switch is a keyword beginning with a slash (/). If it takes a value,
19638 +   then the value is appended to it (with no intervening spaces),
19639 +   separated by a colon (:) or equal sign (=). Depending on the switch,
19640 +   the value may be a number, a keyword, a filename, a date/time, etc.
19641 +   Examples:
19642 +
19643 +  send oofa.txt                              ; No switches
19644 +  send /binary oofa.zip                      ; A switch without a value
19645 +  send /protocol:zmodem oofa.zip             ; A switch with a value (:)
19646 +  send /protocol=zmodem oofa.zip             ; A switch with a value (=)
19647 +  send /text /delete /as-name:x.x oofa.txt   ; Several switches
19648 +
19649 +   Like other command fields, switches are separated from other fields,
19650 +   and from each other, by whitespace, as shown in the examples just
19651 +   above. You can not put them together like so:
19652 +
19653 +  send/text/delete/as-name:x.x oofa.txt
19654 +
19655 +   (as you might do in VMS or DOS, or as we might once have done in
19656 +   TOPS-10 or TOPS0-20, or PIP). This is primarily due to ambiguity
19657 +   between "/" as switch introducer versus "/" as UNIX directory
19658 +   separator; e.g. in:
19659 +
19660 +  send /delete/as-name:foo/text oofa.txt
19661 +
19662 +   Does "foo/text" mean the filename is "foo" and the transfer is to be in
19663 +   text mode, or does it mean the filename is "foo/text"? Therefore we
19664 +   require whitespace between switches to resolve the ambiguity. (That's
19665 +   only one of several possible ambiguities -- it is also conceivable that
19666 +   a file called "text" exists in the path "/delete/as-name:foo/").
19667 +
19668 +   In general, if a switch can take a value, but you omit it, then either
19669 +   a reasonable default value is supplied, or an error message is printed:
19670 +
19671 +  send /print:-Plaserwriter oofa.txt         ; Value included = print options
19672 +  send /print oofa.txt                       ; Value omitted, OK
19673 +  send /mail:kermit@columbia.edu oofa.txt    ; Value included = address
19674 +  send /mail oofa.txt                        ; Not OK - address required
19675 +  ?Address required
19676 +
19677 +   Context-sensitive help (?) and completion (Esc or Tab) are available in
19678 +   the normal manner:
19679 +
19680 +  C-Kermit> send /pr? Switch, one of the following:
19681 +    /print /protocol
19682 +  C-Kermit> send /pro<ESC>tocol:?  File-transfer protocol,
19683 +   one of the following:
19684 +    kermit   xmodem   ymodem   ymodem-g   zmodem
19685 +  C-Kermit> send /protocol:k<TAB>ermit
19686 +
19687 +   If a switch takes a value and you use completion on it, a colon (:) is
19688 +   printed at the end of its name to indicate this. If it does not take a
19689 +   value, a space is printed.
19690 +
19691 +   Also, if you type ? in a switch field, switches that take values are
19692 +   shown with a trailing colon; those that don't take values are shown
19693 +   without one.
19694 +
19695 +1.5.2. Order and Effect of Switches
19696 +
19697 +   The order of switches should not matter, except that they are evaluated
19698 +   from left to right, so if you give two switches with opposite effects,
19699 +   the rightmost one is used:
19700 +
19701 +  send /text /binary oofa.zip                ; Sends oofa.zip in binary mode.
19702 +
19703 +   Like other command fields, switches have no effect whatsoever until the
19704 +   command is entered (by pressing the Return or Enter key). Even then,
19705 +   switches affect only the command with which they are included; they do
19706 +   not have global effect or side effects.
19707 +
19708 +1.5.3. Distinguishing Switches from Other Fields
19709 +
19710 +   All switches are optional. A command that uses switches lets you give
19711 +   any number of them, including none at all. Example:
19712 +
19713 +  send /binary oofa.zip
19714 +  send /bin /delete oofa.zip
19715 +  send /bin /as-name:mupeen.zip oofa.zip
19716 +  send oofa.zip
19717 +
19718 +   But how does Kermit know when the first "non-switch" is given? It has
19719 +   been told to look for both a switch and for something else, the data
19720 +   type of the next field (filename, number, etc). In most cases, this
19721 +   works well. But conflicts are not impossible. Suppose, for example, in
19722 +   UNIX there was a file named "text" in the top-level directory. The
19723 +   command to send it would be:
19724 +
19725 +  send /text
19726 +
19727 +   But C-Kermit would think this was the "/text" switch. To resolve the
19728 +   conflict, use braces:
19729 +
19730 +  send {/text}
19731 +
19732 +   or other circumlocutions such as "send //text", "send /./text", etc.
19733 +
19734 +   The opposite problem can occur if you give an illegal switch that
19735 +   happens to match a directory name. For example:
19736 +
19737 +  send /f oofa.txt
19738 +
19739 +   There is no "/f" switch (there are several switches that begin with
19740 +   "/f", so "/f" is ambiguous). Now suppose there is an "f" directory in
19741 +   the root directory; then this command would be interpreted as:
19742 +
19743 +     Send all the files in the "/f" directory, giving each one an as-name
19744 +     of "oofa.txt".
19745 +
19746 +   This could be a mistake, or it could be exactly what you intended;
19747 +   C-Kermit has no way of telling the difference. To avoid situations like
19748 +   this, spell switches out in full until you are comfortable enough with
19749 +   them to know the minimum abbreviation for each one. Hint: use ? and
19750 +   completion while typing switches to obtain the necessary feedback.
19751 +
19752 +1.5.4. Standard File Selection Switches
19753 +
19754 +   The following switches are used on different file-oriented commands
19755 +   (such as SEND, DIRECTORY, DELETE, PURGE) to refine the selection of
19756 +   files that match the given specification.
19757 +
19758 +   /AFTER:date-time
19759 +          Select only those files having a date-time later than the one
19760 +          given. See [360]Section 1.6 for date-time formats. Synonym:
19761 +          /SINCE.
19762 +
19763 +   /NOT-AFTER:date-time
19764 +          Select only those files having a date-time not later than (i.e.
19765 +          earlier or equal to) the one given. Synonym: /NOT-SINCE.
19766 +
19767 +   /BEFORE:date-time
19768 +          Select only those files having a date-time earlier than the one
19769 +          given.
19770 +
19771 +   /NOT-BEFORE:date-time
19772 +          Select only those files having a date-time not earlier than
19773 +          (i.e. later or equal to) the one given.
19774 +
19775 +   /DOTFILES
19776 +          UNIX and OS-9 only: The filespec is allowed to match files whose
19777 +          names start with (dot) period. Normally these files are not
19778 +          shown.
19779 +
19780 +   /NODOTFILES
19781 +          (UNIX and OS-9 only) Don't show files whose names start with dot
19782 +          (period). This is the opposite of /DOTFILES, and is the default.
19783 +          Note that when a directory name starts with a period, the
19784 +          directory and (in recursive operations) all its subdirectories
19785 +          are skipped.
19786 +
19787 +   /LARGER-THAN:number
19788 +          Only select files larger than the given number of bytes.
19789 +
19790 +   /SMALLER-THAN:number
19791 +          Only select files smaller than the given number of bytes.
19792 +
19793 +   /EXCEPT:pattern
19794 +          Specifies that any files whose names match the pattern, which
19795 +          can be a regular filename, or may contain "*" and/or "?"
19796 +          metacharacters (wildcards), are not to be selected. Example:
19797 +
19798 +  send /except:*.log *.*
19799 +
19800 +          sends all files in the current directory except those with a
19801 +          filetype of ".log". Another:
19802 +
19803 +  send /except:*.~*~ *.*
19804 +
19805 +          sends all files except the ones that look like Kermit or EMACS
19806 +          backup files (such as "oofa.txt.~17~") (of course you can also
19807 +          use the /NOBACKUP switch for this).
19808 +
19809 +          The pattern matcher is the same one used by IF MATCH string
19810 +          pattern ([361]Section 7.4), so you can test your patterns using
19811 +          IF MATCH. If you need to match a literal * or ? (etc), precede
19812 +          it by a backslash (\). If the pattern contains any spaces, it
19813 +          must be enclosed in braces:
19814 +
19815 +  send /except:{Foo bar} *.*
19816 +
19817 +          The pattern can also be a list of up to 8 patterns. In this
19818 +          case, the entire pattern must be enclosed in braces, and each
19819 +          sub-pattern must also be enclosed in braces; this eliminates the
19820 +          need for designating a separator character, which is likely to
19821 +          also be a legal filename character on some platform or other,
19822 +          and therefore a source of confusion. You may include spaces
19823 +          between the subpatterns but they are not necessary. The
19824 +          following two commands are equivalent:
19825 +
19826 +  send /except:{{ck*.o} {ck*.c}} ck*.?
19827 +  send /except:{{ck*.o}{ck*.c}} ck*.?
19828 +
19829 +          If a pattern is to include a literal brace character, precede it
19830 +          with "\". Also note the apparent conflict of this list format
19831 +          and the string-list format described in [362]Section 4.9.1. In
19832 +          case you want to include a wildcard string-list with braces on
19833 +          its outer ends as an /EXCEPT: argument, do it like this:
19834 +
19835 +  send /except:{{{ckuusr.c,ckuus2.c,ckuus6.c}}} ckuus*.c
19836 +
19837 +1.5.5. Setting Preferences for Different Commands
19838 +
19839 +   Certain oft-used commands offer lots of switches because different
19840 +   people have different requirements or preferences. For example, some
19841 +   people want to be able to delete files without having to watch a list
19842 +   of the deleted files scroll past, while others want to be prompted for
19843 +   permission to delete each file. Different people prefer different
19844 +   directory-listing styles. And so on. Such commands can be tailored with
19845 +   the SET OPTIONS command:
19846 +
19847 +   SET OPTIONS command [ switch [ switch [ ... ] ] ]
19848 +          Sets each switch as the default for the given command, replacing
19849 +          the "factory default". Of course you can also override any
19850 +          defaults established by the SET OPTIONS command by including the
19851 +          relevant switches in the affected command any time you issue it.
19852 +
19853 +   SHOW OPTIONS
19854 +          Lists the commands that allows option-setting, and the options
19855 +          currently in effect, if any, for each. Switches that have
19856 +          synonyms are shown under their primary name; for example. /LOG
19857 +          and /VERBOSE are shown as /LIST.
19858 +
19859 +   Commands for which options may be set include DIRECTORY, DELETE, PURGE,
19860 +   and TYPE. Examples:
19861 +
19862 +  SET OPTIONS DIRECTORY /PAGE /NOBACKUP /HEADING /SORT:DATE /REVERSE
19863 +  SET OPTIONS DELETE /LIST /NOHEADING /NOPAGE /NOASK /NODOTFILES
19864 +  SET OPTIONS TYPE /PAGE
19865 +
19866 +   Not necessarily all of a command's switches can be set as options. For
19867 +   example, file selection switches, since these would normally be
19868 +   different for each command.
19869 +
19870 +   Put the desired SET OPTIONS commands in your C-Kermit customization
19871 +   file for each command whose default switches you want to change every
19872 +   time you run C-Kermit.
19873 +
19874 +1.6. Dates and Times
19875 +
19876 +   Some commands and switches take date-time values, such as:
19877 +
19878 +  send /after:{8-Feb-2000 10:28:01}
19879 +
19880 +   Various date-time formats are acceptable. The rules for the date are:
19881 +
19882 +     * The year must have 4 digits.
19883 +     * If the year comes first, the second field is the month.
19884 +     * The day, month, and year may be separated by spaces, /, -, or
19885 +       underscore.
19886 +     * The month may be numeric (1 = January) or spelled out or
19887 +       abbreviated in English.
19888 +
19889 +   If the date-time string contains any spaces, it must be enclosed in
19890 +   braces. Examples of legal dates:
19891 +
19892 +                           Interpretation:
19893 +  2000-Feb-8                8 February 2000
19894 +  {2000 Feb 8}              8 February 2000
19895 +  2000/Feb/8                8 February 2000
19896 +  2000_Feb_8                8 February 2000
19897 +  2000-2-8                  8 February 2000
19898 +  2000-02-08                8 February 2000
19899 +  8-Feb-2000                8 February 2000
19900 +  08-Feb-2000               8 February 2000
19901 +  12/25/2000                25 December 2000
19902 +  25/12/2000                25 December 2000
19903 +
19904 +   The last two examples show that when the year comes last, and the month
19905 +   is given numerically, the order of the day and month doesn't matter as
19906 +   long as the day is 13 or greater (mm/dd/yyyy is commonly used in the
19907 +   USA, whereas dd/mm/yyyy is the norm in Europe). However:
19908 +
19909 +  08/02/2000                Is ambiguous and therefore not accepted.
19910 +
19911 +   If a date is given, the time is optional and defaults to 00:00:00. If
19912 +   the time is given with a date, it must follow the date, separated by
19913 +   space, /, -, or underscore, and with hours, minutes, and seconds
19914 +   separated by colon (:). Example:
19915 +
19916 +  2000-Feb-8 10:28:01       Represents 8 February 2000, 10:28:01am
19917 +
19918 +   If a date is not given, the current date is used and a time is
19919 +   required.
19920 +
19921 +   Time format is hh:mm:ss or hh:mm or hh in 24-hour format, or followed
19922 +   by "am" or "pm" (or "AM" or "PM") to indicate morning or afternoon.
19923 +   Examples of times that are acceptable:
19924 +
19925 +                           Interpretation:
19926 +  3:23:56                    3:23:56am
19927 +  3:23:56am                  3:23:56am
19928 +  3:23:56pm                  3:23:56pm = 15:23:56
19929 + 15:23:56                    3:23:56pm = 15:23:56
19930 +  3:23pm                     3:23:00pm = 15:23:00
19931 +  3:23PM                     3:23:00pm = 15:23:00
19932 +  3pm                        3:00:00pm = 15:00:00
19933 +
19934 +   Examples of legal date-times:
19935 +
19936 +  send /after:{8 Feb 2000 10:28:01}
19937 +  send /after:8_Feb_2000_10:28:01
19938 +  send /after:8-Feb-2000/10:28:01
19939 +  send /after:2000/02/08/10:28:01
19940 +  send /after:2000/02/08_10:28:01
19941 +  send /after:2000/02/08_10:28:01am
19942 +  send /after:2000/02/08_10:28:01pm
19943 +  send /after:2000/02/08_10:28pm
19944 +  send /after:2000/02/08_10pm
19945 +  send /after:10:00:00pm
19946 +  send /after:10:00pm
19947 +  send /after:10pm
19948 +  send /after:22
19949 +
19950 +   Finally, there is a special all-numeric format you can use:
19951 +
19952 +  yyyymmdd hh:mm:ss
19953 +
19954 +   For example:
19955 +
19956 +  20000208 10:28:01
19957 +
19958 +   This is Kermit's standard date-time format (based on ISO 8601), and is
19959 +   accepted (among other formats) by any command or switch that requires a
19960 +   date-time, and is output by any function whose result is a calendar
19961 +   date-time.
19962 +
19963 +   There are no optional parts to this format and it must be exactly 17
19964 +   characters long, punctuated as shown (except you can substitute
19965 +   underscore for space in contexts where a single "word" is required).
19966 +   The time is in 24-hour format (23:00:00 is 11:00pm). This is the format
19967 +   returned by \fdate(filename), so you can also use constructions like
19968 +   this:
19969 +
19970 +  send /after:\fdate(oofa.txt)
19971 +
19972 +   which means "all files newer than oofa.txt".
19973 +
19974 +   Besides explicit dates, you can also use the any of the following
19975 +   shortcuts:
19976 +
19977 +   TODAY
19978 +          Stands for the current date at 00:00:00.
19979 +
19980 +   TODAY 12:34:56
19981 +          Stands for the current date at the given time.
19982 +
19983 +   YESTERDAY
19984 +          Stands for yesterday's date at 00:00:00. A time may also be
19985 +          given.
19986 +
19987 +   TOMORROW
19988 +          Stands for tomorrow's date at 00:00:00. A time may also be
19989 +          given.
19990 +
19991 +   + number { DAYS, WEEKS, MONTHS, YEARS } [ time ]
19992 +          Is replaced by the future date indicated, relative to the
19993 +          current date. If the time is omitted, 00:00:00 is used.
19994 +          Examples: +3days, +2weeks, +1year, +37months.
19995 +
19996 +   - number { DAYS, WEEKS, MONTHS, YEARS } [ time ]
19997 +
19998 +          Is replaced by the past date indicated, relative to the current
19999 +          date. If the time is omitted, 00:00:00 is used.
20000 +
20001 +   The time can be separated from the date shortcut by any of the same
20002 +   separators that are allowed for explicit date-times: space, hyphen,
20003 +   slash, period, or underscore. In switches and other space-delimited
20004 +   fields, use non-spaces to separate date/time fields, or enclose the
20005 +   date-time in braces, e.g.:
20006 +
20007 +  purge /before:-4days_12:00:00
20008 +  purge /before:{- 4 days 12:00:00}
20009 +
20010 +   Of course you can also use variables:
20011 +
20012 +  define \%n 43
20013 +  purge /before:-\%ndays_12:00:00
20014 +
20015 +   Shortcut names can be abbreviated to any length that still
20016 +   distinguishes them from any other name that can appear in the same
20017 +   context, e.g. "TOD" for today, "Y" for yesterday. Also, the special
20018 +   abbreviation "wks" is accepted for WEEKS, and "yrs" for "YEARS".
20019 +
20020 +   (To see how to specify dates relative to a specific date, rather than
20021 +   the current one, see the [363]\fmjd() function description below.)
20022 +
20023 +   You can check date formats with the DATE command. DATE by itself prints
20024 +   the current date and time in standard format: yyyymmdd hh:mm:ss. DATE
20025 +   followed by a date and/or time (including shortcuts) converts it to
20026 +   standard format if it can understand it, otherwise it prints an error
20027 +   message.
20028 +
20029 +   The following variables and functions deal with dates and times; any
20030 +   function argument designated as "date-time" can be in any of the
20031 +   formats described above.
20032 +
20033 +   \v(day)
20034 +          The first three letters of the English word for the current day
20035 +          of the week, e.g. "Wed".
20036 +
20037 +   \fday(date-time)
20038 +          The first three letters of the English word for day of the week
20039 +          of the given date. If a time is included, it is ignored.
20040 +          Example: \fday(8 Feb 1988) = "Mon".
20041 +
20042 +   \v(nday)
20043 +          The numeric day of the week: 0 = Sunday, 1 = Monday, ..., 6 =
20044 +          Saturday.
20045 +
20046 +   \fnday(date-time)
20047 +          The numeric day of the week for the given date. If a time is
20048 +          included, it is ignored. Example: \fnday(8 Feb 1988) = "1".
20049 +
20050 +   \v(date)
20051 +          The current date as dd mmm yyyy, e.g. "08 Feb 2000" (as in this
20052 +          example, a leading zero is supplied for day-of-month less than
20053 +          10).
20054 +
20055 +   \v(ndate)
20056 +          The current date in numeric format: yyyymmdd, e.g. "20000208".
20057 +
20058 +   \v(time)
20059 +          The current time as hh:mm:ss, e.g. "15:27:14".
20060 +
20061 +   \ftime(time)
20062 +          The given free-format date and/or time (e.g. "3pm") returns the
20063 +          time (without the date) converted to hh:mm:ss 24-hour format,
20064 +          e.g. "15:00:00" (the date, if given, is ignored).
20065 +
20066 +   \v(ntime)
20067 +          The current time as seconds since midnight, e.g. "55634".
20068 +
20069 +   \v(tftime)
20070 +          The elapsed time of the most recent file-transfer operation in
20071 +          seconds.
20072 +
20073 +   \v(intime)
20074 +          The elapsed time for the most recent INPUT command to complete,
20075 +          in milliseconds.
20076 +
20077 +   \fntime(time)
20078 +          The given free-format date and/or time is converted to seconds
20079 +          since midnight (the date, if given, is ignored). This function
20080 +          replaces \ftod2secs(), which is now a synonym for \fntime().
20081 +          Unlike \ftod2secs(), \fntime() allows a date to be included, and
20082 +          it allows the time to be in free format (like 3pm), and it
20083 +          allows the amount of time to be more than 24 hours. E.g.
20084 +          \fntime(48:00:00) = 172800. Example of use:
20085 +
20086 +  set alarm \fntime(48:00:00) ; set alarm 48 hours from now.
20087 +
20088 +   \fn2time(seconds)
20089 +          The given number of seconds is converted to hh:mm:ss format.
20090 +
20091 +   \fdate(filename)
20092 +          Returns the modification date-time of the given file in standard
20093 +          format: yyyymmdd hh:mm:ss.
20094 +
20095 +   \fcvtdate(date-time)
20096 +          Converts a free-format date and/or time to Kermit standard
20097 +          format: yyyymmdd hh:mm:ss. If no argument is given, returns the
20098 +          current date-time in standard format. If a date is given but no
20099 +          time, the converted date is returned without a time. If a time
20100 +          is given with no date, the current date is supplied. Examples:
20101 +
20102 +  \fcvtdate(4 Jul 2000 2:21:17pm) = 20000704 14:21:17
20103 +  \fcvtdate() = 20000704 14:21:17 (on 4 Jul 2000 at 2:21:17pm).
20104 +  \fcvtd(4 Jul 2000) = 20000704
20105 +  \fcvtd(6pm) = 20000704 18:00:00 (on 4 Jul 2000 at 6:00pm).
20106 +
20107 +   \fdayofyear(date-time)
20108 +   \fdoy(date-time)
20109 +          Converts a free-format date and/or time to yyyyddd, where ddd is
20110 +          the 3-digit day of the year, and 1 January is Day 1. If a time
20111 +          is included with the date, it is returned in standard format. If
20112 +          a date is included but no time, the date is returned without a
20113 +          time. If a time is given with no date, the time is converted and
20114 +          the current date is supplied. If no argument is given, the
20115 +          current date-time is returned. Synonym: \fdoy(). Examples:
20116 +
20117 +  \fddayofyear(4 Jul 2000 2:21:17pm) = 2000185 14:21:17
20118 +  \fdoy() = 2000185 14:21:17 (on 4 Jul 2000 at 2:21:17pm).
20119 +  \fdoy(4 Jul 2000) = 2000185
20120 +  \fdoy(6pm) = 2000185 18:00:00 (on 4 Jul 2000 at 6:00pm).
20121 +
20122 +   Note: The yyyyddd day-of-year format is often erroneously referred to
20123 +   as a Julian date. However, a true Julian date is a simple counting
20124 +   number, the number of days since a certain fixed day in the past.
20125 +   [364]See \fmjd() below.
20126 +
20127 +   \fdoy2date(date-time)
20128 +          Converts a date or date-time in day-of-year format to a standard
20129 +          format date. A yyyyddd-format date must be supplied; time is
20130 +          optional. The given date is converted to yyyymmdd format. If a
20131 +          time is given, it is converted to 24-hour format. Examples:
20132 +
20133 +  \fdoy2date(2000185) = 20000704
20134 +  \fdoy2(2000185 3pm) = 20000704 15:00:00
20135 +
20136 +   \fmjd(date-time)
20137 +          Converts free-format date and/or time to a Modified Julian Date
20138 +          (MJD), the number of days since 17 Nov 1858 00:00:00. If a time
20139 +          is given, it is ignored. Examples:
20140 +
20141 +  \fmjd(4 Jul 2000) = 50998
20142 +  \fmjd(17 Nov 1858) = 0
20143 +  \fmjd(16 Nov 1858) = -1
20144 +
20145 +   \fmjd2date(mjd)
20146 +          Converts an MJD (integer) to standard date format, yyyymmdd:
20147 +
20148 +  \fmjd2(50998) = 4 Jul 1998
20149 +  \fmjd2(0) = 17 Nov 1858
20150 +  \fmjd2(-1) = 16 Nov 1858
20151 +  \fmjd2(-365) = 17 Nov 1857
20152 +
20153 +   MJDs are normal integers and, unlike DOYs, may be added, subtracted,
20154 +   etc, with each other or with other integers, to obtain meaningful
20155 +   results. For example, to find out the date 212 days ago:
20156 +
20157 +  echo \fmjd2date(\fmjd()-212)
20158 +
20159 +   Constructions such as this can be used in any command where a date-time
20160 +   is required, e.g.:
20161 +
20162 +  send /after:\fmjd2date(\fmjd()-212)
20163 +
20164 +   to send all files that are not older than 212 days (this is equivalent
20165 +   to "send /after:-212days").
20166 +
20167 +   MJDs also have other regularities not exhibited by other date formats.
20168 +   For example, \fmodulus(\fmjd(any-date),7) gives the day of the week for
20169 +   any date (where 4=Sun, 5=Mon, ..., 3=Sat). (However, it is easier to
20170 +   use \fnday() for this purpose, and it gives the more conventional
20171 +   result of 0=Sun, 1=Mon, ..., 6=Sat).
20172 +
20173 +   Note that if MJDs are to be compared, they must be compared numerically
20174 +   (IF <, =, >) and not lexically (IF LLT, EQUAL, LGT), whereas DOYs must
20175 +   be compared lexically if they include a time (which contains ":"
20176 +   characters); however, if DOYs do not include a time, they may also be
20177 +   compared numerically.
20178 +
20179 +   In any case, lexical comparison of DOYs always produces the appropriate
20180 +   result, as does numeric comparison of MJDs.
20181 +
20182 +   The same comments apply to sorting. Also note that DOYs are fixed
20183 +   length, but MJDs can vary in length. However, all MJDs between 3 April
20184 +   1886 and 30 Aug 2132 are 5 decimal digits long. (MJDs become 6 digits
20185 +   long on 31 Aug 2132, and 7 digits long on 13 Oct 4596).
20186 +
20187 +1.7. Partial Completion of Keywords
20188 +
20189 +   Partial completion of keywords was added in C-Kermit 7.0. In prior
20190 +   versions, if completion was attempted (by pressing the Esc or Tab key)
20191 +   on a string that matched different keywords, you'd just get a beep. Now
20192 +   Kermit completes up to the first character where the possibly matching
20193 +   keywords differ and then beeps. For example:
20194 +
20195 +  C-Kermit> send /n<Tab>
20196 +
20197 +   which matches /NOT-BEFORE and /NOT-AFTER, now completes up to the dash:
20198 +
20199 +  C-Kermit> send /n<Tab>ot-<Beep>
20200 +
20201 +   Partial completion works for filenames too (as it has for some years).
20202 +
20203 +1.8. Command Recall
20204 +
20205 +   C-Kermit has had a command history buffer for some time, which could be
20206 +   scrolled interactively using control characters or (in Kermit 95 only)
20207 +   arrow keys. Version 7.0 adds a REDO command that allows the most recent
20208 +   command matching a given pattern to be re-executed:
20209 +
20210 +   { REDO, RR, ^ } [ pattern ]
20211 +          Search the command history list for the most recent command that
20212 +          matches the given pattern, and if one is found, execute it
20213 +          again.
20214 +
20215 +   The pattern can be a simple string (like "send"), in which case the
20216 +   last SEND command is re-executed. Or it can contain wildcard characters
20217 +   "*" and/or "?", which match any string and any single character,
20218 +   respectively (note that "?" must be preceded by backslash to override
20219 +   its normal function of giving help), and in most C-Kermit versions may
20220 +   also include [] character lists and {} string lists (see [365]Section
20221 +   4.9).
20222 +
20223 +   The match works by appending "*" to the end of the given pattern (if
20224 +   you didn't put one there yourself). Thus "redo *oofa" becomes "redo
20225 +   *oofa*" and therefore matches the most recent command that contains
20226 +   "oofa" anywhere within the command. If you want to inhibit the
20227 +   application of the trailing "*", e.g. to force matching a string at the
20228 +   end of a command, enclose the pattern in braces:
20229 +
20230 +  redo {*oofa}
20231 +
20232 +   matches the most recent command that ends with "oofa".
20233 +
20234 +   REDO commands themselves are not entered into the command history list.
20235 +   If no pattern is given, the previous (non-REDO) command is re-executed.
20236 +   The REDOne command is reinserted at the end of the command history
20237 +   buffer, so the command scrollback character (Ctrl-P, Ctrl-B, or
20238 +   Uparrow) can retrieve it.
20239 +
20240 +   Examples:
20241 +
20242 +  C-Kermit> echo foo
20243 +  foo
20244 +  C-Kermit> show alarm
20245 +  (no alarm set)
20246 +  C-Kermit> echo blah
20247 +  blah
20248 +  C-Kermit> redo          ; Most recent command
20249 +  blah
20250 +  C-Kermit> redo s        ; Most recent command starting with "s"
20251 +  (no alarm set)
20252 +  C-Kermit> redo echo f   ; Most recent command starting with "echo f"
20253 +  foo
20254 +  C-Kermit> redo *foo     ; Most recent command that has "foo" in it
20255 +  foo
20256 +  C-Kermit> <Ctrl-P>      ; Scroll back
20257 +  C-Kermit> echo foo      ; The REDOne command is there
20258 +  C-Kermit> redo {*foo}   ; Most recent command that ends with "foo"
20259 +  foo
20260 +  C-Kermit>
20261 +
20262 +   Since REDO, REDIAL, and REDIRECT all start the same way, and RED is the
20263 +   designated non-unique abbreviation for REDIAL, REDO must be spelled out
20264 +   in full. For convenience, RR is included as an invisible easy-to-type
20265 +   synonym for REDO. You can also use the "^" character for this:
20266 +
20267 +  C-Kermit> ^             ; Most recent command
20268 +  C-Kermit> ^ s           ; Most recent command starting with "s"
20269 +  C-Kermit> ^s            ; Ditto (space not required after "^").
20270 +  C-Kermit> ^*foo         ; Most recent command that has "foo" in it.
20271 +  C-Kermit> ^{*foo}       ; Most recent command ends with "foo".
20272 +
20273 +   Unlike the manual command-history-scrolling keys, the REDO command can
20274 +   be used in a script, but it's not recommended (since the command to be
20275 +   REDOne might not be found, so if the REDO command fails, you can't tell
20276 +   whether it was because REDO failed to find the requested command, or
20277 +   because the command was found but it failed).
20278 +
20279 +1.9. EXIT Messages
20280 +
20281 +   The EXIT and QUIT commands now accept an optional message to be
20282 +   printed. This makes the syntax of EXIT and QUIT just like END and STOP:
20283 +
20284 +   { EXIT, QUIT, END, STOP } [ status-code [ message ] ]
20285 +
20286 +   where status-code is a number (0 indicating success, nonzero indicating
20287 +   failure). This is handy in scripts that are never supposed to enter
20288 +   interactive mode:
20289 +
20290 +  dial 7654321
20291 +  if fail exit 1 Can't make connection - try again later.
20292 +
20293 +   Previously this could only be done in two steps:
20294 +
20295 +  dial 7654321
20296 +  xif fail { echo Can't make connection - try again later, exit 1 }
20297 +
20298 +   A status code must be included in order to specify a message. In the
20299 +   case of EXIT and QUIT, the default status code is contained in the
20300 +   variable \v(exitstatus), and is set automatically by various events
20301 +   (file transfer failures, etc; it can also be set explicitly with the
20302 +   SET EXIT STATUS command). If you want to give an EXIT or QUIT command
20303 +   with a message, but without changing the exit status from what it
20304 +   normally would have been, use the \v(exitstatus) variable, e.g.:
20305 +
20306 +   exit \v(existatus) Goodbye from \v(cmdfile).
20307 +
20308 +   The EXIT status is returned to the system shell or whatever other
20309 +   process invoked C-Kermit, e.g. in UNIX:
20310 +
20311 +  C-Kermit> exit 97 bye bye
20312 +  bye bye
20313 +  $ echo $?
20314 +  97
20315 +  $
20316 +
20317 +1.10. Managing Keyboard Interruptions
20318 +
20319 +   When C-Kermit is in command or file-transfer mode (as opposed to
20320 +   CONNECT mode), it can be interrupted with Ctrl-C. Version 7.0 adds the
20321 +   ability to disarm the Ctrl-C interrupt:
20322 +
20323 +   SET COMMAND INTERRUPT { ON, OFF }
20324 +          COMMAND INTERRUPT is ON by default, meaning the Ctrl-C can be
20325 +          used to interrupt a command or a file transfer in progress. Use
20326 +          OFF to disable these interruptions, and use it with great
20327 +          caution for obvious reasons.
20328 +
20329 +   SET TRANSFER INTERRUPT { ON, OFF }
20330 +          This can be used to disable keyboard interruption of file
20331 +          transfer when C-Kermit is in local mode, or to re-enable it
20332 +          after it has been disabled. This applies to the X, Z, E, and
20333 +          similar keys as well as to the system interrupt character,
20334 +          usually Ctrl-C. This is distinct from SET TRANSFER CANCELLATION,
20335 +          which tells whether packet mode can be exited by sending a
20336 +          special sequence of characters.
20337 +
20338 +   Several other commands can be interrupted by pressing any key while
20339 +   they are active. Version 7.0 adds the ability to disable this form of
20340 +   interruption also:
20341 +
20342 +   SET INPUT CANCELLATION { ON, OFF }
20343 +          Whether an INPUT command in progress can be interrupted by
20344 +          pressing a key. Normally ON. Setting INPUT CANCELLATION OFF
20345 +          makes INPUT commands uninterruptible except by Ctrl-C (unless
20346 +          COMMAND INTERRUPTION is also OFF).
20347 +
20348 +   SET SLEEP CANCELLATION { ON, OFF }
20349 +          Whether a SLEEP, PAUSE, or WAIT command in progress can be
20350 +          interrupted by pressing a key. Normally ON. Setting SLEEP
20351 +          CANCELLATION OFF makes these commands uninterruptible except by
20352 +          Ctrl-C (unless COMMAND INTERRUPTION is also OFF). Synonyms: SET
20353 +          PAUSE CANCELLATION, SET WAIT CANCELLATION.
20354 +
20355 +   So to make certain a script is not interruptible by the user, include
20356 +   these commands:
20357 +
20358 +  SET TRANSFER INTERRUPT OFF
20359 +  SET SLEEP CANCELLATION OFF
20360 +  SET INPUT CANCELLATION OFF
20361 +  SET COMMAND INTERRUPTION OFF
20362 +
20363 +   Make sure to turn them back on afterwards if interruption is to be
20364 +   re-enabled.
20365 +
20366 +   When a PAUSE, SLEEP, WAIT, or INPUT command is interrupted from the
20367 +   keyboard, the new variable \v(kbchar) contains a copy of the (first)
20368 +   character that was typed and caused the interruption, provided it was
20369 +   not the command interrupt character (usually Ctrl-C). If these commands
20370 +   complete successfully or time out without a keyboard interruption, the
20371 +   \v(kbchar) variable is empty.
20372 +
20373 +   The \v(kbchar) variable (like any other variable) can be tested with:
20374 +
20375 +  if defined \v(kbchar) command
20376 +
20377 +   The command is executed if the variable is not empty.
20378 +
20379 +   The \v(kbchar) variable can be reset with WAIT 0 (PAUSE 0, SLEEP 0,
20380 +   etc).
20381 +
20382 +1.11. Taming The Wild Backslash -- Part Deux
20383 +
20384 +   [366]Using C-Kermit, 2nd Edition, contains a brief section, "Taming the
20385 +   Wild Backslash", on page 48, which subsequent experience has shown to
20386 +   be inadequate for Kermit users intent on writing scripts that deal with
20387 +   Windows, DOS, and OS/2 filenames, in which backslash (\) is used as the
20388 +   directory separator. This section fills in the blanks.
20389 +
20390 +1.11.1. Background
20391 +
20392 +   The Kermit command language shares a certain unavoidable but annoying
20393 +   characteristic with most other command languages that are capable of
20394 +   string replacement, namely the necessity to "quote" certain characters
20395 +   when you want them to be taken literally. This is a consequence of the
20396 +   facts that:
20397 +
20398 +    1. One or more characters must be set aside to denote replacement,
20399 +       rather than acting as literal text.
20400 +    2. We have only 96 printable characters to work with in ASCII, which
20401 +       is still the only universally portable character set.
20402 +    3. There is no single printable character that is unused everywhere.
20403 +    4. Variables are not restricted to certain contexts, as they are in
20404 +       formal programming languages like C and Fortran, but can appear
20405 +       anywhere at all within a command, and therefore require special
20406 +       syntax.
20407 +
20408 +   Thus there can be conflicts. To illustrate, the standard UNIX shell
20409 +   uses dollar sign ($) to introduce variables. So the shell command:
20410 +
20411 +  echo $TERM
20412 +
20413 +   displays the value of the TERM variable, e.g. vt320. But suppose you
20414 +   want to display a real dollar sign:
20415 +
20416 +  echo The price is $10.20
20417 +
20418 +   This causes the shell to evaluate the variable "$1", which might or
20419 +   might not exist, and substitute its value, e.g.:
20420 +
20421 +  The price is 0.20
20422 +
20423 +   (in this case the $1 variable had no value.) This is probably not what
20424 +   you wanted. To force the dollar sign to be taken literally, you must
20425 +   apply a "quoting rule", such as "precede a character by backslash (\)
20426 +   to force the shell to take the character literally":
20427 +
20428 +  echo The price is \$10.20
20429 +  The price is $10.20
20430 +
20431 +   But now suppose you want the backslash AND the dollar sign to be taken
20432 +   literally:
20433 +
20434 +  echo The price is \\$10.20
20435 +
20436 +   This doesn't work, since the first backslash quotes the second one,
20437 +   thereby leaving the dollar sign unquoted again:
20438 +
20439 +  The price is \0.20
20440 +
20441 +   Quoting the dollar sign requires addition of a third backslash:
20442 +
20443 +  echo The price is \\\$10.20
20444 +  The price is \$10.20
20445 +
20446 +   The first backslash quotes the second one, and the third backslash
20447 +   quotes the dollar sign.
20448 +
20449 +   Every command language -- all UNIX shells, VMS DCL, DOS Batch, AOS/VS
20450 +   CLI, etc etc -- has similar rules. UNIX shell rules are probably the
20451 +   most complicated, since many printable characters -- not just one --
20452 +   are special there: dollar sign, single quote, double quote, backslash,
20453 +   asterisk, accent grave, number sign, ampersand, question mark,
20454 +   parentheses, brackets, braces, etc -- practically every
20455 +   non-alphanumeric character needs some form of quoting if it is to be
20456 +   taken literally. And to add to the confusion, the UNIX shell offers
20457 +   many forms of quoting, and many alternative UNIX shells are available,
20458 +   each using slightly different syntax.
20459 +
20460 +1.11.2. Kermit's Quoting Rules
20461 +
20462 +   Kermit's basic quoting rules are simple by comparison (there are, of
20463 +   course, additional syntax requirements for macro definitions, command
20464 +   blocks, function calls, etc, but they are not relevant here).
20465 +
20466 +   The following characters are special in Kermit commands:
20467 +
20468 +   Backslash (\)
20469 +          Introduces a variable, or the numeric representation of a
20470 +          special character, or a function, or other item for
20471 +          substitution. If the backslash is followed by a digit or by any
20472 +          of the following characters:
20473 +
20474 +  x, o, d, m, s, f, v, $, %, &, :, {
20475 +
20476 +          this indicates a special substitution item; otherwise the
20477 +          following character is to be taken literally (exceptions: \ at
20478 +          end of line is taken literally; \n, \b, and \n are special items
20479 +          in the OUTPUT command only).
20480 +
20481 +   Semicolon (;)
20482 +          (Only when at the beginning of a line or preceded by at least
20483 +          one space or tab) Introduces a comment.
20484 +
20485 +   Number sign (#)
20486 +          (Only when at the beginning of a line or preceded by at least
20487 +          one space or tab) Just like semicolon; introduces a comment.
20488 +
20489 +   Question mark (?)
20490 +          (Only at the command prompt - not in command files or macros)
20491 +          Requests context-sensitive help.
20492 +
20493 +   To force Kermit to take any of these characters literally, simply
20494 +   precede it by a backslash (\).
20495 +
20496 +   Sounds easy! And it is, except when backslash also has a special
20497 +   meaning to the underlying operating system, as it does in DOS, Windows,
20498 +   and OS/2, where it serves as the directory separator in filenames such
20499 +   as:
20500 +
20501 +  D:\K95\KEYMAPS\READ.ME
20502 +
20503 +   Using our rule, we would need to refer to this file in Kermit commands
20504 +   as follows:
20505 +
20506 +  D:\\K95\\KEYMAPS\\READ.ME
20507 +
20508 +   But this would not be obvious to new users of Kermit software on DOS,
20509 +   Windows, or OS/2, and it would be annoying to seasoned ones. Thus
20510 +   MS-DOS Kermit and Kermit 95 go to rather extreme lengths to allow the
20511 +   more natural notation, as in:
20512 +
20513 +  send d:\k95\keymaps\read.me
20514 +
20515 +   The reason this is tricky is that we also need to allow for variables
20516 +   and other expressions introduced by backslash in the same command. For
20517 +   example, suppose \%a is a variable whose value is "oofa" (without the
20518 +   quotes). What does the following command do?
20519 +
20520 +  send d:\%a
20521 +
20522 +   Does it send the file named "oofa" in the current directory of the D:
20523 +   disk, or does it send a file named "%a" in the root directory of the D:
20524 +   disk? This is the kind of trouble we get into when we attempt to bend
20525 +   the rules in the interest of user friendliness. (The answer is: if the
20526 +   variable \%a has definition that is the name of an existing file, that
20527 +   file is sent; if a file d:\%a exists, it is sent; otherwise if both
20528 +   conditions are true, the variable takes precedence, and the literal
20529 +   filename can be forced by quoting: \\%a.)
20530 +
20531 +   In Kermit 95 (but not MS-DOS Kermit), we also bend the rules another
20532 +   way by allowing you to use forward slash (/) rather than backslash (\)
20533 +   as the directory separator:
20534 +
20535 +  send d:/k95/keymaps/read.me
20536 +
20537 +   This looks more natural to UNIX users, and in fact is perfectly
20538 +   acceptable to the Windows 95/98/NT and OS/2 operating systems on the
20539 +   API level. BUT (there is always a "but") the Microsoft shell,
20540 +   COMMAND.COM, for Windows 95/98 and NT does not allow this notation, and
20541 +   therefore it can not be used in any Kermit command -- such as RUN --
20542 +   that invokes the Windows command shell AND your command shell is
20543 +   COMMAND.COM or any other shell that does not allow forward slash as
20544 +   directory separator (some alternative shells do allow this).
20545 +
20546 +     NOTE: There exists a wide variety of alternative shells from third
20547 +     parties that do not have this restriction. If you are using a shell
20548 +     that accepts forward slash as a directory separator, you can stop
20549 +     reading right now -- UNLESS (there is always an "unless") you want
20550 +     your scripts to be portable to systems that have other shells. Also
20551 +     note that some Windows shells might actually REQUIRE forward slashes
20552 +     (instead of backslashes) as directory separators; we do not treat
20553 +     this situation below, but the treatment is obvious -- use slash
20554 +     rather backslash as the directory separator.
20555 +
20556 +1.11.3. Passing DOS Filenames from Kermit to Shell Commands
20557 +
20558 +   The following Kermit commands invoke the system command shell:
20559 +
20560 +  RUN (and its synonyms ! and @)
20561 +  REDIRECT
20562 +  PIPE
20563 +
20564 +   Each of these commands takes a shell command as an operand. These shell
20565 +   commands are not, and can not be, parsed by Kermit since Kermit does
20566 +   not know the syntax of shell commands, and so can't tell the difference
20567 +   between a keyword, a filename, a variable, a switch, or other item.
20568 +   Therefore the rules can not be bent since Kermit doesn't know where or
20569 +   how to bend them. To illustrate (using the regular Windows shell):
20570 +
20571 +  run c:\\windows\\command\\chkdsk.exe
20572 +
20573 +   works OK, but:
20574 +
20575 +  run c:/windows/command/chkdsk.exe
20576 +
20577 +   is not accepted by COMMAND.COM. But:
20578 +
20579 +  run c:\windows\command\chkdsk.exe
20580 +
20581 +   results in Kermit applying its quoting rules before sending the text to
20582 +   the shell. Since "w" and "c" are not in the list of backslash-item
20583 +   codes, the backslash means "take the following character literally".
20584 +   Thus, by the time this filename gets to the Windows shell, it has
20585 +   become:
20586 +
20587 +  c:windowscommandchkdsk.exe
20588 +
20589 +   which is probably not what you wanted. (If "w" and "c" were in the
20590 +   list, the results could be even stranger.) Even more confusing is the
20591 +   case where a directory or filename starts with one or more digits:
20592 +
20593 +  run c:\123\lotus.exe
20594 +
20595 +   in which "\123" is the Kermit notation for ASCII character 123, which
20596 +   happens to be left brace ({), resulting in "c:{lotus.exe".
20597 +
20598 +   So when passing filenames to a Windows shell, always use double
20599 +   backslashes as directory separators, to ensure that the shell gets
20600 +   single backslashes:
20601 +
20602 +  run c:\\windows\\command\\chkdsk.exe
20603 +  run c:\\123\\lotus.exe
20604 +
20605 +   Similar problems might occur with the built-in EDIT, BROWSE, and FTP
20606 +   commands. These commands result in Kermit building a shell command
20607 +   internally to invoke the associated helper program; the form of this
20608 +   command might conflict with the form demanded by certain alternative
20609 +   shells.
20610 +
20611 +1.11.4. Using Variables to Hold DOS Filenames
20612 +
20613 +   Now to the next level. Suppose you want to write a script in which
20614 +   filenames are parameters, and therefore are stored in variables.
20615 +   Example:
20616 +
20617 +  define \%f c:\windows\command\chkdsk.exe
20618 +  ...
20619 +  run \%f
20620 +
20621 +   Obviously this won't work for the reasons just noted; the RUN command
20622 +   requires directory separators be coded as double backslashes:
20623 +
20624 +  define \%f c:\\windows\\command\\chkdsk.exe
20625 +  ...
20626 +  run \%f
20627 +
20628 +   This will work; no surprises here. However, if you had used ASSIGN
20629 +   rather than DEFINE, you might have been surprised after all; review
20630 +   pages 348-349 of [367]Using C-Kermit (2nd Ed) for the difference
20631 +   between DEFINE and ASSIGN.
20632 +
20633 +   We have said that any Kermit 95 or MS-DOS Kermit command that parses
20634 +   filenames itself -- SEND, for example -- does not require double
20635 +   backslashes since it knows it is parsing a filename. So since the
20636 +   following works:
20637 +
20638 +  send c:\windows\command\chkdsk.exe
20639 +
20640 +   Should the following also work?
20641 +
20642 +  define \%f c:\windows\command\chkdsk.exe
20643 +  ...
20644 +  send \%f
20645 +
20646 +   Answer: No. Why? Because \%f is evaluated "recursively", to allow for
20647 +   the possibility that its definition contains further variable
20648 +   references. This is true of all "backslash-percent-letter" (or -digit)
20649 +   variables, and also for array references. So \%f becomes
20650 +   c:\windows\command\chkdsk.exe, which becomes
20651 +   c:windowscommandchkdsk.exe.
20652 +
20653 +   The trick here is to use the "other" kind of variable, that is
20654 +   evaluated only "one level deep" rather than recursively:
20655 +
20656 +  define filename c:\windows\command\chkdsk.exe
20657 +  ...
20658 +  send \m(filename)
20659 +
20660 +   Similarly if you want to prompt the user for a filename:
20661 +
20662 +  ask filename { Please type a filename: }
20663 +   Please type a filename: c:\windows\command\chkdsk.exe
20664 +  send \m(filename)
20665 +
20666 +1.11.5. Passing DOS Filenames as Parameters to Macros
20667 +
20668 +   Suppose you want to pass a DOS filename containing backslashes as a
20669 +   parameter to a Kermit macro. This raises two issues:
20670 +
20671 +    1. Parameters to macros are "just text" and so are fully evaluated
20672 +       before they are passed to the macro.
20673 +    2. Once inside the macro, the formal parameters \%1, \%2, ... \%9 are
20674 +       the type of variable that is evaluated recursively.
20675 +
20676 +   Thus a DOS filename is ruined once in the act of parsing the macro
20677 +   invocation, and again when referring to it from within the macro. To
20678 +   illustrate, suppose "test" is a macro. Then in the invocation:
20679 +
20680 +  test c:\mydir\blah.txt
20681 +
20682 +   "c:mydirblah.txt" is assigned to \%1. However, if we double the
20683 +   backslashes:
20684 +
20685 +  test c:\\mydir\\blah.txt
20686 +
20687 +   "c:\mydir\blah.txt" is assigned to \%1. But then when you refer to \%1
20688 +   in the macro, it is evaluated recursively, resulting in
20689 +   "c:mydirblah.txt". To illustrate:
20690 +
20691 +  define test echo \%1
20692 +  test c:\mydir\blah.txt
20693 +  c:mydirblah.txt
20694 +  test c:\\mydir\\blah.txt
20695 +  c:mydirblah.txt
20696 +  test c:\\\\mydir\\\\blah.txt
20697 +  c:\mydir\blah.txt
20698 +
20699 +   Let's address each part of the problem separately. First, inside the
20700 +   macro. You can use the \fcontents() function to force a
20701 +   backslash-percent variable (such as a macro argument) to be evaluated
20702 +   one level deep instead of recursively, for example:
20703 +
20704 +  define test echo { The filename is "\fcontents(\%1)"}
20705 +
20706 +  test c:\mydir\blah.txt               ; We don't expect this to work
20707 +   The filename is "c:mydirblah.txt"   ; and it doesn't.
20708 +  test c:\\mydir\\blah.txt             ; But this does...
20709 +   The filename is "c:\mydir\blah.txt"
20710 +
20711 +   Thus if the filename arrives inside the macro with single backslashes,
20712 +   the backslashes are preserved if you always refer to the parameter
20713 +   through the \fcontents() function.
20714 +
20715 +   Now how to ensure that backslashes are not stripped or misinterpreted
20716 +   when passing a filename to a macro? This brings us back to what we
20717 +   learned in earlier sections:
20718 +
20719 +    1. If it is a literal filename, either double the backslashes, or (if
20720 +       the filename is to be used only within Kermit itself and not passed
20721 +       to a DOS shell, or it is to be passed to an alternative shell that
20722 +       accepts forward slash as a directory separator), use forward slash
20723 +       instead of backslash as the directory separator.
20724 +    2. If it is a variable that contains a filename, make sure you use a
20725 +       macro-style variable name, rather than a
20726 +       backslash-percent-character name.
20727 +
20728 +   Examples:
20729 +
20730 +  define test echo \fcontents(\%1)
20731 +  define filename c:\mydir\blah.txt
20732 +
20733 +  test c:\\mydir\\blah.txt  ; Literal filename with double backslashes
20734 +  c:\mydir\blah.txt
20735 +
20736 +  test c:/mydir/blah.txt    ; Literal filename with forward slashes
20737 +  c:/mydir/blah.txt
20738 +
20739 +  test \m(filename)         ; Variable
20740 +  c:\mydir\blah.txt
20741 +
20742 +   But what if you don't like these rules and you still want to pass a
20743 +   literal filename containing single backslashes to a macro? This is
20744 +   possible too, but a bit tricky: turn command quoting off before
20745 +   invoking the macro, and then turn it back on inside the macro. Example:
20746 +
20747 +  define test set command quoting on, echo \fcontents(\%1)
20748 +
20749 +  set command quoting off
20750 +  test c:\mydir\blah.txt
20751 +  c:\mydir\blah.txt
20752 +
20753 +   Upon return from the macro, command quoting is back on (since the macro
20754 +   turned it on).
20755 +
20756 +   Obviously this trick can not be used if the filename is stored in a
20757 +   variable, since it prevents the variable from being evaluated.
20758 +
20759 +1.11.6. Passing DOS File Names from Macro Parameters to the DOS Shell
20760 +
20761 +   Now suppose you need to pass a DOS filename to a macro, and the macro
20762 +   needs to pass it, in turn, to the Windows shell via (say) Kermit's RUN
20763 +   command. This works too:
20764 +
20765 +  define xrun run \fcontents(\%1)
20766 +  xrun c:\\windows\\command\\chkdsk.exe
20767 +
20768 +   (or you can use the SET COMMAND QUOTING OFF / ON technique described
20769 +   above to avoid the double backslashes.) But..
20770 +
20771 +  xrun c:/windows/command/chkdsk.exe
20772 +
20773 +   does not work if the Windows shell does not recognize "/" as a
20774 +   directory separator. If there is a chance that a filename might be
20775 +   passed to the macro in this form, the macro will need to convert it to
20776 +   a form acceptable to the shell:
20777 +
20778 +  define xrun run \freplace(\fcontents(\%1),/,\\)
20779 +
20780 +   Here we replace all occurrences (if any) of "/" in the argument with
20781 +   "\" prior to issuing the RUN command. Of course, in order to specify
20782 +   "\" as a literal character in the \freplace() argument list, we have to
20783 +   double it.
20784 +
20785 +1.11.7. Passing DOS Filenames to Kermit from the Shell
20786 +
20787 +   As noted in the manual, the \&@[] array contains Kermit's command-line
20788 +   arguments. Suppose one of these arguments, say \&@[3], is a DOS
20789 +   filename such as C:\FOO\BAR\BAZ\OOFA.TXT. (Note: In C-Kermit 7.0 and
20790 +   K95 1.1.18 and later, command-line arguments after "=" or "--" are also
20791 +   available in the top-level \%1..9 variables; see [368]Section 7.5.)
20792 +
20793 +   Of course you can eliminate any problems by using forward slashes
20794 +   rather than backslashes in the filename, but sometimes this is not
20795 +   possible, as when the Kermit command line is being generated by another
20796 +   program than can only generate "native" format DOS filenames.
20797 +
20798 +   As noted in the manual, "\%x" variables and \&x[] arrays are always
20799 +   evaluated "all the way" (recursively). If the contents of one of these
20800 +   variables contains backslashes, this causes another level of
20801 +   evaluation.
20802 +
20803 +   There is another kind of variable, which is evaluated only "one level
20804 +   deep". You can use this to prevent interpretation of the backslashes in
20805 +   the filenames. Example:
20806 +
20807 +  assign filename \fcontents(\&@[3])  ; Transfer contents
20808 +  ...
20809 +  send \m(filename)
20810 +
20811 +   Or, more simply:
20812 +
20813 +  send \fcontents(\&@[3])
20814 +
20815 +1.12. Debugging
20816 +
20817 +   The debug log is produced when you give a "log debug" command. This is
20818 +   normally done at the request of the Kermit help desk, for forwarding to
20819 +   the Kermit developers for analysis as a last resort in troubleshooting
20820 +   problems. (Last resort because it can grow quite huge in a very short
20821 +   time.) In cases where timing information is critical to understanding a
20822 +   problem, you can tell C-Kermit to put a timestamp on each debug log
20823 +   line by giving the command:
20824 +
20825 +  SET DEBUG TIMESTAMP ON
20826 +
20827 +   At any time before or after activating the debug log (SET DEBUG
20828 +   TIMESTAMP OFF turns off timestamping). Timestamps can be turned off and
20829 +   on as desired while logging. Obviously, they increase the size and
20830 +   growth rate of the log significantly, and so should be used sparingly.
20831 +   Timestamps are of the form hh:mm:ss.xxx, where .xxx is thousands of a
20832 +   second (but is included only on platforms that include this feature).
20833 +
20834 +1.13. Logs
20835 +
20836 +   In UNIX C-Kermit and in K-95, you can now direct any log to a pipe.
20837 +   This not only lets you send your logs to places other than disk files,
20838 +   but also lets you customize them to any desired degree.
20839 +
20840 +   LOG { DEBUG, PACKETS, SESSION, TRANSACTION, CONNECTION } { file, pipe }
20841 +          ...
20842 +          A "pipe" is the name of a command, preceded by a vertical bar.
20843 +          If the pipe contains any spaces, it must be enclosed in braces.
20844 +
20845 +   Here are some examples for UNIX (always remember the importance of
20846 +   getting the UNIX shell quoting rules right):
20847 +
20848 +   LOG TRANSACTIONS |lpr
20849 +          This sends the transaction log to the default UNIX printer,
20850 +          rather than to a file (use "lp" rather than "lpr" if necessary).
20851 +
20852 +   LOG TRANSACTIONS {| myfilter > t.log}
20853 +          For those who don't like the format of the transaction log, or
20854 +          want to extract certain information from it; write your own
20855 +          output filter.
20856 +
20857 +   LOG SESSION {| lpr -Plaserwriter}
20858 +          This sends the session log to a specific UNIX printer, rather
20859 +          than to a file. Note the braces around the pipeline. These are
20860 +          required because it contains spaces.
20861 +
20862 +   LOG DEBUG {| tail -100 > debug.log}
20863 +          This causes the debug log file to contain only the final 100
20864 +          lines. Suppose C-Kermit crashes under some unpredictable
20865 +          circumstances, and you need a debug log to catch it in the act.
20866 +          But the debug log can grow to huge proportions very quickly,
20867 +          possibly filling up the disk. Piping the debug log through
20868 +          "tail" results in keeping only the last 100 lines (or other
20869 +          number of your choice).
20870 +
20871 +   LOG DEBUG {| grep "^TELNET" > debug.log}
20872 +          This one shows how to log only Telnet negotiations. Piping the
20873 +          debug log through grep or egrep lets you log only specific
20874 +          information, rather than everything. "man grep" for further
20875 +          info.
20876 +
20877 +   LOG DEBUG {| gzip -c > debug.log.gz}
20878 +          Creates a full debug log, but compressed by gzip to save space.
20879 +
20880 +   LOG PACKETS {| tr "\\01" "X" | cut -c9- > packet.log}
20881 +          This one writes the regular packet log, but translates the
20882 +          Ctrl-A that starts each packet to the letter "X" and removes the
20883 +          s-nn-nn- notation from the beginning of each line. Note the
20884 +          double backslash (normal Kermit quoting rules). "man tr" and
20885 +          "man cut" for further info.
20886 +
20887 +   See [369]Section 2.12 for information about the new connection log.
20888 +
20889 +1.14. Automatic File-Transfer Packet Recognition at the Command Prompt
20890 +
20891 +   Beginning in version 7.0, C-Kermit can recognize Kermit (and in some
20892 +   cases also Zmodem) file-transfer packets while at its command prompt.
20893 +   This is convenient (for example), if you escaped back from a remote
20894 +   Kermit program and told the local Kermit program to send a file, but
20895 +   forgot to tell the remote Kermit program to receive it (and the local
20896 +   Kermit did not have the "send a Kermit receive command" feature
20897 +   available). This feature is controlled by the following command:
20898 +
20899 +   SET COMMAND AUTODOWNLOAD { ON, OFF }
20900 +          When ON, which is the default, the command parser recognizes
20901 +          Kermit packets when Kermit is in remote mode. An S packet makes
20902 +          it go into receive mode, an I packet makes it go into server
20903 +          mode. When OFF, packet recognition is disabled and the behavior
20904 +          when a packet is received at the command prompt is as it was in
20905 +          C-Kermit 6.1 and earlier (namely to print an error message).
20906 +
20907 +   COMMAND AUTODOWNLOAD is the command-mode equivalent of TERMINAL
20908 +   AUTODOWNLOAD, which is effective during CONNECT mode.
20909 +
20910 +1.15. The TYPE Command
20911 +
20912 +   The TYPE command now accepts a selection of optional switches
20913 +   ([370]Section 1.5), and also sets several variables.
20914 +
20915 +   Syntax: TYPE [ switches... ] filename
20916 +
20917 +   Variables:
20918 +
20919 +   \v(ty_ln)
20920 +          Line number of current line (during TYPE command; see /PREFIX)
20921 +
20922 +   \v(ty_lc)
20923 +          Line count of file most recently TYPEd.
20924 +
20925 +   \v(ty_mc)
20926 +          Match count of file most recently TYPEd (see /MATCH).
20927 +
20928 +   Switches:
20929 +
20930 +   /PAGE
20931 +          If /PAGE is included, Kermit pauses at the end of each screenful
20932 +          and issues a "more?" prompt. You may press the space bar to view
20933 +          the next page (screenful), or press "q" or "n" to return to the
20934 +          C-Kermit prompt. If this switch is given, it overrides the
20935 +          COMMAND MORE-PROMPTING setting for this command only. If it is
20936 +          not given, paging is according to COMMAND MORE-PROMPTING.
20937 +
20938 +   /NOPAGE
20939 +          Do not pause at the end of each screenful; show the whole file
20940 +          (or all selected lines) at once. If this switch is given, it
20941 +          overrides the COMMAND MORE-PROMPTING setting for this command
20942 +          only. If it is not given, paging is according to COMMAND
20943 +          MORE-PROMPTING.
20944 +
20945 +   /HEAD[:n]
20946 +          Only show the first n lines of the file (where n is a number).
20947 +          If n is omitted, 10 is used.
20948 +
20949 +   /TAIL[:n]
20950 +          Only show the last n lines of the file (where n is a number). If
20951 +          nis omitted, 10 is used. Note: /HEAD and /TAIL can't be
20952 +          combined; if you give both switches, only the most recent one is
20953 +          used.
20954 +
20955 +   /MATCH:pattern
20956 +          Only type lines from the file that match the given pattern (see
20957 +          [371]Section 4.9.1 for pattern notation). UNIX users familiar
20958 +          with grep should note a significant difference: there is no
20959 +          implied "*" at the beginning and end of the pattern. Thus:
20960 +
20961 +  TYPE /MATCH:foo    Lists lines whose entire contents are "foo".
20962 +  TYPE /MATCH:foo*   Lists lines that start with "foo".
20963 +  TYPE /MATCH:*foo   Lists lines that end with "foo".
20964 +  TYPE /MATCH:*foo*  Lists lines that have "foo" anywhere in them.
20965 +
20966 +          /HEAD and /TAIL apply after /MATCH, so "type /tail:20 /match:x*"
20967 +          shows the last 20 lines in the file that start with "x".
20968 +
20969 +   /PREFIX:string
20970 +          Print the given string at the beginning of each line. The string
20971 +          may be a constant, a variable, or a quoted variable. If it's an
20972 +          unquoted variable, its value at the time the TYPE command was
20973 +          given is used as a constant. If it is a quoted variable, it is
20974 +          re-evaluated for each line; a useful variable for this context
20975 +          is \v(ty_ln) (the line number of the current line being typed).
20976 +          If the prefix is to include spaces, it must be enclosed in
20977 +          braces. Examples:
20978 +
20979 +        type /prefix:{oofa.txt: } /match:*thing* oofa.txt
20980 +                Prints all lines in oofa.txt that contain "thing" with the
20981 +                filename itself as the prefix (similar to UNIX grep).
20982 +
20983 +        type /prefix:{\v(time). } oofa.txt
20984 +                Prefixes each line of oofa.txt with the time at which the
20985 +                TYPE command was given (one backslash)
20986 +
20987 +        type /prefix:{\\v(time). } oofa.txt
20988 +                Prefixes each line of oofa.txt with the time at which that
20989 +                line is being typed (two backslashes).
20990 +
20991 +        type /prefix:{\\v(ty_ln). } oofa.txt
20992 +                Prefixes each line of oofa.txt with its line number.
20993 +
20994 +        type /prefix:{\\flpad(\\v(ty_ln),4). } oofa.txt
20995 +                Same as the previous example, except the line number is
20996 +                right-adjusted in a 4-column field.
20997 +
20998 +   /WIDTH[:n]
20999 +          Truncates each line at column n (which must be a number) prior
21000 +          to printing it. This option can be used for long lines when you
21001 +          don't want them to wrap. If nis omitted, your current screen
21002 +          width is used.
21003 +
21004 +   /COUNT
21005 +          Counts lines and -- if /MATCH was included, matches -- but does
21006 +          not print any lines from the file. The line and match count is
21007 +          shown at the end, and the variables \v(ty_lc) and \v(ty_lm) are
21008 +          set accordingly.
21009 +
21010 +   SET OPTIONS TYPE { /PAGE, /NOPAGE, /WIDTH:n }
21011 +          Sets the paging default for TYPE commands, which can be
21012 +          overridden in any particular TYPE command by including the
21013 +          desired switch.
21014 +
21015 +   If a TYPE command is given with no switch, and no SET OPTIONS TYPE
21016 +   selection is in effect, paging is according to your COMMAND
21017 +   MORE-PROMPTING setting (SHOW COMMAND).
21018 +
21019 +1.16. The RESET Command
21020 +
21021 +   The RESET command, added in 7.0, closes all open files and logs, but
21022 +   does not affect the open connection (if any).
21023 +
21024 +1.17. The COPY and RENAME Commands
21025 +
21026 +   As of C-Kermit 7.0, in the UNIX version only, the COPY and RENAME
21027 +   commands are built in and do not call the underlying platform's COPY or
21028 +   RENAME command. This allows them to work in "NOPUSH" versions and other
21029 +   circumstances where it can't access system commands, and it allows file
21030 +   copying and renaming to be done portably in scripts. The
21031 +   characteristics of the built-in COPY or RENAME include:
21032 +     * It fails if the source file is a directory or is wild or lacks read
21033 +       access.
21034 +     * It fails if the source file is the destination file.
21035 +     * It allows the destination file to be a directory, in which case the
21036 +       source file is copied (or renamed) into it with the same name.
21037 +     * It overwrites an existing destination file if its permission
21038 +       allows.
21039 +     * It sets the new file's permission according to umask but also
21040 +       carries forward the source file's execute permission bits if the
21041 +       destination file did not already exist.
21042 +     * It fails if interrupted by Ctrl-C.
21043 +     * Upon error, it prints an appropriate message.
21044 +     * It returns standardized error codes that can be tested by IF
21045 +       SUCCESS / FAIL.
21046 +
21047 +   These commands now also accept the following switches:
21048 +
21049 +  /LIST (/LOG, /VERBOSE)    = Print "file1 => file2 (OK)" (or error message).
21050 +  /NOLIST (/NOLOG, /QUIET)  = Don't print anything (except error messages).
21051 +
21052 +   /NOLIST is the default.
21053 +
21054 +   The same built-in code is used by the UNIX C-Kermit server to execute
21055 +   REMOTE COPY commands (except in this case no switches are available).
21056 +
21057 +   The COPY command also accepts the following additional switches. When
21058 +   any of these are given (and they can be used in any combination except
21059 +   /SWAP and /APPEND), some of the checks listed above are relaxed, and
21060 +   thus it might be possible to get into trouble in certain cases, e.g.
21061 +   when the source and target files are the same file:
21062 +
21063 +  /APPEND                   = Append source file to destination file.
21064 +  /SWAP-BYTES               = Swap bytes (see [372]Section 6.6.5).
21065 +  /FROMB64                  = Decode the source file from Base64 encoding.
21066 +  /TOB64                    = Encode the target file in Base64.
21067 +
21068 +   Base64 is the encoding commonly used for enclosures in Internet email.
21069 +
21070 +1.18. The MANUAL Command
21071 +
21072 +   The MANUAL command can be used to access the appropriate Kermit manual
21073 +   or other manual. The general syntax is:
21074 +
21075 +   MANUAL [ string ]
21076 +          If the string is omitted, C-Kermit asks the underlying system to
21077 +          access the C-Kermit manual using whatever method is appropriate
21078 +          for the system.
21079 +
21080 +   The specific action depends on the system. In UNIX, a "man" command is
21081 +   issued; "kermit" is the default argument but other manual topics may be
21082 +   specified. If the "man" command allows index or string searching, the
21083 +   appropriate syntax may be included.
21084 +
21085 +   In Kermit 95, the MANUAL command brings up the HTML online K95 manual.
21086 +
21087 +   In VMS and elsewhere, "man" is simply translated to "help", with a
21088 +   default argument of "kermit"; other and/or additional arguments may be
21089 +   included according to the definition of the system's "help" command.
21090 +
21091 +   Correct operation of the "man" command in C-Kermit depends on the
21092 +   appropriate man page or help topic having been installed in the right
21093 +   place with the right permissions and format.
21094 +
21095 +1.19. String and Filename Matching Patterns
21096 +
21097 +   A pattern is a string that includes special notation for matching
21098 +   classes or sequences of characters. C-Kermit 7.0 / K95 1.1.19 supports
21099 +   patterns in several places:
21100 +
21101 +     * Filenames ([373]Section 4.9)
21102 +     * SWITCH case labels ([374]Section 7.18)
21103 +     * The new IF MATCH statement ([375]Section 7.4)
21104 +     * TYPE /MATCH ([376]Section 1.15)
21105 +     * SET FILE TEXT-PATTERNS and BINARY-PATTERNS ([377]Section 4.3)
21106 +     * The \fsearch() and \farraylook() functions ([378]Sections 7.3 and
21107 +       [379]7.10.7)
21108 +     * The \fpattern() function used with [M,RE]INPUT ([380]Section 7.1)
21109 +
21110 +   Patterns are also called wildcards, especially when used for filename
21111 +   matching. C-Kermit's pattern syntax is explained in [381]Section 4.9.1,
21112 +   and also by the HELP WILDCARDS command.
21113 +
21114 +1.20. Multiple Commands on One Line
21115 +
21116 +   As of C-Kermit 7.0, commands can be grouped together on one line by
21117 +   separating the commands with commas and enclosing the list in braces.
21118 +   For example:
21119 +
21120 +  C-Kermit> { echo One, echo Two, echo Three }
21121 +  C-Kermit> do { echo One, echo Two, echo Three }
21122 +
21123 +   Command lists can be nested:
21124 +
21125 +  [ do ] { echo One, echo Two, if true { echo A, echo B}, echo Three }
21126 +
21127 +   and the END command works as it does in macros:
21128 +
21129 +  [ do ] { echo One, echo Two, if true end, echo Three }
21130 +
21131 +   The "one line" stricture is, of course, pliant to line-continuation
21132 +   conventions, namely that lines ending in hyphen (-) or left brace ({)
21133 +   are to be continued. Thus the first example can also be rendered:
21134 +
21135 +  [ do ] {
21136 +      echo One
21137 +      echo Two
21138 +      echo Three
21139 +  }
21140 +
21141 +   (the "do" is optional).
21142 +
21143 +1.21. What Do I Have?
21144 +
21145 +   C-Kermit can be built for hundreds of different platforms with
21146 +   practically countless configuration options. Certain commands might not
21147 +   be available in certain configurations, etc. Even on the same platform,
21148 +   different builds are possible: "maximum functionality", "minimum size",
21149 +   "maximum performance", and so on. You can find out a lot about the
21150 +   configuration of your C-Kermit program with the SHOW FEATURES command.
21151 +   Of course, a lot of what it says, especially in the bottom part, might
21152 +   seem like gibberish, but can be deciphered with a Rosetta Stone (such
21153 +   as the C-Kermit source or the [382]ckccfg.txt file). In any case, the
21154 +   output from SHOW FEATURES might easily explain why some expected
21155 +   feature is missing, or some buffer is smaller than expected. Here's a
21156 +   sample of the bottom section for the SunOS version:
21157 +
21158 +C-Kermit 7.0.196, 1 Jan 2000
21159 +
21160 +Major optional features included:
21161 + Network support (type SHOW NET for further info)
21162 + Telnet Kermit Option
21163 + Hardware flow control
21164 + External XYZMODEM protocol support
21165 + Latin-1 (West European) character-set translation
21166 + Latin-2 (East European) character-set translation
21167 + Cyrillic (Russian, Ukrainian, etc) character-set translation
21168 + Greek character-set translation
21169 + Hebrew character-set translation
21170 + Japanese character-set translation
21171 + Unicode character-set translation
21172 + Pseudoterminal control
21173 + REDIRECT command
21174 + RESEND command
21175 + Fullscreen file transfer display
21176 + Control-character unprefixing
21177 + Streaming
21178 + Autodownload
21179 +
21180 +Major optional features not included:
21181 + No Kerberos(TM) authentication
21182 + No SRP(TM) (Secure Remote Password) protocol
21183 + No Secure Sockets Layer (SSL) protocol
21184 + No Transport Layer Security (TLS) protocol
21185 + No encryption
21186 + No X Windows forwarding
21187 +
21188 +Host info:
21189 + Machine:    sun4m
21190 + Model:      (unknown)
21191 + OS:         SunOS
21192 + OS Release: 4.1.3_U1
21193 + OS Version: 4
21194 +
21195 +Target: sunos41gsc
21196 +GCC version: 2.7.2
21197 +Compiled Dec 31 1999 10:38:54, options:
21198 + __GNUC__ __STDC__ _POSIX_JOB_CONTROL _SC_JOB_CONTROL ARRAYREFLEN=1024 BIGBUFOK
21199 + BROWSER BSD4 CK_ANSIC CK_APC CK_AUTODL CK_CURSES CK_DNS_SRV CK_ENVIRONMENT
21200 + CK_FAST CK_LOGIN CK_MKDIR CK_NAWS CK_PCT_BAR CK_PERMS CK_RECALL CK_RTSCTS
21201 + CK_SPEED CK_TIMERS CK_TMPDIR CK_TTGWSIZ CK_TTYFD CK_WREFRESH CKEXEC
21202 + CKFLOAT=double CKGHNLHOST ckmaxfiles=64 CKMAXOPEN=64 CKMAXPATH=1023 CKREALPATH
21203 + CKREGEX CKSYSLOG CKTUNING CMDBL=32763 CMDDEP=64 CONGSPD DCMDBUF DIRENT DYNAMIC
21204 + FNFLOAT FORDEPTH=32 GFTIMER HADDRLIST HDBUUCP IFDEBUG IKS_OPTION IKSDB
21205 + IKSDCONF INBUFSIZE=32768 INPBUFSIZ=4096 MAC_MAX=16384 MACLEVEL=128 MAXDDIR=32
21206 + MAXDNUMS=4095 MAXGETPATH=128 MAXTAKE=54 MAXWLD=102400 MSENDMAX=1024 NETCMD
21207 + NETCONN NETPTY NOKVERBS NOSETBUF OBUFSIZE=32768 PARSENSE PATTERNS PIPESEND
21208 + RENAME RLOGCODE SAVEDUID SELECT SIG_V SOL_SOCKET sparc STREAMING sun SUNOS4
21209 + SYSTIMEH TCPSOCKET TIMEH TLOG TNCODE TTLEBUF TTSPDLIST UIDBUFLEN=256 UNIX
21210 + UNPREFIXZERO USE_LSTAT USE_MEMCPY VNAML=4096 WHATAMI XFRCAN Z_MAXCHAN=46
21211 + z_maxchan=46 ZXREWIND
21212 +
21213 + byte order: big endian
21214 +
21215 + sizeofs: int=4 long=4 short=2 char=1 char*=4 float=4 double=8
21216 +
21217 + floating-point: precision=16 rounding=1
21218 +
21219 +   Without going into detail about what all the notation means, notice a
21220 +   couple things:
21221 +
21222 +     * The Options section shows symbols ("macros") in effect during
21223 +       compilation, together with their values (for those that have
21224 +       values). The options are listed in alphabetical order to make any
21225 +       particular option easier to find.
21226 +     * MAXWLD is the maximum number of files that a wildcard can expand
21227 +       to.
21228 +     * Anything starting with "NO" is a feature (or something other than a
21229 +       feature) that has been deliberately "compiled out", or omitted.
21230 +     * Important items for script writers include: CMDBL=32763 (the size
21231 +       of the command buffer and therefore the maximum length for a macro
21232 +       or variable definition; CMDDEP=64 (the limit on recursion depth);
21233 +       FORDEPTH=32 (the nesting limit on FOR loops); INBUFSIZE=32768 (the
21234 +       size of the INPUT command circular buffer); MAC_MAX=16384 (the
21235 +       maximum number of macros), etc.
21236 +
21237 +   See the [383]ckccfg.txt file for details.
21238 +
21239 +1.22. Generalized File Input and Output
21240 +
21241 +   C-Kermit 7.0 adds a new generalized I/O system for stream files,
21242 +   augmenting (and to some extent, overlapping with) the older OPEN, READ,
21243 +   WRITE, and CLOSE commands. In the new file i/o system, which can be
21244 +   used simultaneously with the old one, all commands are grouped together
21245 +   under the new FILE keyword, and some related functions and variables
21246 +   are added.
21247 +
21248 +1.22.1. Why Another I/O System?
21249 +
21250 +   The well-known LOG, OPEN, READ, WRITE, and CLOSE commands have the
21251 +   following restrictions:
21252 +
21253 +    1. Only one READ file and one WRITE file can be open at a time.
21254 +    2. The READ and WRITE commands are strictly line oriented.
21255 +    3. These commands can not be used with binary files.
21256 +    4. They do not support read/write access or random access.
21257 +    5. The syntax is a bit counterintuitive for programmers.
21258 +
21259 +   The new file i/o system allows multiple files to be open at once, in
21260 +   any desired combination of modes (read/write/append) supported by the
21261 +   operating system, for line, block (record), or character i/o, for
21262 +   sequential or random access, using consistent syntax and conventions.
21263 +
21264 +   The new system, however, does not replace the old one, since the old
21265 +   system still must be used for:
21266 +
21267 +    1. The session, packet, debug, transaction, and connection logs.
21268 +    2. Reading and writing commands rather than files.
21269 +    3. Existing scripts.
21270 +
21271 +   The new system works only with regular files, not with commands or
21272 +   pipes or mailboxes or pseudoterminals. No special provisions are made
21273 +   in the FILE commands for handling devices or network connections, nor
21274 +   for preventing you from trying to open them; if the underlying
21275 +   operating system treats them like regular stream disk files, the FILE
21276 +   commands (except, of course SEEK, REWIND, and COUNT) might work with
21277 +   them. (In C programming terms, the FILE commands are, at present,
21278 +   nothing more than a front end to fopen() / fread() / fwrite() /
21279 +   fclose() and friends, which are a portable API to sequential files, but
21280 +   this might change in the future for platforms like VMS and VOS that
21281 +   have more complicated file systems.)
21282 +
21283 +   Definitions:
21284 +
21285 +   Channel
21286 +          A number assigned to a file when it is opened, by which it must
21287 +          be referred to in all input/output operations.
21288 +
21289 +   Read/Write Pointer
21290 +          The current position in an open file, expressed as the 0-based
21291 +          byte count from the beginning.
21292 +
21293 +1.22.2. The FILE Command
21294 +
21295 +   FILE keyword [ switches ] channel [ data ]
21296 +          The keyword specifies the function: FILE OPEN, FILE READ, FILE
21297 +          WRITE, FILE CLOSE, etc. For convenience (and for familiarity to
21298 +          C programmers), the two-word FILE commands can be shortened to
21299 +          the single words FOPEN, FREAD, FWRITE, FCLOSE, and so on.
21300 +          Switches are optional, and modify or amplify the requested file
21301 +          function.
21302 +
21303 +   As in C, Fortran, and other programming languages, open files are
21304 +   referred to by "channels", integers such as 0, 1, 2, 3, and so on. A
21305 +   channel number is assigned when you open a file. The number of
21306 +   available channels depends on the underlying operating system, and can
21307 +   be seen in the variable:
21308 +
21309 +  \v(f_max)
21310 +
21311 +   or by giving the FILE LIST (FLIST) command. Channels are discussed in
21312 +   greater detail in [384]Section 1.22.4.
21313 +
21314 +   FILE command errors can be caught with IF FAIL after the FILE command.
21315 +   In addition, the \v(f_error) variable is set to the completion code of
21316 +   the command: 0 if no error, or a negative number if there was an error.
21317 +   The error codes are listed in [385]Section 1.22.5.
21318 +
21319 +   The command to open a file is:
21320 +
21321 +   FILE OPEN [ switches ] variable filename
21322 +          Opens a file for the type of access specified by the switches,
21323 +          or for read-only access if no switches are given. Upon success,
21324 +          a channel number is assigned to this file and stored in the
21325 +          given variable so you can refer to the open file in subsequent
21326 +          i/o commands. If the file can not be opened, the FILE OPEN
21327 +          command fails. Synonym: FOPEN.
21328 +
21329 +   The FILE OPEN switches are:
21330 +
21331 +   /READ
21332 +          Open the file for read access. If no switches are given, /READ
21333 +          is assumed. If the file does not exist or can't be opened for
21334 +          read access, the FILE OPEN command fails.
21335 +
21336 +   /WRITE
21337 +          Allow writing. If a file of the same name already exists, it is
21338 +          overwritten unless /READ or /APPEND is also included. If a file
21339 +          of the given name does not exist, it is created.
21340 +
21341 +   /APPEND
21342 +          Equivalent to /WRITE, except that if the file exists, it is not
21343 +          destroyed. The read/write pointer is set to the end of the file,
21344 +          so unless you change it with FILE SEEK or REWIND (see below),
21345 +          the first FILE WRITE command adds to the end of the file,
21346 +          preserving what was there already. If /WRITE is also given, it
21347 +          is ignored.
21348 +
21349 +   /BINARY
21350 +          Open the file in "binary" mode, rather than text mode. This
21351 +          switch is meaningless (but still can be used) in UNIX. In VMS,
21352 +          Windows, and OS/2, it inhibits end-of-line processing and
21353 +          conversion, and so should be used for binary files and/or files
21354 +          that are to be accessed in record or character mode rather than
21355 +          line by line.
21356 +
21357 +   The variable for the channel number can be any kind of variable: the
21358 +   \%x kind, a macro name, or an array element. But it must be a variable,
21359 +   not a number -- C-Kermit assigns the channel number; you can't tell it
21360 +   what number to use.
21361 +
21362 +   Example:
21363 +
21364 +  FILE OPEN \%c oofa.txt                  ; Open oofa.txt for reading.
21365 +  IF FAIL exit 1 Can't open oofa.txt      ; Always check to see if it worked.
21366 +  ECHO oofa.txt: channel = \%c
21367 +
21368 +   If the file oofa.txt is opened successfully, a channel number is
21369 +   assigned to the variable \%c. Here's another example using a macro name
21370 +   for the channel number:
21371 +
21372 +  FILE OPEN channel oofa.txt              ; Open oofa.txt for reading.
21373 +  IF SUCCESS ECHO oofa.txt: channel = \m(channel)
21374 +
21375 +   Switches can be combined when it makes sense and the underlying
21376 +   operating system allows it. For example, to open a file in binary mode
21377 +   for reading and writing (sometimes called "update"):
21378 +
21379 +  FILE OPEN /READ /WRITE /BINARY \%c budget.db
21380 +
21381 +   Some combinations might be allowed, others not. For example /READ
21382 +   /APPEND will usually not be allowed. /WRITE /APPEND is treated as
21383 +   /APPEND.
21384 +
21385 +   A major advantage of the new system over the older one is that you can
21386 +   have multiple files open at once. Suppose, for example, that you want
21387 +   to open all the files in a certain directory at once:
21388 +
21389 +  .\%n := \ffiles(/usr/olga*,&f)          ; Get file list into array.
21390 +  if ( > \%n \v(f_max) ) {                ; Make sure there aren't too many.
21391 +      exit 1 {\v(dir): \%n = Too many files}
21392 +  }
21393 +  declare \&c[\%n]                        ; Make array for channel numbers.
21394 +  for \%i 1 \%n 1 {                       ; Loop to open every file...
21395 +      file open \&c[\%i] \&f[\%i]         ; Try to open this one
21396 +      if fail exit 1 Open error: \&f[\%i] ; Check for failure
21397 +  }
21398 +
21399 +   If this loop completes successfully, the \&c[] array will contain \%n
21400 +   channel numbers of open files in elements 1 through \%n.
21401 +
21402 +   Any file that you open with FILE OPEN stays open until Kermit exits, or
21403 +   you close it explicitly. The command to close a file is:
21404 +
21405 +   FILE CLOSE { ALL, channel }
21406 +          If a channel number is given and the channel refers to an open
21407 +          file, the file is closed and the channel is freed for reuse; if
21408 +          the channel does not refer to an open file, an error message is
21409 +          printed and the command fails. If ALL is specified instead of a
21410 +          specific channel, all files opened with FILE OPEN are closed and
21411 +          if all open files were closed successfully (even if no files
21412 +          were open), the command succeeds; if any open file could not be
21413 +          closed, the command fails; however, all open files that could be
21414 +          closed are still closed. Synonym: FCLOSE.
21415 +
21416 +   FILE CLOSE might fail because, for example, the disk filled up or a
21417 +   quota was exceeded. Example:
21418 +
21419 +  fopen /write \%c new.txt                ; Open new.txt for writing.
21420 +  if fail exit 1                          ; Check for error.
21421 +  fclose \%c                              ; Close the file we just opened.
21422 +
21423 +   This creates a 0-length file called new.txt.
21424 +
21425 +   Note that FILE OPEN /WRITE (without /READ or /APPEND) always creates a
21426 +   new file, and therefore destroys any file with the same name that might
21427 +   already exist (assuming you have permission to delete it). To avoid
21428 +   overwriting existing files, simply check first:
21429 +
21430 +  if exist new.txt exit 1 {Fatal - new.txt already exists}
21431 +  fopen /write \%c new.txt
21432 +  if fail ...
21433 +
21434 +   The next two commands give information about open files:
21435 +
21436 +   FILE STATUS channel
21437 +          Tells the name of the file, if any, open on the given channel
21438 +          and the switches it was opened with. The read/write pointer is
21439 +          also shown; this is where the next read or write will occur;
21440 +          "[EOF]" is shown if the current position in the open file is the
21441 +          end -- i.e. the next read will fail if the file was opened in
21442 +          /READ mode; the next write will add material to the end. The
21443 +          current line number (0-based) is also shown if known. The FILE
21444 +          STATUS command succeeds if the channel is open, and fails if
21445 +          there is no open file on the given channel, or if the channel
21446 +          number is invalid or out of range. Synonym: FSTATUS.
21447 +
21448 +   FILE LIST
21449 +          Lists the channel number and name of each open file, along with
21450 +          its OPEN modes (R, W, A, B, RW, etc) and its current read/write
21451 +          pointer or "[EOF]" if it is at the end. Also tells the number of
21452 +          files currently opened with FILE OPEN, plus the maximum number
21453 +          of open files allowed by the system and the maximum number
21454 +          allowed for FILE OPEN. Synonym: FLIST.
21455 +
21456 +   Next come the commands for reading and writing files:
21457 +
21458 +   FILE READ [ switches ] channel [ variable ]
21459 +          Reads data from the file on the given channel number into the
21460 +          variable, if one was given; if no variable was given, the result
21461 +          is printed on the screen. IMPORTANT: The variable should
21462 +          normally be a macro name rather than a \%x or \&x[] variable if
21463 +          you want backslash characters in the file to be taken literally
21464 +          (see pp.408-412 of [386]Using C-Kermit for an explanation; you
21465 +          can also read into a \%x or \&x[] variable, but then you must
21466 +          remember to protect future references to by \fcontents() if you
21467 +          don't want C-Kermit to process any backslashes it might
21468 +          contain). The desired amount of data (according to the switches)
21469 +          is read from the file at the current read/write pointer, and
21470 +          upon completion the read/write position is updated to first byte
21471 +          after the data that was read, no matter what switches were
21472 +          given. Synonym: FREAD.
21473 +
21474 +   FILE WRITE [ switches ] channel text
21475 +          Writes the given text to the file on the given channel number.
21476 +          The text, of course, can be literal text or a variable, or any
21477 +          combination. If the text might contain leading or trailing
21478 +          spaces, it must be enclosed in braces if you want to preserve
21479 +          them. Synonym: FWRITE.
21480 +
21481 +   Before proceeding, a caution about the NUL character. C-Kermit is so
21482 +   named because it is a Kermit program written in the C language. In C,
21483 +   character strings are represented as a sequence of non-NUL bytes
21484 +   terminated by a NUL byte (a byte in which all bits are 0). Thus a C
21485 +   string can not contain NUL bytes; it always ends with the first NUL
21486 +   byte. C-Kermit variables are implemented as C strings and therefore
21487 +   can't contain NUL bytes either, so the FILE READ and FILE WRITE
21488 +   commands do not handle files or strings that contain NUL bytes, except
21489 +   when the /CHARACTER switch is included with the FILE READ or WRITE
21490 +   command, or when /LPAD:0 or /RPAD:0 is given with the FILE WRITE
21491 +   command; these switches are explained below.
21492 +
21493 +   Also note that Kermit can not be used read or write binary numbers in
21494 +   the machine's internal format (integer or floating-point); in general,
21495 +   numbers can be processed only when represented as numeric or
21496 +   floating-point strings.
21497 +
21498 +   FILE READ switches are:
21499 +
21500 +   /LINE
21501 +          Specifies that a line of text is to be read. A line is defined
21502 +          according to the underlying operating system's text-file format.
21503 +          For example, in UNIX a line is a sequence of characters up to
21504 +          and including a linefeed, or the end of the file, which ever
21505 +          comes first. The line terminator (if any) is removed before
21506 +          assigning the text to the variable. If no switches are included
21507 +          with the FILE READ command, /LINE is assumed. Normally this
21508 +          switch should not be used with files opened in /BINARY mode (but
21509 +          nothing prevents it either).
21510 +
21511 +   /SIZE:number
21512 +          Specifies that the given number of bytes (characters) is to be
21513 +          read. The actual number of bytes returned will be less if the
21514 +          end of file is reached (or a NUL byte is encountered). For
21515 +          example, if a file is 514 bytes long, FILE READ /SIZE:512
21516 +          returns 512 bytes the first time and 2 bytes the second time.
21517 +          FILE READ /SIZE provides a kind of "record i/o" for files that
21518 +          do not necessarily contain lines. The resulting block of
21519 +          characters is assigned to the variable without any editing.
21520 +          Synonym: /BLOCK.
21521 +
21522 +   /CHARACTER
21523 +          Equivalent to /SIZE:1. If FILE READ /CHAR succeeds but the
21524 +          variable is empty, this indicates a NUL byte was read. Synonym:
21525 +          BYTE.
21526 +
21527 +   FILE WRITE switches are:
21528 +
21529 +   /LINE
21530 +          Specifies that an appropriate line terminator is to be added to
21531 +          the end of the text. If no switches are included, /LINE is
21532 +          assumed.
21533 +
21534 +   /SIZE:number
21535 +          Specifies that the given number of bytes (characters) is to be
21536 +          written. If the given text is longer than the requested size, it
21537 +          is truncated; if is shorter, it is padded according /LPAD and
21538 +          /RPAD switches. Synonym: /BLOCK.
21539 +
21540 +   /LPAD[:value]
21541 +          If /SIZE was given, but the text is shorter than the requested
21542 +          size, the text is padded on the left with sufficient copies of
21543 +          the character whose ASCII value is given to write the given
21544 +          length. If no value is specified, 32 (the code for Space) is
21545 +          used. The value can also be 0 to write the indicated number of
21546 +          NUL bytes. If /SIZE was not given, this switch is ignored.
21547 +
21548 +   /RPAD[:value]
21549 +          Like LPAD, but pads on the right.
21550 +
21551 +   /CHARACTER
21552 +          Specifies that one character should be written. If the text is
21553 +          empty or not given, a NUL character is written; otherwise the
21554 +          first character of text is given. Synonym: /BYTE.
21555 +
21556 +   /STRING
21557 +          Specifies that the text is to be written as-is, with no
21558 +          terminator added.
21559 +
21560 +   Here's an example in which we copy a text file line by line:
21561 +
21562 +  file open /read \%c oofa.txt            ; Open input file
21563 +  if fail exit 1 Can't open input file    ; Check that it's open
21564 +  file open /write \%d new.txt            ; Open output file
21565 +  if fail exit 1 Can't open output file   ; Check
21566 +  while true {                            ; Loop to copy lines
21567 +      file read /line \%c line            ; Read a line
21568 +      if fail break                       ; Assume failure = end of file
21569 +      file write /line \%d {\m(line)}     ; Write the line to output file
21570 +      if fail exit 1 Write failure        ; Failure here is fatal
21571 +  }
21572 +  file close \%c                          ; Close the two files
21573 +  file close \%d
21574 +
21575 +   Note that since /LINE is the default for both FILE READ and FILE WRITE,
21576 +   it can be omitted as in the following example, where we also use the
21577 +   short names for the FILE commands.
21578 +
21579 +  fopen /read \%c oofa.txt                ; Open input file
21580 +  if fail exit 1 Can't open input file    ; Check that it's open
21581 +  fopen /write \%d new.txt                ; Open output file
21582 +  if fail exit 1 Can't open output file   ; Check
21583 +  while true {                            ; Loop to copy lines
21584 +      fread \%c line                      ; Read a line
21585 +      if fail break                       ; Assume failure = end of file
21586 +      fwrite \%d {\m(line)}               ; Write the line to output file
21587 +      if fail exit 1 Write failure        ; Failure here is fatal
21588 +  }
21589 +  fclose \%c                              ; Close the two files
21590 +  fclose \%d
21591 +
21592 +   Here's the same example using "record i/o" (the open and close
21593 +   sequences are are omitted since they are the same as above). The result
21594 +   is the same, but execution is much faster:
21595 +
21596 +  while true {                            ; Loop to copy blocks
21597 +      fread /size:512 \%c block           ; Read a block into \%a
21598 +      if fail break                       ; Assume failure = end of file
21599 +      fwrite /string \%d {\m(block)}      ; Write the block to output file
21600 +      if fail exit 1 Write failure        ; Failure here is fatal
21601 +  }
21602 +
21603 +   Although record i/o is faster, it should not be used in line-oriented
21604 +   applications, since it returns arbitrary chunks of the file to your
21605 +   script, rather than lines. In this example, FWRITE /STRING is used
21606 +   rather than FWRITE /SIZE:512 to avoid the last output block being
21607 +   padded beyond the original file's length.
21608 +
21609 +   A file can also be copied character by character, but this is much
21610 +   slower than line i/o and VERY much slower than block i/o:
21611 +
21612 +  while true {                            ; Loop to copy blocks
21613 +      fread /char \%c c                   ; Read a character into c
21614 +      if fail break                       ; Assume failure = end of file
21615 +      fwrite /char \%d {\m(c)}            ; Write character to output file
21616 +      if fail exit 1 Write failure        ; Failure is fatal
21617 +  }
21618 +
21619 +   Although character i/o is slow, it is the only way to process files
21620 +   that contain NUL characters (i.e. bytes composed of only zero bits). In
21621 +   the example above, when "fread /char \%c c" returns a NUL, the c
21622 +   variable is empty. But since the FREAD /CHAR command did not fail, we
21623 +   know the result was really a NUL. FWRITE /CHAR, when given an empty
21624 +   variable (or no variable at all) writes a NUL. Thus the loop above will
21625 +   copy any file at all (very slowly). In non-copying applications, NULs
21626 +   are detected like this:
21627 +
21628 +  fread /char \%c c
21629 +  if fail (do something)
21630 +  if not def c (a NUL byte was read)
21631 +
21632 +   Finally some advanced file operations:
21633 +
21634 +   FILE FLUSH channel
21635 +          For output files only: commits all previous writes to disk, in
21636 +          case the computer was buffering them. Synonym: FFLUSH.
21637 +
21638 +   FILE COUNT [ { /BYTES, /LINES, /LIST, /NOLIST } ] channel
21639 +          By default, or if the /BYTES switch is given, counts the bytes
21640 +          in the file, if any, open on the given channel. If the /LINES
21641 +          switch is given, counts lines in the file. If the /LIST switch
21642 +          is given, the result is printed. If the /NOLIST switch is given,
21643 +          the result is not printed. /QUIET is a synonym for /NOLIST. If
21644 +          neither /LIST nor /NOLIST is given, the result is printed if the
21645 +          command is given at top level, i.e. not from a command file or
21646 +          macro. In all cases, the result of the most recent FILE COUNT
21647 +          command is stored in the variable \v(f_count). Note that FILE
21648 +          COUNT /LINE works (and can only work) by reading the entire
21649 +          file; expect it to take some time if the file is large. Synonym:
21650 +          FCOUNT.
21651 +
21652 +   FILE REWIND channel
21653 +          Moves the read/write pointer to the beginning of the file.
21654 +          Equivalent to FILE SEEK channel 0. Synonym: FREWIND.
21655 +
21656 +   FILE SEEK [ switches ] channel { [{+,-}]number, LAST, EOF }
21657 +          Moves the read/write pointer for the file on this channel to the
21658 +          given position, which may be a byte (character) number or a line
21659 +          number, expressed in either absolute or relative terms.
21660 +          Switches:
21661 +
21662 +        /BYTE
21663 +                The number given is a byte number. Synonym: /CHARACTER.
21664 +
21665 +        /LINE
21666 +                The number given is a line number.
21667 +
21668 +        /ABSOLUTE
21669 +                The number given is absolute.
21670 +
21671 +        /RELATIVE
21672 +                The number given is relative to the current position.
21673 +
21674 +          By default, or if the /BYTE switch is given, the number is a
21675 +          byte number (0 = first byte). If /LINE is given, the number is a
21676 +          line number (0 = first line). EOF means to move to the end of
21677 +          the file. LAST means to move to the last line or character of
21678 +          the file, depending on whether it's a line or character seek.
21679 +
21680 +          If neither the /RELATIVE nor the /ABSOLUTE switch is given, then
21681 +          if a signed number is given, the motion is relative to the
21682 +          current position. An expression that evaluates to a negative
21683 +          number is not considered signed for this purpose; that is, a
21684 +          sign (+ or -) must be included as the first character of the
21685 +          number in the command itself to force a relative seek (in the
21686 +          absence of /RELATIVE or /ABSOLUTE).
21687 +
21688 +          If the number has no sign, or if the /ABSOLUTE switch is given,
21689 +          the number represents an absolute position (relative to the
21690 +          beginning of the file). Subsequent FILE READs or WRITEs will
21691 +          take place at the new position.
21692 +
21693 +          If the read/write pointer is placed after the end of the file, a
21694 +          subsequent FILE READ will fail, but a FILE WRITE will succeed
21695 +          (possibly creating a file with "holes"). If a FILE SEEK /BYTE
21696 +          command is given, the current line becomes unknown (unless the
21697 +          position is 0) and subsequent FILE SEEK /RELATIVE /LINE commands
21698 +          will fail until the next non-relative FILE SEEK /LINE command is
21699 +          given. Synonym: FSEEK.
21700 +
21701 +   An absolute FILE SEEK to a negative position fails silently, as does a
21702 +   relative seek to a position before the beginning of the file.
21703 +
21704 +   A caution about relative SEEKs: remember that the number is relative to
21705 +   the current position. Whenever you read or write, this changes the
21706 +   position. In each of the following examples, assume the file open on
21707 +   channel \%c is positioned at line n (the FREAD target variable is
21708 +   omitted for lack of space):
21709 +
21710 +  { FREAD \%c, FSEEK /LINE \%c -1, FREAD \%c }  <-- Reads line n twice
21711 +  { FREAD \%c, FSEEK /LINE \%c +0, FREAD \%c }  <-- Reads lines n and n+1
21712 +  { FREAD \%c, FSEEK /LINE \%c +1, FREAD \%c }  <-- Reads lines n and n+2
21713 +  { FREAD \%c, FSEEK /LINE \%c -2, FREAD \%c }  <-- Reads lines n and n-1
21714 +  { FREAD \%c, FSEEK /LINE \%c -3, FREAD \%c }  <-- Reads lines n and n-2
21715 +
21716 +   Another caution: Using FSEEK and FREAD /SIZE to repeatedly read the
21717 +   same disk block (e.g. when sampling a database record that is
21718 +   frequently updated) might not give you updated disk blocks due to the
21719 +   internal buffering and caching of the C library (this probably varies
21720 +   from one platform/compiler combination to another). If necessary you
21721 +   can force a fresh disk read with a close/open sequence:
21722 +
21723 +  FCLOS \%c
21724 +  FOPEN \%c samefilename
21725 +  FSEEK \%c samespot
21726 +  FREAD /SIZE:howmanybytes \%c variable
21727 +
21728 +1.22.3. FILE Command Examples
21729 +
21730 +   To read the last 10 lines of a text file into an array:
21731 +
21732 +  fopen /read \%c oofa.txt                ; Open the file
21733 +  if fail exit 1 Can't open oofa.txt      ; Always check for failure
21734 +  dcl \&a[10]                             ; Declare a 10-element array
21735 +  fcount /line \%c                        ; Count lines in the file
21736 +  fseek /line \%c \v(f_count)-10          ; Seek to 10 lines from the end
21737 +  if fail exit 1 Can't seek               ; Check for failure
21738 +  for \%i 1 10 1 { fread \%c \&a[\%i] }   ; Read the last 10 lines
21739 +  fclose \%c                              ; Close the file
21740 +
21741 +   Note that blank lines show up as empty (undefined) array elements, for
21742 +   example if you give a "show array a" command at this point. This is
21743 +   normal. You can still use these elements; e.g.:
21744 +
21745 +  for \%i 1 10 1 { echo \%i. \&a[\%i] }   ; Display the 10 lines
21746 +
21747 +   Here is how to read the last line of a file (already open on channel
21748 +   \%c):
21749 +
21750 +  fseek /line \%c last                    ; Seek directly to last line
21751 +
21752 +   Alternatively:
21753 +
21754 +  fseek /line \%c eof                     ; Seek to end of file
21755 +  fseek /line \%c -1                      ; Seek to beginning of last line
21756 +
21757 +   Alternatively:
21758 +
21759 +  fcount /line \%c                        ; Count the file's lines
21760 +  fseek /line \%c \v(f_count)-1           ; Seek to last line
21761 +  fread \%c                               ; Read it
21762 +
21763 +   To read every other line from the file (using relative SEEK), skipping
21764 +   the first line:
21765 +
21766 +  fopen /read \%c oofa.txt                ; Open the file
21767 +  while ( success ) {                     ; Loop through lines
21768 +      fseek /line \%c +1                  ; Skip a line
21769 +      if success fread \%c                ; Read & display a line
21770 +  }
21771 +  fclose \%c                              ; Close the file
21772 +
21773 +   Here is how to read the lines of a file in reverse order:
21774 +
21775 +  fopen /read \%c oofa.txt                ; Open
21776 +  if fail exit 1                          ; Check
21777 +  fseek /line \%c last                    ; Seek to last line
21778 +  while success {                         ; Loop
21779 +      fread \%c                           ; Read line
21780 +      fseek /line \%c -2                  ; Seek backwards two lines
21781 +  }
21782 +  fclose \%c                              ; Close the file
21783 +
21784 +   The loop works because a relative SEEK outside the file fails.
21785 +
21786 +   It is also possible to use block i/o to manage random-access files with
21787 +   fixed-length records (as long as they don't contain NUL characters).
21788 +   Suppose, for example, you have a file of "card image" records with
21789 +   fixed-field information about customers, such as:
21790 +
21791 +  Name:     Columns  1-32  (column numbers are 1-based)
21792 +  Address:  Columns 33-72
21793 +  Balance:  Columns 73-80
21794 +
21795 +   The records are indexed by customer number, starting with 0. There are
21796 +   no line terminators separating them. Therefore the record for customer
21797 +   number n starts at position nx 80 (\%n*80).
21798 +
21799 +   Now suppose we received a payment from customer number 173 and want to
21800 +   update the balance:
21801 +
21802 +  .\%n = 173                               ; Customer (record) number
21803 +  .\%a = 12.72                             ; Amount
21804 +  fopen /read /write \%c customer.db       ; Open the file
21805 +  if fail stop 1 OPEN FAILED: \f_errmsg()  ; Check
21806 +  fseek /byte \%c 80*\%n                   ; Seek to record
21807 +  fread /size:80 \%c r                     ; Read the record
21808 +  if fail stop 1 READ FAILED: \f_errmsg()  ; Check (IMPORTANT)
21809 +  .\%b := \fright(\m(r),8)                 ; Extract the balance
21810 +  .\%b := \ffpadd(\%b,\%a,2)               ; Add the new payment
21811 +  if fail stop 1 ARITHMETIC ERROR: \%b/\%a ; Catch bad records
21812 +  .r := {\fleft(\m(r),72)\flpad(\%b,8)}    ; Update the record
21813 +  fseek /byte \%c 80*\%n                   ; Reposition to same spot
21814 +  fwrite /size:80 \%c {\m(r)}              ; Replace the record
21815 +  if fail stop 1 WRITE FAILED: \f_errmsg() ; Check
21816 +  fclose \%c                               ; Close the file
21817 +
21818 +   REMEMBER: Using FILE SEEK to move beyond the end of file can result in
21819 +   a file with holes when writing; when reading, an end-of-file error will
21820 +   occur -- be sure to check for it.
21821 +
21822 +1.22.4. Channel Numbers
21823 +
21824 +   C-Kermit's channel numbers are integers from 0 to some
21825 +   platform-dependent limit, such as 46 or 1985 (the value of \v(f_max)).
21826 +   This is the limit placed by the operating system on the number of files
21827 +   that may be opened by one process or user or job, minus the standard
21828 +   input, output, and error files, and minus the number of files reserved
21829 +   by C-Kermit for logs, OPEN READ and WRITE, and file transfer (and maybe
21830 +   some command files -- the \v(f_max) number can't be exact).
21831 +
21832 +   Although you must include a variable in the FILE OPEN command, to which
21833 +   the channel number is assigned, you don't have to use a variable in the
21834 +   other FILE commands if you know what the number is -- you can just put
21835 +   the number. This saves you a few keystrokes when typing commands at the
21836 +   prompt:
21837 +
21838 +  fopen \%c oofa.txt
21839 +  flist
21840 +  0. /usr/olga.oofa.txt (R) 0
21841 +
21842 +   This tells the channel number is 0 (the number on the left is the
21843 +   channel file's channel number). Of course you can also find it by
21844 +   echoing the variable:
21845 +
21846 +  echo \%c
21847 +  0
21848 +
21849 +   Or with "fstatus \%c". Now you can type commands like:
21850 +
21851 +  fread 0
21852 +
21853 +   to read a line from the file. Obviously, however, using digits rather
21854 +   than a variable for the channel number would be poor practice in a
21855 +   script.
21856 +
21857 +   If in commands like:
21858 +
21859 +  fread \%c \%a
21860 +
21861 +   you have trouble remembering which variable is which, note that the
21862 +   channel number is, indeed, a number. Anywhere C-Kermit accepts a number
21863 +   it can also accept an expression, so you can put parentheses around the
21864 +   channel number to remind you it's the channel number and not the
21865 +   variable into which data is to be read:
21866 +
21867 +  fread (\%c) \%a
21868 +
21869 +   Normally channel numbers are assigned sequentially as 0, 1, 2, ... up
21870 +   to the limit. However, once you start closing files, there can be holes
21871 +   in the sequence. New channels are assigned to fill in the holes. Thus
21872 +   you can't depend on channel numbers being in any particular sequence.
21873 +
21874 +1.22.5. FILE Command Errors
21875 +
21876 +   Each FILE command sets the variable \v(f_error) to one of the following
21877 +   values:
21878 +
21879 +    0 = No error
21880 +   -1 = System error
21881 +   -2 = Attempt to read after end of file
21882 +   -3 = Channel not open
21883 +   -4 = Channel number out of range (negative or too large)
21884 +   -5 = Numeric argument (size, ...) out of range
21885 +   -6 = File not found
21886 +   -7 = Bad or missing filename
21887 +   -8 = Too many files are already open (FILE OPEN only)
21888 +   -9 = Forbidden operation (e.g. write to a read-only file)
21889 +  -10 = Access denied
21890 +  -11 = Illegal combination of OPEN modes (FILE OPEN only)
21891 +  -12 = Buffer overflow
21892 +  -13 = Current line number unknown (for relative line seeks)
21893 +  -14 through -98: Reserved.
21894 +  -99 = Requested operation not implemented in this version of C-Kermit
21895 + -999 = Unknown error
21896 +
21897 +   When \v(f_error) is -1, this means the FILE command failed because
21898 +   because of a system error, in which case you can examine the following
21899 +   variables:
21900 +
21901 +  \v(errno)     = System error number.
21902 +  \v(errstring) = Error message corresponding to \v(errno).
21903 +
21904 +   A special function is available for translating the \v(f_error) code to
21905 +   an error message string:
21906 +
21907 +\f_errmsg([code])
21908 +  If the code is -1, returns error message of the most recent system
21909 +  error; otherwise if the code is a valid \v(f_error) value, the associated
21910 +  message is returned.  If the code is omitted, the status message
21911 +  corresponding to the current \v(f_error) value is returned.
21912 +
21913 +   A FILE command that fails prints the appropriate error message
21914 +   automatically, except when the command is READ or SEEK and the error is
21915 +   -2 (end of file); in that case, the command still fails, but does not
21916 +   print a message. This allows constructions such as:
21917 +
21918 +  fopen \%c oofa.txt
21919 +  while success { fread \%c }
21920 +  fclose \%c
21921 +
21922 +   to work as expected, i.e. without an annoying message when the end of
21923 +   file is reached.
21924 +
21925 +1.22.6. File I/O Variables
21926 +
21927 +   The variables associated with the file i/o package are:
21928 +
21929 +   \v(f_count)
21930 +          Result of the most recent FILE COUNT (FCOUNT) command.
21931 +
21932 +   \v(f_error)
21933 +          Numeric error code of most recent FILE command (0 = no error).
21934 +
21935 +   \v(f_max)
21936 +          Maximum number of files open simultaneously.
21937 +
21938 +1.22.7. File I/O Functions
21939 +
21940 +   Some of the FILE commands can also be issued as function calls, which
21941 +   makes script writing a bit more convenient, especially for C
21942 +   programmers. Also, several functions are provided that do not have
21943 +   command equivalents. Each of these functions takes a channel number as
21944 +   the first argument. These functions do not work for OPEN { READ, !READ,
21945 +   WRITE, !WRITE, and APPEND } files.
21946 +
21947 +   \f_status(channel)
21948 +          Returns 0 if the channel is not open, otherwise a number between
21949 +          1 and 15 which is the sum of the OPEN modes:
21950 +
21951 +  1 = /READ
21952 +  2 = /WRITE
21953 +  4 = /APPEND
21954 +  8 = /BINARY
21955 +
21956 +   The remaining functions work only for open channels. Each of these
21957 +   functions can fail for the applicable reasons listed in [387]Section
21958 +   1.22.5. For instructions on handling function errors, see [388]Section
21959 +   7.12.
21960 +
21961 +   \f_pos(channel)
21962 +          Returns the file's current read/write pointer (0-based). There
21963 +          is no FILE command equivalent.
21964 +
21965 +   \f_line(channel)
21966 +          Returns the file's current line number (0-based), if known,
21967 +          otherwise -1. There is no FILE command equivalent. The line
21968 +          number is known as long as no character or block i/o has been
21969 +          done on the channel.
21970 +
21971 +   \f_handle(channel)
21972 +          Returns the "file handle" of the file. That is, it translates
21973 +          the portable C-Kermit channel number into a system-specific file
21974 +          handle or number that can be passed to other programs on the
21975 +          same platform. In UNIX this is a file descriptor. There is no
21976 +          FILE command equivalent.
21977 +
21978 +   \f_eof(channel)
21979 +          Returns 1 if the read/write pointer of the file on the given
21980 +          channel is at the end of the file, 0 otherwise. Convenient in
21981 +          WHILE statements, e.g.:
21982 +
21983 +    while not \f_eof(\%c) { fread \%c }
21984 +
21985 +   \f_getchar(channel)
21986 +          Equivalent to FREAD /CHAR. Returns the character actually read.
21987 +          If \f_getchar() does not fail but the return value is empty,
21988 +          this means a NULL character was read.
21989 +
21990 +   \f_getline(channel)
21991 +          Equivalent to FREAD /LINE. Returns the line actually read, but
21992 +          with the line terminator stripped. If \f_getline() does not fail
21993 +          but the return value is empty, this normally means an empty line
21994 +          was read.
21995 +
21996 +   \f_getblock(channel,n)
21997 +          Equivalent to FREAD /SIZE:n. Returns the block of characters
21998 +          actually read. If the returned block is smaller than n, it
21999 +          indicates either that the end of file was reached or a NUL
22000 +          character is in the block.
22001 +
22002 +   \f_putchar(channel,c)
22003 +          Equivalent to FWRITE /CHARACTER. Writes the character c. If c
22004 +          contains more than one character, only the first is written. If
22005 +          c is empty a NUL is written. Returns the number of characters
22006 +          written on success, or a negative error code upon failure.
22007 +
22008 +   \f_putline(channel,string)
22009 +          Equivalent to FWRITE /LINE. Writes the string and adds the
22010 +          appropriate line termination character or sequence. If the
22011 +          string is empty or omitted, an empty line is written. Returns
22012 +          the number of characters written on success, or a negative error
22013 +          code upon failure.
22014 +
22015 +   \f_putblock(channel,string)
22016 +          Equivalent to FWRITE /STRING. Writes the string as given. If the
22017 +          string is empty or omitted, nothing is written. Returns the
22018 +          number of characters written on success, or a negative error
22019 +          code upon failure.
22020 +
22021 +1.22.8. File I/O Function Examples
22022 +
22023 +  fopen /read \%c oofa.txt            ; Open our favorite file for reading
22024 +  if failure exit 1                   ; Check that it's open
22025 +  while not \f_eof(\%c) {             ; Loop until EOF
22026 +      .line := \f_getline(\%c)        ; Get a line
22027 +      if success echo {\m(line)}      ; Echo it
22028 +  }
22029 +  if not \f_eof(\%c) {                ; Check reason for loop exit
22030 +      exit 1 File Error: \f_errmsg()  ; If not EOF say so.
22031 +  }
22032 +
22033 +  frewind \%c                         ; Rewind the file
22034 +  while not \f_eof(\%c) {             ; Same thing but with block i/o
22035 +      .block := \f_getblock(\%c,256)  ; (much faster than line i/o)
22036 +      if success xecho {\m(block)}
22037 +  }
22038 +
22039 +  frewind \%c                         ; Rewind again
22040 +  while not \f_eof(\%c) {             ; Same deal but with character i/o
22041 +      .c := \f_getchar(\%c)           ; (much slower than line i/o)
22042 +      if success xecho {\m(c)}
22043 +  }
22044 +  close \%c
22045 +
22046 +   To close all open files (equivalent to FCLOSE ALL):
22047 +
22048 +  for \%i 0 \v(f_max)-1 1 {
22049 +      if \f_status(\%i) fclose \%i
22050 +  }
22051 +
22052 +1.23. The EXEC Command
22053 +
22054 +   The EXEC command is available only in UNIX.
22055 +
22056 +   EXEC [ /REDIRECT ] command [ arg1 [ arg2 [ ... ] ]
22057 +          Runs the given command with the arguments in such a way that the
22058 +          command replaces C-Kermit in memory, and C-Kermit ceases to
22059 +          execute. EXEC is like RUN, except instead of returning to
22060 +          C-Kermit when finished, the command returns to whatever process
22061 +          invoked Kermit.
22062 +
22063 +   In the normal case, no files are closed, so the EXEC'd command inherits
22064 +   the open files, read/write pointers, working directory, process ID,
22065 +   user ID (unless command is SUID), group ID (unless command is SGID),
22066 +   groups, etc. (In UNIX, the EXEC command is simply a front end for
22067 +   execvp().)
22068 +
22069 +   If the /REDIRECT switch is included, then if a connection is open (SET
22070 +   LINE or SET HOST), it becomes the standard input and output of the
22071 +   EXEC'd program. If no connection is open, the /REDIRECT switch has no
22072 +   effect. For example to use C-Kermit for PPP dialing in Linux:
22073 +
22074 +  set modem type usr          ; Specify the kind of modem you have
22075 +  set line /dev/ttyS1         ; Specify the device it's connected to
22076 +  set speed 57600             ; and the speed
22077 +  set flow rts/cts            ; and flow control.
22078 +  set dial retries 100        ; Try the dial sequence up to 100 times.
22079 +  dial {{9-212-555-1212}{9-212-555-1213}{9-212-555-1214}{9-212-555-1215}}
22080 +  if fail exit 1
22081 +  for \%i 1 16 1 {            ; Try up to 16 times to get login prompt
22082 +      input 10 Login:         ; Wait 10 sec for it to appear
22083 +      if success break        ; Got it - proceed...
22084 +      output \13              ; Send a carriage return and try again
22085 +  }
22086 +  if ( > \%i 16 ) stop 1 NO LOGIN PROMPT
22087 +  lineout \(myuserid)         ; Send user ID
22088 +  input 30 assword:           ; Wait for Password prompt
22089 +  if fail stop 1 NO PASSWORD PROMPT
22090 +  lineout \m(mypassword)      ; Send the password.
22091 +  exec /redirect pppd         ; Replace ourselves with pppd.
22092 +
22093 +   In this example we assume that the script has already set up the
22094 +   myuserid and mypassword variables -- normally the password should be
22095 +   prompted for, rather than stored on disk. Notice the advantages over
22096 +   the well-known "chat script":
22097 +     * You don't have to control the modem itself with AT commands;
22098 +       Kermit's DIAL command does this for you.
22099 +     * You can have Kermit automatically redial as many times as you want
22100 +       until it gets a connection (if this is legal in your country).
22101 +     * You can have Kermit fetch the number or numbers from a dialing
22102 +       directory.
22103 +     * You can have Kermit cycle through a list of phone numbers (this is
22104 +       new in C-Kermit 7.0; see [389]Section 2.1.16) without having to
22105 +       enter the numbers in a dialing directory.
22106 +     * Dialing is location-independent; you can use the same script to
22107 +       dial from different areas or countries.
22108 +     * Once the connection is made, the full power of Kermit's script
22109 +       language is available to manage the dialog with the terminal server
22110 +       or other device that answers the phone call.
22111 +
22112 +   NOTE: PPP and SLIP dialing are not available in Windows 95/98/NT/2000,
22113 +   whose APIs do not provide a method for an application to hand over a
22114 +   connection to the PPP or SLIP driver.
22115 +
22116 +1.24. Getting Keyword Lists with '?'
22117 +
22118 +   Suppose you type "te" at the C-Kermit> 6.0 prompt and then Esc or Tab
22119 +   to request keyword completion. Kermit beeps, indicating that more than
22120 +   one command starts with "te". But if you type '?' to see what they are,
22121 +   Kermit shows only "telnet". So why the beep? Because of invisible
22122 +   keywords like "telopt", "terminal", and "text". Lots of keywords are
22123 +   invisible because they are either synonyms for other keywords or else
22124 +   esoteric options to be used only in special circumstances, so we don't
22125 +   want them cluttering up the menus.
22126 +
22127 +   But then there is no way for you to discover them. So in C-Kermit 7.0,
22128 +   if you type '?' AFTER the beginning of a keyword field, then invisible
22129 +   keywords are shown too:
22130 +
22131 +  C-Kermit> te<Esc><BEEP>
22132 +  C-Kermit> te? Command, one of the following:
22133 +   telnet    telopt    terminal  text
22134 +  C-Kermit>te
22135 +
22136 +   But if '?' is typed at the beginning of a field, only visible keywords
22137 +   are shown, as before (so, in this example, if '?' is typed at the
22138 +   C-Kermit> prompt, "telnet" is the only command shown that starts with
22139 +   "te").
22140 +
22141 +2. MAKING AND USING CONNECTIONS The SET LINE, SET HOST, and SET PORT (a
22142 +synonym for SET LINE) commands have new synonyms, in which the word SET is
22143 +replaced by the word OPEN: OPEN LINE, etc. There is no new functionality
22144 +here, but OPEN is a better verb, since SET generally takes no action, whereas
22145 +these commands actually try to open a connection. Furthermore, there is the
22146 +symmetry with CLOSE. 2.0. SET LINE and SET HOST Command SwitchesThe SET LINE
22147 +(SET PORT) and SET HOST commands now allow switches before the device or host
22148 +name, in most cases, and under certain circumstances, also at the end. The
22149 +new syntax is backwards compatible with the previous syntax; thus SET LINE,
22150 +SET PORT, and SET HOST commands in command files written for C-Kermit 6.0 or
22151 +earlier still work. The expanded syntax is:
22152 +
22153 +{ OPEN, SET } { LINE, PORT, HOST } [ switches ] device-or-address [ switches
22154 +]
22155 +
22156 +The first group of switches is:
22157 +
22158 +   /NETWORK-TYPE:{TCP/IP,X.25,PIPE,PTY...}
22159 +          When more than one network type is available, this lets you
22160 +          specify the type of network to use for this connection without
22161 +          affecting your global SET NETWORK TYPE. See [390]Section 2.7
22162 +          about pipes and ptys.
22163 +
22164 +   /USERID:[string]
22165 +          This switch is equivalent to SET LOGIN USERID. If a string is
22166 +          given, it sent to host during Telnet negotiations; if this
22167 +          switch is given but the string is omitted, no user ID is sent to
22168 +          the host. If this switch is not given, your current LOGIN USERID
22169 +          (\v(userid) value), if any, is sent. Unlike most other switches,
22170 +          this one is "sticky", since the value must persist throughout
22171 +          the session in case the server requests the ID string at a later
22172 +          time.
22173 +
22174 +   /CONNECT
22175 +          Enter CONNECT mode immediately and automatically after the
22176 +          device or connection is open. On serial devices, however, when
22177 +          CARRIER-WATCH is not OFF, wait up to 1 second for the Carrier
22178 +          Detect signal to appear before trying to connect, to give the
22179 +          device time to react DTR, which might have been off prior to
22180 +          opening the device.
22181 +
22182 +   /SERVER
22183 +          Enter server mode immediately and automatically after the device
22184 +          or connection is open. Treatment of carrier is the same as for
22185 +          /CONNECT.
22186 +
22187 +   /WAIT
22188 +   /NOWAIT
22189 +          For Telnet connections only: Like SET TELNET WAIT { ON, OFF },
22190 +          but applies only to this connection, and in fact applies only
22191 +          when OPENing this connection (which is usually the only place it
22192 +          matters). Typically you would use TELNET /NOWAIT to make a
22193 +          connection to a misbehaving Telnet server that does not reply to
22194 +          negotiations as required by the Telnet protocol definition.
22195 +
22196 +   Note: /CONNECT and /SERVER switches are not available in the RLOGIN and
22197 +   TELNET commands, since these commands already include an implicit
22198 +   /CONNECT and preclude automatic entry into server mode.
22199 +
22200 +   The /CONNECT and /SERVER switches are especially useful with "set host
22201 +   *" connections. For example, suppose you want to start a Kermit server
22202 +   on socket 3000 of your TCP host. Normally you would have to give the
22203 +   command:
22204 +
22205 +  set host * 3000
22206 +
22207 +   and then wait for a connection to come in, and only then could you give
22208 +   the SERVER command (or else define a macro to do this, and then execute
22209 +   the macro). Now you can do it in one step:
22210 +
22211 +  set host /server * 3000
22212 +
22213 +   This tells C-Kermit to wait for the connection and then enter server
22214 +   mode once it comes in, no matter how long it takes. Similarly, "set
22215 +   host /conn *" can be used to wait for a "chat" connection to come in.
22216 +
22217 +   Another set of switches is available in VMS only, for use only with SET
22218 +   LINE:
22219 +
22220 +   /SHARE
22221 +          Allows the SET LINE device to be opened in shared mode. Normally
22222 +          it makes no sense to open a serial device in shared mode, but
22223 +          it's necessary when C-Kermit is running in an environment such
22224 +          as DECIntact, that opens your job's controlling terminal in such
22225 +          a way that C-Kermit can't open it too, unless it enables SHARE
22226 +          privilege. Note: SHARE privilege is required.
22227 +
22228 +   /NOSHARE
22229 +          Requires that the SET LINE device not be in use by any other
22230 +          process in order for it to be successfully opened by C-Kermit.
22231 +          If neither /SHARE nor /NOSHARE is specified, /NOSHARE is used.
22232 +
22233 +   The second group of switches is:
22234 +
22235 +   /NO-TELNET-INIT
22236 +          Do not send initial Telnet negotiations even if this is a Telnet
22237 +          port.
22238 +
22239 +   /RAW-SOCKET
22240 +          This is a connection to a raw TCP socket ([391]Section 2.3.5).
22241 +
22242 +   /RLOGIN
22243 +          Use Rlogin protocol even if this is not an Rlogin port.
22244 +
22245 +   /TELNET
22246 +          Send initial Telnet negotiations even if this is not a Telnet
22247 +          port.
22248 +
22249 +   As of C-Kermit 7.0 and K95 1.1.19, the TELNET command includes an
22250 +   implicit /TELNET switch. So if you TELNET to a non-TELNET port, Kermit
22251 +   sends initial Telnet negotiations. This makes sense, since that's what
22252 +   "telnet" means.
22253 +
22254 +   If you want to make a connection to a non-Telnet port without sending
22255 +   initial Telnet negotiations, use:
22256 +
22257 +  set host [ /connect ] name-or-address port
22258 +
22259 +   or:
22260 +
22261 +  telnet name-or-address port /no-telnet-init
22262 +
22263 +   Additional switches might be added in the future; type "set host ?" or
22264 +   "set line ?" to see a current list.
22265 +
22266 +2.1. Dialing
22267 +
22268 +   Automatic redialing is illegal or restricted in many countries, so
22269 +   until C-Kermit 7.0, it was disabled by default, i.e. until a SET DIAL
22270 +   RETRIES command was given. In C-Kermit 7.0, if no SET DIAL RETRIES
22271 +   command has been given, a default is picked dynamically at DIAL time
22272 +   based on the calling country code, if known. At this writing, the only
22273 +   country code known to have no restrictions on automatic redialing is 1.
22274 +   So in this case a limit of 10 is chosen; otherwise 1. If you have not
22275 +   given an explicit SET DIAL RETRIES command, SHOW DIAL shows the value
22276 +   as "(auto)", and then the value actually used is shown when you give
22277 +   the DIAL command.
22278 +
22279 +   As of C-Kermit 7.0, automatic redialing is automatically canceled if
22280 +   the call could not be placed because no dialtone was detected.
22281 +
22282 +2.1.1. The Dial Result Message
22283 +
22284 +   If DIAL DISPLAY is not ON, the "Call complete" message now shows the
22285 +   modem's call result message, for example:
22286 +
22287 +  Dialing: ...
22288 +  Call complete: "CONNECT 31200/ARQ/V32/LAPM/V42BIS"
22289 +
22290 +   The exact format and contents of this message, of course, depends on
22291 +   the make, model, and configuration of your modem, so use your modem
22292 +   manual to interpret it. The call result message is also available in
22293 +   C-Kermit's \v(dialresult) variable.
22294 +
22295 +  C-Kermit> echo \v(dialresult)
22296 +  CONNECT 31200/ARQ/V32/LAPM/V42BIS
22297 +  C-Kermit> echo Speed = \fword(\v(dialresult),2)
22298 +  Speed = 31200
22299 +  C-Kermit>
22300 +
22301 +   Suppose your modem reports the modulation speed as shown above and you
22302 +   want to ensure your call is completed at (say) 24000 bps or more. You
22303 +   can use a little macro to do the job:
22304 +
22305 +define HSDIAL {                ; High Speed DIAL
22306 +    local \%s
22307 +    if < \v(argc) 1 if not def \v(dialnumber) end 1 Usage: \%0 number
22308 +    set dial retries 100
22309 +    set dial interval 1
22310 +    while true {
22311 +        dial \%*
22312 +        if fail end 1 DIAL failed.
22313 +        asg \%s \fword(\v(dialresult),2)
22314 +        if def \%s if numeric \%s if not < \%s 24000 break
22315 +    }
22316 +}
22317 +
22318 +   (See [392]Section 7.5 about the \%* variable.)
22319 +
22320 +2.1.2. Long-Distance Dialing Changes
22321 +
22322 +   Due to the glut of cell phones, pagers, fax machines, ISPs, etc, area
22323 +   codes and dialing rules are changing all the time. In the North
22324 +   American Numbering Plan (NANP) countries (USA, Canada, etc), area codes
22325 +   are split or overlayed with increasing frequency, and 10- and 11-digit
22326 +   dialing is gradually becoming the norm for local calls. Changes are
22327 +   occurring In Europe, too, partly for these reasons and partly because
22328 +   of some new EC rules.
22329 +
22330 +   In France, effective 18 October 1996, all calls, even local ones, must
22331 +   be dialed with an area code. French area codes are presently 1-digit
22332 +   numbers, 1-6, and the long-distance dialing prefix is 0. All calls
22333 +   within France are considered long distance and begin with 01, 02, ...,
22334 +   06.
22335 +
22336 +   Effective 1 May 1997, all calls within the US state of Maryland, even
22337 +   local ones, must be dialed with an area code but without the
22338 +   long-distance prefix -- this is the now widely-known North American
22339 +   phenomenon of "ten digit dialing". The same is happening elsewhere --
22340 +   many cities in Florida adopted 10-digit dialing in 1998.
22341 +
22342 +   In Italy beginning 19 June 1998, all calls to fixed (as opposed to
22343 +   mobile) numbers must be prefixed by 0. When calling into Italy from
22344 +   outside, the 0 must follow the country code (39). Calls to cell phones,
22345 +   however, must be placed without the 0. Then on 29 December 2000, the 0
22346 +   will become a 4 (for calling fixed numbers) and a prefix of 3 must used
22347 +   for calling mobile phones. More info at:
22348 +   http://www.telecomitalia.it/npnn/.
22349 +
22350 +   In Spain, effective 4 April 1998, with hard cutover on 18 July 1998,
22351 +   all calls within the country must be dialed with 9 digits, and all
22352 +   calls from outside Spain must also be dialed with 9 digits (after the
22353 +   country code, 34). The new 9-digit numbers all begin with "9". More
22354 +   info at: [393]http://www.telefonica.es/cambiodenumeracion/
22355 +
22356 +   Several new dialing features and commands have been added in version
22357 +   6.1 and 7.0 to address these changes.
22358 +
22359 +   C-Kermit 6.0 and Kermit 95 1.1.11 and earlier handle the French
22360 +   situation via a reasonable subterfuge (setting the local area code to a
22361 +   nonexistent one), but did not handle "ten-digit dialing" well at all;
22362 +   the recommended technique was to change the long-distance dialing
22363 +   prefix to nothing, but this defeated Kermit's "list numbers for one
22364 +   name" feature when the numbers were in different locations. For
22365 +   example:
22366 +
22367 +  set dial ld-prefix
22368 +  dial onlineservice
22369 +
22370 +   where "onlineservice" is a dialing directory entry name corresponding
22371 +   to entries that are in (say) Maryland as well as other states, would
22372 +   not correctly dial the numbers not in Maryland.
22373 +
22374 +   A new command lets you specify a list of area codes to be considered
22375 +   local, except that the area code must be dialed:
22376 +
22377 +   SET DIAL LC-AREA-CODES [ areacode [ areacode [ areacode [ ... ] ] ] ]
22378 +          The list may include up to 32 area codes. If a number is called
22379 +          whose area code is in this list, it is dialed WITHOUT the
22380 +          long-distance prefix, but WITH the area code.
22381 +
22382 +   So in Maryland, which (last time we looked) has two area codes, 410 and
22383 +   301, the setup would be:
22384 +
22385 +  SET DIAL LC-AREA-CODES 410 301
22386 +
22387 +   Example:
22388 +
22389 +  SET DIAL LD-PREFIX 1
22390 +  SET DIAL AREA-CODE 301
22391 +  SET DIAL LC-AREA-CODES 410 301 <-- Area codes in 10-digit dialing region
22392 +  DIAL +1 (301) 765-4321         <-- Dials 3017654321  (local with area code)
22393 +  DIAL +1 (410) 765-4321         <-- Dials 4107654321  (local with area code)
22394 +  DIAL +1 (212) 765-4321         <-- Dials 12127654321 (long distance)
22395 +
22396 +   The SET DIAL LC-AREA-CODES command does not replace the SET DIAL
22397 +   AREA-CODE command. The latter specifies the area code you are dialing
22398 +   from. If the called number is in the same area code, then the area code
22399 +   is dialed if it is also in the LC-AREA-CODES list, and it is not dialed
22400 +   otherwise. So if "301" had not appeared in the LC-AREA-CODES list in
22401 +   the previous example:
22402 +
22403 +  SET DIAL LD-PREFIX 1
22404 +  SET DIAL AREA-CODE 301
22405 +  SET DIAL LC-AREA-CODES 410     <-- Area codes in 10-digit dialing region
22406 +  DIAL +1 (301) 765-4321         <-- Dials 7654321     (local)
22407 +  DIAL +1 (410) 765-4321         <-- Dials 4107654321  (local with area code)
22408 +  DIAL +1 (212) 765-4321         <-- Dials 12127654321 (long distance)
22409 +
22410 +   The new Kermit versions also add a Local Call Prefix and Local Call
22411 +   Suffix, in case you have any need for it. These are added to the
22412 +   beginning and of local phone numbers (i.e. numbers that are not
22413 +   long-distance or international). Examples:
22414 +
22415 +  SET DIAL LD-PREFIX 1
22416 +  SET DIAL LC-PREFIX 9
22417 +  SET DIAL LC-SUFFIX *
22418 +  SET DIAL LC-AREA-CODES 410     <-- Area codes in 10-digit dialing region
22419 +  SET DIAL AREA-CODE 301
22420 +  DIAL +1 (301) 765-4321         <-- Dials 97654321*     (local)
22421 +  DIAL +1 (410) 765-4321         <-- Dials 94107654321*  (local with area code)
22422 +  DIAL +1 (212) 765-4321         <-- Dials 12127654321   (long distance)
22423 +
22424 +2.1.3. Forcing Long-Distance Dialing
22425 +
22426 +   Suppose a number is in your country and area, but for some reason you
22427 +   need to dial it long-distance anyway (as is always the case in France).
22428 +   There have always been various ways to handle this:
22429 +
22430 +    1. Temporarily set your area code to a different (or nonexistent or
22431 +       impossible) one (but this required knowledge of which area codes
22432 +       were nonexistent or impossible in each country).
22433 +    2. Dial the number literally instead of using the portable format, but
22434 +       this defeats the purpose of the portable dialing directory.
22435 +
22436 +   Now there is also a new command that, very simply, can force
22437 +   long-distance dialing:
22438 +
22439 +   SET DIAL FORCE-LONG-DISTANCE { ON, OFF }
22440 +          If a call is placed to a portable phone number within the same
22441 +          country code as the calling number, it is dialed with the
22442 +          long-distance prefix and the area code if FORCE-LONG-DISTANCE is
22443 +          ON. If OFF, the regular rules and procedures apply.
22444 +
22445 +   Example (France):
22446 +
22447 +  SET DIAL COUNTRY-CODE 33
22448 +  SET DIAL AREA-CODE 6
22449 +  SET DIAL FORCE-LONG-DISTANCE ON
22450 +
22451 +   (In fact, SET DIAL COUNTRY-CODE 33 automatically sets DIAL
22452 +   FORCE-LONG-DISTANCE ON...)
22453 +
22454 +   Example (USA, for a certain type of reverse-charge calling in which the
22455 +   called number must always be fully specified):
22456 +
22457 +  SET DIAL PREFIX 18002666328$     ; 1-800-COLLECT
22458 +  SET DIAL COUNTRY-CODE 1
22459 +  SET DIAL AREA-CODE 212
22460 +  SET DIAL FORCE-LONG-DISTANCE ON
22461 +
22462 +   Example (Toronto, where calls to exchange 976 within area code 416 must
22463 +   be dialed as long distance, even when you are dialing from area code
22464 +   416):
22465 +
22466 +  SET DIAL COUNTRY-CODE 1
22467 +  SET DIAL AREA-CODE 416
22468 +  SET DIAL FORCE-LONG-DISTANCE ON
22469 +  DIAL +1 (416) 976-xxxx
22470 +
22471 +   If dialing methods were consistent and sensible, of course it would be
22472 +   possible to always dial every domestic call as if it were long
22473 +   distance. But in many locations this doesn't work or if it does, it
22474 +   costs extra. The following macro can be used for dialing any given
22475 +   number with forced long-distance format:
22476 +
22477 +  define LDIAL {
22478 +      local \%x
22479 +      set dial force-long-distance on
22480 +      dial \%*
22481 +      asg \%x \v(success)
22482 +      set dial force-long-distance off
22483 +      end \%x
22484 +  }
22485 +
22486 +   (See [394]Section 7.5 about the \%* variable.)
22487 +
22488 +2.1.4. Exchange-Specific Dialing Decisions
22489 +
22490 +   This applies mainly to the North American Numbering Plan (NANP). Refer
22491 +   to the section "Alternative notations" in [395]Using C-Kermit 2nd
22492 +   Edition, pages 106-107, and the story about Toronto on page 110. Using
22493 +   the new LC-AREA-CODES list, we can address the problem by treating the
22494 +   exchange as part of the area code:
22495 +
22496 +  SET DIAL LD-PREFIX 1
22497 +  SET DIAL AREA-CODE 416
22498 +  SET DIAL LC-AREA-CODES 905276
22499 +  DIAL +1 416 765 4321               <-- 7654321      (local)
22500 +  DIAL +1 905 276 4321               <-- 9052764321   (local with area code)
22501 +  DIAL +1 905 528 4321               <-- 19055284321  (long distance)
22502 +
22503 +   The same technique can be used in Massachusetts (story at top of page
22504 +   111) and in any other place where dialing to some exchanges within a
22505 +   particular area code is local, but to others in the same area code is
22506 +   long distance.
22507 +
22508 +2.1.5. Cautions about Cheapest-First Dialing
22509 +
22510 +   Kermit does not maintain a knowledge base of telephony information; it
22511 +   only provides the tools to let you enter a phone number in a standard
22512 +   format and dial it correctly from any location in most cases.
22513 +
22514 +   In particular, Kermit does not differentiate the charging method from
22515 +   the dialing method. If a call that is DIALED as long-distance (e.g.
22516 +   from 212 to 718 in country code 1) is not CHARGED as long distance, we
22517 +   have no way of knowing that without keeping a matrix of charging
22518 +   information for every area-code combination within every country, and
22519 +   any such matrix would be obsolete five minutes after it was
22520 +   constructed. Thus, "cheapest-first" sorting is only as reliable as our
22521 +   assumption that the charging method follows the dialing method. A good
22522 +   illustration would be certain online services that have toll-free
22523 +   dialup numbers which they charge you a premium (in your online service
22524 +   bill) for using.
22525 +
22526 +2.1.6. Blind Dialing (Dialing with No Dialtone)
22527 +
22528 +   C-Kermit's init string for Hayes-like modems generally includes an X4
22529 +   command to enable as many result codes as possible, so that Kermit can
22530 +   react appropriately to different failure reasons. One of the result
22531 +   codes that X4 enables is "NO DIALTONE". A perhaps not obvious side
22532 +   effect of enabling this result code that the modem must hear dialtone
22533 +   before it will dial.
22534 +
22535 +   It is becoming increasingly necessary to force a modem to dial even
22536 +   though it does not hear a dialtone on the phone line; for example, with
22537 +   PBXs that have strange dialtones, or with phone systems in different
22538 +   countries, or with ISDN phones, etc. This is called "blind dialing".
22539 +
22540 +   C-Kermit 7.0 has two new commands to cope with this situation:
22541 +
22542 +   SET DIAL IGNORE-DIALTONE { ON, OFF }
22543 +          OFF (the default) means to tell the modem to wait for dialtone
22544 +          before dialing. ON means to enable "blind dialing", i.e. tell
22545 +          the modem NOT to wait for dialtone before dialing. Generally
22546 +          this is accomplished by sending ATX3 to the modem just prior to
22547 +          dialing. SET MODEM TYPE xxx and then SHOW MODEM displays
22548 +          Kermit's built-in "ignore dialtone" command.
22549 +
22550 +   SET DIAL COMMAND IGNORE-DIALTONE text
22551 +          This lets you change the built-in ignore-dialtone command (such
22552 +          as ATX3) to whatever you choose, in case the built-in one does
22553 +          not work, or another command works better.
22554 +
22555 +   Notes:
22556 +    1. The ignore-dialtone command is not sent unless SET DIAL
22557 +       IGNORE-DIALTONE is ON.
22558 +    2. The ATX3 command generally disables not only NO DIALTONE, but also
22559 +       BUSY. So this will prevent Kermit from detecting when the line is
22560 +       busy. This is a property of the modem, not of Kermit.
22561 +
22562 +2.1.7. Trimming the Dialing Dialog
22563 +
22564 +   The command:
22565 +
22566 +  SET MODEM COMMAND action [ command ]
22567 +
22568 +   is used to override Kermit's built-in modem commands for each action,
22569 +   for each kind of modem in its internal database. If you include a
22570 +   command, this is used instead of the built-in one. If you omit the
22571 +   command, this restores the original built-in command.
22572 +
22573 +   If you want to omit the command altogether, so Kermit doesn't send the
22574 +   command at all, or wait for a response, use:
22575 +
22576 +  SET MODEM COMMAND action {}
22577 +
22578 +   That is, specify a pair of empty braces as the command, for example:
22579 +
22580 +  SET MODEM COMMAND ERROR-CORRECTION ON {}
22581 +
22582 +2.1.8. Controlling the Dialing Speed
22583 +
22584 +   The rate at which characters are sent to the modem during dialing is
22585 +   normally controlled by the built-in modem database. You might want to
22586 +   override this if Kermit seems to be dialing too slowly, or it is
22587 +   sending characters to the modem faster than the modem handle them. A
22588 +   new command was added for this in C-Kermit 7.0:
22589 +
22590 +   SET DIAL PACING number
22591 +          Specifies the number of milliseconds (thousandths of seconds) to
22592 +          pause between each character when sending commands to the modem
22593 +          during DIAL or ANSWER command execution. 0 means no pause at
22594 +          all, -1 (the default) or any other negative number means to use
22595 +          the value from the database. Any number greater than 0 is the
22596 +          number of milliseconds to pause.
22597 +
22598 +   HINT: You might also need to control the rate at which the modem
22599 +   generates Touch Tones during dialing, for example when sending a
22600 +   numeric page. There are two ways to do this. One way is to insert pause
22601 +   characters into the dialing string. For modems that use the AT command
22602 +   set, the pause character is comma (,) and causes a 2-second pause. On
22603 +   most modems, you can use the S8 register to change the pause interval
22604 +   caused by comma in the dialing string. The other way is to set your
22605 +   modem's tone generation interval, if it has a command for that. Most
22606 +   AT-command-set modems use S11 for this; the value is in milliseconds.
22607 +   For example on USR modems:
22608 +
22609 +  ATS11=200
22610 +
22611 +   selects an interval of 200 milliseconds to separate each dialing tone.
22612 +
22613 +   Hint: To add S-Register settings or other commands to your dialing
22614 +   procedure, use the new SET MODEM COMMAND PREDIAL-INIT command
22615 +   ([396]Section 2.2.2).
22616 +
22617 +2.1.9. Pretesting Phone Number Conversions
22618 +
22619 +   The LOOKUP command now accepts telephone numbers as well as
22620 +   directory-entry names, for example:
22621 +
22622 +  LOOKUP +1 (212) 7654321
22623 +
22624 +   When given a phone number, LOOKUP prints the result of converting the
22625 +   phone number for dialing under the current dialing rules. For example,
22626 +   if my country code is 1 and my area code is 212, and I am dialing out
22627 +   from a PBX whose outside-line prefix is "93,":
22628 +
22629 +  C-Kermit> lookup +1 (212) 7654321
22630 +  +1 (212) 7654321 => 93,7654321
22631 +  C-Kermit>
22632 +
22633 +   You can also use the \fdialconvert(phone-number) function ([397]Section
22634 +   2.1.11) to do this programmatically:
22635 +
22636 +  C-Kermit> echo "\fdialconvert(+1 (212) 7654321)"
22637 +  "93,7654321"
22638 +  C-Kermit>
22639 +
22640 +   So the new LOOKUP behaves as follows:
22641 +
22642 +   LOOKUP portable-format-phone-number
22643 +          Displays how the number would actually be dialed Sets FAILURE if
22644 +          there was a conversion error, otherwise SUCCESS.
22645 +
22646 +   LOOKUP literal-format-phone-number
22647 +          Displays the same literal-format-phone-number Always sets
22648 +          SUCCESS.
22649 +
22650 +   LOOKUP dialing-directory-name
22651 +          Displays all matching entries and converts portable phone
22652 +          numbers. Sets SUCCESS if at least one entry was found, otherwise
22653 +          FAILURE.
22654 +
22655 +   LOOKUP =anything
22656 +          Displays "=anything" and sets SUCCESS.
22657 +
22658 +   There is, at present, no programmatic way to fetch numbers from the
22659 +   dialing directory. This will be considered for a future release.
22660 +
22661 +2.1.10. Greater Control over Partial Dialing
22662 +
22663 +   The following rules now apply to partial dialing:
22664 +
22665 +     * Phone number transformations based on country and area code,
22666 +       application of prefixes, etc, are performed only on the first
22667 +       PDIAL.
22668 +     * Each PDIAL argument is looked up in the dialing directory, so it is
22669 +       possible have directory entries for pieces of phone numbers or
22670 +       other information.
22671 +     * Suffixes are not applied automatically, since there is no way for
22672 +       C-Kermit to know in which PDIAL segment you want them to be
22673 +       applied.
22674 +
22675 +   However, the suffix that *would* have been applied, based on the
22676 +   dialing rules that were invoked when processing the first PDIAL
22677 +   command, is stored in the variable:
22678 +
22679 +  \v(dialsuffix)
22680 +
22681 +   which you can include in any subsequent PDIAL or DIAL commands.
22682 +
22683 +   Example:
22684 +
22685 +  pdial {\m(my_long_distance_pager_number_part_1)}
22686 +  pdial {\m(my_long_distance_pager_number_part_2)}
22687 +  pdial {\v(dialsuffix)}
22688 +  pdial {\m(my_long_distance_pager_number_part_3)}
22689 +  pdial {@\m(numeric_pager_code)#}
22690 +
22691 +2.1.11. New DIAL-related Variables and Functions
22692 +
22693 +   \fdialconvert(s)
22694 +          s is a phone number in either literal or portable format (not a
22695 +          dialing directory entry name). The function returns the dial
22696 +          string that would actually be used by the DIAL command when
22697 +          dialing from the current location, after processing country
22698 +          code, area code, and other SET DIAL values, and should be the
22699 +          same as the result of LOOKUP when given a telephone number.
22700 +
22701 +   \v(dialsuffix)
22702 +          Contains the suffix, if any, that was applied in the most recent
22703 +          DIAL command, or the suffix that would have been applied in the
22704 +          most recent PDIAL command. Use this variable to send the dial
22705 +          suffix at any desired point in a PDIAL sequence.
22706 +
22707 +   \v(dialtype)
22708 +          A number indicating the type of call that was most recently
22709 +          placed. Can be used after a normal DIAL command, or after the
22710 +          first PDIAL command in a PDIAL sequence. Values are:
22711 +
22712 +  -2: Unknown because TAPI handled the phone number translation.
22713 +  -1: Unknown because some kind of error occured.
22714 +   0: Internal within PBX.
22715 +   1: Toll-free.
22716 +   2: Local within calling area.
22717 +   3: Unknown (e.g. because a literal-format phone number was given).
22718 +   4: Long distance within country.
22719 +   5: International
22720 +
22721 +   \v(dialcount)
22722 +          The current value of the DIAL retry counter, for use in a DIAL
22723 +          macro ([398]Section 2.1.13).
22724 +
22725 +   \v(d$px)
22726 +          PBX Exchange (see [399]Section 2.1.12).
22727 +
22728 +   Other dial-related variables, already documented in [400]Using C-Kermit
22729 +   (or other sections of this document, e.g. [401]Section 2.1.1), include
22730 +   \v(dialnumber), \v(dialstatus), etc. A convenient way to display all of
22731 +   them is:
22732 +
22733 +  show variable dial  ; hint: abbreviate "sho var dial"
22734 +
22735 +   This shows the values of all the variables whose names start with
22736 +   "dial". Also "show variable d$" (to show the \v(d$...) variables).
22737 +
22738 +2.1.12. Increased Flexibility of PBX Dialing
22739 +
22740 +   Refer to [402]Using C-Kermit, 2nd Edition, pages 107-108. Recall that
22741 +   three commands are needed to configure C-Kermit for dialing from a PBX:
22742 +
22743 +  SET DIAL PBX-EXCHANGE number
22744 +  SET DIAL PBX-INSIDE-PREFIX number
22745 +  SET DIAL PBX-OUTSIDE-PREFIX number
22746 +
22747 +   Unfortunately, this model does not accommodate PBXs that have more than
22748 +   one exchange. For example our PBX at Columbia University (which must
22749 +   handle more than 10,000 phones) has 853-xxxx and 854-xxxx exchanges.
22750 +
22751 +   Beginning in C-Kermit 7.0, the SET DIAL PBX-EXCHANGE command accepts a
22752 +   list of exchanges, e.g.:
22753 +
22754 +  SET DIAL PBX-EXCHANGE 853 854
22755 +
22756 +   (multiple exchanges are separated by spaces, not commas).
22757 +
22758 +   So now when dialing a portable-format number that has the same country
22759 +   and area codes as those of your dialing location, C-Kermit compares the
22760 +   exchange of the dialed number with each number in the PBX Exchange list
22761 +   (rather than with a single PBX Exchange number, as it did formerly) to
22762 +   determine whether this is an internal PBX number or an external call.
22763 +   If it is an external call, then the PBX Outside Prefix is applied, and
22764 +   then the normal dialing rules for local or long-distance calls.
22765 +
22766 +   If it is an inside call, the exchange is replaced by the PBX Inside
22767 +   Prefix. But if the PBX has more than one exchange, a single fixed PBX
22768 +   Inside Prefix is probably not sufficient. For example, at Columbia
22769 +   University, we must dial 3-xxxx for an internal call to 853-xxxx, but
22770 +   4-xxxx for a call to 854-xxxx. That is, the inside prefix is the final
22771 +   digit of the exchange we are dialing. For this reason, C-Kermit 7.0
22772 +   provides a method to determine the inside prefix dynamically at dialing
22773 +   time, consisting of a new variable and new syntax for the SET DIAL
22774 +   PBX-INSIDE-PREFIX command:
22775 +
22776 +   \v(d$px)
22777 +          This variable contains the exchange that was matched when a PBX
22778 +          internal call was detected. For example, if the PBX exchange
22779 +          list is "853 854" and a call is placed to +1 (212) 854-9999,
22780 +          \v(d$px) is set to 854.
22781 +
22782 +   SET DIAL PBX-INSIDE-PREFIX \fxxx(...)
22783 +          If the PBX Inside Prefix is defined to be a function, its
22784 +          evaluation is deferred until dialing time. Normally, this would
22785 +          be a string function having \v(d$px) as an operand. Of course,
22786 +          you can still specify a constant string, as before.
22787 +
22788 +   So given the following setup:
22789 +
22790 +  SET DIAL COUNTRY-CODE 1
22791 +  SET DIAL AREA-CODE 212
22792 +  SET DIAL PBX-OUTSIDE-PREFIX 93,
22793 +  SET DIAL PBX-EXCHANGE 853 854
22794 +  SET DIAL PBX-INSIDE-PREFIX \fright(\v(d$px),1)
22795 +
22796 +   The following numbers give the results indicated:
22797 +
22798 + Number                   Result
22799 +  +1 (212) 854-9876        4-9876
22800 +  +1 (212) 853-1234        3-1234
22801 +  +1 (212) 765-4321        93,765-4321
22802 +  +1 (333) 765-4321        93,1333765-4321
22803 +
22804 +   Furthermore, the K_PBX_XCH environment variable may now be set to a
22805 +   list of exchanges to automatically initialize C-Kermit's PBX exchange
22806 +   list, for example (in UNIX ksh or bash):
22807 +
22808 +  export K_PBX_XCH="853 854"
22809 +
22810 +   (Quotes required because of the space.) Of course, this variable can
22811 +   also be set to a single exchange, as before:
22812 +
22813 +  export K_PBX_XCH=853
22814 +
22815 +2.1.13. The DIAL macro - Last-Minute Phone Number Conversions
22816 +
22817 +   After a DIAL or LOOKUP command is given, a list of phone numbers is
22818 +   assembled from the dialing directory (if any), with all
22819 +   location-dependent conversion rules applied as described in Chapter 5
22820 +   of [403]Using C-Kermit.
22821 +
22822 +   However, additional conversions might still be required at the last
22823 +   minute based on local or ephemeral conditions. So that you can have the
22824 +   final word on the exact format of the dial string, C-Kermit 7.0 lets
22825 +   you pass the converted string through a macro of your own design for
22826 +   final processing before dialing. The relevant command is:
22827 +
22828 +   SET DIAL MACRO [ name ]
22829 +          Specifies the name of a macro to be run on each phone number
22830 +          after all built-in conversions have been applied, just before
22831 +          the number is dialed. If no name is given, no macro is run. The
22832 +          phone number, as it would have been dialed if there were no dial
22833 +          macro, is passed to the macro.
22834 +
22835 +   The dial macro can do anything at all (except start a file transfer).
22836 +   However, the normal use for the macro would be to modify the phone
22837 +   number. For this reason the phone number is passed to the macro as
22838 +   argument number 1 (\%1). To cause a modified number to be dialed, the
22839 +   macro should terminate with a RETURN statement specifying a return
22840 +   value. To leave the number alone, the macro should simply end. Example:
22841 +
22842 +  define xxx return 10108889999$\%1
22843 +  set dial macro xxx
22844 +  dial xyzcorp
22845 +
22846 +   This defines a DIAL MACRO called xxx, which puts an access code on the
22847 +   front of the number. Another example might be:
22848 +
22849 +  def xxx if equal "\v(modem)" "hayes-1200" return \freplace(\%1,$,{,,,,,})
22850 +  set dial macro xxx
22851 +  dial xyzcorp
22852 +
22853 +   which replaces any dollar-sign in the dial string by a series of five
22854 +   commas, e.g. because this particular modem does not support the "wait
22855 +   for bong" feature (remember that commas that are to be included
22856 +   literally in function arguments must be enclosed in braces to
22857 +   distinguish them from the commas that separate the arguments) and when
22858 +   the IF condition is not satisfied, the macro does not return a value,
22859 +   and so the number is not modified. Then when a DIAL command is given
22860 +   referencing a dialing directory entry, "xyzcorp". The macro is
22861 +   automatically applied to each matching number.
22862 +
22863 +   Numerous dial-, modem-, communications-, and time-related variables are
22864 +   available for decision making your dial macro. Type SHOW VARIABLES for
22865 +   a list. Of particular interest is the \v(dialcount) variable, which
22866 +   tells how many times the DIAL command gone through its retry loop: 1 on
22867 +   the first try, 2 on the second, 3 on the third, and so on, and the
22868 +   \v(dialresult) and \v(dialstatus) variables.
22869 +
22870 +   Here are some other applications for the DIAL MACRO (from users):
22871 +
22872 +     * Phone numbers in the dialing directory are formatted with '-' for
22873 +       readability, but some modems don't like the hyphens, so the DIAL
22874 +       macro is used to remove them before dialing; e.g 0090-123-456-78-99
22875 +       becomes 00901234567899: "def xxx return \freplace(\%1,-)".
22876 +     * To set some specific modem (or other) options depending on the
22877 +       called customer or telephone number.
22878 +     * Choosing the most appropriate provider based on (e.g.) time of day,
22879 +       or cycling through a list of providers in case some providers might
22880 +       be busy.
22881 +
22882 +   To illustrate the final item, suppose you have a choice among many
22883 +   phone service providers; the provider is chosen by dialing an access
22884 +   code before the number. Different providers might be better (e.g.
22885 +   cheaper) for certain times of day or days of the week, or for dialing
22886 +   certain locations; you can use the DIAL macro to add the access for the
22887 +   most desirable provider.
22888 +
22889 +   Similarly, when the same number might be reached through multiple
22890 +   providers, it's possible that one provider might not be able to
22891 +   complete the call, but another one can. In that case, you can use the
22892 +   DIAL macro to switch providers each time through the DIAL loop --
22893 +   that's where the \v(dialcount) variable comes in handy.
22894 +
22895 +   The following command can be used to debug the DIAL macro:
22896 +
22897 +   SET DIAL TEST { ON, OFF }
22898 +          Normally OFF, so the DIAL command actually dials. When ON, the
22899 +          DIAL command performs all lookups and number conversions, and
22900 +          then goes through the number list and retry loop, but instead of
22901 +          actually dialing, lists the numbers it would have called if none
22902 +          of the DIAL attempts succeeded (or more precisely, every number
22903 +          was always busy).
22904 +
22905 +2.1.14. Automatic Tone/Pulse Dialing Selection
22906 +
22907 +   SET DIAL METHOD { AUTO, DEFAULT, PULSE, TONE }
22908 +          Chooses the dialing method for subsequent calls.
22909 +
22910 +   Prior to version 7.0, C-Kermit's DIAL METHOD was DEFAULT by default,
22911 +   meaning it does not specify a dialing method to the modem, but relies
22912 +   on the modem to have an appropriate default dialing method set. So, for
22913 +   example, when using Hayes compatible modems, the dial string would be
22914 +   something like ATD7654321, rather than ATDT7654321 or ATDP7654321.
22915 +
22916 +   In C-Kermit 7.0 and K95 1.1.19, the dial method can be set from the
22917 +   environment variable:
22918 +
22919 +  K_DIAL_METHOD
22920 +
22921 +   when Kermit starts. The values can be TONE, PULSE, or DEFAULT, e.g.
22922 +   (UNIX):
22923 +
22924 +  set K_DIAL_METHOD=TONE; export K_DIAL_METHOD
22925 +
22926 +   In the absence of a K_DIAL_METHOD definition, the new default SET DIAL
22927 +   METHOD is AUTO rather than DEFAULT. When DIAL METHOD is AUTO and the
22928 +   local country code is known, then if tone dialing is universally
22929 +   available in the corresponding area, tone dialing is used; if dialing
22930 +   from a location where pulse dialing is mandatory, pulse dialing is
22931 +   used.
22932 +
22933 +   The "tone country" and "pulse country" lists are preloaded according to
22934 +   our knowledge at the time of release. You can see their contents in the
22935 +   SHOW DIAL listing. You can change the lists with:
22936 +
22937 +   SET DIAL TONE-COUNTRIES [ cc [ cc [ ... ] ] ]
22938 +          Replaces the current TONE-COUNTRIES list with the one given.
22939 +          Each cc is a country code; separate them with spaces (not
22940 +          commas). Example:
22941 +
22942 +  set dial tone-countries 1 358 44 46 49
22943 +
22944 +          If no country codes are given, the current list, if any, is
22945 +          removed, in which case SET DIAL METHOD AUTO is equivalent to SET
22946 +          DIAL METHOD DEFAULT.
22947 +
22948 +   SET DIAL PULSE-COUNTRIES [ cc [ cc [ ... ] ] ]
22949 +          Replaces the current PULSE-COUNTRIES list with the one give.
22950 +          Syntax and operation is like SET DIAL TONE-COUNTRIES.
22951 +
22952 +   If the same country code appears in both lists, Pulse takes precedence.
22953 +
22954 +   The SET DIAL TONE- and PULSE-COUNTRIES commands perform no verification
22955 +   whatsoever on the cc's, since almost any syntax might be legal in some
22956 +   settings. Furthermore, there is no facility to edit the lists; you can
22957 +   only replace the whole list. However, since the only purpose of these
22958 +   lists is to establish a basis for picking tone or pulse dialing
22959 +   automatically, all you need to override the effect of the list is to
22960 +   set a specific dialing method with SET DIAL METHOD TONE or SET DIAL
22961 +   METHOD PULSE.
22962 +
22963 +2.1.15. Dial-Modifier Variables
22964 +
22965 +   As of C-Kermit 7.0, dial modifiers are available in the following
22966 +   variables:
22967 +
22968 + \v(dm_lp) Long pause
22969 + \v(dm_sp) Short pause
22970 + \v(dm_pd) Pulse dial
22971 + \v(dm_td) Tone dial
22972 + \v(dm_wa) Wait for answer
22973 + \v(dm_wd) Wait for dialtone
22974 + \v(dm_rc) Return to command mode
22975 +
22976 +   You can use these in your dial strings in place of hardwired modifiers
22977 +   like "@", ",", etc, for increased portability of scripts. Example:
22978 +
22979 +  C-Kermit>set modem type usrobotics
22980 +  C-Kermit>sho variables dm
22981 +   \v(dm_lp) = ,
22982 +   \v(dm_sp) = /
22983 +   \v(dm_pd) = P
22984 +   \v(dm_td) = T
22985 +   \v(dm_wa) = @
22986 +   \v(dm_wd) = W
22987 +   \v(dm_rc) = ;
22988 +  C-Kermit>exit
22989 +
22990 +2.1.16. Giving Multiple Numbers to the DIAL Command
22991 +
22992 +   Prior to C-Kermit 7.0, the only way to give a DIAL command a list of
22993 +   phone numbers to try until one answers was to create a dialing
22994 +   directory that had multiple entries under the same name, and then use
22995 +   that entry name in the DIAL command. Now a list of numbers can be given
22996 +   to the DIAL command directly in the following format:
22997 +
22998 +  dial {{number1}{number2}{number3}...}
22999 +
23000 +   This is the same list format used by SEND /EXCEPT: and other commands
23001 +   that allow a list where normally a single item is given. Restrictions
23002 +   on this form of the DIAL command are:
23003 +
23004 +     * The first two braces must be adjacent; spacing is optional
23005 +       thereafter.
23006 +     * Each number must be an actual number to dial, not a dialing
23007 +       directory entry.
23008 +     * Dialing directory entries may not contain number lists in this
23009 +       format.
23010 +
23011 +   In all other respects, the numbers are treated as if they had been
23012 +   fetched from the dialing directory; they can be in literal or portable
23013 +   format, etc. Example:
23014 +
23015 +  dial {{7654321} {+1 (212) 5551212} { 1-212-5556789 }}
23016 +
23017 +   The list can be any length at all, within reason.
23018 +
23019 +   This feature is especially handy for use with the K95 Dialer, allowing
23020 +   a list of phone numbers to be specified in the Telephone Number box
23021 +   without having to set up or reference a separate dialing directory.
23022 +
23023 +   You can also use it to add commonly-dialed sequences as variables in
23024 +   your C-Kermit customization file, e.g.:
23025 +
23026 +  define work {{7654321}{7654322}{7654323}}
23027 +
23028 +   and then:
23029 +
23030 +  dial {\m(work)}
23031 +
23032 +   (the variable name must be enclosed in braces).
23033 +
23034 +   Or more simply:
23035 +
23036 +  define work dial {{7654321}{7654322}{7654323}}
23037 +
23038 +   and then:
23039 +
23040 +  work
23041 +
23042 +2.2. Modems
23043 +
23044 +2.2.1. New Modem Types
23045 +
23046 +   Since C-Kermit 6.0:
23047 +
23048 +  atlas-newcom-33600ifxC Atlas/Newcom 33600
23049 +  att-keepintouch        AT&T KeepinTouch PCMCIA V.32bis Card Modem
23050 +  att-1900-stu-iii       AT&T Secure Data STU-III Model 1900
23051 +  att-1910-stu-iii       AT&T Secure Data STU-III Model 1910
23052 +  bestdata               Best Data
23053 +  cardinal               Cardinal V.34 MVP288X series.
23054 +  compaq                 Compaq Data+Fax (e.g. in Presario)
23055 +  fujitsu                Fujitsu Fax/Modem Adapter
23056 +  generic-high-speed     Any modern error-correcting data-compressing modem
23057 +  itu-t-v25ter/v250      ITU-T (CCITT) V.25ter (V.250) standard command set
23058 +  megahertz-att-v34      Megahertz AT&T V.34
23059 +  megahertz-xjack        Megahertz X-Jack
23060 +  motorola-codex         Motorola Codex 326X Series
23061 +  motorola-montana       Motorola Montana
23062 +  mt5634zpx              Multitech MT5634ZPX
23063 +  rockwell-v90           Rockwell V.90 56K
23064 +  rolm-244pc             Siemens/Rolm 244PC (AT command set)
23065 +  rolm-600-series        Siemens/Rolm 600 Series (AT command set)
23066 +  spirit-ii              QuickComm Spirit II
23067 +  suprasonic             SupraSonic V288+
23068 +  supra-express-v90      Supra Express V.90
23069 +
23070 +   One of the new types, "generic-high-speed" needs a bit of explanation.
23071 +   This type was added to easily handle other types that are not
23072 +   explicitly covered, without going through the bother of adding a
23073 +   complete user-defined modem type. This one works for modern modems that
23074 +   use the AT command set, on the assumption that all the default
23075 +   ("factory") settings of the modem (a) are appropriate for Kermit, (b)
23076 +   include error correction, data compression, and speed buffering; and
23077 +   (c) are recallable with the command AT&F.
23078 +
23079 +   If the command to recall your modem's profile is not AT&F, use the SET
23080 +   MODEM COMMAND INIT-STRING command to specify the appropriate modem
23081 +   command. The default init-string is AT&F\13 (that is, AT, ampersand, F,
23082 +   and then carriage return); a survey of about 20 modern modem types
23083 +   shows they all support this, but they might mean different things by
23084 +   it. For example, the USR Sportster or Courier needs AT&F1 (not AT&F,
23085 +   which is equivalent to AT&F0, which recalls an inappropriate profile),
23086 +   so for USR modems:
23087 +
23088 +  set modem type generic-high-speed
23089 +  set modem command init AT&F1\13
23090 +
23091 +   Of course, USR modems already have their own built-in modem type. But
23092 +   if you use this one instead, it will dial faster because it has fewer
23093 +   commands to give to the modem; in that sense "&F1" is like a macro that
23094 +   bundles numerous commands into a single one. See your modem manual for
23095 +   details about factory profiles and commands to recall them.
23096 +
23097 +   WARNING: Do not use the generic-high-speed modem type in operating
23098 +   systems like VMS where hardware flow control is not available, at least
23099 +   not unless you change the init string from AT&F\13 to something else
23100 +   that enables local Xon/Xoff or other appropriate type of flow control.
23101 +
23102 +   Also see [404]Section 2.1.7 for additional hints about making dialing
23103 +   go faster.
23104 +
23105 +2.2.2. New Modem Controls
23106 +
23107 +   SET MODEM CAPABILITIES list
23108 +          In C-Kermit 7.0, this command automatically turns MODEM
23109 +          SPEED-MATCHING OFF if SB (Speed Buffering) is in the list, and
23110 +          turns it ON if SB is absent.
23111 +
23112 +   SET MODEM COMMAND PREDIAL-INIT [ text ]
23113 +          Commands to be sent to the modem just prior to dialing. Normally
23114 +          none.
23115 +
23116 +   SET MODEM SPEAKER { ON, OFF }
23117 +          Determines whether modem speaker is on or off while call is
23118 +          being placed. ON by default. Note: This command does not provide
23119 +          fine-grained control over when the speaker is on or off.
23120 +          Normally, ON means while the call is being placed, until the
23121 +          point at which carrier is successfully established. If your
23122 +          modem has a different speaker option that you want to choose,
23123 +          then use the SET MODEM COMMAND SPEAKER ON text command to
23124 +          specify this option.
23125 +
23126 +   SET MODEM COMMAND SPEAKER { ON, OFF } [ text ]
23127 +          Specify or override the commands to turn your modem's speaker on
23128 +          and off.
23129 +
23130 +   SET MODEM VOLUME { LOW, MEDIUM, HIGH }
23131 +          When MODEM SPEAKER is on, select volume. Note: In some modems,
23132 +          especially internal ones, these commands have no effect; this is
23133 +          a limitation of the particular modem, not of Kermit.
23134 +
23135 +   SET MODEM COMMAND VOLUME { LOW, MEDIUM, HIGH } [ text ]
23136 +          Specify or override the commands to set your modem's speaker
23137 +          volume.
23138 +
23139 +   SET MODEM COMMAND IGNORE-DIALTONE [ text ]
23140 +          The command to enable blind dialing ([405]Section 2.1.6).
23141 +
23142 +   SET MODEM ESCAPE-CHARACTER code
23143 +          Has been augmented to allow codes of 0 or less: < 0 means the
23144 +          escape mechanism is disabled. = 0 means to use (restore) the
23145 +          default value from the modem database. > 0 and < 128 is a
23146 +          literal value to be used instead of the default one. > 127 means
23147 +          the escape mechanism is disabled. This affects "modem hangup".
23148 +          When the escape mechanism is disabled, but SET MODEM
23149 +          HANGUP-METHOD is MODEM-COMMAND, it sends the hangup command
23150 +          immediately, without the <pause>+++<pause> business first. This
23151 +          is useful (for example) when sending lots of numeric pages, a
23152 +          process in which never we go online, and so never need to escape
23153 +          back. Eliminating the unnecessary pauses and escape sequence
23154 +          allows a lot more pages to be sent per unit time.
23155 +
23156 +   Recall that C-Kermit can dial modems to which it is connected via
23157 +   TCP/IP (Telnet or Rlogin) as described on page 126 of [406]Using
23158 +   C-Kermit, 2nd Ed. In this case the MODEM HANGUP-METHOD should be
23159 +   MODEM-COMMAND, since RS-232 signals don't work over TCP/IP connections.
23160 +   As noted in the manual, such connections are set up by the following
23161 +   sequence:
23162 +
23163 +  set host host [ port ]
23164 +  set modem type name
23165 +  dial number
23166 +
23167 +   But this can cause complications when you use Kermit to switch between
23168 +   serial and TCP/IP connections. In the following sequence:
23169 +
23170 +  set host name
23171 +  set modem type name
23172 +  set port name
23173 +
23174 +   the first two commands obey the rules for dialing out over Telnet.
23175 +   However, the SET PORT command requires that Kermit close its current
23176 +   (Telnet) connection before it can open the serial port (since Kermit
23177 +   can only have one connection open at a time). But since a modem type
23178 +   was set after the "set host" command was given, Kermit assumes it is a
23179 +   Telnet dialout connection and so sends the modem's hangup sequence is
23180 +   sent to the Telnet host. To avoid this, close the network connection
23181 +   explicitly before opening the serial one:
23182 +
23183 +  set host name
23184 +  close
23185 +  set modem type name
23186 +  set port name
23187 +
23188 +2.3. TELNET and RLOGIN
23189 +
23190 +   For additional background, please also read the [407]TELNET.TXT file,
23191 +   also available on the Web in [408]HTML format.
23192 +
23193 +   Cautions:
23194 +
23195 +     * If making a Telnet connection with C-Kermit takes a very long time,
23196 +       like over a minute, whereas the system Telnet program makes the
23197 +       same connection immediately, try including the /NOWAIT switch:
23198 +  C-Kermit> telnet /nowait hostname
23199 +
23200 +       See [409]TELNET.TXT or [410]TELNET.HTM for details. If it also
23201 +       takes a very long time to make a Telnet connection with system
23202 +       Telnet, then the delay is most likely caused by reverse DNS lookups
23203 +       when your host is not properly registered in DNS.
23204 +     * When supplying numeric IP addresses to C-Kermit or to any other
23205 +       application (regular Telnet, Rlogin, etc), do not include leading
23206 +       0's in any fields unless you intend for those fields to be
23207 +       interpreted as octal (or hex) numbers. The description of the
23208 +       Internet address interpreter (the sockets library inet_addr()
23209 +       routine) includes these words:
23210 +
23211 +     All numbers supplied as "parts" in a "." notation may be decimal,
23212 +     octal, or hexadecimal, as specified in the C language (that is, a
23213 +     leading 0x or 0X implies hexadecimal; otherwise, a leading 0 implies
23214 +     octal; otherwise, the number is interpreted as decimal).
23215 +       To illustrate, 128.59.39.2 and 128.059.039.002 are not the same
23216 +       host! Even though most of the fields contain non-octal digits.
23217 +       Using system Telnet (not Kermit):
23218 +  $ telnet 128.059.039.002
23219 +  Trying 128.49.33.2 ...
23220 +
23221 +       Of course the same thing happens with Kermit because it uses (as it
23222 +       must) the same system service for resolving network addresses that
23223 +       Telnet, FTP, and all other TCP/IP applications use.
23224 +     * The RLOGIN section on page 123 does not make it clear that you can
23225 +       use the SET TELNET TERMINAL-TYPE command to govern the terminal
23226 +       type that is reported by C-Kermit to the RLOGIN server.
23227 +     * Note that the SET TCP commands described on pages 122-123 might be
23228 +       absent; some platforms that support TCP/IP do not support these
23229 +       particular controls.
23230 +
23231 +   New commands:
23232 +
23233 +   TELOPT { AO, AYT, BREAK, CANCEL, EC, EL, EOF, EOR, GA, IP, DMARK,
23234 +          DO, DONT, NOP, SB, SE, SUSP, WILL, WONT }
23235 +          This command was available previously, but supported only DO,
23236 +          DONT, WILL, and WONT. Now it lets you send all the Telnet
23237 +          protocol commands. Note that certain commands do not require a
23238 +          response, and therefore can be used as nondestructive "probes"
23239 +          to see if the Telnet session is still open; e.g.:
23240 +
23241 +  set host xyzcorp.com
23242 +  ...
23243 +  telopt nop
23244 +  if fail stop 1 Connection lost
23245 +
23246 +   SET TCP ADDRESS [ ip-address ]
23247 +          Specifies the IP address of the computer that C-Kermit is
23248 +          running on. Normally this is not necessary. The exception would
23249 +          be if your machine has multiple network adapters (physical or
23250 +          virtual) with a different address for each adapter AND you want
23251 +          C-Kermit to use a specific address when making outgoing
23252 +          connections or accepting incoming connections.
23253 +
23254 +   SET TCP DNS-SERVICE-RECORDS { ON, OFF }
23255 +          Tells C-Kermit whether to try to use DNS SRV records to
23256 +          determine the host and port number upon which to find an
23257 +          advertised service. For example, if a host wants regular Telnet
23258 +          connections redirected to some port other than 23, this feature
23259 +          allows C-Kermit to ask the host which port it should use. Since
23260 +          not all domain servers are set up to answer such requests, this
23261 +          feature is OFF by default.
23262 +
23263 +   SET TCP REVERSE-DNS-LOOKUP { ON, OFF, AUTO }
23264 +          Tells Kermit whether to perform a reverse DNS lookup on TCP/IP
23265 +          connections. This allows Kermit to determine the actual hostname
23266 +          of the host it is connected to, which is useful for connections
23267 +          to host pools, and is required for Kerberos connections to host
23268 +          pools and for incoming connections. If the other host does not
23269 +          have a DNS entry, the reverse lookup could take a long time
23270 +          (minutes) to fail, but the connection will still be made. Turn
23271 +          this option OFF for speedier connections if you do not need to
23272 +          know exactly which host you are connected to and you are not
23273 +          using Kerberos. AUTO, the default, means the lookup is done on
23274 +          hostnames, but not on numeric IP addresses.
23275 +
23276 +   SET TELNET WAIT-FOR-NEGOTIATIONS { ON, OFF }
23277 +          Each Telnet option must be fully negotiated either On or Off
23278 +          before the session can continue. This is especially true with
23279 +          options that require sub-negotiations such as Authentication,
23280 +          Encryption, and Kermit; for proper support of these options
23281 +          Kermit must wait for the negotiations to complete. Of course,
23282 +          Kermit has no way of knowing whether a reply is delayed or not
23283 +          coming at all, and so will wait a minute or more for required
23284 +          replies before continuing the session. If you know that Kermit's
23285 +          Telnet partner will not be sending the required replies, you can
23286 +          set this option of OFF to avoid the long timeouts. Or you can
23287 +          instruct Kermit to REFUSE specific options with the SET TELOPT
23288 +          command.
23289 +
23290 +   SET TELOPT [ { /CLIENT, /SERVER } ] option
23291 +          { ACCEPTED, REFUSED, REQUESTED, REQUIRED }
23292 +          [ { ACCEPTED, REFUSED, REQUESTED, REQUIRED } ]
23293 +          SET TELOPT lets you specify policy requirements for Kermit's
23294 +          handling of Telnet option negotiations. Setting an option is
23295 +          REQUIRED causes Kermit to offer the option to the peer and
23296 +          disconnect if the option is refused. REQUESTED causes Kermit to
23297 +          offer an option to the peer. ACCEPTED results in no offer but
23298 +          Kermit will attempt to negotiate the option if it is requested.
23299 +          REFUSED instructs Kermit to refuse the option if it is requested
23300 +          by the peer.
23301 +
23302 +          Some options are negotiated in two directions and accept
23303 +          separate policies for each direction; the first keyword applies
23304 +          to Kermit itself, the second applies to Kermit's Telnet partner;
23305 +          if the second keyword is omitted, an appropriate
23306 +          (option-specific) default is applied. You can also include a
23307 +          /CLIENT or /SERVER switch to indicate whether the given policies
23308 +          apply when Kermit is the Telnet client or the Telnet server; if
23309 +          no switch is given, the command applies to the client.
23310 +
23311 +          Note that some of Kermit's Telnet partners fail to refuse
23312 +          options that they do not recognize and instead do not respond at
23313 +          all. In this case it is possible to use SET TELOPT to instruct
23314 +          Kermit to REFUSE the option before connecting to the problem
23315 +          host, thus skipping the problematic negotiation.
23316 +
23317 +          Use SHOW TELOPT to view current Telnet Option negotiation
23318 +          settings. SHOW TELNET displays current Telnet settings.
23319 +
23320 +2.3.0. Bug Fixes
23321 +
23322 +   If "set host nonexistent-host" was given (and it properly failed),
23323 +   followed by certain commands like SEND, the original line and modem
23324 +   type were not restored and C-Kermit thought that it still had a network
23325 +   hostname; fixed in 7.0.
23326 +
23327 +2.3.1. Telnet Binary Mode Bug Adjustments
23328 +
23329 +   SET TELNET BUG BINARY-ME-MEANS-U-TOO { ON, OFF } was added to edit 192
23330 +   after the book was printed. Also SET TELNET BUG BINARY-U-MEANS-ME-TOO.
23331 +   The default for both is OFF. ON should be used when communicating with
23332 +   a Telnet partner (client or server) that mistakenly believes that
23333 +   telling C-Kermit to enter Telnet binary mode also means that it, too,
23334 +   is in binary mode, contrary to the Telnet specification, which says
23335 +   that binary mode must be negotiated in each direction separately.
23336 +
23337 +2.3.2. VMS UCX Telnet Port Bug Adjustment
23338 +
23339 +   A new command, SET TCP UCX-PORT-BUG, was added for VMS versions with
23340 +   UCX (DEC TCP/IP), applying only to early versions of UCX, like 2.2 or
23341 +   earlier. If you try to use VMS C-Kermit to make a Telnet connection
23342 +   using a port name (like "telnet", which is used by default), the
23343 +   underlying UCX getservbyname() function might return the service number
23344 +   with its bytes swapped and the connection will fail. If "telnet
23345 +   hostname 23" works, then your version of UCX has this bug and you can
23346 +   put "set tcp ucx-port-bug on" in your CKERMIT.INI file to get around
23347 +   it.
23348 +
23349 +2.3.3. Telnet New Environment Option
23350 +
23351 +   The TELNET NEW-ENVIRONMENT option ([411]RFC 1572) is supported as 7.0.
23352 +   This option allows the C-Kermit Telnet client to send certain
23353 +   well-known variables to the Telnet server, including USER, PRINTER,
23354 +   DISPLAY, and several others. This feature is enabled by default in
23355 +   Windows and OS/2, disabled by default elsewhere. The command to enable
23356 +   and disable it is:
23357 +
23358 +  SET TELNET ENVIRONMENT { ON, OFF }
23359 +
23360 +   When ON, and you Telnet to another computer, you might (or might not)
23361 +   notice that the "login:" or "Username:" prompt does not appear --
23362 +   that's because your username was sent ahead, in which case the remote
23363 +   system might prompt you only for your password (similar to Rlogin). Use
23364 +   "set telnet environment off" to defeat this feature, particularly in
23365 +   scripts where the dialog must be predictable. You can also use this
23366 +   command to specify or override specific well-known environment variable
23367 +   values:
23368 +
23369 + SET TELNET ENVIRONMENT { ACCT,DISPLAY,JOB,PRINTER,SYSTEMTYPE,USER } [ text ]
23370 +
23371 +2.3.4. Telnet Location Option
23372 +
23373 +   The TELNET LOCATION option ([412]RFC 779) is supported in 7.0. This
23374 +   option allows the C-Kermit Telnet client to send a location string to
23375 +   the server if the server indicates its willingness to accept one. If an
23376 +   environment variable named LOCATION exists at the time C-Kermit starts,
23377 +   its value is used as the location string. If you want to change it,
23378 +   use:
23379 +
23380 +  SET TELNET LOCATION text
23381 +
23382 +   If you omit the text from this command, the Telnet location feature is
23383 +   disabled.
23384 +
23385 +   SET TELNET ENVIRONMENT DISPLAY is used to set the DISPLAY variable that
23386 +   is sent to the host, as well as the the XDISPLAY location.
23387 +
23388 +2.3.5. Connecting to Raw TCP Sockets
23389 +
23390 +   The SET HOST and TELNET commands now accept an optional switch,
23391 +   /RAW-SOCKET, at the end, only if you first give a host and a port.
23392 +   Example:
23393 +
23394 +  set host xyzcorp.com 23 /raw-socket
23395 +  set host 128.49.39.2:2000 /raw-socket
23396 +  telnet xyzcorp.com 3000 /raw
23397 +
23398 +   Without this switch, C-Kermit behaves as a Telnet client when (a) the
23399 +   port is 23 or 1649, or (b) the port is not 513 and the server sent what
23400 +   appeared to be Telnet negotiations -- that is, messages starting with
23401 +   0xFF (IAC). With this switch, Kermit should treat all incoming bytes as
23402 +   raw data, and will not engage in any Telnet negotiations or NVT CRLF
23403 +   manipulations. This allows transparent operation through (e.g.) raw TCP
23404 +   ports on Cisco terminal servers, through the 'modemd' modem server,
23405 +   etc.
23406 +
23407 +2.3.6. Incoming TCP Connections
23408 +
23409 +   Accomplished via SET HOST * port, were introduced in C-Kermit 6.0, but
23410 +   for UNIX only. In Version 7.0, they are also available for VMS.
23411 +
23412 +2.4. The EIGHTBIT Command
23413 +
23414 +   EIGHTBIT is simply a shorthand for: SET PARITY NONE, SET TERMINAL
23415 +   BYTESIZE 8, SET COMMAND BYTESIZE 8; that is, a way to set up an 8-bit
23416 +   clean connection in a single command.
23417 +
23418 +2.5. The Services Directory
23419 +
23420 +   Chapter 7 of [413]Using C-Kermit does not mention the ULOGIN macro,
23421 +   which is used by our sample services directory, CKERMIT.KND. Unlike
23422 +   UNIXLOGIN, VMSLOGIN, etc, this one is for use with systems that require
23423 +   a user ID but no password. Therefore it doesn't prompt for a password
23424 +   or wait for a password prompt from the remote service.
23425 +
23426 +   In version 7.0, the CALL macro was changed to not execute a SET MODEM
23427 +   TYPE command if the given modem type was the same as the current one;
23428 +   otherwise the new SET MODEM TYPE command would overwrite any
23429 +   customizations that the user had made to the modem settings. Ditto for
23430 +   SET LINE / SET PORT and SET SPEED.
23431 +
23432 +2.6. Closing Connections
23433 +
23434 +   Until version 7.0, there was never an obvious and general way to close
23435 +   a connection. If a serial connection was open, it could be closed by
23436 +   "set line" or "set port" (giving no device name); if a network
23437 +   connection was open, it could be closed by "set host" (no host name).
23438 +
23439 +   In version 7.0, a new command closes the connection in an obvious and
23440 +   straightforward way, no matter what the connection type:
23441 +
23442 +  CLOSE [ CONNECTION ]
23443 +
23444 +   The CLOSE command was already present, and required an operand such as
23445 +   DEBUG-LOG, WRITE-FILE, etc, and so could never be given by itself. The
23446 +   new CONNECTION operand is now the default operand for CLOSE, so CLOSE
23447 +   by itself closes the connection, if one is open, just as you would
23448 +   expect, especially if you are a Telnet or Ftp user.
23449 +
23450 +   Also see the description of the new SET CLOSE-ON-DISCONNECT command in
23451 +   [414]Section 2.10.
23452 +
23453 +2.7. Using C-Kermit with External Communication Programs
23454 +
23455 +   C-Kermit 7.0 includes a new ability to create and conduct sessions
23456 +   through other communications programs. Two methods are available:
23457 +
23458 +    1. Pty (pseudoterminal): The external program is run on a
23459 +       "pseudoterminal", which is controlled by Kermit. This method works
23460 +       with practically any external program, but it is not portable. At
23461 +       this writing, it works only on some (not all) UNIX versions, and
23462 +       not on any non-UNIX platforms.
23463 +    2. Pipe: The external program's standard input and output are
23464 +       redirected through a "pipe" controlled by Kermit. This method is
23465 +       relatively portable -- it should work across all UNIX versions, and
23466 +       it also works in Windows and OS/2 -- but it is effective only when
23467 +       the external program actually uses standard i/o (and many don't).
23468 +
23469 +   The two methods are started differently but are used the same way
23470 +   thereafter.
23471 +
23472 +   The purpose of this feature is to let you use C-Kermit services like
23473 +   file transfer, character-set translation, scripting, automatic dialing,
23474 +   etc, on connections that Kermit can't otherwise make itself.
23475 +
23476 +   This feature is the opposite of the REDIRECT feature, in which C-Kermit
23477 +   makes the connection, and redirects an external (local) command or
23478 +   program over this connection. In a pty or pipe connection, C-Kermit
23479 +   runs and controls a local command or program, which makes the
23480 +   connection. (The same method can be used to simply to control a local
23481 +   program without making a connection; see [415]Section 2.8.)
23482 +
23483 +   To find out if your version of Kermit includes PTY support, type "show
23484 +   features" and look for NETPTY in the alphabetical list of options. For
23485 +   pipes, look for NETCMD.
23486 +
23487 +   The commands are:
23488 +
23489 +   SET NETWORK TYPE PTY or SET NETWORK TYPE PIPE
23490 +   SET HOST command
23491 +          where command is any interactive command. If the command does
23492 +          not use standard i/o, you must use SET NETWORK TYPE PTY.
23493 +
23494 +   Notes:
23495 +
23496 +     * COMMAND is an invisible synonym for PIPE.
23497 +     * The command and its arguments are case-sensitive in UNIX.
23498 +
23499 +   The SET NETWORK TYPE, SET HOST sequence sets the given network type for
23500 +   all subsequent SET HOST commands until another SET NETWORK TYPE command
23501 +   is given to change it.
23502 +
23503 +   You can also use the new /NETWORK-TYPE:PTY or /NETWORK-TYPE:PIPE (or
23504 +   simply /PIPE or /PTY) switches on the SET HOST command itself:
23505 +
23506 +  SET HOST /NETWORK-TYPE:PIPE command  ; These two are the same
23507 +  SET HOST /PIPE command
23508 +
23509 +  SET HOST /NETWORK-TYPE:PTY command   ; Ditto
23510 +  SET HOST /PTY command
23511 +
23512 +   These are like SET NETWORK TYPE followed by SET HOST, except they apply
23513 +   only to the connection being made and do not change the global network
23514 +   type setting (see [416]Section 1.5 about the difference between
23515 +   switches and SET commands).
23516 +
23517 +   Include any command-line options with the command that might be needed,
23518 +   as in this example where C-Kermit uses another copy of itself as the
23519 +   communications program:
23520 +
23521 +  SET HOST /PIPE /CONNECT kermit -YQJ xyzcorp.com
23522 +
23523 +     IMPORTANT: In Unix, wildcards and redirectors are interpreted by the
23524 +     shell. If you want to run a program with (say) SET HOST /PTY with
23525 +     its i/o redirected or with wildcard file arguments, you will need to
23526 +     invoke the shell too. Example:
23527 +
23528 +SET HOST /PTY {sh -c "crypt < foo.x"}
23529 +SET HOST /PTY {sh -c "grep somestring *.txt"}
23530 +
23531 +   As usual, if you include the /CONNECT switch, SET HOST enters CONNECT
23532 +   mode immediately upon successful execution of the given command.
23533 +   Therefore new commands are available as a shorthand for SET HOST
23534 +   /CONNECT /PTY and /PIPE:
23535 +
23536 +   PTY [ command ]
23537 +   PIPE [ command ]
23538 +          The PTY and PIPE commands work like the TELNET and RLOGIN
23539 +          commands: they set up the connection (in this case, using the
23540 +          given command) and then enter CONNECT mode automatically (if the
23541 +          PIPE or PTY command is given without a command, it continues the
23542 +          current session if one is active; otherwise it gives an error
23543 +          message).
23544 +
23545 +   The PIPE command is named after the mechanism by which C-Kermit
23546 +   communicates with the command: UNIX pipes. C-Kermit's i/o is "piped"
23547 +   through the given command. Here is a typical example:
23548 +
23549 +  PIPE rlogin -8 xyzcorp.com
23550 +
23551 +   This is equivalent to:
23552 +
23553 +  SET HOST /PIPE rlogin -8 xyzcorp.com
23554 +  CONNECT
23555 +
23556 +   and to:
23557 +
23558 +  SET HOST /PIPE /CONNECT rlogin -8 xyzcorp.com
23559 +
23560 +   IMPORTANT:
23561 +          If you are writing a script, do not use the PIPE, PTY, TELNET,
23562 +          or RLOGIN command unless you really want C-Kermit to enter
23563 +          CONNECT mode at that point. Normally SET HOST is used in scripts
23564 +          to allow the login and other dialogs to be controlled by the
23565 +          script itself, rather than by an actively participating human at
23566 +          the keyboard.
23567 +
23568 +   Throughput of pty and pipe connections is limited by the performance of
23569 +   the chosen command or program and by the interprocess communication
23570 +   (IPC) method used and/or buffering capacity of the pipe or pty, which
23571 +   in turn depends on the underlying operating system.
23572 +
23573 +   In one trial (on SunOS 4.1.3), we observed file transfer rates over an
23574 +   rlogin connection proceeding at 200Kcps for downloads, but only 10Kcps
23575 +   for uploads on the same connection with the same settings (similar
23576 +   disparities were noted in HP-UX). Examination of the logs revealed that
23577 +   a write to the pipe could take as long as 5 seconds, whereas reads were
23578 +   practically instantaneous. On the other hand, using Telnet as the
23579 +   external program rather than rlogin, downloads and uploads were better
23580 +   matched at about 177K each.
23581 +
23582 +   Most external communication programs, like C-Kermit itself, have escape
23583 +   characters or sequences. Normally these begin with (or consist entirely
23584 +   of) a control character. You must be sure that this control character
23585 +   is not "unprefixed" when uploading files, otherwise the external
23586 +   program will "escape back" to its prompt, or close the connection, or
23587 +   take some other unwanted action. When in CONNECT mode, observe the
23588 +   program's normal interaction rules. Of course C-Kermit's own escape
23589 +   character (normally Ctrl-\) is active too, unless you have taken some
23590 +   action to disable it.
23591 +
23592 +   On PTY connections, the underlying PTY driver is not guaranteed to be
23593 +   transparent to control characters -- for example, it might expand tabs,
23594 +   translate carriage returns, generate signals if it sees an interrupt
23595 +   character, and so on. Similar things might happen on a PIPE connection.
23596 +   For this reason, if you plan to transfer files over a PTY or PIPE
23597 +   connection, tell the file sender to:
23598 +
23599 +   SET PREFIXING ALL
23600 +          This causes all control characters to be prefixed and
23601 +          transmitted as printable ASCII characters.
23602 +
23603 +   If the external connection program is not 8-bit clean, you should also:
23604 +
23605 +   SET PARITY SPACE
23606 +          This causes 8-bit data to be encoded in 7 bits using single
23607 +          and/or locking shifts.
23608 +
23609 +   And if it does not make a reliable connection (such as those made by
23610 +   Telnet, Rlogin, Ssh, etc), you should:
23611 +
23612 +   SET STREAMING OFF
23613 +          This forces C-Kermit to treat the connection as unreliable and
23614 +          to engage in its normal ACK/NAK protocol for error detection and
23615 +          correction, rather than "streaming" its packets, as it normally
23616 +          does on a network connection ([417]Section 4.20).
23617 +
23618 +   In some cases, buffer sizes might be restricted, so you might also need
23619 +   to reduce the Kermit packet length to fit; this is a trial-and-error
23620 +   affair. For example, if transfers always fail with 4000-byte packets,
23621 +   try 2000. If that fails too, try 1000, and so on. The commands are:
23622 +
23623 +   SET RECEIVE PACKET-LENGTH number
23624 +          This tells the file receiver to tell the file sender the longest
23625 +          packet length it can accept.
23626 +
23627 +   SET SEND PACKET-LENGTH number
23628 +          This tells the file sender not to send packets longer than the
23629 +          given length, even if the receiver says longer ones are OK. Of
23630 +          course, if the receiver's length is shorter, the shorter length
23631 +          is used.
23632 +
23633 +   If none of this seems to help, try falling back to the bare minimum,
23634 +   lowest-common-denominator protocol settings:
23635 +
23636 +   ROBUST
23637 +          No sliding windows, no streaming, no control-character
23638 +          unprefixing, packet length 90.
23639 +
23640 +   And then work your way back up by trial and error to get greater
23641 +   throughput.
23642 +
23643 +   Note that when starting a PIPE connection, and the connection program
23644 +   (such as telnet or rlogin) prints some greeting or information messages
23645 +   before starting the connection, these are quite likely to be printed
23646 +   with a stairstep effect (linefeed without carriage return). This is
23647 +   because the program is not connected with the UNIX terminal driver;
23648 +   there's not much Kermit can do about it. Once the connection is made,
23649 +   everything should go back to normal. This shouldn't happen on a PTY
23650 +   connection because a PTY is, indeed, a terminal.
23651 +
23652 +   On a similar note, some connection programs (like Solaris 2.5 rlogin)
23653 +   might print lots of error messages like "ioctl TIOCGETP: invalid
23654 +   argument" when used through a pipe. They are annoying but usually
23655 +   harmless. If you want to avoid these messages, and your shell allows
23656 +   redirection of stderr, you can redirect stderr in your pipe command, as
23657 +   in this example where the user's shell is bash:
23658 +
23659 +  PIPE rlogin xyzcorp.com 2> /dev/null
23660 +
23661 +   Or use PTY rather than PIPE, since PTY is available on Solaris.
23662 +
23663 +2.7.0. C-Kermit over tn3270 and tn5250
23664 +
23665 +   Now you can make a connection from C-Kermit "directly" to an IBM
23666 +   mainframe and transfer files with it, assuming it has Kermit-370
23667 +   installed. Because tn3270 is neither 8-bit clean nor transparent to
23668 +   control characters, you must give these commands:
23669 +
23670 +  SET PREFIXING ALL   ; Prefix all control characters
23671 +  SET PARITY SPACE    ; Telnet connections are usually not 8-bit clean
23672 +
23673 +   and then:
23674 +
23675 +  SET HOST /PTY /CONNECT tn3270 abccorp.com
23676 +
23677 +   or simply:
23678 +
23679 +  pty tn3270 abccorp.com
23680 +
23681 +   SET HOST /PIPE does not work in this case, at least not for file
23682 +   transfer. File transfer does work, however, with SET HOST /PTY,
23683 +   provided you use the default packet length of 90 bytes; anything longer
23684 +   seems to kill the session.
23685 +
23686 +   You can also make connections to IBM AS/400 computers if you have a
23687 +   tn5250 program installed:
23688 +
23689 +  pty tn5250 hostname
23690 +
23691 +   In this case, however, file transfer is probably not in the cards since
23692 +   nobody has ever succeeded in writing a Kermit program for the AS/400.
23693 +   Hint:
23694 +
23695 +  define tn3270 {
23696 +      check pty
23697 +      if fail end 1 Sorry - no PTY support...
23698 +      pty tn3270 \%*
23699 +  }
23700 +
23701 +   Similarly for tn5250. Note that CHECK PTY and CHECK PIPE can be used in
23702 +   macros and scripts to test whether PTY or PIPE support is available.
23703 +
23704 +2.7.1. C-Kermit over Telnet
23705 +
23706 +   Although C-Kermit includes its own Telnet implementation, you might
23707 +   need to use an external Telnet program to make certain connections;
23708 +   perhaps because it has access or security features not available in
23709 +   C-Kermit itself. As noted above, the only precautions necessary are
23710 +   usually:
23711 +
23712 +  SET PREFIXING ALL   ; Prefix all control characters
23713 +  SET PARITY SPACE    ; Telnet connections might not be 8-bit clean
23714 +
23715 +   and then:
23716 +
23717 +  SET HOST /PTY (or /PIPE) /CONNECT telnet abccorp.com
23718 +
23719 +   or, equivalently:
23720 +
23721 +  PTY (or PIPE) telnet abccorp.com
23722 +
23723 +2.7.2. C-Kermit over Rlogin
23724 +
23725 +   C-Kermit includes its own Rlogin client, but this can normally be used
23726 +   only if you are root, since the rlogin TCP port is privileged. But ptys
23727 +   and pipes let you make rlogin connections with C-Kermit through your
23728 +   computer's external rlogin program, which is normally installed as a
23729 +   privileged program:
23730 +
23731 +  SET PREFIXING ALL
23732 +
23733 +   and then:
23734 +
23735 +  SET HOST /PTY (or /PIPE) /CONNECT rlogin -8 abccorp.com
23736 +
23737 +   or, equivalently:
23738 +
23739 +  PTY (or PIPE) rlogin -8 abccorp.com
23740 +
23741 +   The "-8" option to rlogin enables transmission of 8-bit data. If this
23742 +   is not available, then include SET PARITY SPACE if you intend to
23743 +   transfer files.
23744 +
23745 +   Note that the normal escape sequence for rlogin is Carriage Return
23746 +   followed by Tilde (~), but only when the tilde is followed by certain
23747 +   other characters; the exact behavior depends on your rlogin client, so
23748 +   read its documentation.
23749 +
23750 +2.7.3. C-Kermit over Serial Communication Programs
23751 +
23752 +   Ptys and pipes also let you use programs that make serial connections,
23753 +   such as cu or tip. For example, C-Kermit can be used through cu to make
23754 +   connections that otherwise might not be allowed, e.g. because C-Kermit
23755 +   is not installed with the required write permissions to the dialout
23756 +   device and the UUCP lockfile directory.
23757 +
23758 +   Suppose your UUCP Devices file contains an entry for a serial device
23759 +   tty04 to be used for direct connections, but this device is protected
23760 +   against you (and Kermit when you run it). In this case you can:
23761 +
23762 +  SET CONTROL PREFIX ALL
23763 +  PTY (or PIPE) cu -l tty04
23764 +
23765 +   (Similarly for dialout devices, except then you also need to include
23766 +   the phone number in the "cu" command.)
23767 +
23768 +   As with other communication programs, watch out for cu's escape
23769 +   sequence, which is the same as the rlogin program's: Carriage Return
23770 +   followed by Tilde (followed by another character to specify an action,
23771 +   like "." for closing the connection and exiting from cu).
23772 +
23773 +2.7.4. C-Kermit over Secure Network Clients
23774 +
23775 +     DISCLAIMER: There are laws in the USA and other countries regarding
23776 +     use, import, and/or export of encryption and/or decryption or other
23777 +     forms of security software, algorithms, technology, and intellectual
23778 +     property. The Kermit Project attempts to follow all known statutes,
23779 +     and neither intends nor suggests that Kermit software can or should
23780 +     be used in any way, in any location, that circumvents any
23781 +     regulations, laws, treaties, covenants, or other legitimate canons
23782 +     or instruments of law, international relations, trade, ethics, or
23783 +     propriety.
23784 +
23785 +   For secure connections or connections through firewalls, C-Kermit 7.0
23786 +   can be a Kerberos, SRP, and/or SOCKS client when built with the
23787 +   appropriate options and libraries. But other application-level security
23788 +   acronyms and methods -- SSH, SSL, SRP, TLS -- pop up at an alarming
23789 +   rate and are (a) impossible to keep up with, (b) usually mutually
23790 +   incompatible, and (c) have restrictions on export or redistribution and
23791 +   so cannot be included in C-Kermit itself.
23792 +
23793 +   However, if you have a secure text-based Telnet (or other) client that
23794 +   employs one of these security methods, you can use C-Kermit "through"
23795 +   it via a pty or pipe.
23796 +
23797 +2.7.4.1. SSH
23798 +
23799 +   C-Kermit does not and can not incorporate SSH due to licensing, patent,
23800 +   and USA export law restrictions.
23801 +
23802 +   The UNIX SSH client does not use standard input/output, and therefore
23803 +   can be used only by Kermit's PTY interface, if one is present. The
23804 +   cautions about file transfer, etc, are the same as for Rlogin. Example:
23805 +
23806 +  SET PREFIXING ALL
23807 +  PTY ssh XYZCORP.COM
23808 +
23809 +   Or, for a scripted session:
23810 +
23811 +  SET PREFIXING ALL
23812 +  SET HOST /PTY ssh XYZCORP.COM
23813 +
23814 +   Hint:
23815 +
23816 +  define ssh {
23817 +      check pty
23818 +      if fail end 1 Sorry - no PTY support...
23819 +      pty ssh \%*
23820 +  }
23821 +
23822 +2.7.4.2. SSL
23823 +
23824 +   Secure Sockets Layer (SSL) is another TCP/IP security overlay, this one
23825 +   designed by and for Netscape. An SSL Telnet client is available for
23826 +   UNIX from the University of Queensland. More info at:
23827 +
23828 +  [418]http://www.psy.uq.oz.au/~ftp/Crypto/
23829 +
23830 +   Interoperability with C-Kermit is unknown. C-Kermit also includes its
23831 +   own built-in SSL/TLS support, but it is not exportable; [419]CLICK HERE
23832 +   file for details.
23833 +
23834 +2.7.4.3. SRP
23835 +
23836 +   SRP(TM) is Stanford University's Secure Remote Password protocol. An
23837 +   SRP Telnet client is available from Stanford:
23838 +
23839 +  [420]http://srp.stanford.edu/srp/
23840 +
23841 +   Stanford's SRP Telnet client for UNIX has been tested on SunOS and
23842 +   works fine with C-Kermit, as described in [421]Section 2.7.1, e.g.
23843 +
23844 +  SET PREFIX ALL
23845 +  PTY (or PIPE) srp-telnet xenon.stanford.edu
23846 +
23847 +   C-Kermit itself can be built as an SRP Telnet client on systems that
23848 +   have libsrp.a installed; the C-Kermit support code, however, may not be
23849 +   exported outside the USA or Canada.
23850 +
23851 +2.7.4.4. SOCKS
23852 +
23853 +   C-Kermit can be built as a SOCKS-aware client on systems that have a
23854 +   SOCKS library. See section 8.1.1 of the [422]ckccfg.txt file.
23855 +
23856 +   C-Kermit 7.0 can also be run over SOCKSified Telnet or rlogin clients
23857 +   with SET NETWORK TYPE COMMAND. Suppose the Telnet program on your
23858 +   system is SOCKS enabled but C-Kermit is not. Make Kermit connections
23859 +   like this:
23860 +
23861 +  SET PREFIX ALL
23862 +  PTY (or PIPE) telnet zzz.com
23863 +
23864 +2.7.4.5. Kerberos
23865 +
23866 +   UNIX C-Kermit can be built with MIT Kerberos IV or V authentication and
23867 +   encryption. Instructions are available in a [423]separate document.
23868 +   Additional modules are required that can not be exported from the USA
23869 +   to any country except Canada, by US law.
23870 +
23871 +   If you have Kerberos installed but you don't have a Kerberized version
23872 +   of C-Kermit, you can use ktelnet as C-Kermit's external communications
23873 +   program to make secure connections without giving up C-Kermit's
23874 +   services:
23875 +
23876 +  SET PREFIX ALL
23877 +  PTY (or PIPE) ktelnet cia.gov
23878 +
23879 +2.8. Scripting Local Programs
23880 +
23881 +   If your version of Kermit has PTY support built in, then any text-based
23882 +   program can be invoked with SET HOST /PTY or equivalent command and
23883 +   controlled using the normal sequence of OUTPUT, INPUT, IF SUCCESS
23884 +   commands (this is the same service that is provided by the 'expect'
23885 +   program, but controlled by the Kermit script language rather than Tcl).
23886 +
23887 +   When PTY service is not available, then any program that uses standard
23888 +   input and output can be invoked with SET HOST /PIPE.
23889 +
23890 +   Here's an example in which we start an external Kermit program, wait
23891 +   for its prompt, give it a VERSION command, and then extract the numeric
23892 +   version number from its response:
23893 +
23894 +  set host /pty kermit -Y
23895 +  if fail stop 1 {Can't start external command}
23896 +  input 10 C-Kermit>
23897 +  if fail stop 1 {No C-Kermit> prompt}
23898 +  output version\13
23899 +  input 10 {Numeric: }
23900 +  if fail stop 1 {No match for "Numeric:"}
23901 +  clear input
23902 +  input 10 \10
23903 +  echo VERSION = "\fsubstr(\v(input),1,6)"
23904 +  output exit\13
23905 +
23906 +   This technique could be used to control any other interactive program,
23907 +   even those that do screen formatting (like Emacs or Vi), if you can
23908 +   figure out the sequence of events. If your Kermit program doesn't have
23909 +   PTY support, then the commands are restricted to those using standard
23910 +   i/o, including certain shells, interactive text-mode "hardcopy" editors
23911 +   like ex, and so on.
23912 +
23913 +   If you are using the PTY interface, you should be aware that it runs
23914 +   the given program or command directly on the pty, without any
23915 +   intervening shell to interpret metacharacters, redirectors, etc. If you
23916 +   need this sort of thing, include the appropriate shell invocation as
23917 +   part of your command; for example:
23918 +
23919 +  pty echo *
23920 +
23921 +   just echoes "*"; whereas:
23922 +
23923 +  pty ksh -c "echo *"
23924 +
23925 +   echoes all the filenames that ksh finds matching "*".
23926 +
23927 +   Similarly for redirection:
23928 +
23929 +  set host /pty ksh -c "cat > foo"  ; Note: use shell quoting rules here
23930 +  set transmit eof \4
23931 +  transmit bar
23932 +
23933 +   And for that matter, for built-in shell commands:
23934 +
23935 +  set host /pty ksh -c "for i in *; do echo $i; done"
23936 +
23937 +   The PIPE interface, on the other hand, invokes the shell automatically,
23938 +   so:
23939 +
23940 +  pipe echo *
23941 +
23942 +   prints filenames, not "*".
23943 +
23944 +2.9. X.25 Networking
23945 +
23946 +   X.25 networking is documented in [424]Using C-Kermit, 2nd Edition. When
23947 +   the book was published, X.25 was available only in SunOS, Solaris, and
23948 +   Stratus VOS. Unlike TCP/IP, X.25 APIs are not standardized; each
23949 +   vendor's X.25 libraries and services (if they have them at all) are
23950 +   unique.
23951 +
23952 +   This section describes new additions.
23953 +
23954 +2.9.1. IBM AIXLink/X.25 Network Provider Interface for AIX
23955 +
23956 +   Support for X.25 was added via IBM's Network Provider Interface (NPI),
23957 +   AIXLink/X.25 1.1, to the AIX 4.x version of C-Kermit 7.0.
23958 +   Unfortunately, AIXLink/X.25 is a rather bare-bones facility, lacking in
23959 +   particular any form of PAD support (X.3, X.28, X.29). Thus, the AIX
23960 +   version of C-Kermit, when built to include X.25 networking, has neither
23961 +   a PAD command, nor a SET PAD command. The same is true for the
23962 +   underlying AIX system: no PAD support. Thus it is not possible to have
23963 +   an interactive shell session over an X.25 connection into an AIX system
23964 +   (as far as we know), even from X.25-capable Kermit versions (such as
23965 +   Solaris or VOS) that do include PAD support.
23966 +
23967 +   Thus the X.25 capabilities in AIX C-Kermit are limited to peer-to-peer
23968 +   connections, e.g. from a C-Kermit client to a C-Kermit server. Unlike
23969 +   the Solaris, SunOS, and VOS versions, the AIX version can accept
23970 +   incoming X.25 connections:
23971 +
23972 +  set network type x.25
23973 +  if fail stop 1 Sorry - no X.25 support
23974 +  ; Put any desired DISABLE or ENABLE or SET commands here.
23975 +  set host /server *
23976 +  if fail stop 1 X.25 "set host *" failed
23977 +
23978 +   And then access it from the client as follows:
23979 +
23980 +  set network type x.25
23981 +  if fail stop 1 Sorry - no X.25 support
23982 +  set host xxxxxxx ; Specify the X.25/X.121 address
23983 +  if fail stop 1 Can't open connection
23984 +
23985 +   And at this point the client can use the full range of client commands:
23986 +   SEND, GET, REMOTE xxx, FINISH, BYE.
23987 +
23988 +   The AIX version also adds two new variables:
23989 +
23990 +   \v(x25local_nua)
23991 +          The local X.25 address.
23992 +
23993 +   \v(x25remote_nua)
23994 +          The X.25 address of the host on the other end of the connection.
23995 +
23996 +   C-Kermit's AIX X.25 client has not been tested against anything other
23997 +   than a C-Kermit X.25 server on AIX. It is not known if it will
23998 +   interoperate with C-Kermit servers on Solaris, SunOS, or VOS.
23999 +
24000 +   To make an X.25 connection from AIX C-Kermit, you must:
24001 +
24002 +  set x25 call-user-data xxxx
24003 +
24004 +   where xxxx can be any even-length string of hexadecimal digits, e.g.
24005 +   123ABC.
24006 +
24007 +2.9.2. HP-UX X.25
24008 +
24009 +   Although C-Kermit presently does not include built-in support for HP-UX
24010 +   X.25, it can still be used to make X.25 connections as follows: start
24011 +   Kermit and tell it to:
24012 +
24013 +  set prefixing all
24014 +  set parity space
24015 +  pty padem address
24016 +
24017 +   This should work in HP-UX 9.00 and later (see [425]Section 2.7). If you
24018 +   have an earlier HP-UX version, or the PTY interface doesn't work or
24019 +   isn't available, try:
24020 +
24021 +  set prefixing all
24022 +  set parity space
24023 +  pipe padem address
24024 +
24025 +   Failing that, use Kermit to telnet to localhost and then after logging
24026 +   back in, start padem as you would normally do to connect over X.25.
24027 +
24028 +2.10. Additional Serial Port Controls
24029 +
24030 +   C-Kermit 7.0 adds the following commands for greater control over
24031 +   serial ports. These commands are available only in C-Kermit versions
24032 +   whose underlying operating systems provide the corresponding services
24033 +   (such as POSIX and UNIX System V), and even then their successful
24034 +   operation depends on the capabilities of the specific device and
24035 +   driver.
24036 +
24037 +   SET DISCONNECT { ON, OFF }
24038 +          On a SET LINE or SET PORT connection with SET CARRIER ON or
24039 +          AUTO, if the carrier signal drops during the connection,
24040 +          indicating that the connection has been lost, and C-Kermit
24041 +          notices it, this setting governs what happens next. With SET
24042 +          DISCONNECT OFF, which is consistent with previous behavior, and
24043 +          therefore the default, C-Kermit continues to keep the device
24044 +          open and allocated. With SET DISCONNECT ON, C-Kermit
24045 +          automatically closes and releases the device when it senses a
24046 +          carrier on-to-off transition, thus allowing others to use it.
24047 +          However, it remains the default device for i/o (DIAL, REDIAL,
24048 +          INPUT, SEND, CONNECT, etc), so if a subsequent i/o command is
24049 +          given, the device is reopened if it is still available. When it
24050 +          has been automatically closed in this manner, SHOW
24051 +          COMMUNICATIONS puts "(closed)" after its name, and in UNIX, the
24052 +          lockfile disappears -- both from SHOW COMM and from the lockfile
24053 +          directory itself. Synonym: SET CLOSE-ON-DISCONNECT.
24054 +
24055 +   SET EXIT ON-DISCONNECT { ON, OFF }
24056 +          Like DISCONNECT, but makes the program exit if a connection
24057 +          drops.
24058 +
24059 +   Note that SET CLOSE-ON-DISCONNECT and SET EXIT ON-DISCONNECT apply only
24060 +   to connections that drop; they do not apply to connections that can't
24061 +   be made in the first place. For example, they have no effect when a SET
24062 +   LINE, SET HOST, TELNET, or DIAL command fails.
24063 +
24064 +   HANGUP
24065 +          If [CLOSE-ON-]DISCONNECT is ON, and the HANGUP command is given
24066 +          on a serial device, and the carrier signal is no longer present
24067 +          after the HANGUP command, the device is closed and released.
24068 +
24069 +   SET PARITY HARDWARE { EVEN, ODD }
24070 +          Unlike SET PARITY { EVEN, ODD, MARK, SPACE }, which selects 7
24071 +          data bits plus the indicated kind of parity (to be done in
24072 +          software by Kermit itself), SET PARITY HARDWARE selects 8 data
24073 +          bits plus even or odd parity, to be done by the underlying
24074 +          hardware, operating system, or device driver. This command is
24075 +          effective only with a SET LINE or SET PORT device. That is, it
24076 +          has no effect in remote mode, nor on network connections. There
24077 +          is presently no method for selecting 8 data bits plus mark or
24078 +          space parity. If hardware parity is in effect, the variable
24079 +          \v(hwparity) is set to "even" or "odd". Note: some platforms
24080 +          might also support settings of SPACE, MARK, or NONE.
24081 +
24082 +   SET STOP-BITS { 1, 2 }
24083 +          This tells the number of 1-bits to insert after an outbound
24084 +          character's data and parity bits, to separate it from the next
24085 +          character. Normally 1. Choosing 2 stop bits should do no harm,
24086 +          but will slow down serial transmission by approximately 10
24087 +          percent. Historically, 2 stop bits were used with Teletypes (at
24088 +          110 bps or below) for print-head recovery time. There is
24089 +          presently no method for choosing any number of stop bits besides
24090 +          1 and 2.
24091 +
24092 +   SET SERIAL [ dps ]
24093 +          dps stands for Data-bits, Parity, Stop-bits. This is the
24094 +          notation familiar to many people for serial port configuration:
24095 +          7E1, 8N1, 7O2, etc. The data bits number also becomes the
24096 +          TERMINAL BYTESIZE setting. The second character is E for Even, O
24097 +          for Odd, M for Mark, S for Space, or N for None. The list of
24098 +          available options depends on the capabilities of the specific
24099 +          platform. If dps is omitted, 8N1 is used. Type "set serial ?"
24100 +          for a list of available choices. Examples:
24101 +
24102 +        SET SERIAL 7E1
24103 +                Equivalent to SET PARITY EVEN, SET STOP-BITS 1, SET TERM
24104 +                BYTE 7.
24105 +
24106 +        SET SERIAL 8N1
24107 +                Equivalent to SET PARITY NONE, SET STOP-BITS 1, SET TERM
24108 +                BYTE 8.
24109 +
24110 +        SET SERIAL 7E2
24111 +                Equivalent to SET PARITY EVEN and SET STOP-BITS 2, SET
24112 +                TERM BYTE 7.
24113 +
24114 +        SET SERIAL 8E2
24115 +                Same as SET PARITY HARDWARE EVEN, SET STOP-BITS 2, SET
24116 +                TERM BYTE 8.
24117 +
24118 +        SET SERIAL
24119 +                Same as SET PARITY NONE and SET STOP-BITS 1, SET TERM BYTE
24120 +                8.
24121 +
24122 +   Notes:
24123 +
24124 +     * The SET SERIAL xx2 options are available only in Kermit versions
24125 +       where the SET PARITY HARDWARE command is also available. (SHOW
24126 +       FEATURES includes "HWPARITY" in its options list.)
24127 +     * The SET SERIAL 7xx and 8N1 options affect the software parity
24128 +       setting, even for network connections.
24129 +     * As noted in the manual, selecting 8 data bits does not give you
24130 +       8-bit terminal sessions in CONNECT mode unless you also SET
24131 +       TERMINAL BYTESIZE 8. The default terminal bytesize remains 7, to
24132 +       protect against the situation where the remote host is generating
24133 +       parity but you don't know about it. If the terminal bytesize was 8
24134 +       by default and you CONNECTed to such a host, you would see only
24135 +       garbage on your screen.
24136 +     * If you do not give a SET STOP-BITS or SET SET SERIAL command,
24137 +       C-Kermit does not attempt to set the device's stop bits; instead,
24138 +       it uses whatever setting the device uses when not given explicit
24139 +       instructions about stop bits.
24140 +
24141 +   SHOW COMMUNICATIONS displays the current settings. Stop bits and
24142 +   hardware parity are shown only for SET PORT / SET LINE (serial)
24143 +   devices, since they do not apply to network connections or to remote
24144 +   mode. STOP-BITS is shown as "(default)" if you have not given an
24145 +   explicit SET STOP-BITS or SET SERIAL command.
24146 +
24147 +   The \v(serial) variable shows the SET SERIAL setting (8N1, 7E1, etc).
24148 +
24149 +2.11. Getting Access to the Dialout Device
24150 +
24151 +     This section is for UNIX only; note the special words about QNX at
24152 +     the end. Also see [426]Section 2.0 for SET LINE switches,
24153 +     particularly the /SHARE switch for VMS only.
24154 +
24155 +   C-Kermit does its best to obey the UUCP lockfile conventions of each
24156 +   platform (machine, operating system, OS version) where it runs, if that
24157 +   platform uses UUCP.
24158 +
24159 +   But simply obeying the conventions is often not good enough, due to the
24160 +   increasing likelihood that a particular serial device might have more
24161 +   than one name (e.g. /dev/tty00 and /dev/term/00 are the same device in
24162 +   Unixware 7; /dev/cua and /dev/cufa are the same device in NeXTSTEP),
24163 +   plus the increasingly widespread use of symlinks for device names, such
24164 +   as /dev/modem.
24165 +
24166 +   C-Kermit 7.0 goes to greater lengths than previous versions to
24167 +   successfully interlock with other communications program (and other
24168 +   instances of Kermit itself); for example, by:
24169 +
24170 +     * Creation of dual lockfiles whenever a symlink is used; one for the
24171 +       link name and one for the real name.
24172 +     * Creation of dual lockfiles in HP-UX according to HP rules.
24173 +     * Creation of dual uppercase/lowercase lockfile names in SCO
24174 +       UNIX/ODT/OSR5.
24175 +     * The use of ttylock() in versions of AIX where it works.
24176 +     * The use, wherever possible, of lockfile names based on
24177 +       inode/major/minor device number rather than device name.
24178 +
24179 +   See the [427]ckuins.txt and [428]ckubwr.txt files for details.
24180 +
24181 +   QNX is almost unique among UNIX varieties in having no UUCP programs
24182 +   nor UUCP-oriented dialout-device locking conventions. QNX does,
24183 +   however, allow a program to get the device open count. This can not be
24184 +   a reliable form of locking unless all applications do it (and they
24185 +   don't), so by default, Kermit uses this information only for printing a
24186 +   warning message such as:
24187 +
24188 +  C-Kermit>set line /dev/ser1
24189 +  WARNING - "/dev/ser1" looks busy...
24190 +
24191 +   However, if you want to use it as a lock, you can do so with:
24192 +
24193 +  SET QNX-PORT-LOCK { ON, OFF }
24194 +
24195 +   QNX-PORT-LOCK is OFF by default; if you set in ON, C-Kermit fails to
24196 +   open any dialout device when its open count indicates that another
24197 +   process has it open. SHOW COMM (in QNX only) displays the setting, and
24198 +   if you have a port open, it also shows the current open count (with
24199 +   C-Kermit's own access always counting as 1).
24200 +
24201 +2.12. The Connection Log
24202 +
24203 +   C-Kermit 7.0 adds the ability to log connections, so you can see where
24204 +   you've been and have a record of calls you've made. A connection is
24205 +   defined as any communications session that is begun by SET LINE, SET
24206 +   PORT, DIAL, SET HOST, TELNET, or RLOGIN. Connections are not logged
24207 +   unless you request it; the command is:
24208 +
24209 +   LOG CX [ filename [ { NEW, APPEND } ] ]
24210 +          Enables logging of connections in the given file. If the
24211 +          trailing { NEW, APPEND } keyword is omitted, the file is opened
24212 +          for appending; i.e. new records are written to the end. If NEW
24213 +          is specified, a new file is created; if a file of the same name
24214 +          already existed, it is overwritten. If the filename is omitted,
24215 +          CX.LOG in your home (login) directory is used (note: uppercase).
24216 +          To accept all defaults, just use "log connections" (or "l c" for
24217 +          short). Synonym: LOG CONNECTIONS.
24218 +
24219 +   CLOSE CX-LOG
24220 +          This closes the connection log if it was open. (Note, the CLOSE
24221 +          CONNECTION command closes the connection itself).
24222 +
24223 +   SHOW CX
24224 +          This shows your current connection, if any, including the
24225 +          elapsed time (since you opened it). Synonym: SHOW CONNECTION.
24226 +
24227 +   \v(cx_time)
24228 +          This variable shows the elapsed time of your current connection,
24229 +          or if there is no current connection, of your most recent
24230 +          connection, of if there have been no connections, 0.
24231 +
24232 +   The connection contains one line per connection, of the form:
24233 +
24234 +  yyyymmdd hh:mm:ss username pid p=v [ p=v [ ... ] ]
24235 +
24236 +   where the timestamp (in columns 1-18) shows when the connection was
24237 +   made; username is the login identity of the person who made the
24238 +   connection; pid is Kermit's process ID when it made the connection. The
24239 +   p's are parameters that depend on the type of connection, and the v's
24240 +   are their values:
24241 +
24242 +  T = Connection Type (TCP, SERIAL, DIAL, DECNET, etc).
24243 +  H = The name of the Host from which the connection was made.
24244 +  N = Destination phone Number or Network host name or address.
24245 +  D = Serial connections only: Device name.
24246 +  O = Dialed calls only: Originating country code & area code if known.
24247 +  E = Elapsed time in hh:mm:ss format (or hhh:mm:ss, etc).
24248 +
24249 +   If you always want to keep a connection log, simply add:
24250 +
24251 +  log connections
24252 +
24253 +   to your C-Kermit customization file. Note, however, that if you make a
24254 +   lot of connections, your CX.LOG will grow and grow. You can handle this
24255 +   by adding a "logrotate" procedure like the following to your
24256 +   customization file, before the "log connections" command:
24257 +
24258 +  define LOGROTATE {                    ; Define LOGROTATE macro
24259 +      local \%i \%m \%d \%n \%f MAX
24260 +      def MAX 4                         ; How many months to keep
24261 +      if not def \%1 -                  ; No argument given
24262 +        end 1 \%0: No filename given
24263 +      if not = 1 \ffiles(\%1) -         ; Exactly 1 file must match
24264 +        end 1 \%0: \%1 - File not found
24265 +      .\%d := \fsubstr(\fdate(\%1),1,6) ; Arg OK - get file year & month
24266 +      if = \%d -                        ; Compare file year & month
24267 +        \fsubstr(\v(ndate),1,6) -       ; with current year & month
24268 +          end 0                         ; Same year & month - done
24269 +      rename \%1 \%1.\%d                ; Different - rename file
24270 +      .\%n := \ffiles(\%1.*)            ; How many old files
24271 +      if < \%n \m(MAX) end 0            ; Not enough to rotate
24272 +      .\%m := \%1.999999                ; Initial compare string
24273 +      for \%i 1 \%n 1 {                 ; Loop thru old logs
24274 +         .\%f := \fnextfile()           ; Get next file name
24275 +         if llt \%f \%m .\%m := \%f     ; If this one older remember it
24276 +      }
24277 +      delete \%m                        ; Delete the oldest one
24278 +  }
24279 +  log connections                       ; Now open the (possibly new) log
24280 +  logrotate \v(home)CX.LOG              ; Run the LOGROTATE macro
24281 +
24282 +   As you can see, this compares the yyyymm portion of the modification
24283 +   date (\fdate()) of the given file (\%1) with the current yyyymm. If
24284 +   they differ, the current file has the yyyymm suffix (from its most
24285 +   recent modification date) appended to its name. Then we search through
24286 +   all other such files, find the oldest one, and delete it. Thus the
24287 +   current log, plus the logs from the most recent four months, are kept.
24288 +   This is all done automatically every time you start C-Kermit.
24289 +
24290 +   On multiuser systems, it is possible to keep a single, shared,
24291 +   system-wide connection log, but this is not recommended since (a) it
24292 +   requires you keep a publicly write-accessible logfile (a glaring target
24293 +   for mischief), and (b) it would require each user to log to that file
24294 +   and not disable logging. A better method for logging connections, in
24295 +   UNIX at least, is syslogging (see [429]ckuins.txt Section 15 and
24296 +   [430]Section 4.2 of the [431]IKSD Administration Guide for details).
24297 +
24298 +2.13. Automatic Connection-Specific Flow Control Selection
24299 +
24300 +   Beginning in C-Kermit 7.0, the appropriate flow-control method for each
24301 +   connection type is kept in a table, for example:
24302 +
24303 +  Remote:           NONE
24304 +  Modem:            RTS/CTS
24305 +  Direct-Serial:    NONE
24306 +  TCPIP:            NONE
24307 +
24308 +   The size of the table and values for each connection type can vary from
24309 +   platform to platform. Type "set flow ?" for a list of available
24310 +   flow-control types.
24311 +
24312 +   The table is used to automatically select the appropriate kind of flow
24313 +   control whenever you make a connection. You can display the table with:
24314 +
24315 +  SHOW FLOW-CONTROL
24316 +
24317 +   The defaults are as follows:
24318 +
24319 +   Remote:
24320 +          NONE or XON/XOFF. This is because C-Kermit is not allowed to
24321 +          find out what type of connection the incoming user has (*). No
24322 +          kind of flow control will work on every kind of connection,
24323 +          including (unexpectedly) KEEP, which we would have liked to use,
24324 +          but not turning off flow control at the remote end during file
24325 +          transfer on TCP/IP connections is fatal to the transfer (except
24326 +          in VMS and HP-UX, where it must be set to Xon/Xoff!) Therefore
24327 +          if you are dialing in to a serial port on a server (UNIX or VMS)
24328 +          where C-Kermit is running, you will need to tell C-Kermit to
24329 +          "set flow keep" before transferring files (assuming the modem
24330 +          and port are configured correctly by the system administrator;
24331 +          otherwise you'll need to give a specific kind of flow control,
24332 +          e.g. "set flow xon/xoff"), so in this case C-Kermit will not
24333 +          disable flow control, as it must do when you are coming via
24334 +          Telnet (directly or through a terminal server, except on VMS and
24335 +          HP-UX).
24336 +
24337 +   Modem:
24338 +          This applies when you dial out with a modem. In this case, the
24339 +          MODEM FLOW-CONTROL setting takes affect after the SET FLOW
24340 +          setting, so it can pick the most appropriate flow control for
24341 +          the combination of the particular modem and the
24342 +          computer/port/driver that is dialing.
24343 +
24344 +   Direct-Serial:
24345 +          The default here is NONE because C-Kermit has no way of knowing
24346 +          what kind of flow control, if any, is or can be done by the
24347 +          device at the other end of the connection. RTS/CTS would be a
24348 +          bad choice here, because if the CTS signal is not asserted, the
24349 +          connection will hang. And since direct connections are often
24350 +          made with 3-wire cables, there is a good chance the CTS signal
24351 +          will not be received.
24352 +
24353 +   TCPIP:
24354 +          NONE, since TCP and IP provide their own flow control
24355 +          transparently to the application, except in VMS, where Xon/Xoff
24356 +          is the default due to the requirements of the VMS TCP/IP
24357 +          products.
24358 +
24359 +   Other networks:
24360 +          NONE, since networks should provide their flow control
24361 +          transparently to the application.
24362 +
24363 +   (*) This is possibly the worst feature of UNIX, VMS, and other
24364 +   platforms where C-Kermit runs. If C-Kermit was able to ask the
24365 +   operating system what kind of connection it had to the user, it could
24366 +   set up many things for you automatically.
24367 +
24368 +   You can modify the default-flow-control table with:
24369 +
24370 +  SET FLOW-CONTROL /xxx { NONE, KEEP, RTS/CTS, XON/XOFF, ... }
24371 +
24372 +   where "xxx" is the connection type, e.g.
24373 +
24374 +  SET FLOW /REMOTE NONE
24375 +  SET FLOW /DIRECT RTS/CTS
24376 +
24377 +   If you leave out the switch, SET FLOW works as before, choosing the
24378 +   flow control method to be used on the current connection:
24379 +
24380 +  SET FLOW XON/XOFF
24381 +
24382 +   Thus, whenever you make a connection with SET PORT, SET LINE, DIAL, SET
24383 +   HOST, TELNET, RLOGIN, etc, an appropriate form of flow control is
24384 +   selected automatically. You can override the automatic selection with a
24385 +   subsequent SET FLOW command, such as SET FLOW NONE (no switch
24386 +   included).
24387 +
24388 +   The flow control is changed automatically too when you give a SET MODEM
24389 +   TYPE command. For example, suppose your operating system (say Linux)
24390 +   supports hardware flow control (RTS/CTS). Now suppose you give the
24391 +   following commands:
24392 +
24393 +  set line /dev/ttyS2    ; Automatically sets flow to NONE
24394 +  set modem type usr     ; Automatically sets flow to RTS/CTS
24395 +  set modem type rolm    ; Doesn't support RTS/CTS so now flow is XON/XOFF
24396 +
24397 +   IMPORTANT: This new feature tends to make the order of SET LINE/HOST
24398 +   and SET FLOW commands matter, where it didn't before. For example, in
24399 +   VMS:
24400 +
24401 +  SET FLOW KEEP
24402 +  SET LINE TTA0:
24403 +
24404 +   the SET LINE undoes the SET FLOW KEEP command; the sequence now must
24405 +   be:
24406 +
24407 +  SET FLOW /DIRECT KEEP
24408 +  SET LINE TTA0:
24409 +
24410 +   or:
24411 +
24412 +  SET LINE TTA0:
24413 +  SET FLOW KEEP
24414 +
24415 +2.14. Trapping Connection Establishment and Loss
24416 +
24417 +   If you define a macro called ON_OPEN, it is executed any time that a
24418 +   SET LINE, SET PORT, SET HOST, TELNET, RLOGIN or similar command
24419 +   succeeds in opening a connection. The argument is the host or device
24420 +   name (as shown by SHOW COMMUNICATIONS, and the same as \v(line)). This
24421 +   macro can be used for all sorts of things, like automatically setting
24422 +   connection- or host-specific parameters when the connection is opened.
24423 +   Example:
24424 +
24425 +  def ON_OPEN {
24426 +      switch \%1 {
24427 +        :abccorp.com, set reliable off, break
24428 +        :xyzcorp.com, set receive packet-length 1000, break
24429 +        etc etc...
24430 +      }
24431 +  }
24432 +
24433 +   If you define a macro called ON_CLOSE, it will be executed any time
24434 +   that a SET LINE, SET PORT, SET HOST, TELNET, RLOGIN or any other kind
24435 +   of connection that C-Kermit has made is closed, either by the remote or
24436 +   by a local CLOSE, HANGUP, or EXIT command or other local action, such
24437 +   as when a new connection is opened before an old one was explicitly
24438 +   closed.
24439 +
24440 +   As soon as C-Kermit notices the connection has been closed, the
24441 +   ON_CLOSE macro is invoked at (a) the top of the command parsing loop,
24442 +   or (b) when a connection is closed implicitly by a command such as SET
24443 +   LINE that closes any open connection prior to making a new connection,
24444 +   or (c) when C-Kermit closes an open connection in the act of exiting.
24445 +
24446 +   The ON_CLOSE macro was inspired by the neverending quest to unite
24447 +   Kermit and SSH. In this case using the "tunnel" mechanism:
24448 +
24449 +  def TUNNEL {                                ; \%1 = host to tunnel to
24450 +      local \%p
24451 +      if not def \%1 stop 1
24452 +      assign tunnelhost \%1                   ; Make global copy
24453 +      undef on_close
24454 +      set macro error off
24455 +      close connection                        ; Ignore any error
24456 +      open !read tunnel start \%1
24457 +      read \%p                                ; Get port number
24458 +      if fail stop 1 Tunnel failure: \%1
24459 +      close read
24460 +      if fail stop 1 Tunnel failure: \%1      ; See [432]Section 4.2.8.1
24461 +      assign on_close {                       ; Set up close handler
24462 +          echo Closing tunnel: \m(tunnelhost)
24463 +          !tunnel stop \m(tunnelhost)
24464 +          undef on_close
24465 +      }
24466 +      set host localhost:\%p /telnet
24467 +      if success end 0
24468 +      undef on_close
24469 +      stop 1 Connection failure: \%1
24470 +  }
24471 +
24472 +   In this case, when the connection stops, we also need to shut down the
24473 +   tunnel, even if it is at a later time after TUNNEL has finished
24474 +   executing. This way we can escape back, reconnect, transfer files, and
24475 +   so on until the connection is broken by logging out from the remote, or
24476 +   by explicitly closing it, or by EXITing from C-Kermit, at which time
24477 +   the tunnel is shut down.
24478 +
24479 +   When the connection is closed, no matter how, the ON_CLOSE macro
24480 +   executes and then undefines (destroys) itself, since we don't want to
24481 +   be closing tunnels in the future when we close subsequent connections.
24482 +
24483 +   Other such tricks can be imagined, including ending ON_CLOSE with a
24484 +   STOP command to force the command stack to be peeled all the way back
24485 +   to the top, for example in a deeply nested script that depends on the
24486 +   connection being open:
24487 +
24488 +  def on_close { stop 1 CONNECTION LOST }
24489 +
24490 +   When C-Kermit invokes the ON_CLOSE macro, it supplies one argument
24491 +   (\%1): the reason the connection was closed as a number, one of the
24492 +   following:
24493 +
24494 +  2 - Fatal failure to negotiate a required item on a network connection.
24495 +  1 - Closed by C-Kermit command.
24496 +  0 - All others (normally closed by remote).
24497 +
24498 +   which may be used for any purpose; for example, to add a comment to the
24499 +   connection log:
24500 +
24501 +  def on_close {
24502 +      local \%m
24503 +      if not open cx end 0
24504 +      switch \%1 {
24505 +        :0, .\%m = Closed by remote, break
24506 +        :1, .\%m = Closed by me, break
24507 +        :2, .\%m = Network protocol negotiation failure, break
24508 +      }
24509 +      if def \%m writeln cx {# \%m}
24510 +  }
24511 +
24512 +2.15. Contacting Web Servers with the HTTP Command
24513 +
24514 +   C-Kermit 7.0 (at this writing, the UNIX version only) supports direct
24515 +   contact and interaction with Web servers via HTTP 1.0 protocol. To make
24516 +   a connection, use Kermit's normal method for making a TCP/IP
24517 +   connection, but specify the HTTP port:
24518 +
24519 +  SET HOST host http [ switches ]
24520 +
24521 +   where host is the IP hostname or address, and http is the name of the
24522 +   TCP port for the Web server. Relevant switches include:
24523 +
24524 +   /RAW
24525 +          Treat the connection as a transparent binary pipe. This switch
24526 +          may be required if a port other than 'http' is used.
24527 +
24528 +   /SSL
24529 +          Make an secure private connection with SSL (only if SSL support
24530 +          is included in your version of Kermit). In this case the port
24531 +          name might need to be https rather than http, e.g. "set host
24532 +          secureserver.xyxcorp.com https /ssl".
24533 +
24534 +   /TLS
24535 +          Make an secure private connection with TLS (only if TLS support
24536 +          is included in your version of Kermit). In this case the port
24537 +          name would be https rather than http.
24538 +
24539 +   Then you can issue an HTTP command. In most cases, the server closes
24540 +   the connection when the command is complete. Example:
24541 +
24542 +  SET HOST www.columbia.edu http
24543 +  IF FAIL EXIT 1 Can't contact server
24544 +  HTTP GET kermit/index.html
24545 +
24546 +   At this point the connection is closed, since that's how HTTP 1.0
24547 +   works. If you want to perform additional operations, you must establish
24548 +   a new connection with another SET HOST command.
24549 +
24550 +   The HTTP command acts as a client to the Web server, except instead of
24551 +   displaying the results like a Web browser would, it stores them. Any
24552 +   HTTP command can (but need not) include any or all of the following
24553 +   switches:
24554 +
24555 +   /AGENT:user-agent
24556 +          Identifies the client to the server; "C-Kermit" or "Kermit-95"
24557 +          by default.
24558 +
24559 +   /HEADER:header-line
24560 +          Used for specifying any optional headers. A list of headers is
24561 +          provided using braces for grouping:
24562 +
24563 +  /HEADER:{{tag:value}{tag:value}...}
24564 +
24565 +          For a listing of valid tag value and value formats see [433]RFC
24566 +          1945: Hypertext Transfer Protocol -- HTTP/1.0. A maximum of
24567 +          eight headers may be specified.
24568 +
24569 +   /USER:name
24570 +          In case a page requires a username for access.
24571 +
24572 +   /PASSWORD:password
24573 +          In case a page requires a password for access.
24574 +
24575 +   /ARRAY:arrayname
24576 +          Tells Kermit to store the response headers in the given array,
24577 +          one line per element. The array need not be declared in advance.
24578 +          Example:
24579 +
24580 +  C-Kermit? http /array:c get kermit/index.html
24581 +  C-Kermit? show array c
24582 +  Dimension = 9
24583 +  1. Date: Fri, 26 Nov 1999 23:12:22 GMT
24584 +  2. Server: Apache/1.3.4 (Unix)
24585 +  3. Last-Modified: Mon, 06 Sep 1999 22:35:58 GMT
24586 +  4. ETag: "bc049-f72-37d441ce"
24587 +  5. Accept-Ranges: bytes
24588 +  6. Content-Length: 3954
24589 +  7. Connection: close
24590 +  8. Content-Type: text/html
24591 +
24592 +   As you can see, the header lines are like MIME e-mail header lines:
24593 +   identifier, colon, value. The /ARRAY switch is the only method
24594 +   available to a script to process the server responses for a POST or PUT
24595 +   command.
24596 +
24597 +   The HTTP commands are:
24598 +
24599 +   HTTP [ switches ] GET remote-filename [ local-filename ]
24600 +          Retrieves the named file. If a local-filename is given, the file
24601 +          is stored locally under that name; otherwise it is stored with
24602 +          its own name.
24603 +
24604 +   HTTP [ switches ] HEAD remote-filename local-filename
24605 +          Like GET except without actually getting the file; instead it
24606 +          gets only the headers, storing them into the given file, whose
24607 +          name must be given, one line per header item, as shown above in
24608 +          the /ARRAY: switch description.
24609 +
24610 +   HTTP [ switches ] INDEX remote-directory [ local-filename ]
24611 +          Retrieves the file listing for the given server directory. NOTE:
24612 +          This command is not supported by most Web servers.
24613 +
24614 +   HTTP [ switches ] POST [ /MIME-TYPE:type ] local-file remote-file
24615 +          Used to send a response as if it were sent from a form. The data
24616 +          to be posted must be read from a file.
24617 +
24618 +   HTTP [ switches ] PUT [ /MIME-TYPE:type ] local-file remote-file
24619 +          Uploads a local file to a server file.
24620 +
24621 +   HTTP [ switches ] DELETE remote-filename
24622 +          Instructs the server to delete the specified filename.
24623 +
24624 +3. TERMINAL CONNECTION
24625 +
24626 +3.1. CONNECT Command Switches
24627 +
24628 +   The following switches (see [434]Section 1.5) were added to the CONNECT
24629 +   command in 7.0:
24630 +
24631 +   /QUIETLY
24632 +          Don't print the "Connecting to..." or "Back at..." messages. CQ
24633 +          is an invisible command synonym for CONNECT /QUIETLY.
24634 +
24635 +   /TRIGGER:string
24636 +          Specify a trigger or triggers ([435]Section 3.2) effective for
24637 +          this CONNECT command only, temporarily overriding any current
24638 +          SET TERMINAL TRIGGER values ([436]Section 3.2).
24639 +
24640 +   Note: Other switches might also be available; type "connect ?" for a
24641 +   list, "help connect" for a description of each.
24642 +
24643 +3.2. Triggers
24644 +
24645 +   Triggers were added for UNIX, VMS, AOS/VS, and K95 in C-Kermit 7.0.
24646 +
24647 +   SET TERMINAL TRIGGER string
24648 +          Tells C-Kermit to look for the given string during all
24649 +          subsequent CONNECT sessions, and if seen, to return to command
24650 +          mode automatically, as if you had escaped back manually. If the
24651 +          string includes any spaces, you must enclose it in braces.
24652 +          Example:
24653 +
24654 +  set terminal trigger {NO CARRIER}
24655 +
24656 +   Comparisons are made after character-set translation.
24657 +
24658 +   If a string is to include a literal brace character, precede it with a
24659 +   backslash:
24660 +
24661 +  ; My modem always makes this noise when the connection is lost:
24662 +  set terminal trigger |||ppp\{\{\{\{UUUUUUU
24663 +
24664 +   If you want Kermit to look for more than one string simultaneously, use
24665 +   the following syntax:
24666 +
24667 +  set terminal trigger {{string1}{string2}...{stringn}}
24668 +
24669 +   In this case, C-Kermit will return to command mode automatically if any
24670 +   of the given strings is encountered. Up to 8 strings may be specified.
24671 +
24672 +   If the most recent return to command mode was caused by a trigger, the
24673 +   new variable, \v(trigger), shows the trigger value; otherwise
24674 +   \v(trigger) is empty.
24675 +
24676 +   The SHOW TRIGGER command displays the SET TERMINAL TRIGGER values as
24677 +   well as the \v(trigger) value.
24678 +
24679 +3.3. Transparent Printing
24680 +
24681 +   As noted in the manual, C-Kermit's CONNECT command on UNIX is not a
24682 +   terminal emulator, but rather a "semitransparent pipe" between the
24683 +   terminal or emulator you are using to access C-Kermit, and the remote
24684 +   host to which C-Kermit is connected. The "semitransparent" qualifier is
24685 +   because of character-set translation as well as several actions taken
24686 +   by the emulator in response to the characters or strings that pass
24687 +   through it, such as APCs, Kermit packets (autodownload), triggers, etc.
24688 +
24689 +   The UNIX version of C-Kermit 7.0 adds another such action: Transparent
24690 +   printing, also called Controller printing (as distinct from Autoprint
24691 +   or line or screen print). It is intended mainly for use on UNIX
24692 +   workstation consoles (as opposed to remote logins), but with some care
24693 +   can also be used when accessing C-Kermit remotely.
24694 +
24695 +   Transparent printing is related to APC by sharing C-Kermit's built-in
24696 +   ANSI escape-sequence parser to detect "printer on" and "printer off"
24697 +   sequences from the host. When the printer-on sequence is received, all
24698 +   subsequent arriving characters -- including NUL, control characters,
24699 +   and escape sequences -- are sent to the SET PRINTER device instead of
24700 +   to your screen until the printer-off sequence is received, or you
24701 +   escape back, whichever happens first. These bytes are not translated or
24702 +   modified or filtered in any way by Kermit (except for possibly
24703 +   stripping of the 8th bit, as noted below), but if filtering or
24704 +   translation is desired, this can be accomplished by your SET PRINTER
24705 +   selection (e.g. by choosing a pipeline of filters).
24706 +
24707 +   By default, your SET PRINTER device is your default UNIX printer, but
24708 +   it can also be a file, a command, or the null device (which causes all
24709 +   printer material to be discarded). See [437]Using C-Kermit, 2nd Ed.,
24710 +   p.41 for details.
24711 +
24712 +   Transparent printing is controlled by the command:
24713 +
24714 +   SET TERMINAL PRINT { ON, OFF }
24715 +          When ON, transparent-print sequences are obeyed, and printing
24716 +          occurs on the system where C-Kermit is running. When OFF,
24717 +          transparent print sequences are ignored and passed through to
24718 +          your actual terminal or emulator, along with the data they
24719 +          enclose. OFF is the default, for compatibility with earlier
24720 +          C-Kermit releases. As noted in the manual, when the current SET
24721 +          PRINTER device is a file, transparent-print material is appended
24722 +          to it; the file is not overwritten.
24723 +
24724 +   SET TERMINAL BYTESIZE { 7, 8 }
24725 +   SET PARITY { EVEN, ODD, MARK, SPACE, NONE }
24726 +          If the terminal bytesize is 7, or PARITY is not NONE, the 8th
24727 +          bit of each byte is stripped prior to printing.
24728 +
24729 +   The transparent-print escape sequences are:
24730 +
24731 +   <ESC>[5i
24732 +          Printer On. Send all subsequent incoming bytes to the printer
24733 +          without any kind of filtering, translation, or alteration. Note:
24734 +          <ESC> stands for ASCII character number 27 (decimal), Escape.
24735 +
24736 +   <ESC>[4i
24737 +          Printer Off. Resume displaying incoming bytes on the screen.
24738 +
24739 +   These are the same sequences used by DEC VT100 and higher terminals and
24740 +   other ANSI X3.64 and ISO 6429 compatible terminals. There is no
24741 +   provision for selecting other printer-control sequences.
24742 +
24743 +   Restrictions:
24744 +
24745 +    1. You must SET TERM TRANSPARENT-PRINT ON before you can use this
24746 +       feature.
24747 +    2. Only the 7-bit forms of the escape sequences are supported. The
24748 +       8-bit CSI C1 control is not recognized.
24749 +    3. Autoprint is not supported, since this requires a full-fledged
24750 +       terminal emulator with direct access to the screen.
24751 +    4. The start-print and stop-print sequences pass through to the screen
24752 +       (there is no way to avoid this without causing unacceptable delays
24753 +       or deadlocks in CONNECT mode). Thus if your terminal or emulator
24754 +       also supports transparent printing via these same sequences, an
24755 +       empty file will be sent to its printer. Normally this has no
24756 +       effect.
24757 +
24758 +   Point (4) is similar to the situation with autodownload and APC -- when
24759 +   you have several Kermit clients in a chain, you should take care that
24760 +   these features are enabled in only one of them.
24761 +
24762 +   Example 1:
24763 +
24764 +  set printer {|lpr -Plaser}  ; Specify the printer (if not default).
24765 +  set term print on           ; Enable transparent printing.
24766 +  set term byte 8             ; Enable 8-bit characters.
24767 +  connect                     ; Enter CONNECT mode.
24768 +
24769 +   Example 2:
24770 +
24771 +  set printer /home/users/olga/printer.log  ; Send printer material to a file.
24772 +
24773 +   Example 3:
24774 +
24775 +  set printer {| grep -v ^Received | lpr}   ; Filter out some lines
24776 +
24777 +   Then use "pcprint" or "vtprint" commands on the host to initiate
24778 +   transparent print operations. See [438]Using C-Kermit, 2nd Ed., p.406
24779 +   for details.
24780 +
24781 +   Here is a sample "pcprint" shell script for UNIX:
24782 +
24783 +  #!/bin/sh
24784 +  echo -n '<ESC>[5i'
24785 +  if [ $# -eq 0 ]; then
24786 +    cat
24787 +  else
24788 +    cat $*
24789 +  fi
24790 +  echo -n '<FF><ESC>[4i'
24791 +  # (end)
24792 +
24793 +   (Replace "<ESC>" by the actual ASCII Escape character and "<FF>" by the
24794 +   ASCII Formfeed character).
24795 +
24796 +   If you always want transparent printing enabled, put "set term print
24797 +   on" in your C-Kermit customization file (~/.mykermrc in UNIX). The "set
24798 +   term bytesize" selection, however, is a property of each separate
24799 +   connection.
24800 +
24801 +3.4. Binary and Text Session Logs
24802 +
24803 +   C-Kermit 7.0 corrects an oversight in earlier releases, in which binary
24804 +   session logs (SET SESSION-LOG BINARY) translated character sets and
24805 +   performed various formatting transformations (e.g. "newline mode")
24806 +   before writing characters to the session log. In C-Kermit 7.0,
24807 +   binary-mode session logging writes characters as they come in, before
24808 +   anything (other that parity-bit stripping) is done to them. Text-mode
24809 +   session logging records the characters after processing.
24810 +
24811 +4. FILE TRANSFER
24812 +
24813 +   Every file is transferred either in text mode (which implies
24814 +   record-format and character-set translation) or binary mode (in which
24815 +   each byte is sent literally without any kind of conversion). The mode
24816 +   in which a file is transferred is controlled by (a) the default mode,
24817 +   in the absence of any other indications; (b) the SET FILE TYPE command;
24818 +   (c) various automatic mechanisms based on client/server negotiations,
24819 +   directory information or filename patterns, etc.
24820 +
24821 +   The default FILE TYPE was changed from TEXT to BINARY in C-Kermit 7.0
24822 +   because:
24823 +
24824 +     * Transferring a text file in binary mode does less damage than
24825 +       transferring a binary file in text mode.
24826 +     * Only binary-mode transfers can be recovered from the point of
24827 +       failure.
24828 +     * The automatic transfer-mode mechanisms switch to text mode on a
24829 +       per-file basis anyway, so only those files that are not covered by
24830 +       the automatic mechanisms are affected.
24831 +     * All file transfers on the Web are done in binary mode, so people
24832 +       are accustomed to it and expect it.
24833 +
24834 +4.0. BUG FIXES, MINOR CHANGES, AND CLARIFICATIONS
24835 +
24836 +4.0.0. Filenames with Spaces
24837 +
24838 +   Filenames that contain spaces are a major nuisance to a program like
24839 +   Kermit, whose command language is line- and word-oriented, in which
24840 +   words are separated by spaces and a filename is assumed to be a "word".
24841 +   In general (unless noted otherwise in the description of a particular
24842 +   command), there is only one way to refer to such files in Kermit
24843 +   commands, and that is to enclose the name in braces:
24844 +
24845 +  send {this file}
24846 +
24847 +   Tells Kermit to send the file whose name is "this file" (two words, no
24848 +   quotes). Of course, various circumlocutions are also possible, such as:
24849 +
24850 +  define \%a this file
24851 +  send \%a
24852 +
24853 +   BUT, perhaps contrary to expectation, you can't use "\32" to represent
24854 +   the space:
24855 +
24856 +  send this\32file
24857 +
24858 +   does not work. Why? Because the Kermit parser, which must work on many
24859 +   operating systems including Windows, has no way of knowing what you
24860 +   mean by "this\32file". Do you mean a file whose name is "this file" in
24861 +   the current directory? Or do you mean a file whose name is "32file" in
24862 +   the "this" subdirectory of the current directory? Guessing won't do
24863 +   here; Kermit must behave consistently and deterministically in all
24864 +   cases on all platforms.
24865 +
24866 +   Note that you can't use Esc or Tab within {...} for filename
24867 +   completion, or question mark to get a filename list. However, you can
24868 +   include wildcards; for example:
24869 +
24870 +  send {* *}
24871 +
24872 +   sends all files whose name contains a space.
24873 +
24874 +   All things considered, it is best to avoid spaces in file and directory
24875 +   names if you can. Also see [439]Section 5.4 on this topic.
24876 +
24877 +4.0.1. Packet out of Window
24878 +
24879 +   C-Kermit 6.0 could send packets "out of window" if the window size was
24880 +   greater than 1 and ACKs had arrived out of order. Fixed in 6.1.
24881 +
24882 +4.0.2. MOVE after ADD SEND-LIST
24883 +
24884 +   ADD SEND-LIST followed by MOVE did not delete original files; fixed in
24885 +   6.1. Carrier loss was not detected during transfer; in 7.0 C-Kermit
24886 +   checks for this (but results can not be guaranteed). In any case, the
24887 +   protocol will eventually time out if the connection is lost.
24888 +
24889 +4.0.3. GET and RECEIVE As-Names
24890 +
24891 +   In 5A(190) through 6.0.192, the GET and RECEIVE as-name did not
24892 +   properly override the RECEIVE PATHNAMES setting. In 7.0 it does.
24893 +
24894 +4.0.4. New Brief Statistics Listing
24895 +
24896 +   Version 7.0 adds a /BRIEF switch to the STATISTICS command, to display
24897 +   a short file-transfer statistics report. /BRIEF is now the default. Use
24898 +   /VERBOSE to see the full display, which is about 25 lines long.
24899 +
24900 +4.0.5. Improved FAST Command
24901 +
24902 +   The preinstalled definition of the FAST macro did not take enough
24903 +   factors into account. Now it sets packet lengths and window sizes
24904 +   appropriate to the configuration. Furthermore, in IRIX only, it might
24905 +   restrict the SEND packet length to 4000, to work around a bug in the
24906 +   IRIX Telnet server, depending on the IRIX version (see [440]ckubwr.txt,
24907 +   IRIX section). To see the built-in definition of the FAST macro, type
24908 +   "show macro fast". To change it, simply define it to be whatever you
24909 +   want -- it's just a macro, like any other.
24910 +
24911 +4.0.6. The SET SEND BACKUP Command
24912 +
24913 +   Version 7.0 adds SET SEND BACKUP { ON, OFF }. This tells whether backup
24914 +   files should be sent. Backup files are the ones created by Kermit (and
24915 +   EMACS, and possibly other applications) to preserve old copies of files
24916 +   when creating new ones with the same name. Kermit does this when
24917 +   receiving a file and its FILE COLLISION setting is BACKUP (or RENAME,
24918 +   in which case it the new file gets the backup name). On most platforms,
24919 +   the backup name is formed by adding:
24920 +
24921 +  .~n~
24922 +
24923 +   to the end of the filename, where "n" is a number. For example, if the
24924 +   original file is oofa.txt, a backup file might be called:
24925 +
24926 +  oofa.txt.~1~
24927 +
24928 +   (or oofa.txt.~2~, etc). If you SET SEND BACKUP OFF, this tells Kermit
24929 +   not to send files that have backup names. Normally, SET SEND BACKUP is
24930 +   ON (as shown by SHOW PROTOCOL), and backup files are sent if their
24931 +   names match the SEND file specification.
24932 +
24933 +   Also see PURGE, SET FILE COLLISION, SEND /NOBACKUP, DIRECTORY
24934 +   /[NO]BACKUP.
24935 +
24936 +4.0.7. The SET { SEND, RECEIVE } VERSION-NUMBERS Command
24937 +
24938 +   VMS Only. Normally when sending files, VMS C-Kermit strips the version
24939 +   number. For example, if the file is FOO.BAR;34, the name is sent as
24940 +   FOO.BAR (without the ";34"). If you want to keep version numbers on
24941 +   when sending files, use SET SEND VERSION-NUMBERS ON. The effect depends
24942 +   on the receiver.
24943 +
24944 +   Normally when receiving files, and an incoming filename includes a
24945 +   VMS-style version number (such as FOO.BAR;34) VMS C-Kermit strips it
24946 +   before trying to create the new file; this way the new file receives
24947 +   the next highest version number in the customary manner for VMS. If you
24948 +   want version numbers on incoming filenames to be used in creating the
24949 +   new files, use SET RECEIVE VERSION-NUMBERS ON.
24950 +
24951 +   Normally these commands would be effective only when VMS C-Kermit is
24952 +   exchanging files with a non-VMS Kermit program, since VMS-to-VMS
24953 +   transfers use labeled mode unless you have gone out of your way to
24954 +   defeat it.
24955 +
24956 +   Example: You want to send all versions of all files in the current
24957 +   directory from a VMS C-Kermit client to a UNIX C-Kermit server. Use:
24958 +
24959 +  set send version-numbers on
24960 +  send *.*;*
24961 +
24962 +   The resulting Unix files will have VMS-style version numbers as part of
24963 +   their name, for example "foo.bar;1", "foo.bar;2", etc.
24964 +
24965 +   Now suppose you want to send these files from Unix to another VMS
24966 +   system and preserve the version numbers. Again we have a Unix C-Kermit
24967 +   server and VMS C-Kermit client. Give these commands to the client:
24968 +
24969 +  set receive version-numbers on
24970 +  get *
24971 +
24972 +4.0.8. The SET { SEND, RECEIVE } { MOVE-TO, RENAME-TO } Commands
24973 +
24974 +   These commands are persistent global versions of the /MOVE-TO: and
24975 +   /RENAME-TO: switches of the SEND, GET, and RECEIVE commands. They
24976 +   should normally be used only when setting up a dedicated
24977 +   transaction-processing application, in which each file is to be moved
24978 +   or renamed immediately after, and only if, it is transferred
24979 +   successfully, so that (for example) an independent, concurrent process
24980 +   can notice when new files appear and process them immediately without
24981 +   having to guess whether they are complete.
24982 +
24983 +4.0.9. SET FILE INCOMPLETE AUTO
24984 +
24985 +   SET FILE INCOMPLETE { KEEP, DISCARD }, which tells whether to keep or
24986 +   discard incompletely received files, has a new option, AUTO, which is
24987 +   also the default. It means KEEP the incomplete file if the transfer is
24988 +   in binary mode, otherwise DISCARD it. This reduces the chances that a
24989 +   subsequent recovery operation (RESEND, REGET, etc) could produce a
24990 +   corrupt file, since recovery works only for binary-mode transfers.
24991 +
24992 +4.1. FILE-TRANSFER FILENAME TEMPLATES
24993 +
24994 +   File-transfer filename templates allow files to be renamed
24995 +   automatically by the file sender, the receiver, or both, during
24996 +   transfer of groups of files.
24997 +
24998 +4.1.1. Templates in the As-Name
24999 +
25000 +   Prior to C-Kermit 6.1 and Kermit 95 1.1.12 the only options that could
25001 +   be used to affect the names of files being transferred were SET
25002 +   FILENAMES { LITERAL, CONVERTED } and SET { SEND, RECEIVE } PATHNAMES {
25003 +   ON, OFF }, plus the "as-name" feature of the SEND (MOVE, etc) and
25004 +   RECEIVE commands.
25005 +
25006 +   Previously, the as-name could be used only for a single file. For
25007 +   example:
25008 +
25009 +  SEND FOO BAR
25010 +
25011 +   would send the file FOO under the name BAR, but:
25012 +
25013 +  SEND *.TXT anything
25014 +
25015 +   was not allowed, since it would give the same name to each file that
25016 +   was sent. When receiving:
25017 +
25018 +  RECEIVE FOO
25019 +
25020 +   would rename the first incoming file to FOO before storing it on the
25021 +   disk, but subsequent files would not be renamed to FOO, since this
25022 +   would result in overwriting the same file repeatedly. Instead, they
25023 +   were stored under the names they arrived with.
25024 +
25025 +   Beginning in C-Kermit 6.1 and Kermit 95 1.1.12, it is possible to
25026 +   specify as-names in SEND, RECEIVE, and related commands even for file
25027 +   groups. This is accomplished by using replacement variables in the
25028 +   as-name, along with optional material such character-string functions
25029 +   and/or constant strings. An as-name containing replacement variables is
25030 +   called a filename template.
25031 +
25032 +   The key to filename templates is the new variable:
25033 +
25034 +  \v(filename)
25035 +
25036 +   During file transfer it is replaced by the name of each file currently
25037 +   being transferred (after transfer, it is the name of the last file
25038 +   transferred).
25039 +
25040 +   So, for example:
25041 +
25042 +  send *.txt \v(filename).new
25043 +
25044 +   sends each file with its own name, but with ".new" appended to it. Of
25045 +   course if the name already contains periods, this could confuse the
25046 +   file receiver, so you can also achieve fancier effects with
25047 +   constructions like:
25048 +
25049 +  send *.txt \freplace(\v(filename),.,_).new
25050 +
25051 +   which replaces all periods in the original filename by underscores, and
25052 +   then appends ".new" to the result. So, for example, oofa.txt would be
25053 +   sent as oofa_txt.new.
25054 +
25055 +   Another new variable that is useful in this regard is \v(filenumber),
25056 +   which is the ordinal number of the current file in the file group, so
25057 +   you can also:
25058 +
25059 +  send *.txt FILE\flpad(\v(filenum),2,0)
25060 +
25061 +   resulting in a series of files called FILE00, FILE01, FILE02, etc. (At
25062 +   the end of the transfer, \v(filenum) tells the number of files that
25063 +   were transferred).
25064 +
25065 +   If you specify a constant as-name when sending a file group:
25066 +
25067 +  send *.txt thisnameonly
25068 +
25069 +   Kermit complains and asks you to include replacement variables in the
25070 +   as-name. You should generally use \v(filename) or \v(filenumber) for
25071 +   this purpose, since other variables (with the possible exception of
25072 +   date/time related variables) do not change from one file to the next.
25073 +   But Kermit accepts any as-name at all that contains any kind of
25074 +   variables for file group, even if the variable will not change. So:
25075 +
25076 +  send *.txt \%a
25077 +
25078 +   is accepted, but all files are sent with the same name (the value of
25079 +   \%a, if it has one and it is constant). If the variable has no value at
25080 +   all, the files are sent under their own names.
25081 +
25082 +   Of course, the value of \%a in the previous example need not be
25083 +   constant:
25084 +
25085 +  define \%a FILE\flpad(\v(filenum),2,0)_at_\v(time)
25086 +  send *.txt \%a
25087 +
25088 +   The RECEIVE command, when given without an as-name, behaves as always,
25089 +   storing all incoming files under the names they arrive with, subject to
25090 +   SET FILE NAME and SET RECEIVE PATHNAMES modifications ([441]Section
25091 +   4.10).
25092 +
25093 +   However, when an as-name is given in the RECEIVE command, it is applied
25094 +   to all incoming files rather than to just the first. If it does not
25095 +   contain replacement variables, then the current FILE COLLISION setting
25096 +   governs the result. For example:
25097 +
25098 +  receive foo
25099 +
25100 +   will result in incoming files named foo, foo.~1~, foo.~2~, and so on,
25101 +   with the default FILE COLLISION setting of BACKUP. If it does contain
25102 +   replacement variables, of course they are used.
25103 +
25104 +   When receiving files, the \v(filename) variable refers to the name that
25105 +   was received in the incoming file-header packet, BEFORE any processing
25106 +   by SET FILE NAMES or SET RECEIVE PATHNAMES. Since the filenames in
25107 +   file-header packets are usually in uppercase, you would need to convert
25108 +   them explicitly if you want them in lowercase, e.g.:
25109 +
25110 +  receive \flower(\v(filename)).new
25111 +
25112 +4.1.2. Templates on the Command Line
25113 +
25114 +   On the command-line, use templates as shown above as the -a option
25115 +   argument, bearing in mind the propensity of UNIX and perhaps other
25116 +   shells to treat backslash as a shell escape character. So in UNIX (for
25117 +   example):
25118 +
25119 +  kermit -s oofa.* -a x.\\v(filenum)
25120 +
25121 +   By the way, this represents a change from 6.0 and earlier releases in
25122 +   which the as-name (-a argument or otherwise) was not evaluated by the
25123 +   command parser. Thus, for example, in VMS (where the shell does not
25124 +   care about backslashes), it was possible to:
25125 +
25126 +  kermit -s oofa.txt -a c:\tmp\oofa.txt
25127 +
25128 +   Now backslashes in the as-name must be quoted not only for the shell
25129 +   (if necessary) but also for Kermit itself:
25130 +
25131 +  kermit -s oofa.txt -a c:\\tmp\\oofa.txt      ; Kermit only
25132 +  kermit -s oofa.txt -a c:\\\\tmp\\\\oofa.txt  ; Shell and Kermit
25133 +
25134 +   You can also use the \fliteral() function for this:
25135 +
25136 +  kermit -s oofa.txt -a \fliteral(c:\tmp\oofa.txt)      ; Kermit only
25137 +  kermit -s oofa.txt -a \\fliteral(c:\\tmp\\oofa.txt)   ; Shell and Kermit
25138 +
25139 +4.1.3. Post-Transfer Renaming
25140 +
25141 +   Filename templates are now also useful in SET { SEND, RECEIVE }
25142 +   RENAME-TO and in the /RENAME-TO: switch, that can be given to the SEND,
25143 +   GET, or RECEIVE commands; this is similar to an as-name, but is
25144 +   effective on a per-file basis if and only if the file was transferred
25145 +   successfully.
25146 +
25147 +   MOVE-TO and RENAME-TO address a requirement commonly stated for
25148 +   transaction processing and similar systems. Suppose, for example, a
25149 +   central system "X" accepts connections from multiple clients
25150 +   simultaneously; a process on X waits for a file to appear and then
25151 +   processes the file. This process must have a way of knowing when the
25152 +   file has been completely and successfully transferred before it starts
25153 +   to process it. This can be accomplished easily using C-Kermit's SET {
25154 +   SEND, RECEIVE } { MOVE-TO, RENAME-TO } command or /MOVE-TO: or
25155 +   /RENAME-TO: switches, described in [442]Sections 4.7.1 through
25156 +   [443]4.7.3.
25157 +
25158 +   Here's an example for the client side, in which files to be sent are
25159 +   placed in a certain directory (/usr/olga/tosend in this example) by
25160 +   another process when they are ready to go. This might be in a hospital
25161 +   or big doctor's office, where medical insurance claims are entered at a
25162 +   number of workstations, and then deposited in the "tosend" directory,
25163 +   from which they are sent to a claims clearinghouse. We assume the
25164 +   connection is already made and a Kermit server is on the other end.
25165 +
25166 +  local srcdir findir              ; Declare local (automatic) variables
25167 +  assign srcdir /usr/olga/tosend   ; Local source directory (files to send)
25168 +  assign findir /usr/olga/sent     ; Where to move files after they are sent
25169 +  log transactions                 ; Keep a log of transfers
25170 +  cd \m(srcdir)                    ; Change to the source directory
25171 +  while true {                     ; Loop forever...
25172 +      send /move-to:\m(findir) *   ; Send all files
25173 +      sleep 60                     ; Sleep a minute
25174 +  }                                ; Go back and do it again
25175 +
25176 +   Note how simple this is. Once each file is sent, it is moved so it
25177 +   won't be sent again (you could also use SEND /RENAME-TO: or even SEND
25178 +   /DELETE). If a transfer fails, the file is not moved and so we try
25179 +   again to send it next time around. If there are no files to send, the
25180 +   SEND command does nothing but a message is printed; you can avoid the
25181 +   message by checking first to see if any files are in the directory:
25182 +
25183 +  while true {                     ; Loop forever...
25184 +      if > \ffiles(*) 0 -          ; If there are any files
25185 +        send /move-to:\m(findir) * ; send them.
25186 +      sleep 60                     ; Sleep a minute.
25187 +  }                                ; Go back and do it again.
25188 +
25189 +   It's even simpler on the server side (here again we assume the
25190 +   connection is already in place):
25191 +
25192 +  local rcvdir findir              ; Declare local (automatic) variables
25193 +  assign rcvdir /usr/ivan/tmp      ; Temporary receiving directory
25194 +  assign findir /usr/ivan/new      ; Where to move files after reception
25195 +  log transactions                 ; Keep a log of transfers
25196 +  cd \m(rcvdir)                    ; Change to the source directory
25197 +  set receive move-to \m(findir)   ; Declare move-to directory.
25198 +  server                           ; Enter server mode.
25199 +
25200 +   A separate process (e.g. the medical claim-form decoder) can look for
25201 +   files appearing in the /usr/ivan/new directory and process them with
25202 +   every confidence that they have been completely received.
25203 +
25204 +   Note that the use of MOVE-TO can result in moved files overwriting one
25205 +   another (the application would normally avoid this by assigning each
25206 +   transaction a unique, e.g. based on customer number and claim number).
25207 +   But if filename collisions are a possibility in your application,
25208 +   RENAME-TO might be a better choice; you can use any variables you like
25209 +   in the template to ensure uniqueness of the RENAME-TO filename; for
25210 +   example:
25211 +
25212 +  SET RECEIVE RENAME-TO \v(filename)_\v(ndate)_\v(ntime)_\v(userid)_\v(pid)
25213 +
25214 +4.2. FILE-TRANSFER PIPES AND FILTERS
25215 +
25216 +4.2.1. INTRODUCTION
25217 +
25218 +   Beginning in C-Kermit 6.1 and Kermit 95 1.1.12, it is possible to send
25219 +   from a command, or "pipe", as well as from a file, and to receive to a
25220 +   pipe or command. In a typical example, we might want to transfer an
25221 +   entire directory tree from one UNIX system to another (but without
25222 +   using the methods described in [444]Sections 4.3 , [445]4.10,
25223 +   [446]4.11, and [447]4.15). We could do this in multiple steps as
25224 +   follows:
25225 +
25226 +  1. Create a tar archive of the desired directory tree
25227 +  2. Compress the tar archive
25228 +  3. Transfer it in binary mode to the other computer
25229 +  4. Decompress it
25230 +  5. Extract the directory tree from the tar archive
25231 +
25232 +   But this is inconvenient and it requires a temporary file, which might
25233 +   be larger than we have room for.
25234 +
25235 +   The new pipe-transfer feature lets you do such things in a single step,
25236 +   and without intermediate files.
25237 +
25238 +   Additional new features, also discussed here, let you specify pre- and
25239 +   post- processing filters for outbound and incoming files, and give you
25240 +   a way to insert the output from shell or system commands into C-Kermit
25241 +   commands.
25242 +
25243 +   The file-transfer related features are available only with Kermit
25244 +   protocol, not with any external protocols, nor with K95's built-in
25245 +   XYZMODEM protocols (because XYZMODEM recovers from transmission errors
25246 +   by rewinding the source file, and you can't rewind a pipe).
25247 +
25248 +   This section begins by discussing the simple and straightforward use of
25249 +   these features in UNIX, in which pipes and input/output redirection are
25250 +   a fundamental component and therefore "just work", and then goes on to
25251 +   discuss their operation in Windows and OS/2, where matters are much
25252 +   more complicated.
25253 +
25254 +4.2.1.1. TERMINOLOGY
25255 +
25256 +   Standard Input
25257 +          This is a precise technical term denoting the normal source of
25258 +          input for a command or program, which is the keyboard of your
25259 +          terminal by default, but which can be redirected to a file or
25260 +          pipe.
25261 +
25262 +   Stdin
25263 +          Abbreviation for Standard Input.
25264 +
25265 +   Standard Output
25266 +          A precise technical term denoting the normal destination for
25267 +          output from a command or program, which is your terminal screen
25268 +          by default, but which can be redirected to a file.
25269 +
25270 +   Stdout
25271 +          Abbreviation for Standard Output.
25272 +
25273 +   Stdio
25274 +          Abbreviation for Standard Input / Standard Output.
25275 +
25276 +   I/O
25277 +          Abbreviation for Input / Output.
25278 +
25279 +   Shell
25280 +          Text-based system command processor, such as the UNIX shell, DOS
25281 +          COMMAND.COM, etc.
25282 +
25283 +   Pipe
25284 +          A mechanism by which the standard output of one program is sent
25285 +          to the standard input of another.
25286 +
25287 +   Pipeline
25288 +          A series of programs connected by pipes.
25289 +
25290 +4.2.1.2. NOTATION
25291 +
25292 +   In command descriptions, "command" is replaced by a shell or system
25293 +   command or pipeline. The command names specified in these commands are
25294 +   interpreted by your shell, just as if you were typing them at the shell
25295 +   prompt, and so if they are in your PATH, they will be found in the
25296 +   expected manner. Therefore you don't have to specify complete pathnames
25297 +   for commands that are programs (but it shouldn't hurt if you do).
25298 +
25299 +   The normal notation for I/O redirection is as follows:
25300 +
25301 +  <  Read Stdin from the given file.
25302 +  >  Send Stdout to the given file.
25303 +  |  Send Stdout from the command on the left to the command on the right.
25304 +
25305 +   Examples:
25306 +
25307 +   sort < foo > bar
25308 +          Sorts the lines in file "foo" and writes the results to file
25309 +          "bar"
25310 +
25311 +   grep -c "some text" *.txt | grep -v ":0" | sort | pr -3 | lpr
25312 +          This is a command pipeline composed of 5 commands:
25313 +
25314 +   grep -c "some text" *.txt
25315 +          Looks in all files whose names end with ".txt" for the string
25316 +          "some text" and writes to Stdout the names of each file followed
25317 +          by a colon and the number of occurrences in each.
25318 +
25319 +   grep -v ":0"
25320 +          Prints to Stdout the lines from Stdin that do NOT contain the
25321 +          string ":0", in this case, it removes the names of files that do
25322 +          not contain "some text".
25323 +
25324 +   sort
25325 +          Sorts the lines from Stdin alphabetically to Stdout.
25326 +
25327 +   pr -3
25328 +          Arranges the lines from Stdin in three columns.
25329 +
25330 +   lpr
25331 +          Prints its Stdin on the default printer.
25332 +
25333 +   Note that the Kermit features described here work only with commands
25334 +   that use Stdio. If you attempt to use them with commands whose input
25335 +   and output can not be redirected, Kermit will most likely get stuck.
25336 +   Kermit has no way of telling how an external command works, nor what
25337 +   the syntax of the shell is, so it's up to you to make sure you use
25338 +   these features only with redirectable commands.
25339 +
25340 +   The quoting rules of your shell apply to the command. Thus in UNIX,
25341 +   where C-Kermit tries to use your preferred shell for running commands,
25342 +   shell "metacharacters" within commands must be escaped if they are to
25343 +   be taken literally, using the methods normal for your shell. For
25344 +   example, the UNIX tr (translate) command must have its arguments in
25345 +   quotes:
25346 +
25347 +  tr "[a-z]" "[A-Z]"
25348 +
25349 +   otherwise the shell is likely to replace them by all filenames that
25350 +   match, which is probably not what you want. This is also true when
25351 +   using your shell directly, and has nothing to do with Kermit.
25352 +
25353 +4.2.1.3. SECURITY
25354 +
25355 +   Some sites might not wish to allow access to system commands or
25356 +   external programs from within Kermit. Such access, including all the
25357 +   features described here, can be disabled in various ways:
25358 +
25359 +    1. When building from source code, include -DNOPUSH among the CFLAGS.
25360 +    2. At runtime, give the NOPUSH command.
25361 +    3. For server mode, give the DISABLE HOST command.
25362 +    4. Implicit use of pipes can be disabled as described in [448]Section
25363 +       4.2.4.
25364 +
25365 +   Note: 3 and 4 are not necessary if you have done 1 or 2.
25366 +
25367 +4.2.2. Commands for Transferring from and to Pipes
25368 +
25369 +   SEND /COMMAND sends data from a command or command pipeline, and
25370 +   RECEIVE /COMMENT writes data to a command or pipeline. The GET /COMMAND
25371 +   command asks a server to send material, and then writes the incoming
25372 +   material to a command or pipeline. These features, along with switches
25373 +   (like "/COMMAND", described in [449]Section 4.7) are new to C-Kermit
25374 +   6.1. The following synonyms are also provided:
25375 +
25376 +  CSEND    = SEND /COMMAND
25377 +  CRECEIVE = RECEIVE /COMMAND
25378 +  CGET     = GET /COMMAND
25379 +
25380 +   None of these commands can be used if a SEND or RECEIVE FILTER
25381 +   (respectively, [450]Section 4.2.3) is in effect, or if a NOPUSH command
25382 +   ([451]Section 4.2.1.3) has been given, or if the current protocol is
25383 +   not Kermit.
25384 +
25385 +4.2.2.1. Sending from a Command
25386 +
25387 +   SEND /COMMAND command [ as-name ]
25388 +   SEND /AS-NAME:as-name /COMMAND command
25389 +   CSEND command [ as-name ]
25390 +          These three forms are the same. They work like the SEND command,
25391 +          but instead of sending a file, it sends the standard output of
25392 +          the given command, either under the command's own name, or else
25393 +          with the given as-name. If the command contains spaces, it must
25394 +          be enclosed in braces. Braces should also be used for the
25395 +          as-name if it contains spaces. If braces are included around
25396 +          either the command or the as-name, they are removed after
25397 +          parsing but before use. As with SEND, the transfer is in text or
25398 +          binary mode according the current FILE TYPE setting, unless you
25399 +          override the global transfer mode by including a /TEXT or
25400 +          /BINARY switch. The command must require no input.
25401 +
25402 +   When sending from a command or pipeline, C-Kermit has no way of knowing
25403 +   in advance how much data will be sent, and so it can not send the size
25404 +   to the other Kermit in the Attribute packet, and so the receiving
25405 +   Kermit has no way of displaying "percent done" or a progress bar
25406 +   (thermometer).
25407 +
25408 +   Examples that make sense in text mode (illustrated by common UNIX
25409 +   commands):
25410 +
25411 +   SEND /COMMAND finger
25412 +   CSEND finger
25413 +          sends the current "finger" listing (who's logged in) under the
25414 +          name "finger". The two forms "send /command" and "csend" are
25415 +          equivalent; we won't bother showing them both in the rest of the
25416 +          examples.
25417 +
25418 +   SEND /COMMAND:{finger}
25419 +   CSEND {finger}
25420 +          Same as previous example (braces are removed from "{finger}").
25421 +
25422 +   SEND /COMMAND:{ finger }
25423 +   CSEND { finger }
25424 +          Same as previous example, but note that the spaces are kept.
25425 +          This does not prevent the shell from running the "finger"
25426 +          program, but its output is sent under the name " finger " (with
25427 +          a leading and trailing space).
25428 +
25429 +   SEND /COMMAND:finger /AS-NAME:userlist
25430 +   CSEND finger userlist
25431 +          sends the current finger listing under the name "userlist".
25432 +
25433 +   SEND /COMMAND:{finger | sort -r} /AS-NAME:userlist
25434 +   CSEND {finger | sort -r} userlist
25435 +          sends the current finger listing, sorted in reverse order, under
25436 +          the name "userlist". The braces are needed to distinguish the
25437 +          command from the as-name.
25438 +
25439 +   SEND /COMMAND:{finger | sort -r} /AS-NAME:{userlist}
25440 +   CSEND {finger | sort -r} {userlist}
25441 +          Same as previous example (braces are removed from "{userlist}").
25442 +
25443 +   SEND /COMMAND:{finger | sort -r}
25444 +          /AS-NAME:{\freplace(\v(filename),\32,_)}
25445 +
25446 +   CSEND {finger | sort -r} {\freplace(\v(filename),\32,_)}
25447 +          Like the previous example, but sends the output of the command
25448 +          under the name of the command, but with all spaces (\32)
25449 +          replaced by underscores, so the as-name is "finger_|_sort_-r".
25450 +
25451 +   Examples that make sense in binary mode (three equivalent forms are
25452 +   shown):
25453 +
25454 +   SEND /COMMAND /BINARY {tar cf - . | gzip -c} mydir.tar.gz
25455 +   SEND /COMMAND /BINARY /AS-NAME:mydir.tar.gz {tar cf - . | gzip -c}
25456 +   CSEND /BINARY {tar cf - . | gzip -c} mydir.tar.gz
25457 +          Makes a tar archive of the current directory, compresses it with
25458 +          the GNU gzip program, and sends it as "mydir.tar.gz". The other
25459 +          Kermit can, of course, just store it as a file, or it can use
25460 +          CRECEIVE to uncompress and dearchive it as part of the transfer
25461 +          process.
25462 +
25463 +   When using a "pipeline" of commands in the command field, obviously,
25464 +   the first command must not require any input, and the last command
25465 +   should produce some output, and all intermediate commands should get
25466 +   some input and produce some output.
25467 +
25468 +4.2.2.2. Receiving to a Command
25469 +
25470 +   RECEIVE /COMMAND command
25471 +   CRECEIVE command
25472 +          This is like RECEIVE, except incoming material is written to the
25473 +          standard input of the given command, in text or binary mode
25474 +          according to the normal rules for file reception. Be sure to
25475 +          include a redirector to a file (if the command normally writes
25476 +          to standard output), or the output of the command won't go
25477 +          anywhere. The command may contain spaces; braces are not needed,
25478 +          but they are removed if used.
25479 +
25480 +   WARNING: C-Kermit has no way of knowing anything about the command, or
25481 +   even whether it is a command. Thus this command will always cause
25482 +   C-Kermit to enter protocol mode, as long as some text is specified in
25483 +   the command field. However, if the text does not correspond to a
25484 +   command, the transfer will eventually fail with a message such as
25485 +   "Error writing data" or "Failure to close file".
25486 +
25487 +   Examples for text mode (in UNIX):
25488 +
25489 +   RECEIVE /COMMAND sort -r > reverse.txt
25490 +   CRECEIVE sort -r > reverse.txt
25491 +          The text that is received is sorted in reverse order and stored
25492 +          in the file "reverse.txt". The two forms shown are equivalent.
25493 +
25494 +   RECEIVE /COMMAND {sort -r > reverse.txt}
25495 +   CRECEIVE {sort -r > reverse.txt}
25496 +          The same as the previous example; if braces are included, they
25497 +          are simply removed.
25498 +
25499 +   RECEIVE /COMMAND {sort -r > \flower(\v(filename)).reverse}
25500 +   CRECEIVE {sort -r > \flower(\v(filename)).reverse}
25501 +          Same but stores result under the incoming filename, lowercased,
25502 +          and with ".reverse" appended to it.
25503 +
25504 +   RECEIVE /COMMAND sort
25505 +   CRECEIVE sort
25506 +          Does nothing useful, since the output of sort has nowhere to go.
25507 +
25508 +   RECEIVE /COMMAND sort -r | pr -3 | lpr -Plaserjet
25509 +   CRECEIVE sort -r | pr -3 | lpr -Plaserjet
25510 +          The text that is received is sorted in reverse order, arranged
25511 +          into three columns, and sent to the "laserjet" printer.
25512 +
25513 +   Examples for binary mode:
25514 +
25515 +   RECEIVE /COMMAND:{gunzip -c | tar xf -}
25516 +   CRECEIVE {gunzip -c | tar xf -}
25517 +          Assuming the data that is received is a compressed tar archive,
25518 +          uncompresses the archive and passes it to tar for extraction. In
25519 +          this case the braces are needed because otherwise the final "-"
25520 +          would be taken as a command continuation character (see
25521 +          [452]Using C-Kermit, 2nd Edition, p.33).
25522 +
25523 +   GET /COMMAND remote-file command
25524 +   GET /COMMAND /AS-NAME:command remote-file
25525 +   CGET remote-file command
25526 +          This command tells the Kermit client to send a GET request for
25527 +          the given remote file to a Kermit server. Unlike GET, however,
25528 +          the incoming material is written to a command, rather than to a
25529 +          file. If the remote-file or the command contain spaces, they
25530 +          must be enclosed in braces. The same cautions about the command
25531 +          apply as for CRECEIVE.
25532 +
25533 +   Examples (for UNIX):
25534 +
25535 +   GET /COMMAND oofa.txt sort -r > oofa.new
25536 +   GET /COMMAND {oofa.txt} {sort -r > oofa.new}
25537 +   CGET oofa.txt sort -r > oofa.new
25538 +   CGET {oofa.txt} {sort -r > oofa.new}
25539 +          These four are equivalent. Each of them requests the server to
25540 +          send its "oofa.txt" file, and as it arrives, it is sorted in
25541 +          reverse order and written to "oofa.new".
25542 +
25543 +   GET /COMMAND {profile exec a} lpr
25544 +   GET /COMMAND {profile exec a} {lpr}
25545 +   GET /COMMAND /AS-NAME:lpr {profile exec a}
25546 +   GET /COMMAND /AS-NAME:{lpr} {profile exec a}
25547 +   GET /COMMAND /AS:lpr {profile exec a}
25548 +   CGET {profile exec a} lpr
25549 +   CGET {profile exec a} {lpr}
25550 +          Here the remote filename contains spaces so it MUST be enclosed
25551 +          in braces. As it arrives it is sent to the lpr program for
25552 +          printing. Braces are optional around "lpr" since it contains no
25553 +          spaces.
25554 +
25555 +   GET /COMMAND *.txt {cat >> new.txt}
25556 +   GET /AS-NAME:{cat >> new.txt} /COMMAND *.txt
25557 +   CGET *.txt {cat >> new.txt}
25558 +          This gets all the ".txt" files from the server and concatenates
25559 +          them all into a single "new.txt" file on the client.
25560 +
25561 +   GET /COMMAND *.txt {echo \v(filename)>>new.txt;cat>>new.txt}
25562 +   CGET *.txt {echo \v(filename)>>new.txt;cat>>new.txt}
25563 +          As above, but inserts each file's name before its contents.
25564 +
25565 +4.2.3. Using File-Transfer Filters
25566 +
25567 +   The commands described in [453]Section 4.2.2 let you send the output of
25568 +   a command, or receive data into a command. But what if you want to
25569 +   specify preprocessing for files that you send, or postprocessing of
25570 +   files that you receive, even when multiple files are involved? For this
25571 +   you need a way to specify send and receive filters. The commands are
25572 +   SET SEND FILTER and SET RECEIVE FILTER; SHOW PROTOCOL displays the
25573 +   current settings.
25574 +
25575 +4.2.3.1. The SEND Filter
25576 +
25577 +   SET SEND FILTER [ command ]
25578 +          This command specifies a command to be run on any file that you
25579 +          SEND (or MOVE, MSEND, etc). It also applies to files sent when
25580 +          in server mode, in response to GET commands, but not to the
25581 +          results of REMOTE commands like REMOTE DIRECTORY, REMOTE TYPE,
25582 +          REMOTE HOST, etc. The command may be, but need not be, enclosed
25583 +          in braces; if it is, the braces are stripped before use. The
25584 +          output of this command is sent, rather than the file itself. The
25585 +          current FILE TYPE setting (TEXT or BINARY) applies to the output
25586 +          of the command. The command must contain at least one instance
25587 +          of \v(filename), for which the name of the actual file is
25588 +          substituted. If the command is omitted, the send filter is
25589 +          removed and files are sent in the normal manner.
25590 +
25591 +   The SET SEND FILTER sets up a "global" filter -- that is, one that
25592 +   applies to all subsequent file-sending commands until you change or
25593 +   remove it. You can also specify a "local" filter to be used in a
25594 +   specific file-sending command by using the /FILTER switch (see
25595 +   [454]Section 1.5); for example:
25596 +
25597 +  SEND /FILTER:command [ other-switches ] filename
25598 +
25599 +   Besides \v(filename), you can include any other script programming
25600 +   notation in the send filter: variable names, array references, calls to
25601 +   built-in string or other functions, and so on. These are evaluated
25602 +   during file transfer, NOT during parsing, and they are evaluated
25603 +   separately for each file.
25604 +
25605 +   When the SEND or MOVE (SEND /DELETE) command is used with a send
25606 +   filter, the output from the filter is sent under the file's original
25607 +   name unless you specify an "as-name" or template. The Attribute packet
25608 +   (if any) contains the original file's attributes (size, creation date,
25609 +   etc). So (for example) if the filter changes the file's size, the
25610 +   progress thermometer might be wrong. (We can't send the size of the
25611 +   output from the filter, because it is not known until the transfer is
25612 +   finished.) If you prefer that the size not be sent, use "set attributes
25613 +   size off".
25614 +
25615 +   You can not use send filters with RESEND (SEND /RECOVER) or PSEND (SEND
25616 +   /START).
25617 +
25618 +   Examples for text mode:
25619 +
25620 +   SET SEND FILTER sort -r \v(filename) ; Braces may be omitted
25621 +   SET SEND FILTER {sort -r \v(filename)} ; Braces may be included
25622 +   SEND *.txt
25623 +          This sends every file in the current directory whose name ends
25624 +          with ".txt" under its own name, but with its lines sorted in
25625 +          reverse order.
25626 +
25627 +   SEND /FILTER:{sort -r \v(filename)} *.txt
25628 +          Same as above, but the filter applies only to this SEND command.
25629 +          Braces are required in this case.
25630 +
25631 +   SET SEND FILTER {sort -r \v(filename)}
25632 +   SEND oofa.txt reverse.txt
25633 +          Sends the oofa.txt file with its lines sorted in reverse order
25634 +          under the name "reverse.txt".
25635 +
25636 +   SET SEND FILTER {sort -r \v(filename)}
25637 +   SEND oofa.* \v(filename).reverse
25638 +          Sends all the oofa.* files with their lines sorted in reverse
25639 +          order; each file is sent under its own name but with ".reverse"
25640 +          appended to it.
25641 +
25642 +   SET SEND FILTER {tr "[a-z]" "[A-Z]" < \v(filename)}
25643 +   SEND *.txt
25644 +          Sends all ".txt" files under their own names, but uppercasing
25645 +          their contents.
25646 +
25647 +   Note that the SEND FILTER applies not only to files that are sent with
25648 +   SEND, MOVE, MSEND, etc, but also to files sent by the C-Kermit server
25649 +   in response to GET requests.
25650 +
25651 +   Examples for binary mode:
25652 +
25653 +   SET SEND FILTER {gzip -c \v(filename)}
25654 +   SEND /BINARY oofa.txt oofa.txt.gz
25655 +          Sends the oofa.txt file, compressed by gzip, as oofa.txt.gz.
25656 +
25657 +   SEND /BINARY /FILTER:{gzip -c \v(filename)} oofa.txt oofa.txt.gz
25658 +          As above, but the filter applies only to this SEND command.
25659 +
25660 +   SET SEND FILTER {gzip -c \v(filename)}
25661 +   SEND /BINARY oofa.* \fupper(\replace(\v(filename),.,_)).GZ
25662 +          Sends all the oofa.* files, compressed by gzip, each under its
25663 +          own name, but with the name uppercased, all periods within the
25664 +          name converted to underscores, and ".GZ" appended to it. So, for
25665 +          example, "oofa.txt" is sent as "OOFA_TXT.GZ".
25666 +
25667 +   In the gzip examples, note that the amount of data that is sent is
25668 +   normally less than the original file size because gzip compresses the
25669 +   file. But Kermit sends the original file size ahead in the attribute
25670 +   packet anyway (unless you tell it not too). Thus the transfer will
25671 +   probably appear to terminate early, e.g. when the receiver's
25672 +   file-transfer display thermometer is only at 40%. If this annoys you,
25673 +   tell Kermit to "set attribute length off". On the other hand, you can
25674 +   use the final position of the thermometer as a measure of the
25675 +   effectiveness of compression.
25676 +
25677 +4.2.3.2. The RECEIVE Filter
25678 +
25679 +   SET RECEIVE FILTER [ command ]
25680 +          This command specifies that the given command will be run on any
25681 +          file that is received before it is written to disk. The command
25682 +          may be, but need not be, enclosed in braces; if it is the braces
25683 +          are stripped before use. The following two commands are
25684 +          equivalent:
25685 +
25686 +  SET RECEIVE FILTER sort -r > \v(filename)
25687 +  SET RECEIVE FILTER {sort -r > \v(filename)}
25688 +
25689 +   The RECEIVE filter command may contain a "\v(filename)" sequence to be
25690 +   replaced by the incoming filename from the file header packet, but it
25691 +   is not required. However you must use it whenever your filter would
25692 +   normally write to Stdout, otherwise its output will be lost.
25693 +
25694 +   The RECEIVE filter command may contain one or more "\v(filename)"
25695 +   sequence to be replaced by the incoming filename from the file header
25696 +   packet, but it is not required. However you must use it whenever your
25697 +   filter would normally write to Stdout, otherwise its output will be
25698 +   lost.
25699 +
25700 +   RECEIVE /FILTER:command and GET /FILTER:command can also be used to
25701 +   specify a filter to be used for only one file-transfer operation.
25702 +
25703 +   UNIX examples for text mode:
25704 +
25705 +   SET RECEIVE FILTER lpr
25706 +   RECEIVE
25707 +          All the files that are received are sent to the default UNIX
25708 +          print spooler.
25709 +
25710 +   RECEIVE /FILTER:lpr
25711 +          Same as above, except the lpr filter is used only with this
25712 +          RECEIVE command.
25713 +
25714 +   RECEIVE lpr
25715 +          This is probably not what you want; it creates a file called
25716 +          lpr.
25717 +
25718 +   SET RECEIVE FILTER {sort -r > \v(filename)}
25719 +   RECEIVE
25720 +          Stores each incoming file with its lines sorted in reverse
25721 +          order, under its own name.
25722 +
25723 +   RECEIVE /FILTER:{sort -r > \v(filename)}
25724 +          As above, but the filter is used only for this RECEIVE command.
25725 +
25726 +   SET RECEIVE FILTER sort -r > \v(filename)
25727 +   RECEIVE reverse.txt
25728 +          Stores each incoming file with its lines sorted in reverse
25729 +          order, under the name "reverse.txt". The actual result depends
25730 +          on the FILE COLLISION setting. If it is OVERWRITE and multiple
25731 +          files arrive, then each incoming file destroys the previous one.
25732 +          If it is BACKUP (the default), filename conflicts are resolve by
25733 +          adding "version numbers" to the filenames: reverse.txt,
25734 +          reverse.txt.~1~, reverse.txt.~2~, etc.
25735 +
25736 +   SET RECEIVE FILTER sort -r > \v(filename)
25737 +   RECEIVE \v(filename).reverse
25738 +          Stores each incoming file with its lines sorted in reverse
25739 +          order, under the name it arrived with, but with ".reverse"
25740 +          appended to it.
25741 +
25742 +   SET RECEIVE FILTER sort -r > \v(filename)
25743 +   RECEIVE \flower(\v(filename)).reverse
25744 +          Like the previous example, but ensures that the filename is
25745 +          lowercase.
25746 +
25747 +          Examples for binary mode:
25748 +
25749 +   SET RECEIVE FILTER gunzip -c > \v(filename)
25750 +   RECEIVE
25751 +          This receives one or more presumably compressed file and
25752 +          uncompresses each one into a file having the same name it was
25753 +          sent with. For example, if the file is sent with the name
25754 +          OOFA.TXT.GZ, it is stored with that name, even after
25755 +          decompression.
25756 +
25757 +   SET RECEIVE FILTER gunzip -c > \v(filename)
25758 +   RECEIVE \flower(\fsubstring(\v(filename),1,\flength(\v(filename))-3))
25759 +          Like the previous example, but the resulting filename has its
25760 +          rightmost three characters removed from it and the remainder is
25761 +          lowercased. So if the incoming filename is OOFA.TXT.GZ, it is
25762 +          stored as oofa.txt after decompression.
25763 +
25764 +   Of course you don't want to type such long hideous commands, so we have
25765 +   also introduced several new functions:
25766 +
25767 +   \fstripx(string[,character])
25768 +          This function removes the rightmost segment of the string that
25769 +          starts with the given character. If no character is given,
25770 +          period (.) is used. Thus it is most conveniently used for
25771 +          stripping the extension from a filename (or the decimal portion
25772 +          from a floating-point number written in US/UK style). Examples:
25773 +
25774 +   \fstripx(OOFA.TXT.GZ)             => OOFA.TXT
25775 +   \fstripx(OOFA.TXT.GZ,.)           => OOFA.TXT
25776 +   \fstripx(OOFA.TXT.GZ,X)           => OOFA.T
25777 +   \fstripx(\fstripx(OOFA.TXT.GZ))   => OOFA
25778 +   \fstripx($100.00)                 => $100
25779 +
25780 +   \fstripn(string,number)
25781 +          Removes the rightmost number characters from the string.
25782 +          Examples:
25783 +
25784 +   \fstripn(OOFA.TXT.GZ)             => OOFA.TXT.GZ
25785 +   \fstripn(OOFA.TXT.GZ,3)           => OOFA.TXT
25786 +   \fstripn(OOFA.TXT.GZ,7)           => OOFA
25787 +
25788 +   \fstripb(string[,c1[,c2]])
25789 +          Strips enclosing matching braces, brackets, parentheses, or
25790 +          quotes from the string. The second argument, c1, specifies which
25791 +          kind of enclosure to look for; if not specified, any enclosing
25792 +          (), [], <>, {}, "", '', or `' are removed. If c1 is specified
25793 +          and c2 is not, then if c1 is an opening brace, bracket, or
25794 +          parenthesis, the matching closing one is supplied automatically
25795 +          as c2. If both c1 and c2 are specified, then to be stripped the
25796 +          string must begin with c1 and end with c2. If the string is not
25797 +          enclosed in the indicated manner, the result is the original
25798 +          string. Examples:
25799 +
25800 +   \fstripb("abc")                   => abc
25801 +   \fstripb([abc])                   => abc
25802 +   \fstripb([abc)                    => [abc
25803 +   \fstripb(<abc>)                   => abc
25804 +   \fstripb(<abc>,[)                 => <abc>
25805 +   \fstripb((abc))                   => abc
25806 +   \fstripb((abc),[)                 => (abc)
25807 +   \fstripb((abc),{(})               => abc
25808 +   \fstripb(+abc+)                   => +abc+
25809 +   \fstripb(+abc+,+)                 => abc
25810 +   \fstripb(+abc+,+,^)               => +abc+
25811 +   \fstripb(+abc^,+,^)               => abc
25812 +   \fstripb('abc')                   => abc
25813 +   \fstripb(`abc')                   => abc
25814 +   \fstripb(``abc'')                 => `abc'
25815 +   \fstripb(\fstripb(``abc''))       => abc
25816 +
25817 +          Notice the special syntax required for including a literal
25818 +          parenthesis in the argument list. As the last two examples
25819 +          illustrate, \fstripb() strips only one level at at a time;
25820 +          nesting can be used to strip a small fixed number of levels;
25821 +          loops can be used to strip larger or indeterminate numbers of
25822 +          levels.
25823 +
25824 +   \flop(string[,char])
25825 +          Removes the leftmost segment of the string that ends with the
25826 +          given character. If no character is given, period (.) is used.
25827 +          Examples:
25828 +
25829 +  \flop(OOFA.TXT.GZ)               => TXT.GZ
25830 +  \flop(OOFA.TXT.GZ,.)             => TXT.GZ
25831 +  \flop(OOFA.TXT.GZ,X)             => T.GZ
25832 +
25833 +          To remove the leftmost number characters, just use
25834 +          \fsubstring(s,number+1). To return the rightmost number
25835 +          characters, use \fright(s,number).
25836 +
25837 +   So the hideous example:
25838 +
25839 +  receive \flower(\fsubstring(\v(filename),1,\flength(\v(filename))-3))
25840 +
25841 +   can now be written as:
25842 +
25843 +  receive \flower(\fstripx(\v(filename)))
25844 +
25845 +   That is, the filename stripped of its extension and then lowercased.
25846 +   This is not only shorter and less hideous, but also does not depend on
25847 +   the length of the extension being 3.
25848 +
25849 +   Note that when a receive filter is in effect, this overrides your FILE
25850 +   COLLISION setting, since Kermit has no way of knowing what the final
25851 +   destination filename will be (because it does not know, and can not be
25852 +   expected to know, the syntax of every version of every command shell on
25853 +   every platform on the planet).
25854 +
25855 +4.2.4. Implicit Use of Pipes
25856 +
25857 +   If you wish, C-Kermit can also examine incoming filenames to see if
25858 +   they start with "!", and if so, the subsequent text is treated as a
25859 +   command to read from or write to. For example, if a Kermit client is
25860 +   given the following command:
25861 +
25862 +  get {!finger | sort}
25863 +
25864 +   the server on the other end, if it supports this feature, will run the
25865 +   "finger" program, pipe its standard output to the "sort" program, and
25866 +   send sort's standard output back to you. Similarly, if you:
25867 +
25868 +  send oofa.txt !sort -r > oofa.new
25869 +
25870 +   or, equivalently:
25871 +
25872 +  send oofa.txt {!sort -r > oofa.new}
25873 +
25874 +   or:
25875 +
25876 +  send /as-name:{!sort -r > oofa.new} oofa.txt
25877 +
25878 +   this has the receiver send the contents of the incoming oofa.txt file
25879 +   to the sort program, which sorts the text in reverse order and stores
25880 +   the result in oofa.new.
25881 +
25882 +   This use of the exclamation mark should be familiar to UNIX users as
25883 +   the "bang" feature that lets you run an external application or command
25884 +   from within another application.
25885 +
25886 +   Kermit's "bang" feature is disabled by default, since it is not unheard
25887 +   for filenames to actually begin with "!". So if you want to use this
25888 +   feature, you must enable it with the following command:
25889 +
25890 +   SET TRANSFER PIPES { ON, OFF }
25891 +          ON enables the recognition of "!" notation in incoming filenames
25892 +          during file transfer as an indicator that the remaining text is
25893 +          the name of a command. OFF, the default, disables this feature
25894 +          and uses the text as a filename in the normal fashion. This
25895 +          command does NOT affect SEND /COMMAND, GET /COMMAND, CSEND, etc.
25896 +
25897 +   So using a combination of CSEND (SEND /COMMAND) and the "bang" feature,
25898 +   you can transfer a directory tree all in one command (assuming the
25899 +   remote Kermit supports pipe transfers and has them enabled):
25900 +
25901 +  CSEND {tar cf - . | gzip -c} {!gunzip -c | tar xf -}
25902 +
25903 +   or:
25904 +
25905 +  SEND /COMMAND:{tar cf - . | gzip -c} /as:{!gunzip -c | tar xf -}
25906 +
25907 +   Pay close attention to the syntax. Braces are needed around the command
25908 +   because it contains spaces; braces are needed around the as-name
25909 +   because it ends with "-". The as-name must begin with "!" or receiving
25910 +   Kermit will not recognize it as a command. The CSEND command must NOT
25911 +   begin with "!" unless you are running a command whose name really does
25912 +   start that character.
25913 +
25914 +   Similarly, you have a Kermit server send a directory tree to be
25915 +   unpacked on the client end:
25916 +
25917 +  CGET {!tar cf - . | gzip -c} {gunzip -c | tar xf -}
25918 +
25919 +   or:
25920 +
25921 +  GET /COMMAND {!tar cf - . | gzip -c} /as:{gunzip -c | tar xf -}
25922 +
25923 +   Notice how, in this case, the bang is required in the remote command,
25924 +   to distinguish it from a filename, but not in the local command, since
25925 +   by definition of CGET (or GET /COMMAND), it is known to be a command.
25926 +
25927 +   SEND and RECEIVE FILTERs supersede the bang feature. For example, if a
25928 +   file arrives under the name "!gunzip -c | tar xf -", but the receiving
25929 +   Kermit also has been given a command like:
25930 +
25931 +  set receive filter sort -r > \v(filename)
25932 +
25933 +   then the incoming data will be sorted rather than gunzipped.
25934 +
25935 +   Finally, if SET TRANSFER PIPES is ON (and in this case, this must be
25936 +   done in your C-Kermit initialization file), you can send from a pipe on
25937 +   the C-Kermit command line:
25938 +
25939 +  kermit -s "!finger | sort -r" -a userlist
25940 +
25941 +   In this case the "filename" contains spaces and so must be quoting
25942 +   using your shell's quoting rules.
25943 +
25944 +4.2.5. Success and Failure of Piped Commands
25945 +
25946 +   Commands or programs started by Kermit as a result of CSEND or CRECEIVE
25947 +   commands, CGET, SEND /COMMAND, REDIRECT commands (see [455]Section
25948 +   4.2.8.2), implicit use of pipes, RUN commands, and so forth, should
25949 +   return their exit status codes to the Kermit command that caused them
25950 +   to be run, and therefore IF SUCCESS and IF FAILURE tests after these
25951 +   commands should work as expected. For example:
25952 +
25953 +  CSEND blah < filename
25954 +
25955 +   should fail if there is no command called "blah" or if there is no file
25956 +   called "filename". However, this is not foolproof and sometimes
25957 +   C-Kermit might think a command succeeded when it failed, or vice versa.
25958 +   This is most likely to happen when the highly system-dependent methods
25959 +   that Kermit must use to determine a command's exit status code do not
25960 +   supply the right information.
25961 +
25962 +   It can also happen because some commands might define success and
25963 +   failure differently from what you expect, or because you are using a
25964 +   pipeline composed of many commands, and one of them fails to pass
25965 +   failing exit status codes up the chain. The most likely culprit is the
25966 +   shell itself, which in most cases must be interposed between Kermit and
25967 +   any external program to be run.
25968 +
25969 +   In any case, you can examine the following variable to find out the
25970 +   exit status code returned to Kermit by the process most recently run by
25971 +   any command that runs external commands or programs, including CSEND,
25972 +   CRECEIVE, REDIRECT, RUN, etc:
25973 +
25974 +  \v(pexitstat)
25975 +
25976 +   In UNIX, Windows and OS/2, the value should be -2 if no command has
25977 +   been run yet, 0 if the most recent command succeeded, -1, -3, or -4 if
25978 +   there was an internal error, and a positive number returned by the
25979 +   command itself if the command failed. If the number is in the range
25980 +   1-127, this is the program's exit status code. If it is 128 or greater,
25981 +   this is supposed to indicate that the command or program was
25982 +   interrupted or terminated from outside itself.
25983 +
25984 +   In Windows 95 and 98, the return values of the default shell are
25985 +   unreliable; various third-party shells can be used to work around this
25986 +   deficiency.
25987 +
25988 +   In VMS, it is the actual exit status code of the command that was run.
25989 +   This is an odd number if the command succeeded, and an even number if
25990 +   it failed. You can see the associated message as follows:
25991 +
25992 +  run write sys$output f$message(\v(pexitstat))
25993 +
25994 +   Or, more conveniently, use the new Kermit function:
25995 +
25996 +  echo \ferrstring(\v(pexitstat))
25997 +
25998 +   which converts a system error code (number) to the corresponding
25999 +   message.
26000 +
26001 +4.2.6. Cautions about Using Pipes to Transfer Directory Trees
26002 +
26003 +   Although utilities such as tar and zip/unzip might be available on
26004 +   different platforms (such as UNIX and Windows), this does not
26005 +   necessarily mean you can use them successfully to transfer directory
26006 +   trees between unlike platforms. For example:
26007 +
26008 +  CSEND {tar cf - . | gzip -c} {!gunzip -c | tar xf -}
26009 +
26010 +   when used from UNIX to Windows will have satisfactory results for
26011 +   binary files, but not for text files. UNIX text files have lines ending
26012 +   with Linefeed (LF) only, whereas Windows text files have lines ending
26013 +   in Carriage Return and Linefeed (CRLF). Thus any text files that were
26014 +   in the archive formed by the first tar command will be unpacked by the
26015 +   second tar command in their original form, and will display and print
26016 +   incorrectly in Windows (except in applications that have been
26017 +   explicitly coded to handle UNIX-format text files). On the other hand
26018 +   if you told gzip to use "text mode" to do record format conversion
26019 +   (assuming there was a way to tell it, as there is with most "zip"
26020 +   programs), this would destroy any binary files in the archive.
26021 +
26022 +   Furthermore, if the archive contains text files that are written in
26023 +   languages other than English, the "special" (accented and/or non-Roman)
26024 +   characters are NOT translated, and are therefore likely show up as
26025 +   gibberish on the target system. For example, West European languages
26026 +   are usually encoded in ISO Latin Alphabet 1 in UNIX, but in PC code
26027 +   page 850 on the PC. Capital A with acute accent is code point 193
26028 +   (decimal) Latin-1, but 181 in CP850. So A-acute in the UNIX file
26029 +   becomes Middle Box Bottom on the PC, and similarly for all the other
26030 +   special characters, and for all other languages -- Greek, Russian,
26031 +   Hebrew, Japanese, etc.
26032 +
26033 +   So when transferring text files between unlike platforms, you should
26034 +   use direct Kermit file transfers so Kermit can apply the needed
26035 +   record-format and character-set transformations. Use pipelines
26036 +   containing archivers like tar or zip only if all the files are binary
26037 +   or the two systems use the same record format and character set for
26038 +   text files.
26039 +
26040 +   Also see [456]Sections 4.3, [457]4.10, [458]4.11, and [459]4.15 for how
26041 +   to transfer directory trees between both like and unlike systems
26042 +   directly with Kermit.
26043 +
26044 +4.2.7. Pipes and Encryption
26045 +
26046 +   Of course pipelines could be used for encrypted file transfers,
26047 +   assuming proper precautions could be taken concerning the transmission
26048 +   of the key. But there is rarely a good way to do this. To illustrate
26049 +   using UNIX crypt:
26050 +
26051 +  csend {crypt key < filename} {!crypt key > filename}
26052 +
26053 +   Or, more ambitiously:
26054 +
26055 +  csend {tar cf - . | gzip -c | crypt key} {!crypt key | gunzip -c | tar xf -}
26056 +
26057 +   transmits the key in the file header packet as part of the (clear-text)
26058 +   remote command, defeating the entire purpose of encrypting the file
26059 +   data.
26060 +
26061 +   But if you are connected in terminal mode to the remote computer and
26062 +   type:
26063 +
26064 +  creceive {crypt key > filename}
26065 +
26066 +   at the remote Kermit prompt, you have also transmitted the key in clear
26067 +   text over the communications link.
26068 +
26069 +   At present, the only secure way to use CSEND and CRECEIVE with an
26070 +   encryption filter is to have a human operator at both ends, so the key
26071 +   does not have to be transmitted.
26072 +
26073 +   Theoretically it would be possible to use PGP software (Pretty Good
26074 +   Privacy, by Phil Zimmerman, Phil's Pretty Good Software) to avoid key
26075 +   transmission (since PGP uses separate public and private key and "lets
26076 +   you communicate securely with people you've never met, with no secure
26077 +   channels needed for prior exchange of keys"), but the specific method
26078 +   has yet to be worked out.
26079 +
26080 +     HINT: See the PGP User's Guide, e.g. at:
26081 +     [460]http://www.telstra.com.au/docs/PGP/
26082 +     Especially the topic "Using PGP as a UNIX-Style Filter":
26083 +     [461]http://www.telstra.com.au/docs/PGP/pgpdoc2/pgpdoc2_17.html
26084 +
26085 +   In any case, better and more convenient security options are now
26086 +   available: Kerberos authentication and encryption ([462]CLICK HERE for
26087 +   details) and the new ability to run C-Kermit "though" other
26088 +   communication programs, described in [463]Section 2.7.
26089 +
26090 +4.2.8. Commands and Functions Related to Pipes
26091 +
26092 +4.2.8.1. The OPEN !READ and OPEN !WRITE Commands
26093 +
26094 +   These are described in [464]Using C-Kermit, and are generally useful
26095 +   with reading output from commands that produce more than one line on
26096 +   their standard output, or writing multiple lines into commands that
26097 +   accept them on their standard input.
26098 +
26099 +   In C-Kermit 7.0 CLOSE !READ is accepted as a synonym for CLOSE READ,
26100 +   and CLOSE !WRITE for CLOSE WRITE.
26101 +
26102 +   Testing the success and failure of these commands, however, can be a
26103 +   bit tricky. Consider:
26104 +
26105 +  open !read lalaskjfsldkfjsldkfj
26106 +
26107 +   (where "lalaskjfsldkfjsldkfj" is neither a valid command nor the name
26108 +   of a program or script that can be run). OPEN !READ, in UNIX at least,
26109 +   translates this into execl(shellpath,shellname,"-c",command). This
26110 +   means it starts your preferred shell (e.g. from the SHELL environment
26111 +   variable) and asks it to execute the given command. It must be this
26112 +   way, because your command can be a either an internal shell command
26113 +   (which only your shell can execute) or an external command, which only
26114 +   your shell knows how to find (it knows your PATH and interprets, etc).
26115 +   Therefore unless OPEN !READ can't start your shell, it always succeeds.
26116 +
26117 +   Continuing with the nonexistent-command example:
26118 +
26119 +  C-Kermit> open !read lalaskjfsldkfjsldkfj
26120 +  C-Kermit> status
26121 +   SUCCESS
26122 +  C-Kermit> read line
26123 +  C-Kermit> status
26124 +   SUCCESS
26125 +  C-Kermit> echo "\m(line)"
26126 +  "bash: lalaskjfsldkfjsldkfj: command not found"
26127 +  C-Kermit> close read
26128 +  C-Kermit> status
26129 +   FAILURE
26130 +  C-Kermit>
26131 +
26132 +   In other words, the failure can not be detected on OPEN, since the OPEN
26133 +   command succeeds if it can start your shell. It can't be detected on
26134 +   READ, since all this does is read output from the shell, which in this
26135 +   case happens to be an error message. However, failure IS detected upon
26136 +   close, since this is the occasion upon which the shell gives Kermit its
26137 +   exit status code.
26138 +
26139 +   For an illustration of this situation, see [465]Section 2.14.
26140 +
26141 +4.2.8.2. The REDIRECT Command
26142 +
26143 +   A second method of I/O redirection is offered by the REDIRECT command.
26144 +   This is a rather advanced and tricky feature that is presently
26145 +   supported only in UNIX C-Kermit, in OS-9 C-Kermit, and in Kermit 95.
26146 +   Syntax:
26147 +
26148 +   REDIRECT command
26149 +          Runs the given command, sending its standard output to the
26150 +          current communications channel (SET LINE, SET PORT, or SET HOST
26151 +          connection), and reading its standard input from the same
26152 +          connection. Works only in local mode -- i.e. a connection is
26153 +          required -- and then only if the given command uses Standard
26154 +          I/O.
26155 +
26156 +   Example:
26157 +
26158 +  redirect finger
26159 +
26160 +   runs the local "finger" command and sends its output over the
26161 +   connection as plain text, where presumably there is a process set up to
26162 +   read it. Another example:
26163 +
26164 +  redirect finger | sort -r
26165 +
26166 +   shows the use of a pipeline.
26167 +
26168 +   Note: REDIRECT differs from CSEND/CRECEIVE in two important ways: (1)
26169 +   it does not use the Kermit protocol, and (2) it uses a bidirectional
26170 +   pipe rather than a one-way pipe.
26171 +
26172 +   The primary use of the REDIRECT command is to run external protocols,
26173 +   such as sz/rz in UNIX for ZMODEM, when they work over Standard I/O(*).
26174 +   Example:
26175 +
26176 +  set host xyzcorp.com
26177 +  (login, etc)
26178 +  redirect sz oofa.zip
26179 +
26180 +   lets you make a Telnet connection with C-Kermit and then do a ZMODEM
26181 +   transfer over it. ZMODEM protocol messages go both ways over the same
26182 +   connection simultaneously.
26183 +
26184 +   It is possible to use C-Kermit on UNIX as your PPP dialer and then to
26185 +   REDIRECT the connection to the PPP software, but C-Kermit 7.0 offers a
26186 +   better approach to PPP dialing in its new EXEC command ([466]Section
26187 +   1.23).
26188 +
26189 +   In theory, you can also redirect an interactive process. For example,
26190 +   suppose you tell Kermit 95 to wait for an incoming TCP/IP connection:
26191 +
26192 +  set host * 3000
26193 +
26194 +   and then tell C-Kermit on UNIX to:
26195 +
26196 +  set host kermit95hostname 3000
26197 +  redirect ksh
26198 +
26199 +   and then tell Kermit 95 to CONNECT: now you are talking to the UNIX
26200 +   K-shell; you can give commands (pwd, ls, etc) and see the results. In
26201 +   practice, the K-shell's terminal modes are messed up because (a) it is
26202 +   not going through the Unix terminal driver, and (b) it is "smart" and
26203 +   knows it is being redirected, and so acts in a decidedly inhospitable
26204 +   manner (other applications like EMACS, vi, etc, simply refuse to run if
26205 +   their standard i/o has been redirected).
26206 +
26207 +     (*) The publicly-distributed sz/rz programs do not work as clients.
26208 +     However, Omen Technology does offer an up-to-date redirectable
26209 +     client XYZMODEM program called crzsz.
26210 +
26211 +4.2.8.3. Receiving Mail and Print Jobs
26212 +
26213 +   As of 7.0, and in UNIX only, files that are sent to C-Kermit as mail
26214 +   (when the other Kermit uses a MAIL or SEND /MAIL command) or to be
26215 +   printed (via REMOTE PRINT or SEND /PRINT) are now piped directly to the
26216 +   mail or print program, rather than written to temporary files and then
26217 +   mailed or printed and then deleted. This has the advantages of (a) not
26218 +   requiring a temporary file, and (b) allowing mail to have a proper
26219 +   subject in place of the filename. Temporary files were bad not only
26220 +   because they required (a) space, and (b) writeability of the current
26221 +   directory, but also because using them could result in wiping out an
26222 +   existing file. See [467]Section 4.7 for more about SEND /MAIL and SEND
26223 +   /PRINT.
26224 +
26225 +4.2.8.4. Pipe-Related Functions
26226 +
26227 +   The \fcommand(command) function runs the given shell or system command
26228 +   and returns the command's standard output as its value (with any
26229 +   newline characters stripped from the end), unless the result is too
26230 +   long, in which case it returns the empty string. The maximum length for
26231 +   the result is at least 1022 bytes, and it might be longer on some
26232 +   platforms. Examples (UNIX):
26233 +
26234 +  C-Kermit> echo "\fcommand(date)"
26235 +  "Fri Apr 18 13:31:42 1997"
26236 +  C-Kermit> echo "\fcommand(finger | wc -l)" ; how many users logged in?
26237 +  "      83"
26238 +  C-Kermit> evaluate \fcommand(finger | wc -l) * 2
26239 +  166
26240 +  C-Kermit> echo Welcome to \fcommand(tty) on \fcommand(date)
26241 +  Welcome to /dev/ttyre on Fri Apr 18 13:31:42 1997
26242 +  C-Kermit> echo "\fcommand(ls oofa.*)"
26243 +  "oofa.c
26244 +  oofa.h
26245 +  oofa.o"
26246 +  C-Kermit> cd /directory-with-thousands-of-files
26247 +  C-Kermit> echo "\fcommand(ls -l)" ; This would be too long
26248 +  ""
26249 +  C-Kermit>
26250 +
26251 +   If a command's output would be too long, you can use the other, more
26252 +   laborious method of reading from a command: OPEN !READ command, READ
26253 +   each line, CLOSE !READ.
26254 +
26255 +   The \frawcommand(command) function is identical to \fcommand(command),
26256 +   except it does not remove trailing newline characters:
26257 +
26258 +  C-Kermit> echo "\frawcommand(date)"
26259 +  "Fri Apr 18 13:31:42 1997
26260 +  "
26261 +  C-Kermit> echo "\frawcommand(ls oofa.*)"
26262 +  "oofa.c
26263 +  oofa.h
26264 +  oofa.o
26265 +  "
26266 +  C-Kermit>
26267 +
26268 +   Use \frawcommand() if you want to retain the final line terminators, or
26269 +   if the command's output is "binary". But remember that if the result of
26270 +   this (or any other) function contains any NUL (ASCII code 0)
26271 +   characters, the first NUL will terminate the result string because this
26272 +   is how C strings work (it's "C-Kermit", remember?).
26273 +
26274 +   These functions are useful not only locally, but also in the
26275 +   client/server arena. If you need to get the results from a system
26276 +   command on the server end into a variable on the client end, just do:
26277 +
26278 +  [ remote ] query kermit command(date)
26279 +
26280 +   The result is in the local \v(query) variable; see [468]Using C-Kermit,
26281 +   2nd Ed., pp.359-360 for details.
26282 +
26283 +4.3. Automatic Per-File Text/Binary Mode Switching
26284 +
26285 +   When transferring files between like systems (e.g. UNIX-to-UNIX),
26286 +   binary mode can be used for all files unless character-set translation
26287 +   is needed, and in fact Kermit programs of recent vintage recognize each
26288 +   others' platforms and switch to binary mode automatically when it is
26289 +   appropriate (e.g. DOS to OS/2, or UNIX to UNIX). (Exception: LABELED
26290 +   mode is chosen for VMS-to-VMS and OS/2-to-OS/2 transfers so complex
26291 +   file formats can be preserved.)
26292 +
26293 +   On a client/server connection between like systems, the transfer mode
26294 +   is currently determined by the file sender, rather than always by the
26295 +   client. If the client is sending, it controls the transfer mode. If a
26296 +   GET command is sent to the server, the server sends all files in binary
26297 +   mode if its TRANSFER CHARACTER-SET is TRANSPARENT; otherwise it uses
26298 +   text mode for text files (according to its text-pattern list) and
26299 +   binary mode for binary files. Of course, the client can control the
26300 +   server's transfer character-set with the REMOTE SET TRANSFER
26301 +   CHARACTER-SET command.
26302 +
26303 +   When transferring files between unlike systems, however, (e.g.
26304 +   UNIX-to-DOS), some files (such as executable program images) must be
26305 +   transferred in binary mode but others (such as plain-text files) must
26306 +   be transferred in text mode so their record format and character sets
26307 +   can be appropriately converted. If a binary file is transferred in text
26308 +   mode, it is ruined. If a text file is transferred in binary mode, then
26309 +   at the very least, its format can be incorrect; at worst it is also
26310 +   corrupted because its character set was not converted (in extreme cases
26311 +   the corruption is total, e.g. because one system is ASCII-based and the
26312 +   other EBCDIC).
26313 +
26314 +4.3.1. Exceptions
26315 +
26316 +   VMS C-Kermit, when sending files to a non-VMS system, switches to text
26317 +   or binary mode automatically for each file, based on the record format
26318 +   in the file's directory entry; thus the mechanisms described in this
26319 +   section do not apply to VMS C-Kermit, yet the effect is the same:
26320 +   automatic text/binary mode switching when VMS C-Kermit is sending
26321 +   files. See the VMS Appendix of [469]Using C-Kermit for details.
26322 +
26323 +   Kermit versions that support LABELED or IMAGE transfer mode are
26324 +   likewise not affected by this feature when one of those modes is
26325 +   selected (normally used only when transferring between like systems).
26326 +
26327 +   Kermit versions that support file-transfer pipes and filters are not
26328 +   affected by this feature when pipes or filters are used, since the
26329 +   output of a pipe or filter (such as gzip) is likely to require transfer
26330 +   in a different mode than the original file.
26331 +
26332 +   Finally, SEND /TEXT or SEND /BINARY will force files to be sent in the
26333 +   indicated mode, overriding all automatic transfer-mode-choosing
26334 +   mechanisms.
26335 +
26336 +4.3.2. Overview
26337 +
26338 +   Suppose you give C-Kermit a command like:
26339 +
26340 +  SEND *.*
26341 +
26342 +   And suppose the pattern *.* matches a mixture of text files (such as
26343 +   program source code) and binary files (such os object modules or
26344 +   executable programs).
26345 +
26346 +   C-Kermit 6.0 and earlier (except on VMS) send all files in the same
26347 +   mode: whatever you said in your most recent SET FILE TYPE command, or
26348 +   else whatever mode was chosen automatically according to the rules on
26349 +   page 236 of Using C-Kermit, 2nd Ed.
26350 +
26351 +   But when text and binary files are mixed in the same group, and the
26352 +   files are being transferred to an unlike system (e.g. UNIX to IBM
26353 +   Mainframe), this results in corruption of either all the text files or
26354 +   all the binary files.
26355 +
26356 +   Stream-oriented file systems such as in UNIX and DOS do not record any
26357 +   information about the file to tell us whether the file should be
26358 +   transferred in binary or text mode, making it impossible to select the
26359 +   transfer mode for each file in a group automatically with any
26360 +   certainty.
26361 +
26362 +   However, we can use some fairly-well established file naming
26363 +   conventions for this purpose. C-Kermit 7.0 lets you provide lists of
26364 +   filename patterns that are used to separately determine the file type
26365 +   for each individual file being transfered. A pattern is a string,
26366 +   possibly containing the special characters "*" (asterisk, which matches
26367 +   any string of zero of more characters) and/or "?" (question mark, which
26368 +   matches any single character). For example "a*b" matches all files
26369 +   whose names start with "a" and end with "b", such as "ab", "arb",
26370 +   "ababababab", etc, but not "abba". And "a?b" matches any file whose
26371 +   name starts with "a", ends with "b", and is exactly 3 characters long.
26372 +
26373 +     NOTE: When typing commands at the C-Kermit prompt, you must prefix
26374 +     "?" with \ to override its normal function of giving help.
26375 +
26376 +   (Also see [470]Section 4.9 for additional pattern-matching notations
26377 +   that might be available in your version of C-Kermit.)
26378 +
26379 +   When you have specified filename recognition patterns, C-Kermit can
26380 +   transfer the ones whose names match any of the binary-mode patterns in
26381 +   binary mode, and those with names that match any of the text-mode
26382 +   patterns in text mode, and those whose names match neither in the
26383 +   prevailing mode you have chosen, or that was chosen automatically via
26384 +   peer recognition.
26385 +
26386 +4.3.3. Commands
26387 +
26388 +   SET FILE PATTERNS { ON, OFF, AUTO }
26389 +          This tells Kermit whether to do per-file filename
26390 +          pattern-matching to determine text or binary mode. The normal
26391 +          and default setting is AUTO, which means to use pattern lists to
26392 +          switch transfer mode only when it is certain that the other
26393 +          Kermit program supports automatic notification of transfer mode
26394 +          (via Attribute packets) on a per-file basis (this information is
26395 +          obtained automatically during protocol startup negotiation). ON
26396 +          means to always determine the transfer mode from the filename
26397 +          and pattern list when sending files. Use OFF to disable this
26398 +          feature (without resetting your pattern lists). Also note that
26399 +          if you have selected LABELED file transfer (SET FILE TYPE
26400 +          LABELED), this takes precedence over filename-matching patterns
26401 +          and all files are sent in labeled mode.
26402 +
26403 +   SET TRANSFER MODE MANUAL
26404 +          Disables the use of filename patterns, no matter what the FILE
26405 +          PATTERNS setting.
26406 +
26407 +   REMOTE SET TRANSFER MODE MANUAL
26408 +          Client command to disable automatic transfer mode, and therefore
26409 +          also filename patterns, in the server. Synonym: REMOTE SET XFER
26410 +          MODE MANUAL.
26411 +
26412 +   { GET, SEND, etc } { /BINARY, /TEXT }
26413 +          Including a /BINARY or /TEXT (or, where supported, /IMAGE or
26414 +          /LABELED) switch with a file-transfer command changes the
26415 +          transfer mode to manual for that command only, and therefore
26416 +          disables patterns that that command.
26417 +
26418 +   SET FILE BINARY-PATTERNS [ pattern [ pattern [ pattern ... ] ] ]
26419 +          A list of zero or more patterns, separated by spaces (not
26420 +          commas). Letters in a pattern are case-sensitive if the
26421 +          underlying filenames are case sensitive (as in UNIX), and
26422 +          case-insensitive otherwise (as in Windows). If a file's name is
26423 +          matched by any pattern in the list and SET FILE PATTERNS is ON,
26424 +          the file is sent in binary mode. Examples:
26425 +
26426 +  SET FILE BINARY-PATTERNS *.gz *.Z *.tar *.zip *.o *.so *.a *.out ; UNIX
26427 +  SET FILE BINARY-PATTERNS *.EXE *.ZIP *.OBJ *.COM ; DOS or OS/2 or Windows
26428 +
26429 +          If a pattern contains spaces, enclose it in braces.
26430 +
26431 +   SET FILE TEXT-PATTERNS [ pattern [ pattern [ pattern ... ] ] ]
26432 +          Like SET FILE BINARY-PATTERNS, but the patterns choose text
26433 +          files rather than binary ones. Examples:
26434 +
26435 +  SET FILE TEXT-PATTERNS *.TXT *.KSC *.HTM* *.BAT ; DOS, Windows, OS/2
26436 +
26437 +   ADD BINARY-PATTERNS [ pattern [ pattern [ pattern ... ] ] ]
26438 +          Adds one or more patterns to the BINARY-PATTERN list.
26439 +
26440 +   ADD TEXT-PATTERNS [ pattern [ pattern [ pattern ... ] ] ]
26441 +          Adds one or more patterns to the TEXT-PATTERN list.
26442 +
26443 +   REMOVE BINARY-PATTERNS [ pattern [ pattern [ pattern ... ] ] ]
26444 +          Removes one or more patterns from the BINARY-PATTERN list. The
26445 +          given patterns are matched with the ones in the BINARY-PATTERNS
26446 +          list with case sensitivity if the underlying file system has
26447 +          case-sensitive names (as do UNIX and OS-9), otherwise with case
26448 +          independence.
26449 +
26450 +   REMOVE TEXT-PATTERNS [ pattern [ pattern [ pattern ... ] ] ]
26451 +          Removes one or more patterns from the TEXT-PATTERN list.
26452 +
26453 +   SHOW PATTERNS
26454 +          Displays the current pattern selections.
26455 +
26456 +   Whenever you give a SET FILE BINARY-PATTERNS or SET FILE TEXT-PATTERNS
26457 +   command, the previous list is replaced. If you give one of these
26458 +   commands without a pattern list, the previous list is removed.
26459 +
26460 +   When patterns are active and files are being sent, text patterns (if
26461 +   any) are applied first (but only if not RESENDing and not sending in
26462 +   LABELED mode), then binary patterns, so if the same pattern appears in
26463 +   both lists, binary mode is chosen.
26464 +
26465 +4.3.4. Examples
26466 +
26467 +   Here's an example that might be used when sending files from UNIX:
26468 +
26469 +  set file type binary
26470 +  set file text-patterns *.c *.h *.w *.txt makefile
26471 +  set file binary-patterns *.o
26472 +  msend makefile wermit wart ck*.[cwho] ck*.txt
26473 +
26474 +   Note that "wermit" and "wart" do not match any patterns so they are
26475 +   sent in the prevailing mode, which is binary. Also note the use of
26476 +   "makefile" as a pattern that does not contain any wildcard characters
26477 +   (there is no other convention to distinguish among "wermit" and "wart",
26478 +   which are binary executables, and "makefile", which is a text file,
26479 +   purely by their names).
26480 +
26481 +   Most C-Kermit implementations have a default pattern list built in,
26482 +   which includes patterns that are almost certain to succeed in picking
26483 +   the right transfer mode. Others are omitted due to ambiguity. For
26484 +   example ".hlp", and ".ini" are generally binary types in Windows but
26485 +   text types everywhere else.
26486 +
26487 +     NOTE: ".doc", used for decades to denote plain-text documentation
26488 +     files, now more often than not denotes a Microsoft Word Document, so
26489 +     ".doc" is now considered a binary type since it does less harm to
26490 +     transfer a plain-text document in binary mode than it does to
26491 +     transfer an MS Word file in text mode (except when IBM mainframes
26492 +     are involved!)
26493 +
26494 +     ANOTHER NOTE: ".com" files are binary in DOS-like operating systems,
26495 +     but they are text (DCL command procedures) in VMS. VMS C-Kermit
26496 +     sends .COM files in text mode; K95 sends them in binary mode. If you
26497 +     download a .COM file from VMS to DOS or Windows, and then upload it
26498 +     to another VMS system, be sure to use SEND /TEXT to preserve its
26499 +     textness.
26500 +
26501 +   You can see the default pattern list by starting C-Kermit without its
26502 +   initialization file (e.g. "kermit -Y") and using the SHOW PATTERNS
26503 +   command. If you will be depending on this feature, be sure to examine
26504 +   the list carefully in conjunction with the applications that you use.
26505 +
26506 +   The default pattern list does not take "backup files" into account
26507 +   because (a) people usually don't want to transfer them; and (b) it
26508 +   would make the pattern lists more than twice as long. For example, we
26509 +   would need to include both *.txt and *.txt.~[0-9]*~ for ".txt" files,
26510 +   and similarly for all the others. Instead, you can use SEND /NOBACKUP
26511 +   (or SET SEND BACKUP OFF) to skip over all backup files.
26512 +
26513 +   Put your most commonly-used safe pattern declarations in your C-Kermit
26514 +   customization file (ckermod.ini, .mykermrc, k95custom.ini, etc).
26515 +
26516 +   As noted, SET FILE PATTERNS is ON by default. Sometimes, however, it is
26517 +   desirable, or necessary, to force files to be sent in a particular
26518 +   mode, and often this must be done from the command line (e.g. when
26519 +   using Kermit as a download helper in a Web browser like Lynx). The -V
26520 +   command-line options is equivalent to SET FILE PATTERNS OFF and SET
26521 +   TRANSFER MODE MANUAL. Example:
26522 +
26523 +  kermit -Vis oofa.txt
26524 +
26525 +   forces oofa.txt to be sent in binary mode, even though ".txt" might
26526 +   match a text pattern.
26527 +
26528 +4.4. File Permissions
26529 +
26530 +   "Permissions" refers to a code associated with a file that specifies
26531 +   who is allowed to access it, and in what manner. For example, the
26532 +   owner, the members of one or more groups, the system administrator, and
26533 +   everybody else, might be allowed various combinations of Read, Write,
26534 +   Append, Execute, or Listing access.
26535 +
26536 +   The permission code goes by different names on different platforms. In
26537 +   UNIX, it might be called the filemode. In VMS, it is called the file
26538 +   protection (or protection mask).
26539 +
26540 +   The comments in this section presently apply only to the UNIX and VMS
26541 +   versions of C-Kermit, to which these features were added in version
26542 +   7.0; the DOS, Windows, and OS/2 file systems embody no notions of
26543 +   protection, and so MS-DOS Kermit and Kermit 95 do not send file
26544 +   permissions, and ignore them when received.
26545 +
26546 +   The permissions for a received file are determined by a combination of
26547 +   the file transfer mode (VMS-to-VMS transfers only), whether a file of
26548 +   the same name exists already, whether permissions of the file are
26549 +   received in the file attribute packet, and the setting of ATTRIBUTES
26550 +   PROTECTION.
26551 +
26552 +   The default for ATTRIBUTES PROTECTION is ON. If no attributes are
26553 +   received, the effect is the same as if attributes PROTECTION were OFF.
26554 +
26555 +   For VMS-to-VMS transfers, the default LABELED mode simply copies the
26556 +   protection code from source to destination.
26557 +
26558 +4.4.1. When ATTRIBUTES PROTECTION is OFF
26559 +
26560 +   If no file of the same name exists, system defaults determine the
26561 +   permissions of the new file. Otherwise, the actions taken depend on the
26562 +   current FILE COLLISION setting: BACKUP, OVERWRITE, RENAME, etc, as
26563 +   documented in [471]Using C-Kermit. But now the new file (if it is
26564 +   created at all) automatically inherits the permissions (mode bits) of
26565 +   the existing file in a way that is appropriate for the platform.
26566 +
26567 +4.4.1.1. Unix
26568 +
26569 +   All mode bits are inherited except the directory bit, since the
26570 +   incoming file can not possibly be a directory. (In any case, it is not
26571 +   possible to receive a file that has the same name as an existing
26572 +   directory unless FILE COLLISION is set to RENAME).
26573 +
26574 +4.4.1.2. VMS
26575 +
26576 +   Files with the same name as an existing file, transferred in modes
26577 +   other than LABELED between VMS systems, inherit the protection of the
26578 +   prior version.
26579 +
26580 +4.4.2 When ATTRIBUTES PROTECTION is ON
26581 +
26582 +   File permissions can be conveyed as part of the file transfer process,
26583 +   in accordance with the Kermit protocol definition. If the file sender
26584 +   puts system-dependent and/or system-independent versions of the file
26585 +   protection (permissions) into the Attribute (A) packet, the file
26586 +   receiver can set the new file's permissions from them. Otherwise, the
26587 +   permissions are set the same as for ATTRIBUTES PROTECTION OFF.
26588 +
26589 +   When the incoming A packet contains system-dependent permissions, the
26590 +   file receiver checks to see if the sender has the same system ID (e.g.
26591 +   both the sending and receiving systems are UNIX, or both are VMS); if
26592 +   so, it decodes and uses the system-dependent permissions; otherwise it
26593 +   uses the generic ones (if any) and applies them to the owner field,
26594 +   setting the other fields appropriately as described in the following
26595 +   sections.
26596 +
26597 +   Setting the incoming file's protection from the A packet is controlled
26598 +   by SET ATTRIBUTES PROTECTION (or PERMISSION), which is ON by default,
26599 +   and its status is displayed by SHOW ATTRIBUTES.
26600 +
26601 +   The main benefit of this feature is to not have to "chmod +x" an
26602 +   executable file after transfer from UNIX to UNIX. Its cross-platform
26603 +   benefits are less evident, perhaps to retain the status of the Unix 'x'
26604 +   bit on a VMS system, for subsequent transfer back to a Unix system.
26605 +
26606 +4.4.2.1. System-Specific Permissions
26607 +
26608 +   System-specific file permissions are used when the two Kermit programs
26609 +   recognize each other as running on the same type of system. For
26610 +   example, both are running under some form of UNIX (it doesn't matter
26611 +   which UNIX variation -- HP-UX, Solaris, AIX, etc -- all use the same
26612 +   scheme for file permissions); or both are running under VMS (even if
26613 +   one is on an Alpha and the other on a VAX, and/or one is old and the
26614 +   other is new).
26615 +
26616 +4.4.2.1.1. UNIX
26617 +
26618 +   UNIX supports three categories of users, File Owner, Group, and World,
26619 +   and three types of file access permission: Read, Write, and Execute.
26620 +   Thus, a UNIX file's permissions are expressed in 9 bits.
26621 +
26622 +   The system-dependent permission string for UNIX is a 3-digit octal
26623 +   string, the low-order 9 bits of the st_mode member of the stat struct;
26624 +   we deliberately chop off the "file format" bits because they are not
26625 +   permissions, nor do we convey the setuid/setgid bits, lock bit, sticky
26626 +   bit, etc.
26627 +
26628 +4.4.2.1.2. VMS
26629 +
26630 +   VMS supports four categories of users, System, File Owner, Group, and
26631 +   World, and four types of file access permission: Read, Write, Execute,
26632 +   and Delete. Thus, a VMS file's permissions are expressed in 16 bits.
26633 +
26634 +   The system-dependent protection string for VMS is a 4-digit hexadecimal
26635 +   string, corresponding to the internal-format protection word of the
26636 +   file (RWED for each of World,Group,Owner,System). A new file normally
26637 +   gets all 16 protection bits from the original file of the same name.
26638 +
26639 +   Note: VMS-to-VMS transfers take place in LABELED mode when the two
26640 +   C-Kermits recognize each other's platform as VMS (unless you have
26641 +   disabled LABELED-mode transfers). In this case, all of a file's
26642 +   attributes are preserved in the transfer and the protection mask (and
26643 +   other information) is taken from the file's internal information, and
26644 +   this takes precedence over any information in the Attribute packets.
26645 +   You can defeat the automatic switching into LABELED mode (if you want
26646 +   to) with SET TRANSFER MODE MANUAL.
26647 +
26648 +4.4.2.2. System-Independent Permissions
26649 +
26650 +   The system-independent ("generic") protection is used when the system
26651 +   IDs of the two Kermit programs do not agree (e.g. one is UNIX, the
26652 +   other is VMS). The generic protection attribute includes the following
26653 +   permissions (not all are applicable to every file system): Read, Write,
26654 +   Append, Execute, Delete, Search. The generic permissions are derived
26655 +   from the owner permissions of the source file, thus, a Unix 'w'
26656 +   permission becomes VMS Write,Delete.
26657 +
26658 +   The Owner field of the new file's permissions is set from the incoming
26659 +   generic protection attribute.
26660 +
26661 +   In UNIX, the Group and World permissions are set according to your
26662 +   umask, except that execute permission is NOT set in these fields if it
26663 +   was not also set in the generic protection (and consequently, is set in
26664 +   the Owner field).
26665 +
26666 +   In VMS, the System, Group, and World permissions are set according to
26667 +   the process default file permission (as shown in VMS by SHOW
26668 +   PROTECTION), except that no permissions are allowed in these fields
26669 +   that are not included in the generic permissions.
26670 +
26671 +   Note that the VMS and UNIX interpretations of Execute permission are
26672 +   not identical. In UNIX, a file (binary executable, shell script, etc)
26673 +   may not be executed unless it has Execute permission, and normally
26674 +   files that are not intended for execution do not have Execute
26675 +   permission. In VMS, Read permission implicitly supplies Execute
26676 +   capability. Generally files that have Read permission also have
26677 +   explicit Execute permission, but files (binary executables, DCL command
26678 +   procedures) that have Read permission and not Execute permission can
26679 +   still be executed.
26680 +
26681 +4.5. File Management Commands
26682 +
26683 +4.5.1. The DIRECTORY Command
26684 +
26685 +   Prior to C-Kermit 7.0, the DIRECTORY command always ran an external
26686 +   system command (such as "ls" on UNIX) or program to product the
26687 +   directory listing. This had certain advantages, mostly that you could
26688 +   include system-dependent options for customized listings, e.g. on UNIX:
26689 +
26690 +  dir -lt c* | more
26691 +
26692 +   or in VMS:
26693 +
26694 +  directory /size/date/protection/except=*.obj oofa.*;0
26695 +
26696 +   This approach, however, carries some disadvantages: C-Kermit can't
26697 +   return SUCCESS or FAILURE status for (e.g.) "dir foo" according to
26698 +   whether the file "foo" exists; and it runs an inferior process, which
26699 +   might be a problem in some environments for resource and/or security
26700 +   reasons, and won't work at all in a "nopush" environment (e.g. one in
26701 +   which C-Kermit is configured to forbid access to exterior commands and
26702 +   programs, e.g. in a VMS "captive account").
26703 +
26704 +   In C-Kermit 7.0 on VMS and UNIX, and in K95 1.1.19 and later, the
26705 +   DIRECTORY command is internal to Kermit. It can be run in a "nopush"
26706 +   environment and returns SUCCESS or FAILURE status appropriately. In
26707 +   UNIX it prints all dates and times in a consistent way (unlike ls). In
26708 +   VMS it prints precise file sizes, rather than "blocks". It offers
26709 +   several formatting and other options, but it is not necessarily more
26710 +   flexible than the corresponding external commands or programs (the UNIX
26711 +   "ls" program, the VMS "directory" command). The syntax is:
26712 +
26713 +   DIRECTORY [ switch [ switch [ ... ] ] ] [ filespec ]
26714 +
26715 +   If no filespec is given, all files in the current directory are listed.
26716 +
26717 +   Optional switches include all the standard file-selection switches
26718 +   presented in [472]Section 1.5.4, plus:
26719 +
26720 +   /ALL
26721 +          Show both regular files and directories; this is the default.
26722 +
26723 +   /ARRAY:x
26724 +          Instead of displaying a directory listing, put the files that
26725 +          would have been shown (based on the filespec and other selection
26726 +          switches) in the given array. The array need not (and should
26727 +          not) be predeclared; if the array already exists, it is
26728 +          destroyed and reused. The array name can be a single letter,
26729 +          like "a", or any fuller form, such as "&a", "\&a", "\&a[]", etc.
26730 +          If the /ARRAY switch is included, the following other switches
26731 +          are ignored: /BRIEF, /VERBOSE, /HEADING, /PAGE, /ENGLISHDATE,
26732 +          /ISODATE, /XFERMODE, /MESSAGE, /SORT, /REVERSE, /ASCENDING. In
26733 +          other words, only file selection switches are meaningful with
26734 +          /ARRAY: /FILES, /DIRECTORIES, /ALL, /DOTFILES, /NOBACKUP,
26735 +          /RECURSIVE, /SMALLER, /LARGER, /AFTER, /BEFORE, /EXCEPT, etc.
26736 +          The resulting array has the number of files (n) as its 0th
26737 +          element, and the filenames in elements 1 through n Example:
26738 +
26739 +  dir /array:&a /files /nobackup /after:19990101 /larger:10000 [ab]*
26740 +  show array &a
26741 +
26742 +   /FILES
26743 +          Only show regular files.
26744 +
26745 +   /DIRECTORIES
26746 +          Only show directories.
26747 +
26748 +   /BACKUP
26749 +          In UNIX, OS-9, K-95, and other versions that support SET FILE
26750 +          COLLISION BACKUP and create backup files by appending .~n~ to
26751 +          the filename (where "n" is a number), /BACKUP means to include
26752 +          these files in directory listings. This is the default.
26753 +
26754 +   /NOBACKUP
26755 +          This is the opposite of /BACKUP: that is, do not include backup
26756 +          files in the listing.
26757 +
26758 +   /BRIEF
26759 +          List filenames only; use a compact format, as many filenames as
26760 +          will fit across the screen (based on the longest name). A brief
26761 +          listing is always sorted alphabetically.
26762 +
26763 +   /VERBOSE
26764 +          List one file per line, and include date, size, and (in UNIX
26765 +          only) permissions of each file. This is the opposite of /BRIEF,
26766 +          and is the default.
26767 +
26768 +   /PAGE
26769 +          Pause at the end of each screenful and give a "more?" prompt,
26770 +          even if SET COMMAND MORE-PROMPTING is OFF.
26771 +
26772 +   /NOPAGE
26773 +          Don't pause at the end of each screenful and give a "more?"
26774 +          prompt, even if SET COMMAND MORE-PROMPTING is ON. If neither
26775 +          /PAGE or /NOPAGE is given, paging is according to the prevailing
26776 +          COMMAND MORE-PROMPTING setting (which can be displayed with SHOW
26777 +          COMMAND).
26778 +
26779 +   /ENGLISHDATE
26780 +          Show dates in dd-mmm-yyyy format; mmm is the first three letters
26781 +          of the English month name.
26782 +
26783 +   /ISODATE
26784 +          Show dates in yyyy-mm-dd format; mm is the month number, 1-12.
26785 +          This is the opposite of /ENGLISHDATE, and is the default.
26786 +
26787 +   /HEADINGS
26788 +          Print a heading before the listing and a summary at the end.
26789 +
26790 +   /NOHEADINGS
26791 +          Don't print a heading before the listing or a summary at the
26792 +          end. This is the opposite of /HEADINGS, and is the default.
26793 +
26794 +   /XFERMODE
26795 +          Only in Kermit programs that support SET FILE PATTERNS. If this
26796 +          switch is included, and the filename matches any FILE
26797 +          BINARY-PATTERN ([473]Section 4.3), "(B)" is printed after the
26798 +          filename; otherwise, if it matches a FILE TEXT-PATTERN, "(T)" is
26799 +          printed.
26800 +
26801 +   /NOXFERMODE
26802 +          Don't display transfer-mode indicators. This is the opposite of
26803 +          /XFERMODE and is the default.
26804 +
26805 +   /RECURSIVE
26806 +          Show files not only in the given directory, but also in its
26807 +          subdirectories (if any), their subdirectories, etc.
26808 +
26809 +   /NORECURSIVE
26810 +          Don't show files in subdirectories. This is the opposite of
26811 +          /RECURSIVE, and is the default.
26812 +
26813 +   /MESSAGE:text
26814 +          This lets you specify a short text string to be appended to the
26815 +          end of each directory listing line (a space is supplied
26816 +          automatically). If the text contains any spaces, enclose it in
26817 +          braces, e.g. /MESSAGE:{two words}.
26818 +
26819 +   /NOMESSAGE
26820 +          Don't append any message to the end of each directory listing
26821 +          line (default).
26822 +
26823 +   /SORT:[{NAME,SIZE,DATE}]
26824 +          Sort the listing by name, size, or date. If the /SORT switch is
26825 +          given but the "sort-by" keyword is omitted, the listing is
26826 +          sorted by name. /SORT:NAME /ASCENDING (alphabetic sort by name)
26827 +          is the default.
26828 +
26829 +   /NOSORT
26830 +          Don't sort the listing. Files are listed in whatever order they
26831 +          are supplied by the operating system, e.g. inode order in UNIX.
26832 +
26833 +   /REVERSE
26834 +          If the /SORT switch is given, reverse the order of the sort.
26835 +          Synonym: /DESCENDING.
26836 +
26837 +   /ASCENDING
26838 +          If the /SORT switch is given, sort the listing in normal order.
26839 +          This is the opposite of /REVERSE and is the default.
26840 +
26841 +   Note that most of the DIRECTORY-specific switches come in pairs, in
26842 +   which one member of a pair (e.g. /NOHEADINGS) is the opposite of the
26843 +   other (e.g. /HEADINGS).
26844 +
26845 +   If you always want to use certain options, you can set them with the
26846 +   SET OPTIONS DIRECTORY command ([474]Section 1.5.5). Use SHOW OPTIONS to
26847 +   list the options currently in effect. To make the desired options apply
26848 +   every time you run C-Kermit, put a SET OPTIONS DIRECTORY command in
26849 +   your C-Kermit customization file, specifying the desired options.
26850 +   Options set in this manner apply to every subsequent DIRECTORY command.
26851 +   Of course, if you include switches in a DIRECTORY command, these
26852 +   override any defaults, built-in or custom. Example:
26853 +
26854 +  DIRECTORY            ; Use "factory defaults"
26855 +  SET OPTIONS DIRECTORY /SORT:SIZE /REVERSE /HEADINGS  ; Customize defaults
26856 +  DIRECTORY            ; Use customized defaults
26857 +  DIR /SORT:NAME       ; Override customized default SORT key
26858 +  SET OPT DIR /RECURS  ; Add /RECURSIVE to customized defaults
26859 +  DIR /ASCEND          ; Override customized default SORT order
26860 +
26861 +   Notes:
26862 +
26863 +     * Only a single sort key is supported; there is presently no way to
26864 +       have multiple sort keys.
26865 +     * If the /BRIEF switch is given, all other switches (except
26866 +       /[NO]RECURSIVE, /[NO]DOTFILES, /DIRECTORIES, /FILES, and /ALL) are
26867 +       ignored.
26868 +     * /SORT:anything gives incorrect results if any files have lengths
26869 +       greater than 10 digits (i.e. that are more than 9999999999 bytes
26870 +       long, i.e. if they are 10GB or more in size) because the overlong
26871 +       length field causes the date and name fields to be misaligned.
26872 +     * /SORT:NAME is redundant in VMS since VMS returns filenames in
26873 +       alphabetic order anyway.
26874 +     * /SORT:NAME ignores alphabetic case on platforms where case does not
26875 +       matter in filenames, but this works only for unaccented Roman
26876 +       letters A-Z.
26877 +     * /SORT:NAME is currently based on code values, and so works fine for
26878 +       ASCII, but will probably produce unexpected results for files with
26879 +       non-ASCII or 8-bit characters in their names. (Locale-based sorting
26880 +       raises rather significant issues of portability, size, performance,
26881 +       etc.)
26882 +     * /SORT:DATE works right only for ISO-format dates, not English ones.
26883 +     * /SORT:SIZE sorts the size field lexically. On some platforms (e.g.
26884 +       Windows), the size of a directory file is listed as "<DIR>" rather
26885 +       than as a number; in this case, the "<DIR>" files are gathered at
26886 +       the end (or beginning, depending on the sort order) of the listing.
26887 +     * /RECURSIVE is accepted but ignored in AOS/VS. Use the normal
26888 +       system-specific filespec notation, e.g. "dir #.txt".
26889 +     * /RECURSIVE has no affect when a full, absolute pathname is given;
26890 +       e.g. "dir /recursive /tmp/foo" (where "foo" is a regular file) only
26891 +       shows the "/tmp/foo" file. If you want to see all "foo" files in
26892 +       the /tmp tree, do "cd /tmp" and then "dir /recursive foo".
26893 +     * If a file size of -1 is shown, or date-time of 0000-00-00 00:00:00,
26894 +       this means the file was located, but access to information about
26895 +       the file was denied to C-Kermit.
26896 +     * In VMS, if FOO.DIR;1 is a directory within your current directory,
26897 +       "directory foo" and "directory [.foo]" list the files in the [.FOO]
26898 +       subdirectory, but "directory foo.dir" lists the directory file
26899 +       itself; similarly for "*.dir" versus "[.*]", etc.
26900 +     * In UNIX, if "foo" is a directory within your current directory,
26901 +       "directory foo" lists the files in the foo directory. If you want
26902 +       to list the foo directory file itself, put an asterisk at the end:
26903 +       "dir foo*".
26904 +
26905 +   Hint: How to find the biggest files in a directory tree:
26906 +
26907 +  cd xxx ; (root of tree)
26908 +  directory /sort:size /recursive /reverse /dotfiles /page
26909 +
26910 +   Another hint: If you often use several different directory-listing
26911 +   formats, define macro shortcuts for them:
26912 +
26913 +  DEFINE WD DIRECTORY /SORT:DATE /REVERSE \%*  ; Reverse chronological order
26914 +  DEFINE SD DIRECTORY /SORT:SIZE /REVERSE \%*  ; Reverse order of size
26915 +  DEFINE ND DIRECTORY /SORT:NAME /ASCEND \%*   ; Alphabetical by name
26916 +  DEFINE DL DIR /DIR /SORT:NAME /ASCEND \%*    ; Alphabetical directory list
26917 +
26918 +   Put these definitions in your C-Kermit customization file. Note that
26919 +   "\%*" ([475]Section 7.5) in these definitions lets you include other
26920 +   switches in your macro invocations, e.g.:
26921 +
26922 +  wd /headings *.txt
26923 +
26924 +   Of course you can still access your external directory listing program
26925 +   by using RUN or "!", e.g. in VMS:
26926 +
26927 +  run directory /size/date/protection/except=*.obj oofa.*;0
26928 +
26929 +   or:
26930 +
26931 +  !dir /size/date/prot/exc=*.obj oofa.*;0
26932 +
26933 +   In UNIX, use "!ls" or just "ls" (which is a special synonym for "!ls").
26934 +
26935 +4.5.2. The CD and BACK Commands
26936 +
26937 +   In C-Kermit 7.0, the CD command has a new friend, the BACK command.
26938 +   BACK means "CD to my previous current directory". A second BACK brings
26939 +   you back to where you were before the first one; thus successive BACK
26940 +   commands switch back and forth between two directories.
26941 +
26942 +4.5.2.1. Parsing Improvements
26943 +
26944 +   The CD command, as well as other commands that parse a directory name,
26945 +   were changed in 7.0 to provide all the expected functions: completion
26946 +   on Tab or Esc, directory-name lists on ?, etc. Other affected commands
26947 +   include SET SERVER GET-PATH, SET TEMP-DIRECTORY, SET FILE
26948 +   DOWNLOAD-DIRECTORY, and SPACE. CD and REMOTE CD also now work with
26949 +   logical names.
26950 +
26951 +   In VMS, the situation is a bit complicated since a directory name can
26952 +   look like "DEV:", "[FOO.BAR]", "DEV:[FOO.BAR]", "[FOO]BAR.DIR;1", etc.
26953 +   Completion and ?-help might not always work, but they do in many cases.
26954 +   Examples:
26955 +
26956 +  cd ?           Lists all subdirectories of the current directory
26957 +  cd []?         Ditto
26958 +  cd k?          Ditto, but only those starting with K
26959 +  cd [foo]?      Lists all subdirectories of the [FOO] directory
26960 +  cd [-]?        Lists all subdirectories of the superior directory
26961 +  cd [--]?       Lists all subdirectories of the directory 2 levels up
26962 +  cd [...]?      Lists all directories below the current one
26963 +  cd [foo.?      Does not work.
26964 +
26965 +   C-Kermit allows all of the following in VMS:
26966 +
26967 +  cd bar         CD to subdirectory BAR of the current directory
26968 +  cd .bar        Ditto
26969 +  cd [.bar]      Ditto
26970 +  cd bar.dir     etc...
26971 +  cd bar.dir;
26972 +  cd bar.dir;1
26973 +  cd [foo.bar]
26974 +  cd <foo.bar>
26975 +  cd bar.baz     This can go more than 1 level deep...
26976 +  cd dir:        (where logical name DIR is defined as [FOO.BAR])
26977 +
26978 +   As well as the following:
26979 +
26980 +  cd ..          Go up one level as in UNIX
26981 +  cd .           The current directory
26982 +  cd             My login directory
26983 +
26984 +   Note that "cd -" (go up one level) does not work as expected, because
26985 +   "-" is Kermit's command continuation character. However, "cd [-]", and
26986 +   "
26987 +   cd {-}" have the desired effect (and so does "cd ..", which is easier
26988 +   to type).
26989 +
26990 +4.5.2.2. The CDPATH
26991 +
26992 +   The CD command in the UNIX, Windows, OS/2, and VMS versions of
26993 +   C-Kermit, as of version 6.1 / 1.1.12, searches the CDPATH for the given
26994 +   directory, if it is not absolute and if a CDPATH environment variable
26995 +   is defined. Example (in UNIX ksh or bash):
26996 +
26997 +  $ export CDPATH=$HOME:$HOME/kermit:/tmp
26998 +
26999 +   Now if you give a "cd xxx" command, no matter what your current
27000 +   directory is, if the "xxx" directory is not a subdirectory of your
27001 +   current directory, then the xxx subdirectory of your home directory is
27002 +   used or if that does not exist, then the xxx subdirectory of the kermit
27003 +   subdirectory of your home directory is used or if that does not exist,
27004 +   then /tmp/xxx is used. This is how the ksh "cd" command works, and now
27005 +   the C-Kermit CD command works the same way.
27006 +
27007 +   In VMS, you can define CDPATH to be a list of directories that contain
27008 +   actual directory delimiters, and/or logical names representing
27009 +   directories, using commas to separate them, e.g.:
27010 +
27011 +  $ define cdpath [HOME],[SOMEOTHERDIR],[HOME.MISC]
27012 +  $ define cdpath SYS$LOGIN:,DISK1:[HOME],DISK2:[SCRATCH.IVAN]
27013 +
27014 +   Example:
27015 +
27016 +  $ define cdpath SYS$LOGIN:,[IVAN],[OLAF],[OLGA.MISC]
27017 +  $ kermit
27018 +  DISK1:[OLGA] C-Kermit> cd blah
27019 +
27020 +   tries the BLAH subdirectory of the user's login directory, then
27021 +   [OLGA.BLAH], [IVAN.BLAH], [OLAF.BLAH], and [OLGA.MISC.BLAH], in that
27022 +   order, using the first one it finds, failing if it finds none.
27023 +
27024 +   In C-Kermit 7.0, you may also set the CDPATH from the Kermit prompt:
27025 +
27026 +   SET CD PATH path
27027 +          Allows the CD PATH to be set from within C-Kermit.
27028 +
27029 +   SHOW CD shows the CD path and all other information relevant to the CD
27030 +   command.
27031 +
27032 +4.5.2.3. CD Messages
27033 +
27034 +   Whenever you change directory, you can have C-Kermit display a "Read
27035 +   Me" file from the new directory automatically. The commands are:
27036 +
27037 +   SET CD MESSAGE { ON, OFF, FILE list }
27038 +          ON enables this feature; OFF (the default) disables it. File
27039 +          lets you specify the name of the "Read Me" file. A list of names
27040 +          to look for can be given in the following format:
27041 +
27042 +  {{name1}{name2}{name3}{...}}
27043 +
27044 +          e.g.:
27045 +
27046 +  SET SERVER CD-MESSAGE FILE {{./.readme}{README.TXT}{READ.ME}}
27047 +
27048 +          The default list of CD-message files is system dependent.
27049 +
27050 +   SHOW CD shows your current directory, previous directory, CD path, and
27051 +   CD message info.
27052 +
27053 +4.5.3. Creating and Removing Directories
27054 +
27055 +   The MKDIR command now allows you to create multiple directories at
27056 +   once:
27057 +
27058 +  C-Kermit> mkdir a/b/c/d
27059 +
27060 +   creates the directory a in the current directory (if it doesn't exist
27061 +   already), and then creates subdirectory b in the a directory (if it
27062 +   didn't exist already), and so on.
27063 +
27064 +   If you use MKDIR to try to create a directory that already exists,
27065 +   C-Kermit will print a warning ("?Directory already exists"), but the
27066 +   MKDIR command will still succeed. If you want to avoid the warning
27067 +   message, use IF DIRECTORY first to check if the directory already
27068 +   exists.
27069 +
27070 +   The RMDIR command, however, will not remove more than one directory,
27071 +   nor will it remove a directory that contains any files. (There is, as
27072 +   yet, no RMDIR /RECURSIVE command, although one might be added later.)
27073 +
27074 +   In VMS, these commands (like CD) are more forgiving of your syntax than
27075 +   is the DCL command shell; "mkdir oofa" is equivalent to "mkdir [.oofa]"
27076 +   and so on. Also in VMS, you'll find that C-Kermit's RMDIR command is
27077 +   easier than deleting a directory in DCL, since it automatically first
27078 +   gives it owner delete permission if you are the owner.
27079 +
27080 +4.5.4. The DELETE and PURGE Commands
27081 +
27082 +   The DELETE command now offers a selection of switches, and has a new
27083 +   companion, the PURGE command. First, DELETE:
27084 +
27085 +   DELETE [ switches... ] filespec
27086 +          Deletes the file or files that match the filespec, which may
27087 +          contain wildcards ([476]Section 4.9).
27088 +
27089 +   Optional switches include the standard file-selection switches
27090 +   presented in [477]Section 1.5.4, plus:
27091 +
27092 +   /ASK
27093 +          Before deleting each file, ask permission interactively. Answers
27094 +          are Yes or OK (delete the file), No (don't delete it), or Quit
27095 +          (stop executing the DELETE command).
27096 +
27097 +   /NOASK
27098 +          Don't ask permission to delete each file.
27099 +
27100 +   /LIST
27101 +          List each file and show whether it was deleted. Synonyms: /LOG,
27102 +          /VERBOSE.
27103 +
27104 +   /NOLIST
27105 +          Don't list files while deleting them. Synonyms: /NOLOG, /QUIET.
27106 +
27107 +   /HEADING
27108 +          Print a heading and summary line.
27109 +
27110 +   /NOHEADING
27111 +          Don't print a heading and summary line.
27112 +
27113 +   /PAGE
27114 +          When listing, pause at the end of each screenful and give the
27115 +          "More?" prompt. If you reply "n" (no), the DELETE command
27116 +          terminates.
27117 +
27118 +   /SIMULATE
27119 +          Do everything implied by the given switches and filespec, except
27120 +          do not actually delete any files. This lets you preview which
27121 +          files would be deleted; implies /LIST.
27122 +
27123 +   Now the PURGE command:
27124 +
27125 +   PURGE [ switches... ] [ filespec ]
27126 +          (VMS only) Runs the DCL PURGE command. Switches and filespec, if
27127 +          any, are passed directly to DCL without parsing or verification.
27128 +          Deletes excess versions of the given (or all) files. The rest of
27129 +          this section does not apply to VMS.
27130 +
27131 +   PURGE [ switches... ] [ filespec ]
27132 +          (UNIX only) Deletes "backup files" that match the filespec,
27133 +          which may contain wildcards ([478]Section 4.9). If no filespec
27134 +          is given, all backup files in the current directory are selected
27135 +          (subject to modification by any switches). Do not include backup
27136 +          notation in the filespec.
27137 +
27138 +   Explanation:
27139 +
27140 +   To avoid destroying preexisting files when a new file arrives that has
27141 +   the same name, C-Kermit backs up the old file by appending a "backup
27142 +   number" to its name. In UNIX, the backup suffix consists of a period, a
27143 +   tilde, a number, and another tilde. For example, if a file called
27144 +   oofa.txt exists and a new oofa.txt file arrives, the original is
27145 +   renamed to oofa.txt.~1~. If another oofa.txt file arrives, the existing
27146 +   one is renamed to oofa.txt.~2~. And so on. This system is compatible
27147 +   with the one used by EMACS. Thus over time, if you receive a lot of
27148 +   files with C-Kermit or edit them with EMACS, backup files can build up.
27149 +   The new PURGE command lets you clean out accumulated backup files:
27150 +
27151 +   Optional switches include the standard file-selection switches
27152 +   presented in [479]Section 1.5.4, plus all the switches listed above for
27153 +   the DELETE command, plus:
27154 +
27155 +   /KEEP:n
27156 +          Retains the n most recent (highest-numbered) backup files for
27157 +          each file. For example, if oofa.txt, oofa.txt.~1~, oofa.txt.~2~,
27158 +          oofa.txt.~10~, oofa.txt.~12~, and oofa.txt.~100~ exist, "purge
27159 +          /keep:2 oofa.txt" deletes oofa.txt.~1~, oofa.txt.~2~, and
27160 +          oofa.txt.~10~, and keeps oofa.txt, oofa.txt.~12~, and
27161 +          oofa.txt.~100~. If /KEEP is given without a number, one (the
27162 +          highest numbered) backup file is kept.
27163 +
27164 +   CAUTION: The PURGE command should be used only when *.~*~ files truly
27165 +   are backup files. This is the case for EMACS, and it is the DEFAULT for
27166 +   C-Kermit. However, if C-Kermit's FILE COLLISION has been set to RENAME,
27167 +   newly received files will look like backup files. In that case, don't
27168 +   use the PURGE command or you'll be removing new files rather than old
27169 +   ones. (Use SHOW FILE to find the FILE COLLISION setting.)
27170 +
27171 +   The PURGE command is presently available only in UNIX. The command
27172 +   succeeds if it deleted any files, or if it deleted no files but there
27173 +   were no errors. It fails if it deleted no files and there were errors
27174 +   (i.e. deletion was attempted but failed). In VMS, backup file versions
27175 +   are handled automatically by the OS, and a PURGE command can be used at
27176 +   the VMS prompt to clean them up.
27177 +
27178 +   If you want certain switches to be supplied automatically with each
27179 +   DELETE or PURGE command, you can set them with SET OPTIONS
27180 +   ([480]Section 1.5.5) and you can display any such settings with SHOW
27181 +   OPTIONS. Of course you can override them on a per-command basis by
27182 +   including switches in your PURGE or DELETE command.
27183 +
27184 +   Also see SET FILE COLLISION, SHOW FILE, SEND /NOBACKUP, SET SEND
27185 +   BACKUP, and DIRECTORY /[NO]BACKUP.
27186 +
27187 +4.6. Starting the Remote Kermit Server Automatically
27188 +
27189 +   As noted on pages 275-276 of [481]Using C-Kermit 2nd edition, you can
27190 +   have Kermit send "kermit receive" commands automatically when it is in
27191 +   local mode and you give a SEND or similar command, to start the remote
27192 +   Kermit receiver in case it is not already started. The "kermit receive"
27193 +   commands are specified by:
27194 +
27195 +  SET PROTOCOL KERMIT binary-receive-command text-receive-command
27196 +
27197 +   As of version 7.0, a Kermit protocol option has been added to send a
27198 +   string to the host in advance of any Kermit packets when you give a
27199 +   GET-class or REMOTE command. This will switch the remote C-Kermit into
27200 +   the appropriate mode or, if the remote system is at a system command
27201 +   (shell) prompt, execute the string on the remote system. The new syntax
27202 +   of the SET PROTOCOL KERMIT command is:
27203 +
27204 +  SET PROTOCOL KERMIT [ s1 [ s2 [ s3 ] ] ]
27205 +
27206 +   where:
27207 +
27208 +       Default         Meaning
27209 +  s1  {kermit -ir}     Remote "kermit receive in binary mode" command.
27210 +  s2  {kermit -r}      Remote "kermit receive in text mode" command.
27211 +  s3  {kermit -x}      Remote "start kermit server" command.
27212 +
27213 +   NOTE: If the remote Kermit is 6.0, the following are recommended for
27214 +   fast startup and high-performance file transfer (see Appendix I in
27215 +   [482]Using C-Kermit, second Edition, for command-line options):
27216 +
27217 +  s1   kermit -YQir   (Kermit receive binary, skip init file, fast.)
27218 +  s2   kermit -YQTr   (Kermit receive text, skip init file, fast.)
27219 +  s3   kermit -YQx    (Kermit server, skip init file, fast.)
27220 +
27221 +   If the remote is C-Kermit 7.0 or later, change the -x option (enter
27222 +   server mode) to -O (uppercase letter O), which means "enter server mode
27223 +   for One transaction only); this way, it is not stuck in server after
27224 +   the transfer. Also note that the Q is redundant in version 7.0, since
27225 +   fast Kermit protocol settings are now the default.
27226 +
27227 +   Note that in case the C-Kermit executable is called "wermit" or
27228 +   "ckermit" you can change "kermit" in the strings above to "wermit" or
27229 +   "ckermit" and C-Kermit 7.0 or later will recognize these as synonyms
27230 +   for "kermit", in case it is at its command prompt when one of these
27231 +   strings is sent to it.
27232 +
27233 +4.7. File-Transfer Command Switches
27234 +
27235 +   Over the years, various new methods of transferring a file have
27236 +   accumulated, until we had, in addition to the SEND command, also MOVE
27237 +   (send and then delete), MAIL (send as email), REMOTE PRINT (send to be
27238 +   printed), CSEND (send the output of a command), PSEND (send a part of a
27239 +   file), BSEND (send in binary mode), RESEND (resume an interrupted
27240 +   SEND), etc etc. Similarly: GET, REGET, CGET, RETRIEVE, and so on.
27241 +
27242 +   Not only is it confusing to have different names for these commands,
27243 +   many of which are not real words, but this also does not allow all
27244 +   combinations, like "send a file as mail, then delete it".
27245 +
27246 +   In C-Kermit 7.0, the SEND, GET, and RECEIVE commands were restructured
27247 +   to accept modifier switches (switches are explained in [483]Section
27248 +   1.5).
27249 +
27250 +4.7.1. SEND Command Switches
27251 +
27252 +   Without switches, the SEND command still works exactly as before:
27253 +
27254 +  send oofa.txt      ; send a single file
27255 +  send oofa.*        ; send multiple files
27256 +  send oofa.txt x.x  ; send oofa.txt as x.x (tell receiver its name is x.x)
27257 +  send               ; send from SEND-LIST
27258 +
27259 +   But now the following modifier switches may be included between "send"
27260 +   and the filename. Zero, one, two, or more switches may be included in
27261 +   any combination that makes sense. Switch names (such as /BINARY) can be
27262 +   abbreviated, just like any other keywords. Most of these switches work
27263 +   only when using Kermit protocol (/TEXT and /BINARY are the exceptions).
27264 +
27265 +   /AFTER:date-time
27266 +          Specifies that only those files modified (or, in VMS, created)
27267 +          after the given date-time (see [484]Section 1.6) are to be sent.
27268 +          Examples:
27269 +
27270 +  send /text /after:{2-Feb-1997 10:28:30} *.txt
27271 +  send /text /after:\fdate(oofa.txt) *.txt
27272 +
27273 +          Synonym: /SINCE.
27274 +
27275 +   /ARRAY:arrayname
27276 +          Specifies that instead of sending a file, C-Kermit is to send
27277 +          the contents of the given array. Since an array does not have a
27278 +          filename, you should include an /AS-NAME switch to specify the
27279 +          name under which the array is to be sent (if you do not, the
27280 +          name "_array_x_" is used, where 'x' is replaced by the array
27281 +          designator). See [485]section 7.10 for array-name syntax. As
27282 +          noted in that section, you can also include a range to have a
27283 +          segment of the array sent, rather than the whole thing; for
27284 +          example: "send /array:&a[100:199]". It is strongly recommended
27285 +          that you accompany the /ARRAY switch with a /TEXT or /BINARY
27286 +          switch to force the desired transfer mode, since otherwise the
27287 +          various automatic mechanisms might switch to binary mode when
27288 +          you really wanted text, or vice versa. In text mode a line
27289 +          terminator is added to the end of each array element, but not in
27290 +          binary mode. For details and examples see [486]Section 7.10.11.
27291 +
27292 +   /AS-NAME:text
27293 +          Specifies "text" as the name to send the file under. You can
27294 +          also still specify the as-name as the second filename on the
27295 +          SEND command line. The following two commands are equivalent:
27296 +
27297 +  send oofa.txt oofa.new
27298 +  send /as:oofa.new oofa.txt
27299 +
27300 +   /BEFORE:date-time
27301 +          Specifies that only those files modified (or, in VMS, created)
27302 +          before the given date-time ([487]Section 1.6) are to be sent.
27303 +
27304 +   /BINARY
27305 +          Performs this transfer in binary mode without affecting the
27306 +          global transfer mode, overriding not only the FILE TYPE and
27307 +          TRANSFER MODE settings, but also the FILE PATTERN setting, but
27308 +          for this SEND command only. In other words, SEND /BINARY means
27309 +          what it says: send the file in binary mode, regardless of any
27310 +          other settings. Example:
27311 +
27312 +  set file type text      ; Set global transfer mode to text
27313 +  send /binary oofa.zip   ; Send a file in binary
27314 +  send oofa.txt           ; This one is sent in text mode
27315 +
27316 +   /COMMAND
27317 +          SEND /COMMAND is equivalent to CSEND ([488]Section 4.2.2) -- it
27318 +          says to send the output from a command, rather than the contents
27319 +          of a file. The first "filename" on the SEND command line is
27320 +          interpreted as the name of a command; the second (if any) is the
27321 +          as-name. Examples:
27322 +
27323 +  send /command {grep Sunday oofa.txt} sunday.txt
27324 +  send /as-name:sunday.txt /command {grep Sunday oofa.txt}
27325 +  send /bin /command {tar cf - . | gzip -c} {!gunzip -c | tar xf -}
27326 +
27327 +   /DELETE
27328 +          Deletes the file (or each file in the group) after it has been
27329 +          sent successfully (but does not delete it if it was not sent
27330 +          successfully). SEND /DELETE is equivalent to MOVE. Has no effect
27331 +          when used with /COMMAND. Example:
27332 +
27333 +  send /delete *.log
27334 +
27335 +   /DOTFILES
27336 +          (UNIX and OS-9 only) Normally files whose names begin with "."
27337 +          are skipped when matching wildcards that do not also beging with
27338 +          ".". Include /DOTFILES to force these files to be included too.
27339 +
27340 +   /RECURSIVE
27341 +          Descend the through the directory tree when locating files to
27342 +          send. Automatically sets /PATHNAMES:RELATIVE. Explained in
27343 +          [489]Section 4.11 .
27344 +
27345 +   /EXCEPT:pattern
27346 +          See [490]Section 1.5.4.
27347 +
27348 +   /NOBACKUP
27349 +          This means to skip backup files when sending, even if they match
27350 +          the SEND file specification. This is equivalent to using SEND
27351 +          /EXCEPT and including *.~[0-9]*~ in the exception list (or *.~*~
27352 +          if Kermit was built without pattern-matching support; see
27353 +          [491]Section 4.9.1). Including this switch is equivalent to
27354 +          giving SET SEND BACKUP OFF ([492]Section 4.0.6) prior to SEND,
27355 +          except its effect is local to the SEND command with which it was
27356 +          given.
27357 +
27358 +   /NODOTFILES
27359 +          The opposite of /DOTFILES (q.v.)
27360 +
27361 +   /FILENAMES:{CONVERTED,LITERAL}
27362 +          Use this switch to override the current global SET FILE NAMES
27363 +          setting for this transfer only.
27364 +
27365 +   /FILTER:command
27366 +          This specifies a filter to pass the file through before sending
27367 +          it. See the [493]section on file-transfer pipes and filters. The
27368 +          /FILTER switch applies only to the file-transfer command it is
27369 +          given with; it does not affect the global SEND FILTER setting,
27370 +          if any.
27371 +
27372 +   /IMAGE
27373 +          VMS: Sends in image mode. Non-VMS: same as /BINARY.
27374 +
27375 +   /LABELED
27376 +          VMS and OS/2 only: Sends in labeled mode.
27377 +
27378 +   /LARGER-THAN:number
27379 +          Specifies that only those files that are longer than the given
27380 +          number of bytes are to be sent.
27381 +
27382 +   /LISTFILE:filename
27383 +          Specifies that the files to be sent are listed in a file with
27384 +          the given filename. The file contains one filename per line.
27385 +          These filenames are not checked in any way; each filename is
27386 +          taken and does not use or depend on any Kermit-specific syntax.
27387 +          In particular, backslashes are not treated specially, leading
27388 +          and trailing spaces are not stripped, etc. However, if a
27389 +          filename contains wildcards, they are expanded. Example: If a
27390 +          file named files.txt contains the following lines:
27391 +
27392 +  blah.txt
27393 +  oofa*
27394 +  x.x
27395 +
27396 +          (but without leading or trailing spaces), then the C-Kermit
27397 +          command "send /listfile:files.txt" will send the files blah.txt,
27398 +          x.x, and all files whose names start with "oofa", assuming the
27399 +          files exist and are readable. The /LISTFILE switch, can, of
27400 +          course, be used with other switches when it makes sense, for
27401 +          example, /EXCEPT, /BINARY, /AFTER, /SMALLER, /MOVE-TO, /DELETE,
27402 +          /AS-NAME with a template, etc.
27403 +
27404 +   /MAIL:address
27405 +          Sends the file as e-mail to the given address or addresses.
27406 +          "send /mail:address filename" is equivalent to "mail filename
27407 +          address". You can include multiple addresses separated by
27408 +          commas. Examples:
27409 +
27410 +  send /mail:kermit-support@columbia.edu packet.log
27411 +  send /mail:cmg,fdc,jrd oofa.txt
27412 +
27413 +          As with any switch argument, if the address or address list
27414 +          contains any spaces, you must enclose it in braces. The format
27415 +          of the addresses must agree with that understood by the
27416 +          mail-sending program on the receiver's computer.
27417 +
27418 +   /MOVE-TO:directory-name
27419 +          Specifies that after each (or the only) source file is sent
27420 +          successfully, and ONLY if it is sent successfully, it should be
27421 +          moved to the named directory. If the directory name contains
27422 +          spaces, enclose it in braces. If the directory does not exist,
27423 +          it is created if possible; if it can't be created, the command
27424 +          fails and an error message is printed. Example:
27425 +
27426 +  send /text /move-to:/users/olga/backup/ *.txt
27427 +
27428 +   /NOT-AFTER:date-time
27429 +          Specifies that only those files modified at or before the given
27430 +          date and time are to be sent.
27431 +
27432 +   /NOT-BEFORE:date-time
27433 +          Specifies that only those files modified at or after the given
27434 +          date and time are to be sent.
27435 +
27436 +   /PATHNAMES:{OFF,ABSOLUTE,RELATIVE}
27437 +          Use this switch to override the current global SET SEND
27438 +          PATHNAMES setting for this transfer only. /PATHNAMES:ABSOLUTE or
27439 +          RELATIVE also sets /FILENAMES:LITERAL (also for this transfer
27440 +          only) since pathnames are not sent otherwise.
27441 +
27442 +   /RENAME-TO:text
27443 +          Specifies that after the (or each) source file is sent
27444 +          successfully, and ONLY if it is sent successfully, it should be
27445 +          renamed to the name given. If the name contains spaces, enclose
27446 +          it in braces. If a file group is being sent, then the "text"
27447 +          must contain a variable reference such as \v(filename) (see
27448 +          [494]Section 4.1). Example:
27449 +
27450 +  send /rename-to:ok_\v(filename) *.*
27451 +
27452 +          This sends each file in the current directory and if it was sent
27453 +          successfully, changes its name to begin with "ok_".
27454 +
27455 +   /SMALLER-THAN:number
27456 +          Specifies that only those files that are smaller than the given
27457 +          number of bytes are to be sent.
27458 +
27459 +   /SUBJECT:text
27460 +          Subject for email. Actually, this is just a synonym for
27461 +          /AS-NAME. If the text includes spaces, you must enclose it in
27462 +          braces. If you don't specify a subject (or as-name), the name of
27463 +          the file is used as the subject. Example:
27464 +
27465 +  send /mail:kermit-support@columbia.edu /subj:{As requested} packet.log
27466 +
27467 +   /PRINT:options
27468 +          Sends the file to be printed, optionally specifying options for
27469 +          the printer. Equivalent to REMOTE PRINT filename options.
27470 +          Examples:
27471 +
27472 +  send /print oofa.txt              ; No options.
27473 +  send /print:/copies=3 oofa.txt    ; "/copies=3" is a VMS PRINT switch.
27474 +  send /print:-#3 oofa.txt          ; "-#3" is a UNIX lpr switch.
27475 +
27476 +   /PROTOCOL:name
27477 +          Uses the given protocol to send the file (Kermit, Zmodem, etc)
27478 +          for this transfer without changing global protocol. Only
27479 +          available in Kermit 95, UNIX, and OS-9. Example:
27480 +
27481 +  set protocol kermit               ; Set global protocol
27482 +  send /proto:zmodem /bin oofa.zip  ; Send just this file with Zmodem
27483 +  send oofa.txt                     ; This file is sent with Kermit
27484 +
27485 +   /QUIET
27486 +          When sending in local mode, this suppresses the file-transfer
27487 +          display.
27488 +
27489 +   /RECOVER
27490 +          Used to recover from a previously interrupted transfer; SEND
27491 +          /RECOVER is equivalent to RESEND. Recovery only works in binary
27492 +          mode; SEND /RECOVER and RESEND include an implied /BINARY
27493 +          switch. Even then, recovery will successful only if (a) the
27494 +          original (interrupted) transfer was also in binary mode, or (b)
27495 +          if it was in text mode, the two Kermit programs run on platforms
27496 +          where text-mode transfers are not length-changing.
27497 +
27498 +   /STARTING:number
27499 +          Starts sending the file from the given byte position. SEND
27500 +          /STARTING:n filename is equivalent to PSEND filename n.
27501 +
27502 +   /TEXT
27503 +          Performs this transfer in text mode without affecting the global
27504 +          transfer mode, overriding not only the FILE TYPE and TRANSFER
27505 +          MODE settings, but also the FILE PATTERN setting, for this SEND
27506 +          command only. In other words, SEND /TEXT really send the file in
27507 +          text mode, regardless of any other settings or negotiations.
27508 +
27509 +   About mail... Refer to [495]Section 4.7.1. The same rules apply as for
27510 +   file transfer. If you are mailing multiple files, you can't use an
27511 +   as-name (in this case, a subject) unless it contains replacement
27512 +   variables like \v(filenum). For example, if you:
27513 +
27514 +  send /mail:somebody@xyz.com *.txt
27515 +
27516 +   Then each file will arrive as a separate email message with its name as
27517 +   the subject. But if you:
27518 +
27519 +  send /mail:somebody@xyz.com /subject:{Here is a file} *.txt
27520 +
27521 +   Then each file message will have the same subject, which is probably
27522 +   not what you want. You can get around this with constructions like:
27523 +
27524 +  send /mail:somebody@xyz.com /subject:{Here is \v(filename)} *.txt
27525 +
27526 +   which embed the filename in the subject.
27527 +
27528 +   The MOVE, CSEND, MAIL, and RESEND commands now also accept the same
27529 +   switches. And the switches are also operative when sending from a
27530 +   SEND-LIST (see [496]Using C-Kermit, 2nd Ed, pp.191-192), so, for
27531 +   example, it is now possible to SEND /PRINT or SEND /MAIL from a
27532 +   SEND-LIST.
27533 +
27534 +   The MSEND and MMOVE commands also take switches, but not all of them.
27535 +   With these commands, which take an arbitrary list of filespecs, you can
27536 +   use /BINARY, /DELETE, /MAIL, /PRINT, /PROTOCOL, /QUIET, /RECOVER, and
27537 +   /TEXT (and /IMAGE or /LABELED, depending on the platform). MMOVE is
27538 +   equivalent to MSEND /DELETE. (If you want to send a group of files, but
27539 +   in mixed transfer modes with per-file as-names, use ADD SEND-LIST and
27540 +   then SEND.)
27541 +
27542 +   The MSEND/MMOVE switches come before the filenames, and apply to all of
27543 +   them:
27544 +
27545 +  msend /print /text *.log oofa.txt /etc/motd
27546 +
27547 +   If you type any of these commands (SEND, CSEND, MSEND, etc) followed by
27548 +   a question mark (?), you will see a list of the switches you can use.
27549 +   If you want to see a list of filenames, you'll need to type something
27550 +   like "send ./?" (UNIX, OS/2, Windows, etc), or "send []?" (VMS), etc.
27551 +   Of course, you can also type pieces of a filename (anything that does
27552 +   not start with "/") and then "?" to get a list of filenames that start
27553 +   that way; e.g. "send x.?" still works as before.
27554 +
27555 +   In UNIX, where "/" is also the directory separator, there is usually no
27556 +   ambiguity between a fully-specified pathname and a switch, except when
27557 +   a file in the root directory has the same name as a switch (as noted in
27558 +   [497]Section 1.5):
27559 +
27560 +  send /etc/motd                        ; Works as expected
27561 +  send /command                         ; ???
27562 +
27563 +   The second example interprets "/command" as a switch, not a filename.
27564 +   To send a file actually called "command" in the root directory, use:
27565 +
27566 +  send {/command}
27567 +
27568 +   or other system-dependent forms such as //command, /./command,
27569 +   c:/command, etc, or cd to / and then "send command".
27570 +
27571 +4.7.2. GET Command Switches
27572 +
27573 +   Without switches, the GET command still works about the same as before:
27574 +
27575 +  get oofa.txt                          ; GET a single file
27576 +  get oofa.*                            ; GET multiple files
27577 +
27578 +   However, the mechanism for including an "as-name" has changed.
27579 +   Previously, in order to include an as-name, you were required to use
27580 +   the "multiline" form of GET:
27581 +
27582 +  get
27583 +  remote-filespec
27584 +  local-name
27585 +
27586 +   This was because the remote filespec might contain spaces, and so there
27587 +   would be no good way of telling where it ended and where the local name
27588 +   began, e.g:
27589 +
27590 +  get profile exec a foo
27591 +
27592 +   But now since we can use {braces} for grouping, we don't need the
27593 +   multiline GET form any more, and in fact, support for it has been
27594 +   removed. If you give a GET command by itself on a line, it fails and an
27595 +   error message is printed. The new form is:
27596 +
27597 +   GET [ switches... ] remote-name [ local-name ]
27598 +          Ask the server to send the file whose name is remote-name. If
27599 +          the optional local-name is given, store it locally under this
27600 +          name. If the remote-name or local-name contains spaces, they
27601 +          must be enclosed in braces:
27602 +
27603 +  get {profile exec a} foo
27604 +  get oofa.txt {~/My Files/Oofa text}
27605 +
27606 +   If you want to give a list of remote file specifications, use the MGET
27607 +   command:
27608 +
27609 +   MGET [ switches... ] remote-name [ remote-name [ remote-name ... ] ]
27610 +          Ask the server to send the files whose names are given.
27611 +
27612 +   Now you can also include modifier switches between GET or MGET and the
27613 +   remote-name; most of the same switches as SEND:
27614 +
27615 +   /AS-NAME:text
27616 +          Specifies "text" as the name to store the incoming file under.
27617 +          (This switch is not available for MGET.) You can also still
27618 +          specify the as-name as the second filename on the GET command
27619 +          line. The following two commands are equivalent:
27620 +
27621 +  get oofa.txt oofa.new
27622 +  get /as:oofa.new oofa.txt
27623 +
27624 +   /BINARY
27625 +          Tells the server to send the given file(s) in binary mode
27626 +          without affecting the global transfer mode. Example:
27627 +
27628 +  set file type text      ; Set global transfer mode to text
27629 +  get /binary oofa.zip    ; get a file in binary mode
27630 +  get oofa.txt            ; This one is transferred in text mode
27631 +
27632 +          Or, perhaps more to the point:
27633 +
27634 +  get /binary foo.txt     ; where "*.txt" is a text-pattern
27635 +
27636 +          This has the expected effect only if the server is C-Kermit 7.0
27637 +          or later or K95 1.1.19 or later.
27638 +
27639 +   /COMMAND
27640 +          GET /COMMAND is equivalent to CGET ([498]Section 4.2.2) -- it
27641 +          says to receive the file into the standard input of a command,
27642 +          rather than saving it on disk. The /AS-NAME or the second
27643 +          "filename" on the GET command line is interpreted as the name of
27644 +          a command. Examples:
27645 +
27646 +  get /command sunday.txt {grep Sunday oofa.txt}
27647 +  get /command /as-name:{grep Sunday oofa.txt} sunday.txt
27648 +  get /bin /command {!gunzip -c | tar xf -} {tar cf - . | gzip -c}
27649 +
27650 +   /DELETE
27651 +          Asks the Kermit server to delete the file (or each file in the
27652 +          group) after it has been transferred successfully (but not to
27653 +          delete it if it was not sent successfully). GET /DELETE is
27654 +          equivalent to RETRIEVE. Example:
27655 +
27656 +  get /delete *.log
27657 +
27658 +   /EXCEPT:pattern
27659 +          Specifies that any files whose names match the pattern, which
27660 +          can be a regular filename, or may contain "*" and/or "?"
27661 +          metacharacters, are to be refused upon arrival. To specify
27662 +          multiple patterns (up to 8), use outer braces around the group,
27663 +          and inner braces around each pattern:
27664 +
27665 +  /EXCEPT:{{pattern1}{pattern2}...}
27666 +
27667 +          See the description of SEND /EXCEPT in [499]Section 4.7.1 for
27668 +          examples, etc. Refusal is accomplished using the Attribute
27669 +          Rejection mechanism (reason "name"), which works only when
27670 +          Attribute packets have been successfully negotiated.
27671 +
27672 +   /FILENAMES:{CONVERTED,LITERAL}
27673 +          Use this switch to override the current global SET FILE NAMES
27674 +          setting for this transfer only.
27675 +
27676 +   /FILTER:command
27677 +          This specifies a filter to pass the incoming file through before
27678 +          writing to disk. See the [500]section on file-transfer pipes and
27679 +          filters. The /FILTER switch applies only to the file-transfer
27680 +          command it is given with; it does not affect the global RECEIVE
27681 +          FILTER setting, if any.
27682 +
27683 +   /IMAGE
27684 +          VMS: Transfer in image mode. Non-VMS: same as /BINARY.
27685 +
27686 +   /LABELED
27687 +          VMS and OS/2 only: Specifies labeled transfer mode.
27688 +
27689 +   /MOVE-TO:directory
27690 +          This tells C-Kermit to move each file that is successfully
27691 +          received to the given directory. Files that are not successfully
27692 +          received are not moved. By default, files are not moved.
27693 +
27694 +   /PATHNAMES:{OFF,ABSOLUTE,RELATIVE,AUTO}
27695 +          Use this switch to override the current global SET RECEIVE
27696 +          PATHNAMES setting for this transfer only. /PATHNAMES:ABSOLUTE or
27697 +          RELATIVE also sets /FILENAMES:LITERAL (also for this transfer
27698 +          only) since incoming pathnames would not be treated as pathnames
27699 +          otherwise. See [501]Section 4.10.
27700 +
27701 +   /QUIET
27702 +          When sending in local mode, this suppresses the file-transfer
27703 +          display.
27704 +
27705 +   /RECOVER
27706 +          Used to recover from a previously interrupted transfer; GET
27707 +          /RECOVER is equivalent to REGET. Recovery only works in binary
27708 +          mode; SEND /RECOVER and RESEND include an implied /BINARY
27709 +          switch. Even then, recovery will successful only if (a) the
27710 +          original (interrupted) transfer was also in binary mode, or (b)
27711 +          if it was in text mode, the two Kermit programs run on platforms
27712 +          where text-mode transfers are not length-changing.
27713 +
27714 +   /RECURSIVE
27715 +          Tells the server that the GET file specification applies
27716 +          recursively. This switch also automatically sets
27717 +          /PATHNAMES:RELATIVE in both the server AND the client. When used
27718 +          in conjunction with /DELETE, this "moves" a directory tree from
27719 +          the server's computer to the client's computer (except that only
27720 +          regular files are deleted from the server's computer, not
27721 +          directories; thus the original directories will be left, but
27722 +          will contain no files). Note that all servers that support
27723 +          /RECURSIVE do not necessarily do so in combination with other
27724 +          switches, such as /RECOVER. (Servers that do include C-Kermit
27725 +          7.0 and later, K95 1.1.19 and later.)
27726 +
27727 +   /RENAME-TO:string
27728 +          This tells C-Kermit to rename each file that is successfully
27729 +          received to the given string. Files that are not successfully
27730 +          received are not renamed. By default, files are not renamed. The
27731 +          string can be a literal string, which is appropriate when only
27732 +          one file is being received, or it can contain one or more
27733 +          variables that are to be evaluated at the time each file is
27734 +          received, such as \v(filename), \v(filenumber), \v(ntime),
27735 +          \v(pid), \v(user), etc. WARNING: if you give a literal string
27736 +          and more than one file arrives, each incoming file will be given
27737 +          the same name (but SET FILE COLLISION BACKUP or RENAME can be
27738 +          used to keep the incoming files from overwriting each other).
27739 +
27740 +   /TEXT
27741 +          Tells the server to perform this transfer in text mode without
27742 +          affecting its global transfer mode. See /BINARY for additional
27743 +          info.
27744 +
27745 +   The /MAIL and /PRINT options are not available (as they are for SEND),
27746 +   but you can use /COMMAND to achieve the same effect, as in these UNIX
27747 +   examples:
27748 +
27749 +  get /command oofa.txt {mail kermit@columbia.edu}
27750 +  get /command oofa.txt lpr
27751 +
27752 +   In OS/2 or Windows, you can GET and print like this:
27753 +
27754 +  get oofa.txt prn
27755 +
27756 +   The CGET, REGET, RETRIEVE commands also accept the same switches as
27757 +   GET. CGET automatically sets /COMMAND; REGET automatically sets
27758 +   /RECOVER and /BINARY, and RETRIEVE automatically sets /DELETE.
27759 +
27760 +4.7.3. RECEIVE Command Switches
27761 +
27762 +   Without switches, the RECEIVE command still works as before:
27763 +
27764 +  receive            ; Receives files under their own names
27765 +  receive /tmp       ; Ditto, but into the /tmp directory
27766 +  r                  ; Same as "receive"
27767 +  receive foo.txt    ; Receives a file and renames to foo.txt
27768 +
27769 +   Now you can also include modifier switches may be included between
27770 +   "receive" and the as-name; most of the same switches as GET:
27771 +
27772 +   /AS-NAME:text
27773 +          Specifies "text" as the name to store the incoming file under.
27774 +          You can also still specify the as-name as a filename on the
27775 +          command line. The following two commands are equivalent:
27776 +
27777 +  r oofa.new
27778 +  r /as:oofa.new
27779 +
27780 +   /BINARY
27781 +          Performs this transfer in binary mode without affecting the
27782 +          global transfer mode. NOTE: This does not override the incoming
27783 +          filetype (as it does with GET), so this switch is useful only if
27784 +          ATTRIBUTE TYPE is OFF, or if the other Kermit does not send a
27785 +          TYPE (text or binary) attribute. In any case, it has no affect
27786 +          whatsoever on the file sender.
27787 +
27788 +   /COMMAND
27789 +          RECEIVE /COMMAND is equivalent to CRECEIVE ([502]Section 4.2.2)
27790 +          -- it says to receive the file into the standard input of a
27791 +          command, rather than saving it on disk. The /AS-NAME or the
27792 +          "filename" on the RECEIVE command line is interpreted as the
27793 +          name of a command.
27794 +
27795 +  r /command {grep Sunday oofa.txt}
27796 +  r /command /as-name:{grep Sunday oofa.txt}
27797 +  r /bin /command {tar cf - . | gzip -c}
27798 +
27799 +   /EXCEPT:pattern
27800 +          Specifies that any files whose names match the pattern, which
27801 +          can be a regular filename, or may contain "*" and/or "?"
27802 +          metacharacters, are to be refused upon arrival. To specify
27803 +          multiple patterns (up to 8), use outer braces around the group,
27804 +          and inner braces around each pattern:
27805 +
27806 +  /EXCEPT:{{pattern1}{pattern2}...}
27807 +
27808 +          See the description of SEND /EXCEPT in [503]Section 4.7.1 for
27809 +          examples, etc. Refusal is accomplished using the Attribute
27810 +          Rejection mechanism (reason "name"), which works only when
27811 +          Attribute packets have been successfully negotiated.
27812 +
27813 +   /FILENAMES:{CONVERTED,LITERAL}
27814 +          Use this switch to override the current global SET FILE NAMES
27815 +          setting for this transfer only.
27816 +
27817 +   /FILTER:command
27818 +          This specifies a filter to pass the incoming file through before
27819 +          writing to disk. See the [504]section on file-transfer pipes and
27820 +          filters. The /FILTER switch applies only to the file-transfer
27821 +          command it is given with; it does not affect the global RECEIVE
27822 +          FILTER setting, if any.
27823 +
27824 +   /IMAGE
27825 +          VMS: Transfer in image mode. Non-VMS: same as /BINARY. See
27826 +          comments under RECEIVE /BINARY.
27827 +
27828 +   /LABELED
27829 +          VMS and OS/2 only: Specifies labeled transfer mode. See comments
27830 +          under RECEIVE /BINARY.
27831 +
27832 +   /MOVE-TO:directory
27833 +          This tells C-Kermit to move each file that is successfully
27834 +          received to the given directory. Files that are not successfully
27835 +          received are not moved. By default, files are not moved.
27836 +
27837 +   /PATHNAMES:{ABSOLUTE,RELATIVE,OFF,AUTO}
27838 +          Use this switch to override the current global SET RECEIVE
27839 +          PATHNAMES setting for this transfer only. See [505]Section 4.10.
27840 +
27841 +   /RECURSIVE
27842 +          When used with the RECEIVE command, /RECURSIVE is simply a
27843 +          synonym for /PATHNAMES:RELATIVE.
27844 +
27845 +   /RENAME-TO:string
27846 +          This tells C-Kermit to rename each file that is successfully
27847 +          received to the given string. Files that are not successfully
27848 +          received are not renamed. By default, files are not renamed. The
27849 +          string can be a literal string, which is appropriate when only
27850 +          one file is being received, or it can contain one or more
27851 +          variables that are to be evaluated at the time each file is
27852 +          received, such as \v(filename), \v(filenumber), \v(ntime),
27853 +          \v(pid), \v(user), etc. WARNING: if you give a literal string
27854 +          and more than one file arrives, each incoming file will be given
27855 +          the same name (but SET FILE COLLISION BACKUP or RENAME can be
27856 +          used to keep the incoming files from overwriting each other).
27857 +
27858 +   /QUIET
27859 +          When receiving in local mode, this suppresses the file-transfer
27860 +          display.
27861 +
27862 +   /TEXT
27863 +          Receives in text mode without affecting the global transfer
27864 +          mode. See comments under RECEIVE /BINARY.
27865 +
27866 +   The /MAIL and /PRINT options are not available, but you can use
27867 +   /COMMAND to achieve the same effect, as in these UNIX examples:
27868 +
27869 +  r /command {mail kermit@columbia.edu}
27870 +  r /command lpr
27871 +
27872 +   In OS/2 or Windows, you can RECEIVE and print like this:
27873 +
27874 +  receive prn
27875 +
27876 +   The CRECEIVE command now also accepts the same switches.
27877 +
27878 +4.8. Minor Kermit Protocol Improvements
27879 +
27880 +4.8.1. Multiple Attribute Packets
27881 +
27882 +   C-Kermit 7.0 now sends more than one Attribute packet if a file's
27883 +   attributes do not fit into a single packet of the negotiated length. If
27884 +   a particular attribute (such as file creation date-time) does not fit
27885 +   within the negotiated length (which will only happen when the
27886 +   negotiated length is around 20 or less), that attribute is not sent at
27887 +   all.
27888 +
27889 +4.8.2. Very Short Packets
27890 +
27891 +   There are certain situations where extremely short packets must be
27892 +   used; 20 or 30 bytes at most. This can happen when one or more devices
27893 +   along the communication path have very small buffers and lack an
27894 +   effective means of flow control. Examples are sometimes cited involving
27895 +   radio modems.
27896 +
27897 +   When the maximum packet length is shorter than certain packets that
27898 +   would be sent, those packets are either truncated or else broken up
27899 +   into multiple packets. Specifically:
27900 +
27901 +    1. Parameter negotiation packets (I, S, and their ACKs) are truncated
27902 +       to the negotiated length. Any parameters that do not fit are reset
27903 +       to their default values. There is no provision in the Kermit
27904 +       protocol for fragmentation and reassembly of parameter strings.
27905 +    2. File header packets (containing the filename) are simply truncated.
27906 +       There is no provision in the Kermit protocol for fragmentation and
27907 +       reassembly of filenames.
27908 +    3. Attribute packets are fragmented and reassembled as described in
27909 +       4.8.1 without loss of data, except in case a field will not fit at
27910 +       all in the negotiated length (the longest attribute is usually the
27911 +       date and time of file creation/modification) because of the rule
27912 +       that attributes may not be broken across packets.
27913 +    4. Data packets and other packets are unaffected -- they can be as
27914 +       short as they need to be, within reason.
27915 +
27916 +4.9. Wildcard / File Group Expansion
27917 +
27918 +   "Wildcard" refers to the notation used in filenames to specify a group
27919 +   of files by pattern matching.
27920 +
27921 +4.9.1. In UNIX C-Kermit
27922 +
27923 +   Prior to C-Kermit 7.0, C-Kermit was capable of expanding wildcard
27924 +   strings containing only the "metacharacters" '*' and '?':
27925 +
27926 +   *
27927 +          Matches any sequence of zero or more characters. For example:
27928 +          "ck*.c" matches all files whose names start with "ck" and end
27929 +          with ".c", including "ck.c".
27930 +
27931 +   ?
27932 +          Matches any single character. For example, "ck?.c" matches all
27933 +          files whose names are exactly 5 characters long and start with
27934 +          "ck" and end with ".c". When typing commands at the prompt, you
27935 +          must precede any question mark to be used for matching by a
27936 +          backslash (\) to override the normal function of question mark,
27937 +          which is providing menus and file lists.
27938 +
27939 +   C-Kermit 7.0 adds the additional features that users of ksh, csh, and
27940 +   bash are accustomed to:
27941 +
27942 +   [abc]
27943 +          Square brackets enclosing a list of characters matches any
27944 +          single character in the list. Example: ckuusr.[ch] matches
27945 +          ckuusr.c and ckuusr.h.
27946 +
27947 +   [a-z]
27948 +          Square brackets enclosing a range of characters; the hyphen
27949 +          separates the low and high elements of the range. For example,
27950 +          [a-z] matches any character from a to z.
27951 +
27952 +   [acdm-z]
27953 +          Lists and ranges may be combined. This example matches a, c, d,
27954 +          or m through z.
27955 +
27956 +   {string1,string2,...}
27957 +          Braces enclose a list of strings to be matched. For example:
27958 +          ck{ufio,vcon,cmai}.c matches ckufio.c, ckvcon.c, or ckcmai.c.
27959 +          The strings may themselves contain metacharacters, bracket
27960 +          lists, or indeed, other lists of strings, but (when matching
27961 +          filenames) they may not contain directory separators.
27962 +
27963 +          Thus, the metacharacters in filenames (and in any other field
27964 +          that can be a pattern, such as the IF MATCH pattern, SEND or GET
27965 +          exception lists, etc) are:
27966 +
27967 + * ? [ {
27968 +
27969 +          And within braces only, comma (,) is a metacharacter.
27970 +
27971 +   To include a metacharacter in a pattern literally, precede it with a
27972 +   backslash '\' (or two if you are passing the pattern to a macro).
27973 +   Examples:
27974 +
27975 +  send a*b      ; Send all files whose names start with 'a' and end with 'b'.
27976 +  send a?b      ; Ditto, but the name must be exactly three characters long.
27977 +  send a[a-z]b  ; Ditto, but the second character must be a lowercase letter.
27978 +  send a[x\-z]b ; Ditto, except the second character must be 'x', '-', or 'y'.
27979 +  send a[ghi]b  ; Ditto, except the second character must be 'g', 'h', or 'i'.
27980 +  send a[?*]b   ; Ditto, except the second character must be '?' or '*'.
27981 +  send a[\?\*]b ; Same as previous.
27982 +  send *?[a-z]* ; All files with names containing at least one character
27983 +                ; that is followed by a lowercase letter.
27984 +
27985 +   Or, more practically:
27986 +
27987 +  send ck[cuw]*.[cwh]  ; Send the UNIX C-Kermit source files.
27988 +
27989 +   To refer to the C-Kermit sources files and makefile all in one
27990 +   filespec:
27991 +
27992 +  {{makefile,ck[cuw]*.[cwh]}}
27993 +
27994 +   (NOTE: if the entire pattern is a {stringlist}, you must enclose it it
27995 +   TWO pairs of braces, since the SEND command strips the outer brace
27996 +   pair, because of the "enclose in braces if the filename contains
27997 +   spaces" rule).
27998 +
27999 +   If the makefile is called ckuker.mak:
28000 +
28001 +  ck[cuw]*.{[cwh],mak}
28002 +
28003 +   (NOTE: double braces are not needed here since the pattern does not
28004 +   both begin and end with a brace.)
28005 +
28006 +   To add in all the C-Kermit text files:
28007 +
28008 +  ck[cuw]*.{[cwh],mak,txt}
28009 +
28010 +   All of these features can be used anywhere you would type a filename
28011 +   that is allowed to contain wildcards.
28012 +
28013 +   When you are typing at the command prompt, an extra level of quoting is
28014 +   required for the '?' character to defeat its regular function of
28015 +   producing a list of files that match what you have typed so far, for
28016 +   example:
28017 +
28018 +  send ck[cu]?
28019 +
28020 +   lists all the files whose names start with ckc and cku. If you quote
28021 +   the question mark, it is used as a pattern-matching character, for
28022 +   example:
28023 +
28024 +  send ck\?[ft]io.c
28025 +
28026 +   sends all the file and communications i/o modules for all the
28027 +   platforms: ckufio.c, ckutio.c, ckvfio.c, ckvtio.c, etc.
28028 +
28029 +   If, however, a filename actually contains a question mark and you need
28030 +   to refer to it on the command line, you must use three (3) backslashes.
28031 +   For example, if the file is actually called ck?fio.c, you would use:
28032 +
28033 +  send ck\\\?fio.c
28034 +
28035 +   Further notes on quoting:
28036 +
28037 +     * A single backslash is sufficient for quoting a special character at
28038 +       the command prompt or in a command file. However, when passing
28039 +       patterns to macros you'll need double backslashes, and when
28040 +       referring to these patterns within the macro, you'll need to use
28041 +       \fcontents(\%1) (see [506]Section 1.11.5). You should enclose macro
28042 +       argument references in braces in case grouped arguments were
28043 +       passed. Example:
28044 + define ismatch {
28045 +     if match {\fcont(\%1)} {\fcont(\%2)} {
28046 +         end 0 MATCH
28047 +     } else {
28048 +         end 1 NO MATCH
28049 +     }
28050 + }
28051 + ismatch ab*yz a*\\**z           ; Backslash must be doubled
28052 + ismatch {abc def xyz} *b*e*y*   ; Braces must be used for grouping
28053 +
28054 +     * Watch out for possible conflicts between {} in filename patterns
28055 +       and {} used for grouping multiple words into a single field, when
28056 +       the pattern has outer braces. For example, in:
28057 +     if match {abc xyz} {a* *z} echo THEY MATCH
28058 +
28059 +       braces must be used to group "abc xyz" into a single string. Kermit
28060 +       strips off the braces before comparing the string with the pattern.
28061 +       Therefore:
28062 + if match makefile {makefile,Makefile} echo THEY MATCH
28063 +
28064 +       does not work, but:
28065 + if match makefile {{makefile,Makefile}} echo THEY MATCH
28066 +
28067 +       does.
28068 +     * If you use a pattern that has outer braces, like {*.txt,*.doc}, in
28069 +       a field that accepts a pattern list (like SEND /EXCEPT:xxx), you'll
28070 +       need to add two extra sets of outer braces:
28071 + send /except:{{{*.txt,*.doc}}} *.*
28072 +
28073 +   C-Kermit's new pattern matching capabilities are also used when
28074 +   C-Kermit is in server mode, so now you can send requests such as:
28075 +
28076 +  get ck[cuw]*.[cwh]
28077 +
28078 +   to a C-Kermit server without having to tell it to SET WILD SHELL first.
28079 +   Previously this would have required:
28080 +
28081 +  mget ckc*.c ckc*.w ckc*.h cku*.c cku*.w cku*.h ckw*.c ckw*.w ckw*.h
28082 +
28083 +   The new pattern matching features make SET WILD SHELL redundant, and
28084 +   barring any objections, it will eventually be phased out. (One possible
28085 +   reason for retaining it would be as an escape mechanism when Kermit
28086 +   does not understand the underlying file system.)
28087 +
28088 +   By the way, patterns such as these are sometimes referred to as
28089 +   "regular expressions", but they are not quite the same. In a true
28090 +   regular expression (for example), "*" means "zero or more repetitions
28091 +   of the previous item", so (for example), "([0-9]*)" would match zero or
28092 +   more digits in parentheses. In Kermit (and in most shells), this
28093 +   matches one digit followed by zero or more characters, within
28094 +   parentheses. Here are some hints:
28095 +
28096 +     * Although you can't match any sequence of digits (or letters, etc),
28097 +       you can match (say) 1, 2, or 3 of them in row. For example, the
28098 +       following pattern matches Kermit backup files (with backup numbers
28099 +       from 1 to 999):
28100 + *.~{[1-9],[1-9][0-9],[1-9][0-9][0-9]}~
28101 +
28102 +     * There is presently no NOT operator, so no way to match any
28103 +       character or string EXCEPT the one(s) shown.
28104 +
28105 +   In other wildcarding news...
28106 +
28107 +     * You may now "send xxx" where "xxx" is a directory name, and this
28108 +       will send all the files from the directory xxx, as if you had typed
28109 +       "send xxx/*". You can also use the special shorthand "send ." to
28110 +       send all the files from the current directory.
28111 +     * To easily skip over backup files (the ones whose names end like
28112 +       .~22~) when sending, you can use SEND /NOBACKUP (see [507]Section
28113 +       4.0.6 for details).
28114 +     * When choosing Kermit to expand wildcards, rather than the shell,
28115 +       you can choose whether "dot files" -- files whose names begin with
28116 +       ".", which are normally "invisible" -- should be matched:
28117 + SET WILD KERMIT /NO-MATCH-DOT-FILES (this is the default)
28118 + SET WILD KERMIT /MATCH-DOT-FILES    (this allows matching of "." files)
28119 +
28120 +       or include the /DOTFILES or /NODOTFILES switch on the command you
28121 +       are using, such as SEND or DIRECTORY.
28122 +     * Commands such as DIRECTORY and SEND allow recursive directory
28123 +       traversal. There are also new functions for this to use in scripts.
28124 +       See [508]Section 4.11 for details.
28125 +
28126 +   When building file lists in UNIX, C-Kermit follows symbolic links.
28127 +   Because of this, you might encounter any or all of the following
28128 +   phenomena:
28129 +
28130 +     * Multiple copies of the same file; e.g. one from its real directory
28131 +       and others from links to its real directory, if both the real
28132 +       directory and the links to it are in the wildcard expansion list.
28133 +     * A command might unexpectedly "hang" for a long time because an NFS
28134 +       link might not be responding, or the directory you are looking at
28135 +       contains a link to a huge directory tree (example: "directory
28136 +       /recursive /etc" when /etc/spool is a symlink to /var/spool, which
28137 +       is a large organization's incoming email directory, containing tens
28138 +       of thousands of subdirectories).
28139 +
28140 +   The size of the file list that Kermit can build is limited in most
28141 +   C-Kermit implementations. The limit, if any, depends on the
28142 +   implementation. Use the SHOW FEATURES command and look in the
28143 +   alphabetized options list for MAXWLD to see the value.
28144 +
28145 +4.9.2. In Kermit 95
28146 +
28147 +   Kermit 95 1.1.19 and later uses the same pattern matching syntax as in
28148 +   UNIX, but (as always) you will encounter numerous difficulties if you
28149 +   use backslash (\) as the directory separator. In any command where K95
28150 +   parses filenames itself (that is, practically any file-oriented command
28151 +   except RUN), you can use forward slash (/) as the directory separator
28152 +   to avoid all the nasty conflicts.
28153 +
28154 +4.9.3. In VMS, AOS/VS, OS-9, VOS, etc.
28155 +
28156 +   Platforms other than UNIX, Windows 95/98/NT, and OS/2 have their own
28157 +   filename matching capabilities that are, in general, different from
28158 +   Kermit's built-in ones and in any case might conflict with them. For
28159 +   example, [] encloses directory names in VMS.
28160 +
28161 +   Nevertheless you can still use all the pattern-matching capabilities
28162 +   described in [509]Section 4.9.1 by loading a file list into an array
28163 +   (e.g. with \ffiles(*,&a), see [510]Section 4.11.3) and then using IF
28164 +   MATCH on the members.
28165 +
28166 +4.10. Additional Pathname Controls
28167 +
28168 +   In version 6.0 and earlier, C-Kermit's SET { SEND, RECEIVE } PATHNAMES
28169 +   command had only ON and OFF as options. In version 7.0, there are more
28170 +   choices:
28171 +
28172 +   SET SEND PATHNAMES OFF
28173 +          When sending a file, strip all disk/directory information from
28174 +          the name. Example: "send /usr/olga/letters/oofa.txt" sends the
28175 +          file as "oofa.txt". This applies to actual filenames, not to any
28176 +          as-name you might specify.
28177 +
28178 +   SET SEND PATHNAMES RELATIVE
28179 +          When sending a file, leave the pathname on as given. For
28180 +          example, if your current directory is /usr/olga, "send
28181 +          letters/oofa.txt" sends the file as "letters/oofa.txt", not
28182 +          "/usr/olga/letters/oofa.txt" or "letters.txt".
28183 +
28184 +   SET SEND PATHNAMES ABSOLUTE
28185 +          When sending a file, convert its name to the full, absolute
28186 +          local pathname. For example, if your current directory is
28187 +          /usr/olga, "send letters/oofa.txt" sends the file as
28188 +          "/usr/olga/letters/oofa.txt". NOTE: Even with this setting,
28189 +          device and/or node names are not included. For example, in VMS,
28190 +          any node or device name is stripped; in Windows or OS/2, any
28191 +          disk letter is stripped.
28192 +
28193 +   SET RECEIVE PATHNAMES OFF
28194 +          When receiving a file, strip all disk/directory information from
28195 +          the name before attempting to store it. This applies to incoming
28196 +          filename, not to any as-name you might specify. Example: If a
28197 +          file arrives under the name "/usr/olga/letters/oofa.txt" it is
28198 +          stored simply as "oofa.txt" in your download directory or, if no
28199 +          download directory has been specified, in your current
28200 +          directory.
28201 +
28202 +   SET RECEIVE PATHNAMES RELATIVE
28203 +          When receiving a file, leave the pathname on as it appears in
28204 +          the incoming name, but if the incoming name appears to be
28205 +          absolute, make it relative to your current or download
28206 +          directory. Examples:
28207 +
28208 +          + "oofa.txt" is stored as "oofa.txt".
28209 +          + "letters/oofa.txt" is stored as "letters/oofa.txt"; the
28210 +            "letters" subdirectory is created if it does not already
28211 +            exist.
28212 +          + "/usr/olga/letters/oofa.txt" is stored as
28213 +            "usr/olga/letters/oofa.txt" in your current or download
28214 +            directory, and the "usr", "usr/olga", etc, directories are
28215 +            created if they do not exist.
28216 +
28217 +   SET RECEIVE PATHNAMES ABSOLUTE
28218 +          The incoming filename is used as given. Thus it cannot be stored
28219 +          unless the given path (if any) already exists or can be created.
28220 +          In this case, node, device, or disk designations are NOT
28221 +          stripped, since they most likely were given explicitly by the
28222 +          user as an as-name, meant to be used as given.
28223 +
28224 +   SET RECEIVE PATHNAMES AUTO
28225 +          This is the default, and means RELATIVE if the sender tells me
28226 +          it is a recursive transfer, OFF otherwise.
28227 +
28228 +   Set FILE NAMES CONVERTED now also affects pathnames too. When PATHNAMES
28229 +   are RELATIVE or ABSOLUTE and FILE NAMES are CONVERTED, the file sender
28230 +   converts its native directory-name format to UNIX format, and the file
28231 +   receiver converts from UNIX format to its native one; thus UNIX format
28232 +   is the common intermediate representation for directory hierarchies, as
28233 +   it is in the ZIP/UNZIP programs (which is why ZIP archives are
28234 +   transportable among, UNIX, DOS, and VMS).
28235 +
28236 +   Here's an example in which a file is sent from Windows to UNIX with
28237 +   relative pathnames and FILE NAMES CONVERTED:
28238 +
28239 +  Source name                Intermediate name      Destination Name
28240 +  C:\K95\TMP\OOFA.TXT        K95/TMP/OOFA.TXT       k95/tmp/oofa.txt
28241 +
28242 +   In a more complicated example, we send the same file from Windows to
28243 +   VMS:
28244 +
28245 +  Source name                Intermediate name      Destination Name
28246 +  C:\K95\TMP\OOFA.TXT        K95/TMP/OOFA.TXT       [.K95.TMP]OOFA.TXT
28247 +
28248 +   (Note that disk letters and device designations are always stripped
28249 +   when pathnames are relative).
28250 +
28251 +   As you can imagine, as more and more directory formats are considered,
28252 +   this approach keeps matters simple: on each platform, Kermit must know
28253 +   only its own local format and the common intermediate one. In most
28254 +   cases, the receiver can detect which format is used automatically.
28255 +
28256 +4.11. Recursive SEND and GET: Transferring Directory Trees
28257 +
28258 +   C-Kermit 7.0 in selected versions (UNIX, VMS, VOS, AOS/VS, Windows, and
28259 +   OS/2 at this writing) now permits the SEND command to traverse
28260 +   directories "recursively" if you ask it to; that is, to send files from
28261 +   the current or specified directory and all of its subdirectories too,
28262 +   and their subdirectories, etc. (Some other commands can do this too,
28263 +   including DIRECTORY.)
28264 +
28265 +   This feature is new to UNIX, Windows, VOS, and OS/2. VMS and AOS/VS
28266 +   have always included "wildcard" or "template" characters that allow
28267 +   this, and in this case, recursive directory traversal could happen
28268 +   behind Kermit's back, i.e. Kermit does not have to do it itself (in
28269 +   VMS, the notation is "[...]" or "[directory...]"; in AOS/VS is "#"). In
28270 +   C-Kermit 7.0, however, SEND /RECURSIVE is supported by C-Kermit itself
28271 +   for VMS.
28272 +
28273 +4.11.1. Command-Line Options
28274 +
28275 +   To descend a directory tree when sending files, use the -L command-line
28276 +   option to indicate that the send operation is to be recursive, and
28277 +   include a name or pattern to be sent. When giving a pattern, you should
28278 +   enclose it in quotes to prevent the shell from expanding it. Examples:
28279 +
28280 +  $ kermit -Ls "/usr/olga/*" # send all of Olga's files in all her directories
28281 +  $ kermit -Ls foo.txt       # send all foo.txt files in this directory tree
28282 +  $ kermit -Ls "*.txt"       # send all .txt files in this directory tree
28283 +  $ kermit -Ls "letters/*"   # send all files in the letters directory tree
28284 +  $ kermit -Ls letters       # send all files in the letters directory tree
28285 +  $ kermit -Ls "*"           # send all files in this directory tree
28286 +  $ kermit -Ls .             # UNIX only: send all files in this directory tree
28287 +  $ kermit -s .              # UNIX only: a filename of . implies -L
28288 +
28289 +   If you let the shell expand wildcards, Kermit only sends files whose
28290 +   names match files in the current or given directory, because the shell
28291 +   replaces an unquoted wildcard expression with the list of matching
28292 +   files -- and the shell does not build recursive lists. Note that the
28293 +   "." notation for the tree rooted at the current directory is allowed
28294 +   only in UNIX, since in Windows and OS/2, it means "*.*" (nonrecursive).
28295 +
28296 +4.11.2. The SEND /RECURSIVE Command
28297 +
28298 +   If you include the /RECURSIVE switch in a SEND (or MOVE, or similar)
28299 +   command, it means to descend the current or specified directory tree
28300 +   searching for files whose names match the given name or pattern. Since
28301 +   this is not terribly useful unless you also include pathnames with the
28302 +   outbound files, the /RECURSIVE switch also includes an implicit
28303 +   /PATHNAMES:RELATIVE switch (which you can undo by including an explicit
28304 +   /PATHNAMES switch after the /RECURSIVE switch).
28305 +
28306 +   Examples:
28307 +
28308 +   SEND /RECURSIVE *
28309 +          Sends all of the files in the current directory and all the
28310 +          files in all of its subdirectories, and all of their
28311 +          subdirectories, etc, including their relative pathnames. Empty
28312 +          directories are not sent.
28313 +
28314 +   SEND /RECURSIVE /PATHNAMES:ABSOLUTE *
28315 +          Sends all of the files in the current directory and all the
28316 +          files in all of its subdirectories, and all of their
28317 +          subdirectories, etc, including their absolute pathnames.
28318 +
28319 +   SEND /RECURSIVE /PATHNAMES:OFF *
28320 +          Sends all of the files in the current directory and all the
28321 +          files in all of its subdirectories, and all of their
28322 +          subdirectories, etc, without pathnames.
28323 +
28324 +   SEND /RECURSIVE /usr/olga/*
28325 +          Sends all of the files in the /usr/olga directory and all the
28326 +          files in all of its subdirectories, and all of their
28327 +          subdirectories, etc.
28328 +
28329 +   SEND /RECURSIVE /usr/olga (or /usr/olga/)
28330 +          Same as above. If the name is a directory name (with or without
28331 +          a trailing slash), its files are sent, and those of its
28332 +          subdirectories, and their subdirectories, etc (see [511]Section
28333 +          4.9).
28334 +
28335 +   SEND /RECURSIVE /TEXT /usr/olga/*.txt
28336 +          As above, but only files whose names end with ".txt" are sent,
28337 +          and they are sent in text mode (as they would be by default
28338 +          anyway if SET FILE PATTERNS is ON or AUTO).
28339 +
28340 +   SEND .
28341 +          UNIX only: Send all the files in the current directory.
28342 +
28343 +   SEND /RECURSIVE .
28344 +          UNIX only: Sends all of the files in the current directory and
28345 +          all of its subdirectories, etc ([512]Section 4.9).
28346 +
28347 +   The /RECURSIVE switch is different from most other switches in that its
28348 +   effect is immediate (but still local to the command in which it is
28349 +   given), because it determines how filenames are to be parsed. For
28350 +   example, "send *.txt" fails with a parse error ("No files match") if
28351 +   there are no *.txt files in the current directory, but "send /recursive
28352 +   *.txt" succeeds if there are ".txt" files anywhere in the tree rooted
28353 +   at the current directory.
28354 +
28355 +   The /RECURSIVE switch also affects the file lists displayed if you type
28356 +   "?" in a filename field. "send ./?" lists the regular files in the
28357 +   current directory, but "send /recursive ./?" lists the entire directory
28358 +   tree rooted at the current directory.
28359 +
28360 +4.11.3. The GET /RECURSIVE Command
28361 +
28362 +   In a client/server setting, the client can also request a recursive
28363 +   transfer with:
28364 +
28365 +   GET /RECURSIVE [ other switches ] remote-filespec [ local-spec ]
28366 +
28367 +   In which remote file specification can be a directory name, a filename,
28368 +   a wildcard, or any combination. If the local-spec is not given (and
28369 +   PATHNAMES are RELATIVE), incoming files and directories go into the
28370 +   current local directory. If local-spec is given and is a directory, it
28371 +   becomes the root of the tree into which the incoming files and
28372 +   directories are placed. If local-spec has the syntax of a directory
28373 +   name (e.g. in UNIX it ends with /), C-Kermit creates the directory and
28374 +   then places the incoming files into it. If local-spec is a filename
28375 +   (not recommended), then all incoming files are stored with that name
28376 +   with collisions handled according to the FILE COLLISION setting.
28377 +
28378 +   Again, the normal method for transferring directory trees uses relative
28379 +   pathnames, and this is the default when the sender has been given the
28380 +   /RECURSIVE switch. The action at the receiver depends on its RECEIVE
28381 +   PATHNAMES setting. The default is AUTO, meaning that if the sender
28382 +   tells it to expect a recursive transfer, then it should automatically
28383 +   switch to relative pathnames for this transfer only; otherwise it obeys
28384 +   the RECEIVE PATHNAMES setting of OFF, ABSOLUTE, or RELATIVE.
28385 +
28386 +   What happens if a file arrives that has an absolute pathname, when the
28387 +   receiver has been told to use only relative pathnames? As a security
28388 +   precaution, in this case the receiver treats the name as if it was
28389 +   relative. For example, if a file arrives as:
28390 +
28391 +  /usr/olga/oofa.txt
28392 +
28393 +   The receiver creates a "usr" subdirectory in its current directory, and
28394 +   then an "olga" subdirectory under the "usr" subdirectory in which to
28395 +   store the incoming file.
28396 +
28397 +   Suppose, however there is a sequence of directories:
28398 +
28399 +  /usr/olga/a/b/c/d/
28400 +
28401 +   in which "a" contains nothing but a subdirectory "b", which in turn
28402 +   contains nothing but a subdirectory "c", which in turn contains nothing
28403 +   but a subdirectory "d", which contains nothing at all. Thus there are
28404 +   no files in the "/usr/olga/a/" tree, and so it is not sent, and
28405 +   therefore it is not reproduced on the target computer.
28406 +
28407 +4.11.4. New and Changed File Functions
28408 +
28409 +   C-Kermit 7.0 adds the following functions:
28410 +
28411 +   \ffiles(pattern[,&a])
28412 +          This function has been changed to match only regular files in
28413 +          the current or given directory, and to take an optional array
28414 +          name as a second argument (explained below).
28415 +
28416 +   \fdirectories(pattern[,&a])
28417 +          Returns the number of directories that match the given pattern.
28418 +          If the pattern does not include a directory, then the search is
28419 +          performed in the current directory.
28420 +
28421 +   \frfiles(pattern[,&a])
28422 +          Returns the number of files in the current or given directory
28423 +          and all of its subdirectories, and their subdirectories, etc,
28424 +          that match the given pattern. Warning -- this one can take quite
28425 +          some time if performed at the root of a large directory tree.
28426 +
28427 +   \frdirectories(pattern[,&a])
28428 +          Returns the number of directories in the current or given
28429 +          directory and all of its subdirectories, and their
28430 +          subdirectories, etc, that match the given pattern.
28431 +
28432 +   Each of these functions builds up a list of files to be returned by the
28433 +   \fnextfile() function, just as \ffiles() always has done. (This can
28434 +   also be done with the /ARRAY switch of the DIRECTORY command; see
28435 +   [513]Sections 4.5.1 and [514]7.10).
28436 +
28437 +   Each of these functions can be given an array name as an optional
28438 +   second argument. If an array name is supplied, the array will contain
28439 +   the number of files as its 0th element, and the filenames in elements 1
28440 +   through last. If the array already existed, its previous contents are
28441 +   lost. For example, if the current directory contains two files,
28442 +   oofa.txt and foo.bar, then "\ffiles(*,&a)" creates an array \&a[] with
28443 +   a dimension of 2, containing the following elements:
28444 +
28445 + \&a[0] = 2
28446 + \&a[1] = oofa.txt
28447 + \&a[2] = foo.bar
28448 +
28449 +   If no files match the specification given in the first argument, the
28450 +   array gets a dimension of 0, which is the same as undeclaring the
28451 +   array.
28452 +
28453 +   Note that the order in which the array is filled (and in which
28454 +   \fnextfile() returns filenames) is indeterminate (but see [515]Section
28455 +   7.10.5).
28456 +
28457 +   Here's an example that builds and prints a list of all the file whose
28458 +   names end in .txt in the current directory and all its descendents:
28459 +
28460 +  asg \%n \frfiles(*.txt)
28461 +  declare \&a[\%n]
28462 +  for \%i 1 \%n 1 {
28463 +      asg \&a[\%i] \fnextfile()
28464 +      echo \flpad(\%i,4). "\&a[\%i]"
28465 +  }
28466 +
28467 +   Alternatively, using the array method, and then printing the filenames
28468 +   in alphabetic order (see [516]Section 7.10.3 and [517]7.10.5):
28469 +
28470 +  asg \%n \frfiles(*.txt,&a)
28471 +  sort &a
28472 +  for \%i 1 \%n 1 {
28473 +      echo \flpad(\%i,4). "\&a[\%i]"
28474 +  }
28475 +
28476 +   Or even more simply:
28477 +
28478 +  asg \%n \frfiles(*.txt,&a)
28479 +  sort &a
28480 +  show array &a
28481 +
28482 +   As noted elsewhere, the file lists built by \ffiles(), \frfiles(), etc,
28483 +   are now "safe" in the sense that SEND and other file-related commands
28484 +   can reference \fnextfile() without resetting the list:
28485 +
28486 +  set send pathnames relative
28487 +  for \%i 1 \frfiles(*.txt) 1 {
28488 +      asg \%a \fnextfile()
28489 +      echo Sending \%a...
28490 +      send \%a
28491 +      if fail break
28492 +  }
28493 +
28494 +   Copying to an array (as shown on p.398 of [518]Using C-Kermit 2nd Ed)
28495 +   is no longer necessary.
28496 +
28497 +4.11.5. Moving Directory Trees Between Like Systems
28498 +
28499 +4.11.5.1. UNIX to UNIX
28500 +
28501 +   Transferring a directory tree from one computer to another replicates
28502 +   the file sender's arrangement of files and directories on the file
28503 +   receiver's computer. Normally this is done using relative pathnames,
28504 +   since the user IDs might not be identical on the two computers. Let's
28505 +   say both computers are UNIX based, running C-Kermit 7.0 or later. On
28506 +   the sending computer (leaving out the connection details, etc):
28507 +
28508 +  C-Kermit> cd /usr/olga
28509 +  C-Kermit> send /recursive .
28510 +
28511 +   The /RECURSIVE switch tells C-Kermit to descend through the directory
28512 +   tree and to include relative pathnames on outbound filenames.
28513 +
28514 +   On the receiving computer:
28515 +
28516 +  C-Kermit> mkdir olgas-files           ; Make a new directory.
28517 +  C-Kermit> cd olgas-files              ; CD to it.
28518 +  C-Kermit> receive /recursive          ; = /PATHNAMES:RELATIVE
28519 +
28520 +   Each Kermit program recognizes that the other is running under UNIX and
28521 +   switches to binary mode and literal filenames automatically.
28522 +   Directories are automatically created on the receiving system as
28523 +   needed. File dates and permissions are automatically reproduced from
28524 +   source to destination.
28525 +
28526 +4.11.5.2. VMS to VMS
28527 +
28528 +   To send recursively from VMS, simply include the /RECURSIVE switch, for
28529 +   example at the sender:
28530 +
28531 +  $ kermit
28532 +  C-Kermit> cd [olga]
28533 +  C-Kermit> send /recursive *.*;0
28534 +
28535 +   And at the receiver:
28536 +
28537 +  C-Kermit> cd [.olga]
28538 +  C-Kermit> receive /recursive
28539 +
28540 +   The notation "..." within directory brackets in VMS means "this
28541 +   directory and all directories below it"; the /RECURSIVE switch, when
28542 +   given to the sender, implies the use of "..." in the file specification
28543 +   so you don't have to include "..."; but it makes no difference if you
28544 +   do:
28545 +
28546 +  $ kermit
28547 +  C-Kermit> send /recursive [olga...]*.*;0
28548 +
28549 +   And at the receiver:
28550 +
28551 +  C-Kermit> cd [.olga]
28552 +  C-Kermit> receive /recursive
28553 +
28554 +   In either case, since both systems recognize each other as VMS, they
28555 +   switch into LABELED transfer mode automatically.
28556 +
28557 +4.11.6. Moving Directory Trees Between Unlike Systems
28558 +
28559 +   There are several difficulties with recursive transfers between unlike
28560 +   systems:
28561 +
28562 +     * File formats can be different, especially text files character sets
28563 +       and record formats. This can now be handled by using SET FILE
28564 +       PATTERN, SET FILE TEXT-PATTERNS, and SET FILE BINARY-PATTERNS
28565 +       ([519]Section 4.3).
28566 +     * File naming conventions are different. For example, one system
28567 +       might allow (and use) longer filenames than the other. You can tell
28568 +       Kermit how to handle file names with the normal "set file names"
28569 +       and "set file collision" mechanisms. Most modern Kermits are fairly
28570 +       tolerant of illegal filenames and should not fail simply because of
28571 +       an incoming filename; rather, it will do its best to convert it to
28572 +       a recognizable and unique legal filename.
28573 +     * Directory notations can be different, e.g. backslashes instead of
28574 +       slashes, brackets, parentheses, spaces, etc. But this is now
28575 +       handled by converting pathnames to a standard format during
28576 +       transfer ([520]Section 4.10).
28577 +
28578 +   So now, for the first time, it is possible to send directory trees
28579 +   among any combination of UNIX, DOS, Windows, OS/2, VMS, AOS/VS, etc.
28580 +   Here's an example sending files from an HP-UX system (where text files
28581 +   are encoded in the HP Roman8 character set) to a PC with K95 (where
28582 +   text files are encoded in CP850):
28583 +
28584 + Sender:
28585 +  cd xxx                           ; CD to root of source tree
28586 +  set file type binary             ; Default transfer mode
28587 +  set file character-set hp-roman8 ; Local character set for text files
28588 +  set xfer character-set latin1    ; Transfer character set
28589 +  set file patterns on             ; Enable automatic file-type switching...
28590 +  set file binary-patterns *.Z *.gz *.o  ; based on these patterns...
28591 +  set file text-patterns *.txt *.c *.h   ; for binary and text files.
28592 +  send /recursive *                ; Send all the file in this directory tree
28593 +
28594 + Receiver:
28595 +  cd yyy                           ; CD to root of destination tree
28596 +  set file character-set cp850     ; Local character set for text files
28597 +  receive /pathnames:relative      ; Receive with pathnames
28598 +
28599 +   Notes:
28600 +     * Replace "xxx" and "yyy" with the desired directories.
28601 +     * Replace the file character sets appropriately.
28602 +     * Change the patterns as needed (or just use the built-in default
28603 +       lists).
28604 +     * SEND /RECURSIVE also implies /PATHNAMES:RELATIVE.
28605 +     * The file sender tells the file receiver the transfer mode of each
28606 +       file.
28607 +     * The file sender tells the file receiver the transfer character set.
28608 +     * By default, destination file dates will be the same as on the
28609 +       source.
28610 +     * Many of the settings shown might already be set by default.
28611 +     * See [521]Sections 4.3, [522]4.10, and [523]4.15 for additional
28612 +       explanation.
28613 +
28614 +   If you are refreshing an existing directory on the destination
28615 +   computer, use "set file collision update" or other appropriate file
28616 +   collision option to handle filename collisions.
28617 +
28618 +4.12. Where Did My File Go?
28619 +
28620 +   Now that Kermit can be started by clicking on desktop icons (thus
28621 +   obscuring the concept of "current directory"), and can have a download
28622 +   directory, and can create directories for incoming files on the fly,
28623 +   etc, sometimes it is easy to lose a file after transfer. Of course, if
28624 +   you keep a transaction log:
28625 +
28626 +  LOG TRANSACTIONS
28627 +
28628 +   it will record the fate and final resting place of each file. But in
28629 +   case you did not keep a log, the new command:
28630 +
28631 +  WHERE
28632 +
28633 +   added in C-Kermit 7.0, gives you as much information as it has about
28634 +   the location of the last files transferred, including the pathname
28635 +   reported by the receiving Kermit, if any, when C-Kermit is the sender.
28636 +   This information was also added to SHOW FILE in somewhat less detail.
28637 +
28638 +4.13. File Output Buffer Control
28639 +
28640 +   (UNIX only). The new command SET FILE OUTPUT lets you control how
28641 +   incoming files are written to disk:
28642 +
28643 +   SET FILE OUTPUT BUFFERED [ size ]
28644 +          Chooses buffered file output; this is the default. UNIX does its
28645 +          normal sort of disk buffering. The optional size specifies
28646 +          Kermit's own file output buffer size, and therefore the
28647 +          frequency of disk accesses (write() system calls) -- the bigger
28648 +          the size, the fewer the disk accesses.
28649 +
28650 +   SET FILE OUTPUT UNBUFFERED [ size ]
28651 +          This forces each file output write() call to actually commit the
28652 +          data to disk immediately. Choosing this option will usually slow
28653 +          file reception down.
28654 +
28655 +   SET FILE OUTPUT BLOCKING
28656 +          Write() calls should not return until they are complete. This is
28657 +          the normal setting, and it lets Kermit detect disk-write errors
28658 +          immediately.
28659 +
28660 +   SET FILE OUTPUT NONBLOCKING
28661 +          Write() calls should return immediately. This can speed up file
28662 +          reception, but also delay the detection of disk-write errors.
28663 +
28664 +   Experimentation with these parameters should be harmless, and might (or
28665 +   might not) have a perceptible, even dramatic, effect on performance.
28666 +
28667 +4.14. Improved Responsiveness
28668 +
28669 +   In version 7.0, C-Kermit's file-transfer protocol engine has been tuned
28670 +   for additional speed and responsiveness.
28671 +
28672 +     * Binary-mode transfers over 8-bit connections, a very common case,
28673 +       are now handled in a special way that minimizes overhead.
28674 +     * SET TRANSFER CRC-CALCULATION is now OFF by default, rather than ON.
28675 +       (This affects only the overall per-transfer CRC, \v(crc16), not the
28676 +       per-packet CRCs)
28677 +     * Connection loss during file transfer is now detected immediately in
28678 +       most cases on Internet connections and on serial connections when
28679 +       CARRIER-WATCH is not set to OFF.
28680 +
28681 +4.15. Doubling and Ignoring Characters for Transparency
28682 +
28683 +   The following commands were added in 7.0, primarily to allow successful
28684 +   file transfer through ARPAnet TACs and with Honeywell DPS6 systems, but
28685 +   can be used in any setting where they might be needed:
28686 +
28687 +   SET SEND DOUBLE-CHAR { [ char [ char [ ... ] ] ], NONE }
28688 +          Tells C-Kermit to double the specified characters (use decimal
28689 +          notation) in packets that it sends. For example, if you are
28690 +          sending files through a device that uses @ as an escape
28691 +          character, but allows you to send a single copy of @ through by
28692 +          doubling it, use "set send double 64".
28693 +
28694 +   SET RECEIVE IGNORE-CHAR [ char [ char [ ... ] ] ]
28695 +          Tells C-Kermit to ignore the specified character(s) in incoming
28696 +          packets. Use this, for example, when something between the
28697 +          sender and receiver is inserting linefeeds for wrapping, NULs
28698 +          for padding, etc.
28699 +
28700 +4.16. New File-Transfer Display Formats
28701 +
28702 +   SET TRANSFER DISPLAY { BRIEF, CRT, FULLSCREEN, NONE, SERIAL }
28703 +          Selects the file-transfer display format.
28704 +
28705 +   BRIEF is the new one. This writes one line to the screen per file,
28706 +   showing the file's name, transfer mode, size, the status of the
28707 +   transfer, and when the transfer is successful, the effective data rate
28708 +   in characters per second (CPS). Example:
28709 +
28710 +  SEND ckcfn3.o (binary) (59216 bytes): OK (0.104 sec, 570206 cps)
28711 +  SEND ckcfns.o (binary) (114436 bytes): OK (0.148 sec, 772006 cps)
28712 +  SEND ckcmai.c (text) (79147 bytes): OK (0.180 sec, 438543 cps)
28713 +  SEND ckcmai.o (binary) (35396 bytes): OK (0.060 sec, 587494 cps)
28714 +  SEND ckcnet.o (binary) (62772 bytes): REFUSED
28715 +  SEND ckcpro.o (binary) (121448 bytes): OK (0.173 sec, 703928 cps)
28716 +  SEND ckcpro.w (text) (63687 bytes): OK (0.141 sec, 453059 cps)
28717 +  SEND makefile (text) (186636 bytes): OK (0.444 sec, 420471 cps)
28718 +  SEND wermit (binary) (1064960 bytes): OK (2.207 sec, 482477 cps)
28719 +
28720 +   Note that transfer times are now obtained in fractional seconds, rather
28721 +   than whole seconds, so the CPS figures are more accurate (the display
28722 +   shows 3 decimal places, but internally the figure is generally precise
28723 +   to the microsecond).
28724 +
28725 +4.17. New Transaction Log Formats
28726 +
28727 +   The new command:
28728 +
28729 +  SET TRANSACTION-LOG { VERBOSE, FTP, BRIEF [ separator ] }
28730 +
28731 +   lets you choose the format of the transaction log. VERBOSE (the
28732 +   default) indicates the traditional format described in the book. BRIEF
28733 +   and FTP are new. This command must be given prior to the LOG
28734 +   TRANSACTION command if a non-VERBOSE type is desired.
28735 +
28736 +4.17.1. The BRIEF Format
28737 +
28738 +   BRIEF chooses a one-line per file format suitable for direct
28739 +   importation into databases like Informix, Oracle, or Sybase, in which:
28740 +
28741 +     * Each record has 8 fields.
28742 +     * Fields are separated by a non-alphanumeric separator character.
28743 +     * The default separator character is comma (,).
28744 +     * Any field containing the separator character is enclosed in
28745 +       doublequotes.
28746 +     * The final field is enclosed in doublequotes.
28747 +
28748 +   The fields are:
28749 +
28750 +    1. Date in yyyymmdd format
28751 +    2. Time in hh:mm:ss format
28752 +    3. Action: SEND or RECV
28753 +    4. The local filename
28754 +    5. The size of the file
28755 +    6. The transfer mode (text, binary, image, labeled)
28756 +    7. The status of the transfer: OK or FAILED
28757 +    8. Additional status-dependent info, in doublequotes.
28758 +
28759 +   Examples:
28760 +
28761 +  20000208,12:08:52,RECV,/u/olga/oofa.txt,5246,text,OK,"0.284sec 18443cps"
28762 +  20000208,12:09:31,SEND,/u/olga/oofa.exe,32768,binary,OK,"1.243sec 26362cps"
28763 +  20000208,12:10:02,SEND,"/u/olga/a,b",10130,text,FAILED,"Refused: date"
28764 +
28765 +   Note how the filename is enclosed in doublequotes in the final example,
28766 +   because it contains a comma.
28767 +
28768 +   To obtain BRIEF format, you must give the SET TRANSACTION-LOG BRIEF
28769 +   command before the LOG TRANSACTIONS command. (If you give them in the
28770 +   opposite order, a heading is written to the log by the LOG command.)
28771 +
28772 +4.17.2. The FTP Format
28773 +
28774 +   SET TRANSACTION-LOG FTP (available only in UNIX) chooses a format that
28775 +   is compatible with the WU-FTPD (Washington University FTP daemon) log,
28776 +   and so can be processed by any software that processes the WU-FTPD log.
28777 +   It logs only transfers in and out, both successful and failed (but
28778 +   success or failure is not indicated, due to lack of a field in the
28779 +   WU-FTPD log format for this purpose). Non-transfer events are not
28780 +   recorded.
28781 +
28782 +   Unlike other logs, the FTP-format transaction log is opened in append
28783 +   mode by default. This allows you to easily keep a record of all your
28784 +   kermit transfers, and it also allows the same log to be shared by
28785 +   multiple simultaneous Kermit processes or (permissions permitting)
28786 +   users. You can, of course, force creation of a new logfile by
28787 +   specifying the NEW keyword after the filename, e.g.
28788 +
28789 +  log transactions oofa.log new
28790 +
28791 +   All records in the FTP-style log are in a consistent format. The first
28792 +   field is fixed-length and contains spaces; subsequent fields are
28793 +   variable length, contain no spaces, and are separated by one or more
28794 +   spaces. The fields are:
28795 +
28796 +   Timestamp
28797 +          This is an asctime-style timestamp, example: "Wed Sep 16
28798 +          20:19:05 1999" It is always exactly 24 characters long, and the
28799 +          subfields are always in fixed positions.
28800 +
28801 +   Elapsed time
28802 +          The whole number of seconds required to transfer the file, as a
28803 +          string of decimal digits, e.g. "24".
28804 +
28805 +   Connection
28806 +          The name of the network host to which C-Kermit is connected, or
28807 +          the name of the serial device through which it has dialed (or
28808 +          has a direct connection), or "/dev/tty" for transfers in remote
28809 +          mode.
28810 +
28811 +   Bytes transferred
28812 +          The number of bytes transferred, decimal digits, e.g. "1537904".
28813 +
28814 +   Filename
28815 +          The name of the file that was transferred, e.g.
28816 +          "/pub/ftp/kermit/a/README.TXT". If the filename contains any
28817 +          spaces or control characters, each such character is replaced by
28818 +          an underscore ('_') character.
28819 +
28820 +   Mode
28821 +          The letter 'b' if the file was transferred in binary mode, or
28822 +          'a' if it was transferred in text (ASCII) mode.
28823 +
28824 +   Options
28825 +          This field always contains an underscore ('_') character.
28826 +
28827 +   Direction
28828 +          The letter 'o' if the file was transferred Out, and 'i' if the
28829 +          file was transferred In.
28830 +
28831 +   User class
28832 +          The letter 'r' indicates the file was transferred by a Real
28833 +          user.
28834 +
28835 +   User identification
28836 +          The ID of the user who transferred the file.
28837 +
28838 +   Server identification
28839 +          The string "kermit". This distinguishes a Kermit transfer log
28840 +          record from a WU-FTPD record, which contains "ftp" in this
28841 +          field.
28842 +
28843 +   Authentication class
28844 +          The digit '1' if we know the user's ID on the client system,
28845 +          otherwise '0'. Currently, always '0'.
28846 +
28847 +   Authenticated user
28848 +          If the authentication class is '1', this is the user's ID on the
28849 +          client system. Otherwise it is an asterisk ('*'). Currently it
28850 +          is always an asterisk.
28851 +
28852 +   Examples:
28853 +
28854 +  Thu Oct 22 17:42:48 1998 0 * 94 /usr/olga/new.x a _ i r olga kermit 0 *
28855 +  Thu Oct 22 17:51:29 1998 1 * 147899 /usr/olga/test.c a _ o r olga kermit 0 *
28856 +  Thu Oct 22 17:51:44 1998 1 * 235 /usr/olga/test.o b _ i r olga kermit 0 *
28857 +  Fri Oct 23 12:10:25 1998 0 * 235 /usr/olga/x.ksc a _ o r olga kermit 0 *
28858 +
28859 +   Note that an ftp-format transaction log can also be selected on the
28860 +   Kermit command line as follows:
28861 +
28862 +  kermit --xferfile:filespec
28863 +
28864 +   This is equivalent to:
28865 +
28866 +  SET TRANSACTION-LOG FTP
28867 +  LOG TRANSACTIONS filespec APPEND
28868 +
28869 +   Conceivably it could be possible to have a system-wide shared Kermit
28870 +   log, except that UNIX lacks any notion of an append-only file; thus any
28871 +   user who could append to the log could also delete it (or alter it).
28872 +   This problem could be worked around using setuid/setgid tricks, but
28873 +   these would most likely interfere with the other setuid/setgid tricks
28874 +   C-Kermit must use for getting at dialout devices and UUCP logfiles.
28875 +
28876 +4.18. Unprefixing NUL
28877 +
28878 +   As of 6.1.193 Alpha.10, C-Kermit can finally send and receive
28879 +   file-transfer packets in which NUL (ASCII 0) is unprefixed (no more
28880 +   NUL-terminated packets!). NUL is, of course, extremely prevalent in
28881 +   binary files such as executables, and this has been a significant
28882 +   source of packet overhead. For example, when transferring itself (the
28883 +   SunOS C-Kermit executable) with minimal prefixing and 9000-byte
28884 +   packets, we see:
28885 +
28886 +  File size:                       1064960
28887 +  Packet chars with 0 prefixed:    1199629  overhead = 12.65%
28888 +  Packet chars with 0 unprefixed:  1062393  overhead = -0.03%
28889 +
28890 +   Transfer rates go up accordingly, not only because of the reduced
28891 +   amount of i/o, but also because less computation is required on each
28892 +   end.
28893 +
28894 +4.19. Clear-Channel Protocol
28895 +
28896 +   Now that C-Kermit itself is capable of sending and receiving any byte
28897 +   at all on a clear channel ([524]Section 4.18), it is, for the first
28898 +   time, in a position to negotiate a clear channel with the other Kermit,
28899 +   giving it permission (but not requiring it) to unprefix any and all
28900 +   characters that it knows are safe. In general this means all but the
28901 +   Kermit start-of-packet character (normally Ctrl-A), Carriage Return
28902 +   (not only Kermit's end-of-packet character, but also treated specially
28903 +   on Telnet NVT links), and IAC (255, also special to Telnet).
28904 +
28905 +   By default, C-Kermit will say it has a clear channel only if it has
28906 +   opened a TCP socket. Since the Kermit program on the far end of a
28907 +   TCP/IP connection generally does not know it has a TCP/IP connection,
28908 +   it will not announce a clear channel unless it has been told to do so.
28909 +   The command is:
28910 +
28911 +   SET CLEAR-CHANNEL { ON, OFF, AUTO }
28912 +
28913 +   AUTO is the default, meaning that the clear-channel status is
28914 +   determined automatically from the type of connection. ON means to
28915 +   announce a clear channel, OFF means not to announce it. Use SHOW
28916 +   STREAMING ([525]Section 4.20) to see the current CLEAR-CHANNEL status.
28917 +   Synonym: SET CLEARCHANNEL.
28918 +
28919 +   CLEAR-CHANNEL is also set if you start C-Kermit with the -I switch (see
28920 +   [526]Section 4.20).
28921 +
28922 +   Whenever a clear channel is negotiated, the resulting control-character
28923 +   unprefixing is "sticky"; that is, it remains in effect after the
28924 +   transfer so you can use SHOW CONTROL to see what was negotiated.
28925 +
28926 +   You can also see whether a clear channel was negotiated in the
28927 +   STATISTICS /VERBOSE Display.
28928 +
28929 +   The advantage of the clear channel feature is that it can make file
28930 +   transfers go faster automatically. The disadvantage would be
28931 +   file-transfer failures if the channel is not truly clear, for example
28932 +   if C-Kermit made a Telnet connection to a terminal server, and then
28933 +   dialed out from there; or if C-Kermit made an Rlogin connection to host
28934 +   and then made a Telnet connection from there to another host. If a file
28935 +   transfer fails on a TCP/IP connection, use SHOW CONTROL to check
28936 +   whether control characters became unprefixed as a result of protocol
28937 +   negotiations, and/or SHOW STREAMING ([527]Section 4.20) to see if
28938 +   "clear-channel" was negotiated. If this happened, use SET CLEAR-CHANNEL
28939 +   OFF and SET PREFIXING CAUTIOUS (or whatever) to prevent it from
28940 +   happening again.
28941 +
28942 +4.20. Streaming Protocol
28943 +
28944 +   A new Kermit protocol option called "streaming" was added in C-Kermit
28945 +   7.0. The idea is that if the two Kermit partners have a reliable
28946 +   transport (such as TCP/IP or X.25) between them, then there is no need
28947 +   to send ACKs for Data packets, or NAKs, since a reliable transport
28948 +   will, by definition, deliver all packets in order and undamaged. On
28949 +   such a connection, streaming cuts down not only on Kermit program
28950 +   overhead (switching back and forth between reading and sending
28951 +   packets), but also tends to make the underlying transport use itself
28952 +   more efficiently (e.g. by defeating the Nagle algorithm and/or Delayed
28953 +   ACK stratagem of the TCP layer). Furthermore, it allows transfers to
28954 +   work smoothly on extremely slow network congestions that would
28955 +   otherwise cause timeouts and retransmissions, and even failure when the
28956 +   retry limit was exceeded.
28957 +
28958 +   The trick is knowing when we can stream:
28959 +
28960 +    1. If C-Kermit has opened a TCP socket or X.25 connection, it offers
28961 +       stream.
28962 +    2. If C-Kermit has been started with the -I (uppercase) option, or if
28963 +       it has been told to SET RELIABLE ON, it offers to stream.
28964 +    3. If C-Kermit is in remote mode, and has been told to SET RELIABLE
28965 +       AUTO (or ON), it always offers to stream, and also always agrees to
28966 +       stream, if the other Kermit offers. Unless you take explicit
28967 +       actions to override the defaults, this allows the local Kermit (the
28968 +       one that made the connection, and so knows whether it's reliable)
28969 +       to control streaming.
28970 +
28971 +   (Note that an offer to stream also results in a Clear-Channel
28972 +   announcement if CLEAR-CHANNEL is set to AUTO; see [528]Section 4.19.)
28973 +
28974 +   When BOTH Kermits offer to stream, then they stream; otherwise they
28975 +   don't. Thus streaming-capable Kermit programs interoperate
28976 +   automatically and transparently with nonstreaming ones. If the two
28977 +   Kermits do agree to stream, you'll see the word "STREAMING" on the
28978 +   fullscreen file-transfer display in the Window Slots field. You can
28979 +   also find out afterwards with the STATISTICS or SHOW STREAMING
28980 +   commands.
28981 +
28982 +     WARNING: Automatic choice of streaming is based on the assumption of
28983 +     a "direct" end-to-end network connection; for example, a Telnet or
28984 +     Rlogin connection from host A to host B, and transferring files
28985 +     between A and B. However, if your connection has additional
28986 +     components -- something "in the middle" (B) that you have made a
28987 +     network connection to, which makes a separate connection to the
28988 +     destination host (C), then you don't really have a reliable
28989 +     connection, but C-Kermit has no way of knowing this; transferring
28990 +     files between A and C will probably fail. In such cases, you'll need
28991 +     to tell the *local* C-Kermit to "set reliable off" before
28992 +     transferring files (it does no good to give this command to the
28993 +     remote Kermit since the local one controls the RELIABLE setting).
28994 +
28995 +   Streaming is like using an infinite window size, with no timeouts and
28996 +   no tolerance for transmission errors (since there shouldn't be any). It
28997 +   relies on the underlying transport for flow control, error correction,
28998 +   timeouts, and retransmission. Thus it is very suitable for use on
28999 +   TCP/IP connections, especially slow or bursty ones, since Kermit's
29000 +   packet timeouts won't interfere with the transfer -- each packet takes
29001 +   as long to reach its destination as it takes TCP to deliver it. If TCP
29002 +   can't deliver the packet within its own timeout period (over which
29003 +   Kermit has no control), it signals a fatal error. Just like FTP.
29004 +
29005 +   Streaming goes much faster than non-streaming when a relatively small
29006 +   packet length is used, and it tends to go faster than non-streaming
29007 +   with even the longest packet lengths. The Kermit window size is
29008 +   irrelevant to streaming protocol, but still might affect performance in
29009 +   small ways since it can result in different paths through the code.
29010 +
29011 +   The definition of "reliable transport" does not necessarily demand
29012 +   8-bit and control-character transparency. Streaming can work with
29013 +   parity and/or control-character prefixing just as well (but not as
29014 +   fast) as without them; in such cases you can leave RELIABLE set to ON,
29015 +   but set CLEARCHANNEL and/or PARITY appropriately.
29016 +
29017 +   Maximum performance -- comparable to and often exceeding FTP -- is
29018 +   achieved on socket-to-socket connections (in which the considerable
29019 +   overhead of the terminal driver and Telnet or Rlogin server is
29020 +   eliminated) with long packets and the new "brief" file-transfer display
29021 +   ([529]Section 4.16).
29022 +
29023 +4.20.1. Commands for Streaming
29024 +
29025 +   SET RELIABLE { ON, OFF, AUTO }
29026 +          SET RELIABLE ON tells Kermit that it has a reliable transport.
29027 +          SET RELIABLE OFF tells Kermit the transport is not reliable.
29028 +          SET RELIABLE AUTO tells Kermit that it should SET RELIABLE ON
29029 +          whenever it makes a reliable connection (e.g. TELNET or SET HOST
29030 +          on a TCP/IP or X.25 network), and when in remote mode it should
29031 +          believe the transport is reliable if the other Kermit says it is
29032 +          during Kermit protocol negotiation.
29033 +
29034 +   AUTO is the default; the Kermit program that makes the connection knows
29035 +   whether it is reliable, and tells the remote Kermit.
29036 +
29037 +   The RELIABLE setting has several effects, including:
29038 +
29039 +     * It can affect the timeouts used during normal ACK/NAK protocol.
29040 +     * It can affect the clear-channel announcement.
29041 +     * It can affect streaming.
29042 +
29043 +   If you TELNET or SET HOST somewhere, this includes an implicit SET
29044 +   RELIABLE ON command. The -I command-line option is equivalent to SET
29045 +   RELIABLE ON.
29046 +
29047 +   Since SET RELIABLE ON (and -I) also implies SET CLEAR CHANNEL ON, you
29048 +   might find that in certain cases you need to tell Kermit that even
29049 +   though the connection is reliable, it doesn't have a clear channel
29050 +   after all:
29051 +
29052 +  SET CLEAR-CHANNEL OFF
29053 +  SET PREFIXING CAUTIOUS ; or whatever...
29054 +
29055 +   You can control streaming without affecting the other items with:
29056 +
29057 +  SET STREAMING { ON, OFF, AUTO }
29058 +
29059 +   AUTO is the default, meaning streaming will occur if Kermit has made a
29060 +   TCP/IP connection or if RELIABLE is ON (or it was started with the -I
29061 +   command line option). OFF means don't stream; ON means offer to stream
29062 +   no matter what.
29063 +
29064 +4.20.2. Examples of Streaming
29065 +
29066 +   Here we look at the use and behavior of streaming on several different
29067 +   kinds of connections, and compare its performance with non-streaming
29068 +   transfers.
29069 +
29070 +4.20.2.1. Streaming on Socket-to-Socket Connections
29071 +
29072 +   Here we get streaming automatically when both Kermit programs are
29073 +   capable of it, since they both make socket connections. For example, on
29074 +   the far end:
29075 +
29076 +  C-Kermit> set host * 3000
29077 +  C-Kermit> server
29078 +
29079 +   and on the near end:
29080 +
29081 +  C-Kermit> set host foo.bar.xyz.com 3000
29082 +  (now give SEND and GET command)
29083 +
29084 +   All subsequent file transfers use streaming automatically.
29085 +
29086 +   Here are the results from 84 trials, run on a production network,
29087 +   disk-to-disk, in which a 1-MB binary file (the SunOS C-Kermit Sparc
29088 +   executable) was sent from a Sun Sparc-10 with SunOS 4.1.3 to an IBM
29089 +   Power Server 850 with AIX 4.1, socket-to-socket, over a 10Mbps 10BaseT
29090 +   Ethernet, using minimal control-character unprefixing, window sizes
29091 +   from 10 to 32, and packet sizes from 1450 to 9010:
29092 +
29093 +                Streaming    Nonstreaming
29094 +  Max CPS         748955        683354
29095 +  Min CPS         221522        172491
29096 +  Mean CPS        646134        558680
29097 +  Median CPS      678043        595874
29098 +  Std Dev         101424        111493
29099 +
29100 +   Correlations:
29101 +
29102 +  CPS and window size:   -0.036
29103 +  CPS and packet length:  0.254
29104 +  CPS and streaming:      0.382
29105 +
29106 +   Note that the relationship between streaming and throughput is
29107 +   significantly stronger than that between CPS and window size or packet
29108 +   length.
29109 +
29110 +   Also note that this and all other performance measurements in this
29111 +   section are snapshots in time; the results could be much different at
29112 +   other times when the load on the systems and/or the network is higher
29113 +   or lower.
29114 +
29115 +   In a similar socket-to-socket trial, but this time over a wide-area
29116 +   TCP/IP connection (from New York City to Logan, Utah, about 2000
29117 +   miles), the following results were obtained:
29118 +
29119 +                Streaming    Nonstreaming
29120 +  Max CPS         338226        318203
29121 +  Min CPS         191659        132314
29122 +  Mean CPS        293744        259240
29123 +  Median CPS      300845        273271
29124 +  Std Dev          41914         52351
29125 +
29126 +   Correlations:
29127 +
29128 +  CPS and window size:    0.164
29129 +  CPS and packet length:  0.123
29130 +  CPS and streaming:      0.346
29131 +
29132 +4.20.2.2. Streaming on Telnet Connections
29133 +
29134 +   In this case the local copy of Kermit is told to TELNET or SET HOST,
29135 +   and so it knows it has a reliable connection and -- unless it has been
29136 +   told not to -- will offer to stream, and the other Kermit program,
29137 +   since it has STREAMING set to AUTO, agrees.
29138 +
29139 +   Since we have a reliable connection, we'll also get control-character
29140 +   unprefixing automatically because of the new clear-channel protocol
29141 +   ([530]Section 4.19).
29142 +
29143 +   Any errors that occur during streaming are fatal to the transfer. The
29144 +   message is "Transmission error on reliable link". Should this happen:
29145 +
29146 +    1. Check the remote Kermit's flow control setting (SHOW
29147 +       COMMUNICATIONS). If it is NONE, change it to XON/XOFF, or vice
29148 +       versa. If it is XON/XOFF (or you just changed it to XOFF/XOFF),
29149 +       make sure the file sender is prefixing the XON and XOFF characters.
29150 +       In the most drastic case, use "set prefix all" to force prefixing
29151 +       of all control characters.
29152 +    2. The remote Telnet server might chop off the 8th bit. In that case,
29153 +       tell C-Kermit to "set parity space". Or, you might be able to force
29154 +       the Telnet to allow eight-bit data by telling C-Kermit to "set
29155 +       telopt binary request accept" -- that is, request the Telnet server
29156 +       to enter binary mode, and accept binary-mode bids from the server.
29157 +    3. The remote Telnet server might have a buffering limitation. If a
29158 +       and b don't cure the problem, tell the file receiver to "set
29159 +       receive packet-length 1000" (or other number -- use the largest one
29160 +       that works). This too, is no different from the non-streaming case
29161 +       (more about this in [531]Section 4.20.2.3).
29162 +
29163 +   And remember you can continue interrupted binary-mode transfers where
29164 +   they left off with the RESEND (= SEND /RECOVER) command.
29165 +
29166 +   Here are the figures for the same 84 trials between the same Sun and
29167 +   IBM hosts as in 4.20.2.1, on the same network, but over a Telnet
29168 +   connection rather than socket-to-socket:
29169 +
29170 +                  Streaming    Nonstreaming
29171 +  Max CPS         350088        322523
29172 +  Min CPS          95547        173152
29173 +  Mean CPS        321372        281830
29174 +  Median CPS      342604        291469
29175 +  Std Dev          40503         29948
29176 +
29177 +   Correlations:
29178 +
29179 +  CPS and window size:    0.001
29180 +  CPS and packet length:  0.152
29181 +  CPS and streaming:      0.128
29182 +
29183 +   Here the effect is not as emphatic as in the socket-to-socket case, yet
29184 +   on the whole streaming tends to be beneficial.
29185 +
29186 +   Additional measurements on HP-UX using C-Kermit 7.0 Beta.06:
29187 +
29188 +                  Windowing     Streaming
29189 +  HP-UX 8->8      not tested       14Kcps
29190 +  HP-UX 8->9      not tested       76Kcps
29191 +  HP-UX 8->10      36Kcps          66Kcps
29192 +  HP-UX 9->9      not tested      190Kcps
29193 +  HP-UX 9->10     160Kcps         378Kcps
29194 +
29195 +4.20.2.3. Streaming with Limited Packet Length
29196 +
29197 +   The IRIX telnet server (at least the ones observed in IRIX 5.3 and 6.2)
29198 +   does not allow Kermit to send packets longer than 4096 bytes. Thus when
29199 +   sending from IRIX C-Kermit when it is on the remote end of a Telnet
29200 +   connection, the packet length must be 4K or less. Trials in this case
29201 +   (in which packet lengths range from 1450 to 4000) show a strong
29202 +   advantage for streaming, which would be evident in any other case where
29203 +   the packet length is restricted, and stronger the shorter the maximum
29204 +   packet length.
29205 +
29206 +                  Streaming    Nonstreaming
29207 +  Max CPS         426187        366870
29208 +  Min CPS         407500        276517
29209 +  Mean CPS        415226        339168
29210 +  Median CPS      414139        343803
29211 +  Std Dev           6094         25851
29212 +
29213 +   Correlations:
29214 +
29215 +  CPS and window size:    0.116
29216 +  CPS and packet length:  0.241
29217 +  CPS and streaming:      0.901
29218 +
29219 +4.20.2.4. Streaming on Dialup Connections
29220 +
29221 +   Here "dialup" refers to a "direct" dialup connection, not a SLIP or PPP
29222 +   connection, which is only a particular kind of TCP/IP connection.
29223 +
29224 +   Attempt this at your own risk, and then only if (a) you have
29225 +   error-correcting modems, and (b) the connections between the modems and
29226 +   computers are also error-free, perfectly flow-controlled, and free of
29227 +   interrupt conflicts. Streaming can be used effectively and to fairly
29228 +   good advantage on such connections, but remember that the transfer is
29229 +   fatal if even one error is detected (also remember that should a
29230 +   binary-mode transfer fail, it can be recovered from the point of
29231 +   failure with RESEND).
29232 +
29233 +   To use streaming on an unreliable connection, you must tell both
29234 +   Kermits that the connection is reliable:
29235 +
29236 +  kermit -I
29237 +
29238 +   or:
29239 +
29240 +  C-Kermit> set reliable on
29241 +
29242 +   In this case, it will probably be necessary to prefix some control
29243 +   characters, for example if your connection is through a terminal server
29244 +   that has an escape character. Most Cisco terminal servers, for example,
29245 +   require Ctrl-^ (30, as well as its high-bit equivalent, 158) to be
29246 +   prefixed. To unprefix these, you'll need to defeat the "clear channel"
29247 +   feature:
29248 +
29249 +  C-Kermit> set reliable on
29250 +  C-Kermit> set clear-channel off
29251 +  C-Kermit> set prefixing none
29252 +  C-Kermit> set control prefix 1 13 30 158 ; and whatever else is necessary
29253 +
29254 +   Dialup trials were done using fixed large window and packet sizes. They
29255 +   compare uploading and downloading of two common types of files, with
29256 +   and without streaming. Configuration:
29257 +
29258 +     HP-9000/715/33 -- 57600bps, RTS/CTS -- USR Courier V.34 --
29259 +     V.34+V.42, 31200bps -- USR V.34+ Rackmount -- 57600bps, RTS/CTS --
29260 +     Cisco terminal server -- Solaris 2.5.1. Packet size = 8000, Window
29261 +     Size = 30, Control Character Unprefixing Minimal (but including the
29262 +     Cisco escape character).
29263 +
29264 +   Since this is not a truly reliable connection, a few trials failed when
29265 +   a bad packet was received (most likely due to UART overruns); the
29266 +   failure was graceful and immediate, and the message was informative.
29267 +   The results of ten successful trials uploading and downloading the two
29268 +   files with and without streaming are:
29269 +
29270 +            Streaming..
29271 +            Off    On
29272 +   Upload   5194   5565   txt (= C source code, 78K)
29273 +            3135   3406   gz  (= gzip file, compressed, 85K)
29274 + Download   5194   5565   txt
29275 +            3041   3406   gz
29276 +
29277 +   Each CPS figure is the mean of 10 results.
29278 +
29279 +   A brief test was also performed on a LAT-based dialout connection from
29280 +   a VAX 3100 with VMS 5.5 to a USR Courier V.34 connected to a DECserver
29281 +   700 at 19200 bps. The 1-MB Sparc executable downloaded from a Sun to
29282 +   the VAX at 1100cps without streaming and 1900cps with streaming, using
29283 +   8000-byte packets, 30 window slots, and minimal prefixing in both
29284 +   cases.
29285 +
29286 +4.20.2.5. Streaming on X.25 Connections
29287 +
29288 +   We have only limited access to X.25 networks. One trial was performed
29289 +   in which the 1MB Solaris 2.4 Sparc executable was transferred over a
29290 +   SunLink X.25 connection; nothing is known about the actual physical
29291 +   connection. With a packet length of 8000 and a window size of 30, the
29292 +   file transferred at 6400 cps (using a maximum of 6 window slots). With
29293 +   the same packet length, but with streaming, it transferred without
29294 +   mishap at 6710 cps, about 5% faster.
29295 +
29296 +4.20.3. Streaming - Preliminary Conclusions
29297 +
29298 +   The results vary with the particular connection, but are good overall.
29299 +   Although numerous lower-level tricks can be used to improve performance
29300 +   on specific platforms or connection methods, streaming occurs at a
29301 +   high, system-independent level of the Kermit protocol and therefore can
29302 +   apply to all types of platforms and (reliable) connections
29303 +   transparently.
29304 +
29305 +4.21. The TRANSMIT Command
29306 +
29307 +   Prior to C-Kermit 7.0, the TRANSMIT command transmitted in text or
29308 +   binary mode according to SET FILE TYPE { TEXT, BINARY }. But now that
29309 +   binary mode is likely to be the default for protocol transfers, it is
29310 +   evident that this not also an appropriate default for TRANSMIT, since
29311 +   binary-mode TRANSMIT is a rather specialized and tricky operation.
29312 +   Therefore, TRANSMIT defaults to text mode always, regardless of the
29313 +   FILE TYPE setting.
29314 +
29315 +   C-Kermit 7.0 expands the capabilities of the TRANSMIT command by adding
29316 +   the following switches (see [532]Section 1.5). The new syntax is:
29317 +
29318 +  TRANSMIT [ switches... ] filename
29319 +
29320 +   Zero or more switches may be included:
29321 +
29322 +   /PIPE
29323 +          When /PIPE is included, "filename" is interpreted as a system
29324 +          command or program whose output is to be sent. Synonym:
29325 +          /COMMAND. Example:
29326 +
29327 +  transmit /pipe finger
29328 +
29329 +          You may enclose the command in braces, but you don't have to:
29330 +
29331 +  xmit /pipe {ls -l | sort -r +0.22 -0.32 | head}
29332 +
29333 +   /BINARY
29334 +          Transmits the file (or pipe output) in binary mode.
29335 +
29336 +   /TEXT
29337 +          Transmits the file (or pipe output) in line-oriented text mode.
29338 +          Current FILE CHARACTER-SET and TERMINAL CHARACTER-SET selections
29339 +          govern translation. Default.
29340 +
29341 +   /TRANSPARENT
29342 +          Specifies text mode without character-set translation, no matter
29343 +          what the FILE and TERMINAL CHARACTER-SET selections are.
29344 +
29345 +   /NOWAIT
29346 +          This is equivalent to SET TRANSMIT PROMPT 0, but for this
29347 +          TRANSMIT command only. Applies only to text mode; it means to
29348 +          not wait for any kind of echo or turnaround character after
29349 +          sending a line before sending the next line. (Normally Kermit
29350 +          waits for a linefeed.)
29351 +
29352 +   When TRANSMIT ECHO is ON, C-Kermit tries to read back the echo of each
29353 +   character that is sent. Prior to C-Kermit 7.0, 1 second was allowed for
29354 +   each echo to appear; if it didn't show up in a second, the TRANSMIT
29355 +   command would fail. Similarly for the TRANSMIT PROMPT character.
29356 +   However, with today's congested Internet connections, etc, more time is
29357 +   often needed:
29358 +
29359 +   SET TRANSMIT TIMEOUT number
29360 +
29361 +   Specifies the number of seconds to wait for an echo or the prompt
29362 +   character when TRANSMIT PROMPT is nonzero; the default wait is 1
29363 +   second. If you specify 0, the wait is indefinite. When a timeout
29364 +   interval of 0 is specified, and a desired echo or prompt does not show
29365 +   up, the TRANSMIT command will not terminate until or unless you
29366 +   interrupt it with Ctrl-C; use SET TRANSMIT TIMEOUT 0 with caution.
29367 +
29368 +   Note: to blast a file out the communications connection without any
29369 +   kind of synchronization or timeouts or other manner of checking, use:
29370 +
29371 +  SET TRANSMIT ECHO OFF
29372 +  SET TRANSMIT PROMPT 0 (or include the /NOWAIT switch)
29373 +  SET TRANSMIT PAUSE 0
29374 +  TRANSMIT [ switches ] filename
29375 +
29376 +   In this case, text-file transmission is not-line oriented and large
29377 +   blocks can be sent, resulting in a significant performance improvement
29378 +   over line-at-at-time transmission. Successful operation depends (even
29379 +   more than usual for the TRANSMIT command!) on a clean connection with
29380 +   effective flow control.
29381 +
29382 +   For details on TRANSMIT and character sets, see [533]Section 6.6.5.4.
29383 +
29384 +  4.22. Coping with Faulty Kermit Implementations
29385 +
29386 +   Kermit protocol has been implemented in quite a few third-party
29387 +   commercial, shareware, and freeware software packages, with varying
29388 +   degrees of success. In most cases operation is satisfactory but slow --
29389 +   only the bare minimum subset of the protocol is available -- short
29390 +   packets, no sliding windows, no attributes, etc. In other cases, the
29391 +   implementation is incorrect, resulting in failures at the initial
29392 +   negotiation stage or corrupted files.
29393 +
29394 +   C-Kermit 7.0 and Kermit 95 1.1.19 include some new defense mechanisms
29395 +   to help cope with the most common situations. However, bear in mind
29396 +   there is only so much we can do in such cases -- the responsibility for
29397 +   fixing the problem lies with the maker of the faulty software.
29398 +
29399 +    4.22.1. Failure to Accept Modern Negotiation Strings
29400 +
29401 +   The published Kermit protocol specification states that new fields can
29402 +   be added to the parameter negotiation string. These are to be ignored
29403 +   by any Kermit implementation that does not understand them; this is
29404 +   what makes the Kermit protocol extensible. Unfortunately, some Kermit
29405 +   implementations become confused (or worse) when receiving a negotiation
29406 +   string longer than the one they expect. You can try working around such
29407 +   problems by telling Kermit to shorten its negotiation string (and thus
29408 +   disable the corresponding new features):
29409 +
29410 +  SET SEND NEGOTIATION-STRING-MAX-LENGTH number
29411 +
29412 +   Try a number like 10. If that doesn't work, try 9, 8, 7, 6, and so on.
29413 +
29414 +    4.22.2. Failure to Negotiate 8th-bit Prefixing
29415 +
29416 +   The published Kermit protocol specification states that 8th-bit
29417 +   prefixing (which allows transfer of 8-bit data over a 7-bit connection)
29418 +   occurs if the file sender puts a valid prefix character (normally "&")
29419 +   in the 8th-bit-prefix field of the negotiation string, and the receiver
29420 +   puts either a letter "Y" or the same prefix character. At least one
29421 +   faulty Kermit implementation exists that does not accept the letter
29422 +   "Y". To force C-Kermit / K-95 to reply with the other Kermit's prefix
29423 +   character rather than a "Y", give the following (invisible) command:
29424 +
29425 +  SET Q8FLAG ON
29426 +
29427 +   Use SET Q8FLAG OFF to restore the normal behavior.
29428 +
29429 +    4.22.3. Corrupt Files
29430 +
29431 +   Refer to [534]Section 4.22.2. Some Kermit implementations mistakenly
29432 +   interpret the "Y" as a prefix character. Then, whenever a letter Y
29433 +   appears in the data, the Y and the character that follows it are
29434 +   replaced by a garbage character. At this writing, we are not sure if
29435 +   there is any solution, but try "set send negotiation-string-max-length
29436 +   6" and/or "set q8flag on".
29437 +
29438 +   File corruption can also occur when control characters within the file
29439 +   data are sent without prefixing, as at least some are by default in
29440 +   C-Kermit 7.0 and K-95. Some Kermit implementations do not handle
29441 +   incoming "bare" control characters. To work around, "set prefixing
29442 +   all".
29443 +
29444 +    4.22.4. Spurious Cancellations
29445 +
29446 +   The Kermit protocol specification states that if an ACK to a Data
29447 +   packet contains X in its data field, the transfer of the current file
29448 +   is canceled, and if it contains a Z, the entire transfer is canceled.
29449 +   At least one overzealous Kermit implementation applies this rule to
29450 +   non-Data packets as well, the typical symptom being that any attempt to
29451 +   transfer a file whose name begins with X or Z results in cancellation.
29452 +   This is because the file receiver typically sends back the name under
29453 +   which it stored the file (which might not be the same as the name it
29454 +   was sent with) in the ACK to the File Header packet. This is
29455 +   information only and should not cause cancellation. To work around the
29456 +   problem, use:
29457 +
29458 +  SET F-ACK-BUG { ON, OFF }
29459 +
29460 +   ON tells Kermit not to send back the filename in the ACK to the file
29461 +   header packet as it normally would do (OFF puts Kermit back to normal
29462 +   after using ON).
29463 +
29464 +   A variation on the this bug occurs in an obscure Kermit program for
29465 +   MUMPS: When this Kermit program sends a file called (say) FOO.BAR, it
29466 +   requires that the ACK to its F packet contain exactly the same name,
29467 +   FOO.BAR. However, C-Kermit likes to send back the full pathname,
29468 +   causing the MUMPS Kermit to fail. SET F-ACK-BUG ON doesn't help here.
29469 +   So a separate command has been added to handle this situation:
29470 +
29471 +  SET F-ACK-PATH { ON, OFF }
29472 +
29473 +   Normally it is ON (regardless of the SET SEND PATHNAMES setting). Use
29474 +   SET F-ACK-PATH OFF to instruct Kermit to send back only the filename
29475 +   without the path in the ACK to the F packet.
29476 +
29477 +    4.22.5. Spurious Refusals
29478 +
29479 +   Some Kermit implementations, notably PDP-11 Kermit 3.60 and earlier,
29480 +   have bugs in their handling of Attribute packets that can cause
29481 +   unwarranted refusal of incoming files, e.g. based on date or size. This
29482 +   can be worked around by telling one or both of the Kermit partners to:
29483 +
29484 +  SET ATTRIBUTES OFF
29485 +
29486 +    4.22.6. Failures during the Data Transfer Phase
29487 +
29488 +   This can be caused by control-character unprefixing ([535]Section
29489 +   4.22.3 ), and fixed by:
29490 +
29491 +  SET PREFIXING ALL
29492 +
29493 +   It can also have numerous other causes, explained in Chapter 10 of
29494 +   [536]Using C-Kermit: the connection is not 8-bit transparent (so use
29495 +   "set parity space" or somesuch), inadequate flow control, etc. Consult
29496 +   the manual.
29497 +
29498 +    4.22.7. Fractured Filenames
29499 +
29500 +   At least one well-known PC-based communications package negotiates data
29501 +   compression, which (according to the protocol specification) applies to
29502 +   both the filename and the file data, but then fails to decompress the
29503 +   filename. Example: C-Kermit sends a file called R000101.DAT (where
29504 +   000101 might be non-Y2K-wise YYMMDD notation), and the package in
29505 +   question stores the files as R~#0101.DAT. Workaround: Tell C-Kermit to
29506 +   SET REPEAT COUNTS OFF.
29507 +
29508 +    4.22.8. Bad File Dates
29509 +
29510 +   At least one well-known PC-based communications package negotiates the
29511 +   passing of file timestamps from sender to receiver, but when it is
29512 +   sending files, it always gives them a timestamp of 1 February 1970.
29513 +   Workaround: tell C-Kermit to SET ATTRIBUTE DATE OFF. You don't get the
29514 +   file's real date, but you also don't get 1 Feb 1970; instead the file
29515 +   gets the current date and time.
29516 +
29517 +  4.23. File Transfer Recovery
29518 +
29519 +   Prior to C-Kermit 7.0, RESEND (SEND /RECOVER) and REGET (GET /RECOVER)
29520 +   refused to work if FILE TYPE was not BINARY or the /BINARY switch was
29521 +   not included. Now these commands include an implied /BINARY switch,
29522 +   meaning they set the file type to binary for the duration of the
29523 +   command automatically.
29524 +
29525 +   In the client/server arrangement, this also forces the server into
29526 +   binary mode (if it is C-Kermit 7.0 or greater, or K95 1.1.19 or
29527 +   greater) so the recovery operation proceeds, just as you asked and
29528 +   expected.
29529 +
29530 +   BUT... Just as before, the results are correct only under the following
29531 +   conditions:
29532 +
29533 +     * If the prior interrupted transfer was also in binary mode; or:
29534 +     * If the prior transfer was in text mode and the other computer was a
29535 +       "like platform" (e.g. UNIX-to-UNIX, Windows-to-Windows,
29536 +       DOS-to-Windows) AND there was no character-set translation (i.e.
29537 +       TRANSFER CHARACTER-SET was TRANSPARENT).
29538 +
29539 +   Note that these circumstances are more likely to obtain in C-Kermit
29540 +   7.0, in which:
29541 +
29542 +     * The default FILE TYPE in C-Kermit 7.0 is BINARY.
29543 +     * The default FILE INCOMPLETE setting is AUTO, which means KEEP if
29544 +       the transfer is in binary mode, DISCARD otherwise.
29545 +     * C-Kermit 7.0, Kermit 95 1.1.17, and MS-DOS Kermit 3.15 and later
29546 +       can recognize "like platforms" and switch into binary mode
29547 +       automatically. Transfers between like platforms are always binary
29548 +       unless character-set translation has been requested, and then is
29549 +       still binary for all files whose names match a binary pattern,
29550 +       unless the automatic mechanisms have been disabled (with a /TEXT
29551 +       switch, or with SET TRANSFER MODE MANUAL).
29552 +     * SEND /BINARY and GET /BINARY always force binary-mode transfers,
29553 +       even when FILE TYPE is TEXT, even when TRANSFER MODE is AUTOMATIC,
29554 +       even when PATTERNS are ON and the file's name matches a text
29555 +       pattern.
29556 +
29557 +   But also note that the automatic client/server transfer-mode
29558 +   adjustments do not work with versions of C-Kermit prior to 7.0 or K95
29559 +   prior to 1.1.16.
29560 +
29561 +   If the prior transfer was in text mode:
29562 +
29563 +     * If text-mode transfers between the two platforms are
29564 +       "length-changing" (as they are between UNIX -- which terminates
29565 +       text lines with LF -- and DOS or Windows -- which terminates text
29566 +       lines with CRLF), the recovered file will be corrupt.
29567 +     * If text-mode transfers between the two platforms are not
29568 +       length-changing, but character-set translation was active in the
29569 +       prior transfer, the result will be a file in which the first part
29570 +       has translated characters and the second part does not.
29571 +
29572 +   But in C-Kermit 7.0 and K95 1.1.19 and later, incompletely transferred
29573 +   text files are not kept unless you change the default. But if you have
29574 +   done this, and you have an incompletely transferred text file, you'll
29575 +   need to:
29576 +
29577 +     * Transfer the whole file again in text mode, or:
29578 +     * Use SEND /STARTING-AT: to recover the transfer at the correct
29579 +       point; but you have to find out what that point is, as described in
29580 +       the manual.
29581 +
29582 +   Kermit has no way of knowing whether the previous transfer was in text
29583 +   or binary mode so it is your responsibility to choose the appropriate
29584 +   recovery method.
29585 +
29586 +   If you use C-Kermit to maintain parallel directories on different
29587 +   computers, using SET FILE COLLISION to transfer only those files that
29588 +   changed since last time, and the files are big enough (or the
29589 +   connection slow enough) to require SEND /RECOVER to resume interrupted
29590 +   transfers, you should remember that SEND /RECOVER (RESEND) overrides
29591 +   all FILE COLLISION settings. Therefore you should use SEND /RECOVER
29592 +   (RESEND) only on the file that was interrupted, not the file group. For
29593 +   example, if the original transfer was initiated with:
29594 +
29595 +  SEND *
29596 +
29597 +   and was interrupted, then after reestablishing your connection and
29598 +   starting the Kermit receiver with SET FILE COLLISION UPDATE on the
29599 +   remote end, use the following sequence at the sender to resume the
29600 +   transfer:
29601 +
29602 +  SEND /RECOVER name-of-interrupted-file
29603 +
29604 +   and then:
29605 +
29606 +  SEND *
29607 +
29608 +   (In C-Kermit 7.0 and later, \v(filename) contains the name of the file
29609 +   most recently transferred, as long you have not EXITed from Kermit or
29610 +   changed directory, etc.
29611 +
29612 +  4.24. FILE COLLISION UPDATE Clarification
29613 +
29614 +   In UNIX, file modification dates are used when comparing the file date
29615 +   with the date in the attribute packet. In VMS, however, the file
29616 +   creation date is used. These two policies reflect the preferences of
29617 +   the two user communities.
29618 +
29619 +   Also, remember that the file date/time given in the attribute packet is
29620 +   the local time at the file sender. At present, no timezone conversions
29621 +   are defined in or performed by the Kermit protocol. This is primarily
29622 +   because this feature was designed at a time when many of the systems
29623 +   where Kermit runs had no concept of timezone, and therefore would be
29624 +   unable to convert (say, to/from GMT or UTC or Zulu time).
29625 +
29626 +   As a consequence, some unexpected results might occur when transferring
29627 +   files across timezones; e.g. commands on the target system that are
29628 +   sensitive to file dates might not work (UNIX "make", backups, etc).
29629 +
29630 +   Timezone handling is deferred for a future release.
29631 +
29632 +  4.25. Autodownload Improvements
29633 +
29634 +   Refer to pages 164-165 of [537]Using C-Kermit about the hazards of
29635 +   autodownload when C-Kermit is "in the middle". As of C-Kermit 7.0, no
29636 +   more hazards. If C-Kermit has TERMINAL AUTODOWNLOAD ON and it detects a
29637 +   packet of the current protocol type (Kermit or Zmodem), it "erases" the
29638 +   visual aspect of the packet that would be seen by the terminal (or,
29639 +   more to the point, the emulator, such as K95). This way, only C-Kermit
29640 +   goes into RECEIVE mode, and not also the terminal emulator through
29641 +   which C-Kermit is accessed. And therefore, it is no longer necessary to
29642 +   SET TERMINAL AUTODOWNLOAD OFF to prevent multiple Kermits from going
29643 +   into receive mode at once, but of course it is still necessary to
29644 +   ensure that, when you have multiple Kermits in a chain, that the
29645 +   desired one receives the autodownload.
29646 +
29647 +   The defaults have not been changed; Kermit 95 still has autodownload ON
29648 +   by default, and C-Kermit has it OFF by default.
29649 +
29650 +  5. CLIENT/SERVER
29651 +
29652 +  5.0. Hints
29653 +
29654 +   If you use SET SERVER GET-PATH to set up your server, and the GET-PATH
29655 +   does not include the server's current directory, clients can become
29656 +   quite confused. For example, "remote dir oofa.txt" shows a file named
29657 +   oofa.txt, but "get oofa.txt" fails. In this situation, you should
29658 +   either DISABLE DIR or make your GET-PATH include the current directory.
29659 +
29660 +  5.1. New Command-Line Options
29661 +
29662 +   The -G command-line option is like -g (GET), except the incoming file
29663 +   is sent to standard output rather than written to disk.
29664 +
29665 +   The -I option ("Internet") is used to tell a remote C-Kermit program
29666 +   that you are coming in via Internet Telnet or Rlogin and therefore have
29667 +   a reliable connection. The -I option is equivalent to SET RELIABLE ON
29668 +   and SET FLOW NONE.
29669 +
29670 +   The -O option ("Only One") tells C-Kermit to enter server mode but then
29671 +   exit after the first client operation.
29672 +
29673 +   See [538]Section 9.3 for details.
29674 +
29675 +  5.2. New Client Commands
29676 +
29677 +   BYE and FINISH no longer try to do anything if a connection is not
29678 +   active. Thus a sequence like "hangup" followed by "bye" or "finish"
29679 +   will no longer get stuck in a long timeout-and-retransmission cycle,
29680 +   nor will it try to open a new connection.
29681 +
29682 +   REMOTE EXIT
29683 +          Similar to FINISH, except it ensures that the Kermit server
29684 +          program exits back to the operating system or shell prompt.
29685 +          (FINISH would return it to its interactive prompt if it was
29686 +          started in interactive mode, and would cause it to exit if it
29687 +          entered server mode via command-line option.) When C-Kermit is
29688 +          to be the server, you can use { ENABLE, DISABLE } EXIT to
29689 +          control the client's access to this feature.
29690 +
29691 +   REMOTE MKDIR directory-name
29692 +          Tells the client to ask the server to create a directory with
29693 +          the given name, which can be absolute or relative. The syntax of
29694 +          the directory name depends on the Kermit server (see [539]next
29695 +          section); in all cases, it can be in the syntax of the system
29696 +          where the server is running (UNIX, VMS, DOS, etc) but newer
29697 +          servers also accept UNIX syntax, no matter what the underlying
29698 +          platform. The server will not execute this command if (a) it
29699 +          does not understand it, (b) a DISABLE MKDIR command has been
29700 +          given, or (c) a DISABLE CWD command has been given; otherwise,
29701 +          the command is executed, but will fail if the directory can not
29702 +          be created, in which cases most servers will attempt to return a
29703 +          message giving the reason for failure. The REMOTE MKDIR command
29704 +          succeeds if the remote directory is created, or if it already
29705 +          exists and therefore does not need to be created, and fails
29706 +          otherwise.
29707 +
29708 +   REMOTE RMDIR directory-name
29709 +          Tells the client to ask the server to remove (delete) a
29710 +          directory with the given name. The same considerations apply as
29711 +          for REMOTE MKDIR.
29712 +
29713 +   REMOTE SET FILE INCOMPLETE { DISCARD, KEEP, AUTO }
29714 +          Previously this was only available in its earlier form, REMOTE
29715 +          SET INCOMPLETE (no FILE). The earlier form is still available,
29716 +          but invisible. Also, AUTO was added, meaning KEEP if in binary
29717 +          mode, DISCARD otherwise.
29718 +
29719 +   REMOTE SET TRANSFER MODE { AUTOMATIC, MANUAL }
29720 +          Tells the client to ask the server to set the given
29721 +          file-transfer mode. Automatic means (roughly): if the client and
29722 +          the server are running on the same kind of computer (e.g. both
29723 +          are on UNIX), then use binary mode automatically; if the system
29724 +          types are different, use some other method to automatically
29725 +          determine text or binary mode, such as filename pattern
29726 +          matching. MANUAL means, in this context, obey the client's FILE
29727 +          TYPE setting (TEXT or BINARY). Synonym: REMOTE SET XFER MODE.
29728 +
29729 +   [ REMOTE ] QUERY KERMIT function(args...)
29730 +          Prior to C-Kermit 7.0, the arguments were not evaluated locally.
29731 +          Thus it was not possible to have the server run the function
29732 +          with client-side variables as arguments. Now:
29733 +
29734 +  define \%a oofa.*
29735 +  remote query kermit files(\%a)    ; Client's \%a
29736 +  remote query kermit files(\\%a)   ; Server's \%a
29737 +
29738 +   [ REMOTE ] LOGIN [ user [ password ] ]
29739 +          LOGIN is now a synonym for REMOTE LOGIN.
29740 +
29741 +   LOGOUT
29742 +          This command, when given in local mode, is equivalent to REMOTE
29743 +          LOGOUT. When given at the IKSD prompt, it logs out the IKSD.
29744 +          When given at the C-Kermit prompt when it has no connection, it
29745 +          does nothing.
29746 +
29747 +   Note that in C-Kermit 7.0, the REMOTE (or R) prefix is not required for
29748 +   QUERY, since there is no local QUERY command. The new top-level QUERY
29749 +   command does exactly what REMOTE QUERY (RQUERY) does.
29750 +
29751 +   All REMOTE commands now have single-word shortcuts:
29752 +
29753 + Shortcut   Full Form
29754 +  RASG       REMOTE ASSIGN
29755 +  RCD        REMOTE CD
29756 +  RCOPY      REMOTE COPY
29757 +  RDEL       REMOTE DELETE
29758 +  RDIR       REMOTE DIRECTORY
29759 +  REXIT      REMOTE EXIT
29760 +  RHELP      REMOTE HELP
29761 +  RHOST      REMOTE HOST
29762 +  RPWD       REMOTE PWD
29763 +  RSET       REMOTE SET
29764 +  etc.
29765 +
29766 +   The R prefix is not applied to LOGIN because there is already an RLOGIN
29767 +   command with a different meaning. It is not applied to LOGOUT either,
29768 +   since LOGOUT knows what to do in each case, and for symmetry with
29769 +   LOGIN.
29770 +
29771 +    5.2.1. Remote Procedure Definitions and Calls
29772 +
29773 +   This is nothing new, but it might not be obvious... REMOTE ASSIGN and
29774 +   REMOTE QUERY may be used to achieve remote procedure execution. The
29775 +   remote procedure can be defined locally or remotely.
29776 +
29777 +   A remote procedure call is accomplished as noted in the previous
29778 +   section:
29779 +
29780 +  [ remote ] query kermit function-name(args...)
29781 +
29782 +   This invokes any function that is built in to the Kermit server, e.g.:
29783 +
29784 +  [ remote ] query kermit size(foo.bar)
29785 +
29786 +   returns the size of the remote file, foo.bar.
29787 +
29788 +   Now note that C-Kermit includes an \fexecute() function, allowing it to
29789 +   execute any macro as if it were a built-in function. So suppose MYMACRO
29790 +   is the name of a macro defined in the server. You can execute it from
29791 +   the client as follows (the redundant "remote" prefix is omitted in the
29792 +   remaining examples):
29793 +
29794 +  query kermit execute(mymacro arg1 arg2...)
29795 +
29796 +   The return value, if any, is the value of the RETURN command that
29797 +   terminated execution of the macro, for example:
29798 +
29799 +  define addtwonumbers return \feval(\%1+\%2)
29800 +
29801 +   The client invocation would be:
29802 +
29803 +  query kermit execute(addtwonumbers 3 4)
29804 +  7
29805 +
29806 +   The result ("7" in this case) is also assigned to the client's
29807 +   \v(query) variable.
29808 +
29809 +   To execute a remote system command or command procedure (shell script,
29810 +   etc) use:
29811 +
29812 +  query kermit command(name args...)
29813 +
29814 +   Finally, suppose you want the client to send a macro to the server to
29815 +   be executed on the server end. This is done as follows:
29816 +
29817 +  remote assign macroname definition
29818 +  query kermit execute(macroname arg1 arg2...)
29819 +
29820 +   Quoting is required if the definition contains formal parameters.
29821 +
29822 +  5.3. New Server Capabilities
29823 +
29824 +    5.3.1. Creating and Removing Directories
29825 +
29826 +   The C-Kermit 7.0 server responds to REMOTE MKDIR and REMOTE RMDIR
29827 +   commands. The directory name may be in either the native format of the
29828 +   server's computer, or in UNIX format. For example, a server running on
29829 +   VMS with a current directory of [IVAN] can accept commands from the
29830 +   client like:
29831 +
29832 +  remote mkdir olga         ; Makes [IVAN.OLGA] (nonspecific format)
29833 +  remote mkdir .olga        ; Makes [IVAN.OLGA] (VMS format without brackets)
29834 +  remote mkdir olga/        ; Makes [IVAN.OLGA] (UNIX relative format)
29835 +  remote mkdir /ivan/olga   ; Makes [IVAN.OLGA] (UNIX absolute format)
29836 +  remote mkdir [ivan.olga]  ; Makes [IVAN.OLGA] (VMS absolute format)
29837 +  remote mkdir [.olga]      ; Makes [IVAN.OLGA] (VMS relative format)
29838 +
29839 +    5.3.1.1. Creating Directories
29840 +
29841 +   If a directory name is given that contains more than one segment that
29842 +   does not exist, the server attempts to create all the segments. For
29843 +   example, if the client says:
29844 +
29845 +  REMOTE MKDIR letters/angry
29846 +
29847 +   a "letters" subdirectory is created in the server's current directory
29848 +   if it does not already exist, and then an "angry" subdirectory is
29849 +   created beneath it, if it does not already have one. This can repeated
29850 +   to any reasonable depth:
29851 +
29852 +  REMOTE MKDIR a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/z/y/z
29853 +
29854 +    5.3.1.2. Removing Directories
29855 +
29856 +   When attempting to execute a REMOTE RMDIR, the server can remove only a
29857 +   single directory, not an entire sequence or tree. The system service
29858 +   that is called to remove the directory generally requires not only that
29859 +   the server process has write delete access, but also that the directory
29860 +   contain no files.
29861 +
29862 +   In the future, a REMOTE RMDIR /RECURSIVE command (and the accompanying
29863 +   protocol) might be added. For now, use the equivalent REMOTE HOST
29864 +   command(s), if any.
29865 +
29866 +    5.3.2. Directory Listings
29867 +
29868 +   Directory listings are generated by C-Kermit itself, rather than by
29869 +   running the underlying system's directory command. Some control over
29870 +   the listing format can be obtained with the SET OPTIONS DIRECTORY
29871 +   command ([540]Section 4.5.1). The following options affect listings
29872 +   sent by the server: /[NO]HEADING, /[NO]DOTFILES, and /[NO]BACKUP. In
29873 +   UNIX and VMS, the listing is always sorted by filename. There is, at
29874 +   present, no protocol defined for the client to request listing options
29875 +   of the server; this might be added in the future.
29876 +
29877 +   The server's directory listings are in the following format:
29878 +
29879 +   Protection or permissions:
29880 +          In UNIX and OS-9, this is a 10-character field, left adjusted.
29881 +          In VMS it is a 22-character field, left-adjusted. In each case,
29882 +          the protection / permission codes are shown in the server
29883 +          platform's native format. In other operating systems, this field
29884 +          is not shown.
29885 +
29886 +   Size in bytes:
29887 +          This is always a 10-character field. The file's size is shown as
29888 +          a decimal number, right adjusted in the field. If the file is a
29889 +          directory and its size can not be obtained, the size is shown as
29890 +          "<DIR>". Two blanks follow this field.
29891 +
29892 +   Date:
29893 +          Always in yyyy-mm-dd hh:mm:ss numeric format, and therefore 19
29894 +          characters long. If the file's date/time can't be obtained,
29895 +          zeros (0) are shown for all the digits. This field is followed
29896 +          by two blanks.
29897 +
29898 +   Filename:
29899 +          This field extends to the end of the line. Filenames are shown
29900 +          relative to the server's current directory. In UNIX, symbolic
29901 +          links are shown as they are in an "ls -l" listing as "linkname
29902 +          -> filename".
29903 +
29904 +   In UNIX and VMS, listings are returned by the server in alphabetical
29905 +   order of filename. There are presently no other sort or selection
29906 +   options.
29907 +
29908 +   However, since these are fixed-field listings, all fields can be used
29909 +   as sort keys by external sort programs. Note, in particular, that the
29910 +   format used for the date allows a normal lexical on that field to
29911 +   achieve the date ordering. For example, let's assume we have a UNIX
29912 +   client and a UNIX server. In this case, the server's listing has the
29913 +   date in columns 22-40, and thus could be sorted by the UNIX sort
29914 +   program using "sort +0.22 -0.40" or in reverse order by "sort +0.22
29915 +   -0.40r".
29916 +
29917 +   Since the UNIX client can pipe responses to REMOTE commands through
29918 +   filters, any desired sorting can be accomplished this way, for example:
29919 +
29920 +C-Kermit> remote directory | sort +0.22 -0.40
29921 +
29922 +   You can also sort by size:
29923 +
29924 +  C-Kermit> remote directory | sort +0.11 -0.19
29925 +
29926 +   You can use sort options to select reverse or ascending order. "man
29927 +   sort" (in UNIX) for more information. And of course, you can pipe these
29928 +   listings through any other filter of your choice, such as grep to skip
29929 +   unwanted lines.
29930 +
29931 +  5.4. Syntax for Remote Filenames with Embedded Spaces
29932 +
29933 +   C-Kermit and K95, when in server mode, assume that any spaces in the
29934 +   file specification in an incoming GET command are filename separators.
29935 +   Thus if the client gives a command like:
29936 +
29937 +  get {oofa.txt oofa.bin}
29938 +
29939 +   or, equivalently:
29940 +
29941 +  mget oofa.txt oofa.bin
29942 +
29943 +   the server tries to send the two files, oofa.txt and oofa.bin. But what
29944 +   if you want the server to send you a file named, say:
29945 +
29946 +  D:\HP OfficeJet 500\Images\My Pretty Picture Dot PCL
29947 +
29948 +   How does the server know this is supposed to be one file and not seven?
29949 +   In this case, you need to the send file name to the server enclosed in
29950 +   either curly braces:
29951 +
29952 +  {D:\HP OfficeJet 500\Images\My Pretty Picture Dot PCL}
29953 +
29954 +   or ASCII doublequotes:
29955 +
29956 +  "D:\HP OfficeJet 500\Images\My Pretty Picture Dot PCL"
29957 +
29958 +   The method for doing this depends on your client. If your client is
29959 +   C-Kermit 7.0, any recent version of Kermit 95, or MS-DOS Kermit 3.16,
29960 +   then you have to enclose the name in braces just so the client can
29961 +   parse it, so to send braces or doublequotes to the server, you must put
29962 +   them inside the first, outside pair of braces. And you also need to
29963 +   double the backslashes to prevent them from being interpreted:
29964 +
29965 +  get {{D:\\HP OfficeJet 500\\Images\\My Pretty Picture Dot PCL}}
29966 +  get {"D:\\HP OfficeJet 500\\Images\\My Pretty Picture Dot PCL"}
29967 +
29968 +   To get around the requirement to double backslashes in literal
29969 +   filenames, of course you can also use:
29970 +
29971 +  set command quoting off
29972 +  get {{D:\HP OfficeJet 500\Images\My Pretty Picture Dot PCL}}
29973 +  get {"D:\HP OfficeJet 500\Images\My Pretty Picture Dot PCL"}
29974 +  set command quoting on
29975 +
29976 +   If you are giving a "kermit" command to the UNIX shell, you have to
29977 +   observe the shell's quoting rules, something like this:
29978 +
29979 +  kermit -ig "{D:\HP OfficeJet 500\Images\My Pretty Picture Dot PCL}"
29980 +
29981 +   Here, the quotes go on the outside so UNIX will pass the entire
29982 +   filename, spaces, braces, and all, as a single argument to Kermit, and
29983 +   the backslashes are not doubled because (a) the UNIX shell ignores them
29984 +   since they are in a quoted string, and (b) Kermit ignores them since
29985 +   the interactive command parser is not activated in this case.
29986 +
29987 +  5.5. Automatic Orientation Messages upon Directory Change
29988 +
29989 +   C-Kermit 7.0, when acting as a server, can send an orientation message
29990 +   to the client whenever the server directory changes. For example, when
29991 +   the client gives a REMOTE CD command, the server sends the contents of
29992 +   the new directory's "Read Me" file to the client's screen. The
29993 +   following commands govern this feature:
29994 +
29995 +   SET SERVER CD-MESSAGE FILE name
29996 +          Given to the servr, allows the message-file name to be specified
29997 +          at runtime. A list of names to look for can be given in the
29998 +          following format:
29999 +
30000 +  {{name1}{name2}{name3}{...}}
30001 +
30002 +          e.g. SET SERVER CD-MESSAGE FILE
30003 +          {{./.readme}{README.TXT}{READ.ME}}
30004 +
30005 +   REMOTE SET SERVER CD-MESSAGE { ON, OFF }
30006 +          Given to the client, lets the client control whether the server
30007 +          sends automatic CD messages.
30008 +
30009 +   SHOW SERVER
30010 +          Given to server, includes CD-Message status.
30011 +
30012 +   The default CD message file name is system dependent. SHOW CD or SHOW
30013 +   SERVER displays the list. Also see [541]Section 4.5.2.
30014 +
30015 +  5.6. New Server Controls
30016 +
30017 +   DISABLE ENABLE
30018 +          Allows the server to configured such that DISABLEd features can
30019 +          not be re-enabled by any means -- e.g. if the client is somehow
30020 +          able to get the server into command mode. Once DISABLEd, ENABLE
30021 +          can not be re-ENABLEd.
30022 +
30023 +   SET SERVER IDLE-TIMEOUT seconds
30024 +          This was available previously in Kermit 95 only. Now it can be
30025 +          used in C-Kermit also to specify a maximum number of seconds the
30026 +          server is allowed to be idle before exiting server mode. 0
30027 +          seconds means no idle timeout. In C-Kermit (but not K-95), SET
30028 +          SERVER TIMEOUT and SET SERVER IDLE-TIMEOUT are mutually
30029 +          exclusive -- you can have one or the other (or neither), but not
30030 +          both. (Server timeouts are for the benefit of primitive Kermit
30031 +          clients that are not capable of timing out on their own; to our
30032 +          knowledge, no such clients are still in circulation.)
30033 +
30034 +   SET SERVER KEEPALIVE { ON, OFF }
30035 +          (See next section).
30036 +
30037 +  5.7. Timeouts during REMOTE HOST Command Execution
30038 +
30039 +   Prior to C-Kermit 7.0, the C-Kermit server would block waiting for
30040 +   output from a system command invoked via REMOTE HOST from the client.
30041 +   If the system command took a long time to execute, the client would
30042 +   time out and send NAK packets. If the command took too long, the client
30043 +   would reach its retry limit and give up. Even if it didn't, the NAKs
30044 +   would cause unnecessary retransmissions.
30045 +
30046 +   In version 7.0, the C-Kermit server (VMS and select()-capable UNIX
30047 +   versions only), sends "keepalive packets" (empty data packets) once per
30048 +   second while waiting for the system command to complete. This procedure
30049 +   should be entirely transparent to the Kermit client, and should prevent
30050 +   the unwanted timeouts and NAKs. When C-Kermit 7.0 itself (or K95
30051 +   1.1.19) is the client, it prints dots to show the keepalive packets.
30052 +
30053 +   The keepalive feature can be turned off and on with:
30054 +
30055 +  SET SERVER KEEPALIVE { ON, OFF }
30056 +
30057 +   Normally it should be on. Turn it off it if causes trouble with the
30058 +   client, or if it seems to slow down the server (as it might on some
30059 +   platforms under certain circumstances).
30060 +
30061 +  6. INTERNATIONAL CHARACTER SETS
30062 +
30063 +   Support for several new single-byte character sets was added in
30064 +   C-Kermit 7.0. Unicode / ISO 10646 is not yet supported, but is a high
30065 +   priority for forthcoming releases.
30066 +
30067 +  6.0. ISO 8859-15 Latin Alphabet 9
30068 +
30069 +   To accommodate the Euro currency symbol, and to correct several other
30070 +   longstanding problems with ISO Latin Alphabet 1, ISO 8859-15 Latin
30071 +   Alphabet 9 was issued in May 1998. It is supported by C-Kermit 7.0 as a
30072 +   transfer character set, a file character set, and a terminal character
30073 +   set. Translations that preserve the new characters are available
30074 +   between Latin-9 and several other sets including:
30075 +
30076 +  PC Code Page 858         (Western European languages, similar to CP850)
30077 +  Windows Code Page 1252   (Western European languages, similar to Latin-1)
30078 +  Windows Code Page 1250   (Eastern European languages, similar to Latin-2)
30079 +
30080 +   The Latin-9 transfer character set also allows for the OE digraph
30081 +   character, used primarily in French, to be preserved in transfers
30082 +   involving the DEC MCS or NeXT character sets.
30083 +
30084 +   The Euro character is also present in the Universal Character Set,
30085 +   described in [542]Section 6.6.
30086 +
30087 +  6.1. The HP-Roman8 Character Set
30088 +
30089 +   The HP-Roman8 character set is supported in C-Kermit 6.0 and later but
30090 +   was omitted from Table VII-4 in the 2nd Edition of Using C-Kermit due
30091 +   to lack of space. It is listed in [543]Appendix III.
30092 +
30093 +  6.2. Greek Character Sets
30094 +
30095 +   Greek character sets were added in 6.1:
30096 +
30097 +  SET FILE CHARACTER-SET { CP869, ELOT927, GREEK-ISO }
30098 +  SET TRANSFER CHARACTER-SET { GREEK-ISO }
30099 +
30100 +   GREEK-ISO is ISO 8859-7, which the same as ELOT 928.
30101 +
30102 +   The new Greek character sets are listed in [544]Appendix III.
30103 +
30104 +  6.3. Additional Latin-2 Character Sets
30105 +
30106 +   The following have been added as FILE and TERMINAL CHARACTER-SETs:
30107 +
30108 +   MAZOVIA-PC
30109 +          A PC code page used in Poland, equivalent to CP437, but with 18
30110 +          substitutions needed for Polish.
30111 +
30112 +   CP1250
30113 +          The Windows Latin 2 Code Page. Equivalent to ISO 8859-2, but
30114 +          with different encoding.
30115 +
30116 +  6.4. Additional Cyrillic Character Sets
30117 +
30118 +   The following have been added as FILE and TERMINAL CHARACTER-SETs:
30119 +
30120 +   BULGARIA-PC
30121 +          This is the Cyrillic PC code page used in Bulgaria, where it is
30122 +          called Code Page 856. It is attributed to a company called
30123 +          DATEC, Inc, but CP856 is not a proper designation, since it
30124 +          refers to a Hebrew Code Page (see the IBM Registry).
30125 +
30126 +   CP855
30127 +          This PC Code Page contains all the Cyrillic letters that are
30128 +          also in ISO 8859-5, and is therefore useful for non-Russian
30129 +          Cyrillic text (Ukrainian, Belorussian, etc), unlike CP866, which
30130 +          has a smaller repertoire of Cyrillic letters.
30131 +
30132 +   CP1251
30133 +          The Windows Cyrillic Code Page. Equivalent to CP855, but with
30134 +          different encoding.
30135 +
30136 +   KOI8R
30137 +          An extension to "Old KOI-8" that adds upper and lower case
30138 +          Cyrillic letter Io (looks like Roman E with diaeresis) plus a
30139 +          selection of box-drawing characters to columns 8 through 11,
30140 +          which are vacant in original Old KOI-8. KOI8-R is used for the
30141 +          Russian language. It is specified in [545]RFC 1489.
30142 +
30143 +   KOI8U
30144 +          A similar extension of Old KOI-8, but for Ukrainian. It is
30145 +          specified in [546]RFC 2319.
30146 +
30147 +  6.5. Automatic Character-Set Switching
30148 +
30149 +   Prior to version 7.0, C-Kermit's file character-set always had to be
30150 +   set explicitly. In 7.0 and later, it is set automatically when:
30151 +
30152 +    1. This feature is enabled (as it is unless you disable it).
30153 +    2. An incoming text-mode transfer includes a transfer-character-set
30154 +       announcer and you have not previously given a SET FILE
30155 +       CHARACTER-SET command. In this case, C-Kermit switches to an
30156 +       appropriate file character set. For example, on an HP-UX
30157 +       workstation, an incoming Latin-1 file automatically selects
30158 +       HP-Roman8 for the local copy of the file; in Data General AOS/VS,
30159 +       it would select DG International.
30160 +    3. You give a SET TRANSFER CHARACTER-SET command without having
30161 +       previously specified a FILE CHARACTER-SET. An appropriate file
30162 +       character-set is chosen automatically.
30163 +
30164 +   In addition, when you give a SET FILE CHARACTER-SET command, the
30165 +   appropriate transfer character-set is automatically chosen, to be used
30166 +   when you are sending files (but this does not override the one
30167 +   announced by the sender when you are receiving files).
30168 +
30169 +   You might not agree about what is "appropriate", so of course you can
30170 +   disable or change all of the above actions.
30171 +
30172 +   You can disable (or re-enable) the new automatic character-set
30173 +   switching feature in each direction separately:
30174 +
30175 +   SET RECEIVE CHARACTER-SET-SELECTION { AUTOMATIC, MANUAL }
30176 +          AUTOMATIC is the default, causing the behavior described above
30177 +          when an incoming file arrives. Choose MANUAL to defeat this
30178 +          behavior and force your current FILE CHARACTER-SET setting to be
30179 +          used, no matter what it is. Note that SET RECEIVE CHARACTER-SET
30180 +          MANUAL does not disable recognition of the incoming transfer
30181 +          character-set announcer, and translation from the corresponding
30182 +          character-set to your current file character-set. To disable
30183 +          that, use SET ATTRIBUTE CHARACTER-SET OFF.
30184 +
30185 +   SET SEND CHARACTER-SET-SELECTION { AUTOMATIC, MANUAL }
30186 +          Again AUTOMATIC is the default, causing the behavior described
30187 +          above when you give a SET { FILE, TRANSFER } CHARACTER-SET
30188 +          command. Use MANUAL to allow you to specify the transfer and
30189 +          file character-sets independently.
30190 +
30191 +   SHOW CHARACTER-SETS
30192 +          Tells settings of { SEND, RECEIVE } CHARACTER-SET-SELECTION.
30193 +
30194 +   Normally, however, it is more convenient to leave automatic switching
30195 +   active, and change any associations that are not appropriate for your
30196 +   application, area, or country. The commands are:
30197 +
30198 +   SHOW ASSOCIATIONS
30199 +          This command lists all the associations in each direction: for
30200 +          each possible transfer character-set, it lists the associated
30201 +          file character-set, and vice versa. These are two separate and
30202 +          independent lists.
30203 +
30204 +   ASSOCIATE TRANSFER-CHARACTER-SET name1 [ name2 ]
30205 +          Changes the association for the transfer character-set name1 to
30206 +          be the file character-set name2. If name2 is omitted, automatic
30207 +          switching is disabled for this transfer character-set only.
30208 +
30209 +   ASSOCIATE FILE-CHARACTER-SET name1 [ name2 ]
30210 +          Changes the association for the file character-set name1 to be
30211 +          the transfer character-set name2. If name2 is omitted, automatic
30212 +          switching is disabled for this file character-set only.
30213 +
30214 +  6.6. UNICODE
30215 +
30216 +   C-Kermit 7.0 adds support for Unicode, the Universal Character Set,
30217 +   for:
30218 +
30219 +     * File Transfer (SEND, RECEIVE, GET, etc)
30220 +     * Terminal connection (CONNECT)
30221 +     * Unguarded file capture (LOG SESSION)
30222 +     * Unguarded file transmission (TRANSMIT)
30223 +     * Local file character-set conversion (TRANSLATE)
30224 +
30225 +   C-Kermit is not, however, a "Unicode application" in the sense that its
30226 +   commands, messages, or user interface are Unicode. Rather, it is
30227 +   "Unicode aware" in its ability to handle and convert Unicode text in
30228 +   the course of file transfer and terminal connection, and you can also
30229 +   use Kermit to convert local files between Unicode and other character
30230 +   sets. TLA's:
30231 +
30232 +  BMP - Base Multilingual Plane
30233 +  BOM - Byte Order Mark
30234 +  CJK - Chinese, Japanese, and Korean
30235 +  ISO - International Standards Organization
30236 +  TLA - Three-Letter Acronym
30237 +  UCS - Universal Character Set
30238 +  UTF - UCS Transformation Format
30239 +
30240 +   Unicode and ISO 10646 are the coordinated and compatible corporate and
30241 +   international standards for the Universal Character Set (UCS). Unlike
30242 +   single-byte and even most multibyte character sets, the UCS can
30243 +   represent all characters in every existing writing system. A flat
30244 +   plain-text file encoded in some form of UCS can contain any mixture of
30245 +   English, Spanish, Italian, German, Hebrew, Arabic, Greek, Russian,
30246 +   Armenian, Georgian, Japanese, Chinese, Korean, Vietnamese, Tibetan,
30247 +   Hindi, Bengali, Tamil, Thai, Ethiopic, and so on, plus scientific and
30248 +   mathematical notation, as well as texts in Runes, Ogham, Glagolitic,
30249 +   and other historic scripts.
30250 +
30251 +   The UCS already covers these scripts and many more, but it's an
30252 +   evolving standard with efforts underway to accommodate even more
30253 +   languages and writing systems. Support is growing for native UCS use on
30254 +   many platforms and in many applications. The goal of the framers of the
30255 +   UCS is for it to replace ASCII, the ISO Latin Alphabets, ISCII, VISCII,
30256 +   the Chinese, Japanese, and Korean (CJK) multibyte sets, etc, as well as
30257 +   the many private character sets in use today, in other words to become
30258 +   *the* Universal Character Set.
30259 +
30260 +   Until that time, however, conversions between existing sets and the UCS
30261 +   will be necessary when moving text between platforms and applications.
30262 +   Now Kermit can help.
30263 +
30264 +    6.6.1. Overview of Unicode
30265 +
30266 +   For a more complete picture, please visit:
30267 +
30268 +  [547]http://www.unicode.org/
30269 +
30270 +   and access the various online introductions, FAQs, technical reports,
30271 +   and other information. For greater depth, order the latest version of
30272 +   the published Unicode Standard. The following overview contains a great
30273 +   many oversimplifications and perhaps an opinion or two.
30274 +
30275 +   At present, the UCS is a 16-bit (2-byte) character set, but with
30276 +   provisions to grow to a 4-byte set. UCS-2 refers to the two-byte set,
30277 +   also called the Base Multilingual Plane (BMP), in which each character
30278 +   has 16 bits, and therefore there are 2^16 = 65536 possible characters.
30279 +   The first 128 characters are the same as US ASCII (C0 control
30280 +   characters and DEL included), the next 32 are the C1 control characters
30281 +   of ISO 6429, and the next 96 are the Right Half of ISO 8859-1 Latin
30282 +   Alphabet 1. The remaining tens of thousands of characters are arranged
30283 +   newly for the UCS, usually (but not always) in sections corresponding
30284 +   to existing standards, such as ISO Latin/Cyrillic, often plus
30285 +   additional characters not appearing in the existing standards due to
30286 +   lack of space (or other reasons).
30287 +
30288 +   ISO 10646 allows for additional planes, e.g. for Egyptian hieroglyphics
30289 +   or ancient (or other esoteric) CJK characters, but these planes are not
30290 +   yet defined and so we will say nothing more about them here, except
30291 +   that their use will require the 4-byte form of UCS, called UCS-4, in
30292 +   some form (more about "forms" in [548]Section 6.6.2).
30293 +
30294 +   Unicode and ISO 10646 are constantly under revision, mainly to add new
30295 +   characters. The Unicode revision is denoted by a version number, such
30296 +   as 1.0, 1.1, 2.0, 3.0. The ISO 10646 standard revision is identified by
30297 +   Edition (such as ISO 10646-1 1993), plus reference to any amendments.
30298 +   The first versions of these standards included encodings for Korean
30299 +   Hangul syllables (Jamos); these encodings were changed in version 1.1
30300 +   of Unicode and by Amendment 5 to ISO 10646-1. The Unicode Technical
30301 +   Committee and the ISO acknowledge that this was a bad thing to do, and
30302 +   promise never change encodings or character names again, since this
30303 +   poses serious problems for conformance and data interchange.
30304 +
30305 +   A UCS-2 value is customarily written like this:
30306 +
30307 +  U+xxxx
30308 +
30309 +   where "xxxx" represents four hexadecimal digits, 0-9 and A-F. For
30310 +   example, U+0041 is "A", U+00C1 is A-acute, U+042F is uppercase Cyrillic
30311 +   "Ya", U+FB4F is Hebrew Ligature Alef Lamed, and U+FFFD is the special
30312 +   character that means "not a character".
30313 +
30314 +   Most characters from widely-used alphabetic writing systems such as the
30315 +   West European ones, Cyrillic, Greek, Hebrew, Vietnamese, etc, are
30316 +   available in "precomposed" form; for example Uppercase Latin Letter A
30317 +   with Acute Accent is a single character (as it is in Latin-1). However,
30318 +   the UCS also permits composition of a base character with one or more
30319 +   nonspacing diacritics. This means the same character can be represented
30320 +   in more than one way, which can present problems in many application
30321 +   areas, including transfer and character-set conversion of text.
30322 +
30323 +   Conversion from ASCII or Latin-1 to UCS-2 text is "trivial": simply
30324 +   insert a NUL (0) byte before each ASCII or Latin-1 byte. Converting in
30325 +   the reverse direction (provided the UCS-2 file contains only U+0000 to
30326 +   U+00FF) is equally simple (if we ignore the issue of composition):
30327 +   remove every second (NUL) byte. Conversion of other character sets to
30328 +   and from UCS, however, requires tables or algorithms specific to each
30329 +   set. Nevertheless, the relatively transparent upwards compatibility
30330 +   from ASCII and Latin-1, in which a very large share of the world's
30331 +   textual data is encoded, gives the UCS an entree onto existing
30332 +   platforms.
30333 +
30334 +   But the 2-byte format and the preponderance of NUL and other control
30335 +   bytes in UCS-2 text pose problems for current applications and
30336 +   transmission methods. And to make matters worse, different hardware
30337 +   platforms store UCS-2 characters in different byte order. Thus a UCS-2
30338 +   file transferred by FTP (or accessed via NFS, etc) between two
30339 +   computers with different architecture might have its bytes in the wrong
30340 +   order (or worse; see [549]Section 6.6.5.1 ).
30341 +
30342 +    6.6.2. UCS Byte Order
30343 +
30344 +   Consider the number 1. In an 8-bit byte, this would be represented by
30345 +   the following series of 0- and 1-bits:
30346 +
30347 +  +-----------------+
30348 +  | 0 0 0 0 0 0 0 1 |
30349 +  +-----------------+
30350 +
30351 +   Therefore in a 16-bit "word" the representation might be:
30352 +
30353 +  +-----------------+-----------------+
30354 +  | 0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 1 |
30355 +  +-----------------+-----------------+
30356 +
30357 +   Now consider the number 256, which is 2 to the 8th power. The binary
30358 +   representation is 100000000 (1 followed by 8 zeros). 256 would go into
30359 +   a 16-bit word like this:
30360 +
30361 +  +-----------------+-----------------+
30362 +  | 0 0 0 0 0 0 0 1 | 0 0 0 0 0 0 0 0 |
30363 +  +-----------------+-----------------+
30364 +
30365 +   When a computer works this way, it is said to be Big Endian, meaning it
30366 +   puts the most significant (biggest) byte first (on the "left") in a
30367 +   16-bit word, and the least significant byte second (on the right).
30368 +
30369 +   However, some other computers have the opposite arrangement, called
30370 +   Little Endian, in which 1 is:
30371 +
30372 +  +-----------------+-----------------+
30373 +  | 0 0 0 0 0 0 0 1 | 0 0 0 0 0 0 0 0 |
30374 +  +-----------------+-----------------+
30375 +
30376 +   and 256 is:
30377 +
30378 +  +-----------------+-----------------+
30379 +  | 0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 1 |
30380 +  +-----------------+-----------------+
30381 +
30382 +   Computers such as Sparc, MIPS, PA-RISC, and PowerPC are Big Endian,
30383 +   whereas the PC and the Alpha are Little Endian. Endianness has never
30384 +   been an issue with 7- or 8-bit characters, but it is with UCS
30385 +   characters. It can be a tricky business to share or transfer a UCS-2
30386 +   file between two different kinds of computers.
30387 +
30388 +   To alleviate (but not entirely solve) the problem, UCS-2 files are
30389 +   supposed to begin with the Unicode character U+FEFF, Zero-Width
30390 +   No-Break Space (ZWNBS). This is a kind of "no-op" (note: any such
30391 +   assertion must normally be qualified with many "but ifs" and "excepts"
30392 +   which are omitted here in the interest of brevity). If the bytes are
30393 +   reversed the ZWNBS becomes U+FFFE, which is not (and never will be) a
30394 +   defined UCS character. U+FEFF at the beginning of a UCS file is
30395 +   therefore called a Byte Order Mark, or BOM.
30396 +
30397 +   Any application that creates a UCS-2 (or UTF-16, or UCS-4) file should
30398 +   include a BOM, and any application that reads one should test for a
30399 +   BOM, and if one is found, infer the byte order from it. This is a
30400 +   convention, however -- not a standard or a requirement -- and
30401 +   applications vary in their ability to handle BOMs and "backwards" UCS-2
30402 +   files.
30403 +
30404 +   Note that a BOM is useful only at the beginning of a file. If you
30405 +   append one UCS-2 file to another, and both have BOMs, the internal BOM
30406 +   is no longer a BOM. And if the byte orders of the two files differ,
30407 +   then either the first part or the second will be backwards. (Various
30408 +   other undesirable effects might also occur, not discussed here.)
30409 +
30410 +    6.6.2. UCS Transformation Formats
30411 +
30412 +   UCS textual data can be modified in various ways for transmission or
30413 +   storage. Any officially sanctioned method of doing this is called a UCS
30414 +   Transformation Format, or UTF. One such method, called UTF-16, is
30415 +   essentially identical with UCS-2 except that it designates certain code
30416 +   values as "escape sequences" (called surrogate pairs) to access
30417 +   characters in other planes without having to use full UCS-4. We won't
30418 +   discuss UTF-16 further here, since at the moment there are no other
30419 +   planes. Several other UTF's (such as UTF-1, UTF-2, and UTF-7) have
30420 +   fallen into disuse and are not discussed here. The most important
30421 +   transformation format today is UTF-8.
30422 +
30423 +   UTF-8, so called because it "serializes" UCS-2 data into a stream of
30424 +   8-bit bytes, is designed to allow the UCS to work with present-day
30425 +   communications gear, computers, and software. The most important
30426 +   properties of UTF-8 are that byte order is constant (no byte swapping)
30427 +   and all (7-bit) ASCII characters represent themselves. Therefore
30428 +   conversion between ASCII and UTF-8 is no conversion at all, and
30429 +   applications or platforms (such as Plan 9 from Bell Labs) that use
30430 +   UTF-8 "for everything" can still run traditional ASCII-only
30431 +   applications and be accessed from them. In particular, unlike UCS-2,
30432 +   ASCII characters are not padded with NUL bytes. But also unlike UCS-2,
30433 +   there is no transparency for Latin-1 or any other non-ASCII character
30434 +   set. Every non-ASCII UCS-2 character is represented by a sequence of 2
30435 +   or 3 UTF-8 bytes. Thus UTF-8 is more compact than UCS-2 for text
30436 +   containing a preponderance of ABC's (or other ASCII characters), about
30437 +   the same as UCS-2 for other alphabetic scripts (Cyrillic, Roman, Greek,
30438 +   etc), and larger than UCS-2 for Chinese, Japanese, and Korean.
30439 +
30440 +   The UTF-8 uncoding of the UCS has been adopted by the Internet as the
30441 +   preferred character set for new applications, and is gradually being
30442 +   retrofitted into traditional applications like FTP ([550]RFC 2640).
30443 +
30444 +    6.6.3. Conformance Levels
30445 +
30446 +   Although the Unicode and ISO 10646 standards both describe the same
30447 +   character set, these standards differ in many ways, including their
30448 +   stated requirements for conformance and their classification of
30449 +   conformance levels.
30450 +
30451 +   Kermit has always abided by ISO character-set standards, including ISO
30452 +   character-set designation and invocation methods. In adapting Unicode,
30453 +   therefore, we had to choose from among the available ISO designations
30454 +   which, in turn, correspond with ISO 10646 conformance levels. At
30455 +   present, Kermit claims the lowest conformance level, 1, meaning
30456 +   (roughly) that it does not handle combining forms and it does not
30457 +   handle Korean Hangul Jamos (just as, at present, it does not handle
30458 +   Korean in general). Note that ISO 10646 Conformance Levels 1 and 2
30459 +   sidestep the issue of the code changes for Korean Hangul by announcing
30460 +   non-support for Hangul regardless of encoding.
30461 +
30462 +   ISO 10646 Conformance Level 1 is approximately equivalent to Unicode
30463 +   Normalization Form C (described in Unicode Technical Report 15,
30464 +   incorporated into Unicode 3.0).
30465 +
30466 +   As noted in [551]Section 6.6.2, Kermit does not claim to support UTF-16
30467 +   at the present time, hence the UCS-2 nomenclature. Kermit treats
30468 +   surrogates just as if they were any other UCS-2 characters, rather than
30469 +   as escapes to other planes, which means that (except when converting
30470 +   between UCS-2 and UTF-8) they are translated to "error" characters,
30471 +   since (a) no other planes are defined yet (and if they were, no other
30472 +   character sets supported by Kermit would encode their characters), and
30473 +   (b) no valid surrogate character corresponds to any other UCS-2
30474 +   character.
30475 +
30476 +   A minor yet significant aspect of Unicode 3.0 and some recent
30477 +   perturbation of ISO 10646-1 (probably Amendment 18, "Symbols and Other
30478 +   Characters") is the addition of the Euro Sign at U+20AC. As noted in
30479 +   [552]Section 6.0, Kermit's "Euro compliance" includes conversion
30480 +   between Latin Alphabet 9 and various PC code pages. Text can also be
30481 +   converted between UCS-2 or UTF-8 and any other Euro-compliant character
30482 +   set (Latin-9, CP858, CP1250, CP1252) without loss of the Euro Sign.
30483 +
30484 +    6.6.4. Relationship of Unicode with Kermit's Other Character Sets
30485 +
30486 +   Kermit's character sets are divided into two groups: single-byte sets
30487 +   (such as Roman, Hebrew, Cyrillic, Greek) and multibyte (various
30488 +   Japanese sets). The two groups are distinct since one normally would
30489 +   not expect to convert Kanji ideograms to Roman (or other) letters, or
30490 +   vice versa.
30491 +
30492 +   Unicode character-set conversion works with both groups, but obviously
30493 +   the result depends on the repertoires of the source and destination
30494 +   character-sets both including the characters in the file. For example,
30495 +   you can translate a Hungarian text file between Latin-2 and Unicode,
30496 +   but not between (say) Unicode and Latin/Greek. By the same token you
30497 +   can convert Japanese text from Shift-JIS or EUC or JIS-7 to Unicode and
30498 +   back, but you can't convert the same file to (say) Latin-1 if it
30499 +   contains Japanese characters.
30500 +
30501 +     JIS-7 is equivalent to DEC Kanji and ISO-2022-JP except that the
30502 +     latter two do not support halfwidth Katakana. Kermit treats all
30503 +     three of these sets the same way, i.e. as JIS-7.
30504 +
30505 +   As noted, Kermit presently does not handle combining diacritics, and so
30506 +   will not correctly convert UCS files that use them into a single-byte
30507 +   character set. For example, if a UCS file contains Latin Capital Letter
30508 +   A (U+0041) followed by Combining Acute Accent (U+0301), the result will
30509 +   be a two-character sequence, A followed by another character. This is
30510 +   what is meant by Conformance Level 1. (The situation grows worse with
30511 +   multiple diacritics, since they can occur in any order.)
30512 +
30513 +   A higher level of conformance is possible, in which "canonical
30514 +   equivalences" are handled via algorithms and databases, at some
30515 +   (perhaps considerable) cost in performance, since a fair amount of
30516 +   additional code must be executed for every character during data
30517 +   transfer (database lookup, sorting of combining sequences into
30518 +   canonical order, etc). This can be added in future releases if there is
30519 +   a need (but in many cases, pre- and postpostprocessing might be a
30520 +   better option).
30521 +
30522 +   Within these constraints, Kermit converts between the UCS and its other
30523 +   character sets. For example, a mixture of Russian and English (and/or
30524 +   Dutch, or Latin) text can bet converted between the UCS and ISO
30525 +   Latin/Cyrillic or KOI-8. But since Kermit does not presently support
30526 +   Arabic character-set conversion, the new availability of UCS conversion
30527 +   does not mean that Kermit can convert from Arabic UCS text to some
30528 +   other character set, because Kermit does not support any other
30529 +   character set that includes Arabic. Ditto for Thai, Armenian, Georgian,
30530 +   Tibetan, Chinese, Korean, etc. However, Kermit CAN convert Arabic (or
30531 +   any other script) between UCS-2 and UTF-8.
30532 +
30533 +   Considering Cyrillic more carefully, note that the UCS also contains
30534 +   numerous Cyrillic characters not found in any of the Cyrillic sets (ISO
30535 +   Latin/Cyrillic, KOI8, CP866, etc) that Kermit supports; characters
30536 +   needed for Abkhasian, Yakut, Tatar, Bashkir, Altaic, Old Church
30537 +   Slavonic, etc; UCS text containing any of these historic or "extended"
30538 +   Cyrillic characters can not be converted to any of Kermit's current
30539 +   single-byte Cyrillic sets without loss. The situation is similar for
30540 +   Greek, Hebrew, etc, and even worse for Japanese since Unicode contains
30541 +   thousands of Kanjis that are lacking from the Japanese character sets
30542 +   based on JIS X 0208, such as EUC-JP, JIS-7, and Shift-JIS.
30543 +
30544 +   In general, when converting from UCS to a single-byte set, there is
30545 +   always the possibility of data loss, just as there is when converting
30546 +   from any larger set to a smaller one. For example, if a UCS file
30547 +   contains Devanagari characters, these characters will be lost when
30548 +   converting to (say) Latin-1, just as Roman vowels with acute accents
30549 +   are lost when converting from Latin-1 (an 8-bit set) to German ISO 646
30550 +   (a 7-bit set).
30551 +
30552 +    6.6.5. Kermit's Unicode Features
30553 +
30554 +   C-Kermit can convert between UCS-2 or UTF-8 and any of its other
30555 +   character sets, and also between UCS-2 and UTF-8. When converting
30556 +   between UCS-2 or UTF-8 and a non-Unicode character set (such as
30557 +   Latin-1), the UCS Line Separator (LS, U+2028) and Paragraph Separator
30558 +   (PS, U+2029) characters are converted to the appropriate line
30559 +   terminator (CR, LF, or CRLF). When converting from a non-Unicode set to
30560 +   UCS-2 or UTF-8, however, line terminators are not converted to LS or
30561 +   PS. This is in accordance with the recommendations of Unicode Technical
30562 +   Report #13.
30563 +
30564 +   When C-Kermit starts, it tests the native byte order of the computer.
30565 +   You can see the result in the SHOW FEATURES or SHOW FILE display. It's
30566 +   also available in the variable \v(byteorder): 0 means Big Endian, 1
30567 +   means Little Endian.
30568 +
30569 +   When UCS-2 is involved in file transfer or translation, the following
30570 +   commands tell C-Kermit what to do about byte order:
30571 +
30572 +   SET FILE UCS BYTE-ORDER { BIG-ENDIAN, LITTLE-ENDIAN }
30573 +          This is for reading UCS-2 files that don't have a BOM, and also
30574 +          for writing UCS-2 files. If this command is not given, the
30575 +          machine's native byte order is used when writing UCS-2 files,
30576 +          and also when reading UCS-2 files that don't have a BOM.
30577 +
30578 +   SET FILE UCS BOM { ON, OFF }
30579 +          This setting is used when creating UCS-2 files. A BOM is added
30580 +          at the beginning by default. Use OFF to not add the BOM. This
30581 +          command has no affect when writing files.
30582 +
30583 +   COPY /SWAP-BYTES sourcefile destinationfile
30584 +          Use this for fixing a UCS-2 file whose bytes are in the wrong
30585 +          order.
30586 +
30587 +   Use SHOW FILE to display the FILE UCS settings.
30588 +
30589 +   Please note, again, that C-Kermit's user interface, including its
30590 +   script language, is not internationalized in any way. String
30591 +   comparisons, case conversion, and so on, work only for US ASCII
30592 +   (comparisons for equality work with other sets, but not
30593 +   lexically-greater-or-less-than or caseless comparisons; even
30594 +   comparisons for equality can fail when composed characters or byte
30595 +   order are involved). String functions such as \findex() and
30596 +   \fsubstring() that reference byte positions do just that; they won't
30597 +   work with UTF-8 text that contains any non-ASCII characters, and they
30598 +   will not work with UCS-2 text at all since they use C strings
30599 +   internally, which are NUL-terminated. These are just a few examples to
30600 +   illustrate that neither Unicode nor any other character-set beyond
30601 +   ASCII is supported at the user-interface, command, or scripting level
30602 +   in this version of C-Kermit.
30603 +
30604 +    6.6.5.1. File Transfer
30605 +
30606 +   Kermit supports both UCS-2 and UTF-8 as file and transfer character
30607 +   sets in text-mode file transfer.
30608 +
30609 +   To select UCS-2 or UTF-8 as a file character-set, use:
30610 +
30611 +  SET FILE CHARACTER-SET { UCS2, UTF8 }
30612 +
30613 +   If you want to send a UCS-2 text file (or save an incoming file in
30614 +   UCS-2 format), tell Kermit to:
30615 +
30616 +  SET FILE CHARACTER-SET UCS2
30617 +
30618 +   and if you want to send a UTF-8 text file (or store an incoming file in
30619 +   UTF-8 format), tell Kermit to:
30620 +
30621 +  SET FILE CHARACTER-SET UTF8
30622 +
30623 +   When sending UCS-2 files, Kermit determines the byte order from the
30624 +   BOM, if there is one (and if there is a BOM, it is stripped, i.e. not
30625 +   sent). If there is no BOM, the byte order is the one specified in the
30626 +   most recent SET FILE UCS BYTE-ORDER command, if any, otherwise the
30627 +   computer's native byte order is assumed. When storing incoming files as
30628 +   UCS-2, the byte order is according SET FILE UCS BYTE-ORDER, if given,
30629 +   otherwise the native one; a BOM is written according to SET FILE UCS
30630 +   BOM.
30631 +
30632 +   A transfer character-set should be chosen that includes all of the
30633 +   characters in the source file. So, for example, if you are sending a
30634 +   UCS-2 file containing only German-language text, your transfer
30635 +   character-set can be Latin-1, Latin-2, Latin-9, UCS-2, or UTF-8. But if
30636 +   you are sending a file that contains a combination of Hebrew and Greek,
30637 +   your transfer character-set must be UCS-2 or UTF-8 if you don't want to
30638 +   lose one script or the other. Furthermore, the transfer character-set
30639 +   must be one that is supported by the receiving Kermit program. Since
30640 +   UCS support is new, it is possible that the other Kermit program (if it
30641 +   supports character sets at all) does not support it, but does support
30642 +   single-byte sets such as Latin-1, Latin/Cyrillic, etc.
30643 +
30644 +   To select UCS-2 or UTF-8 as a transfer character-set, use:
30645 +
30646 +  SET TRANSFER CHARACTER-SET { UCS2, UTF8 }
30647 +
30648 +   It is up to the receiving Kermit program to convert the transfer format
30649 +   to its own local format, if necessary. If it does not understand the
30650 +   UTF-8 or UCS-2 transfer character-set, and your file can not be
30651 +   adequately represented by any single-byte transfer character-set (such
30652 +   as Latin-1 or Latin/Cyrillic) then, if UTF-8 format is acceptable on
30653 +   the receiving computer, use UTF-8 as the transfer character-set, with
30654 +   the receiver told to "set unknown-char keep", or with the sender told
30655 +   to "set attribute char off". If you want the file to be stored in UCS-2
30656 +   format at the receiver, send it it binary mode if the source file is
30657 +   also UCS-2, or else use the TRANSLATE command (next section) to convert
30658 +   it to UCS-2 first, then send it in binary mode. You should not use
30659 +   UCS-2 as a transfer character-set in text-mode transfers to Kermit
30660 +   programs that don't support it, because they are likely to corrupt the
30661 +   result the same way FTP would (see the final paragraph of this
30662 +   section).
30663 +
30664 +   When UCS-2 is the transfer character set, it always goes into Kermit
30665 +   packets in Big Endian format, with no BOM. As always, the transfer
30666 +   character-set is announced by the sender to the receiver. The
30667 +   announcement for UCS-2 is "I162" (ISO Registration 162 = UCS-2 Level 1)
30668 +   and by definition it is Big Endian (the standards say that when UCS-2
30669 +   is serialized into bytes, the order must be Big Endian). The
30670 +   announcement for UTF-8 is "I190" (UTF-8 Level 1).
30671 +
30672 +   When receiving a file whose transfer character-set is UCS-2 or UTF-8,
30673 +   you must choose the appropriate file character set for the result.
30674 +   There is no way Kermit can do this for you automatically, since UCS
30675 +   data can be in any script at all, or any combination.
30676 +
30677 +   In general, UTF-8 or UCS-2 should be chosen as a transfer character-set
30678 +   if the source file is also encoded in some form of UCS and it contains
30679 +   more than one script. But there are other situations where where UTF-8
30680 +   or UCS-2 offer advantages. For example, suppose the source file is on a
30681 +   NeXTstation and the destination file is on VMS. Both the NeXT and the
30682 +   DEC Multinational character sets include the French OE digraph, but
30683 +   Latin-1 does not. Therefore French words containing this character
30684 +   might not arrive intact when Latin-1 is the transfer character-set, but
30685 +   will with UTF-8 or UCS-2, since the UCS includes the OE digraph (but so
30686 +   does Latin-9).
30687 +
30688 +   UCS-2 should be chosen as a transfer character-set only for Japanese
30689 +   text files that contain a large preponderance of Kanji, since in this
30690 +   case (and only this case) UCS-2 (two bytes per Kanji) is more efficient
30691 +   than UTF-8 (three bytes per Kanji). The same will be true for Chinese
30692 +   and Korean when they are supported by Kermit. UCS-2 should never be
30693 +   used as a transfer character-set with a transfer partner that does not
30694 +   support UCS-2 since this can cause file corruption (see last paragraph
30695 +   in this section).
30696 +
30697 +   Note that Kermit's repeat-count compression is 100% ineffective for
30698 +   UCS-2, and is also ineffective for multibyte characters in UTF-8 and
30699 +   EUC-JP; this is because repeat-compression is a transport-level
30700 +   mechanism that operates on a per-byte basis; it has no knowledge of the
30701 +   distinction between a byte and a character.
30702 +
30703 +   When C-Kermit starts, it sets up associations ([553]Section 6.5) for
30704 +   incoming files whose transfer character sets are UCS-2 or UTF-8
30705 +   appropriately for the platform so that the file character-set for the
30706 +   incoming file is UCS-2 in Windows and UTF-8 elsewhere. Otherwise,
30707 +   C-Kermit does not make any default associations for UCS-2 or UTF-8, but
30708 +   of course you may add or change associations to suit your needs and
30709 +   preferences by including the appropriate ASSOCIATE commands in your
30710 +   Kermit startup file. For example, if you are a PC user and deal only
30711 +   with text written in Greek and English, you can:
30712 +
30713 +  ASSOCIATE TRANSFER-CHARACTER-SET UTF8 CP869
30714 +  ASSOCIATE TRANSFER-CHARACTER-SET UCS2 CP869
30715 +  ASSOCIATE FILE-CHARACTER-SET CP869 UTF8
30716 +
30717 +   Note that when file transfer involves conversion between a single-byte
30718 +   character set and UCS-2 or UTF-8, the file-transfer thermometer and
30719 +   estimated time left might be inaccurate, since they are based on the
30720 +   source file size, not the transfer encoding. This is purely a cosmetic
30721 +   issue and does not effect the final result. (And is not, strictly
30722 +   speaking, a bug; Kermit protocol presently includes no method for the
30723 +   sender to furnish an "estimated transfer size" to the receiver, and in
30724 +   any case any such guess could be as far off as the file size, given the
30725 +   many other factors that come into play, such as compression and
30726 +   prefixing).
30727 +
30728 +   A caution about FTP and UCS-2. As noted previously, if you transfer a
30729 +   UCS-2 file with FTP in binary mode between two computers with opposite
30730 +   Endianness, the result will have its bytes in the wrong order. However,
30731 +   if you use FTP to transfer a UCS-2 file in "ascii" (text) mode to ANY
30732 +   computer, even if it is identical to yours, the result will be
30733 +   corrupted because FTP's line-terminator conversions do not account for
30734 +   UCS-2. The same holds when sending from a UCS-aware Kermit program to
30735 +   an older Kermit program in text mode with a transfer character-set of
30736 +   UCS-2. So use UCS-2 as a transfer character-set ONLY with a UCS-2-aware
30737 +   Kermit partner.
30738 +
30739 +    6.6.5.2. The TRANSLATE Command
30740 +
30741 +   In Kermit versions that have Unicode support included, TRANSLATE now
30742 +   always goes through Unicode; that is, the source set is converted to
30743 +   UCS-2 and thence to the target set. This is a major improvement, since
30744 +   in prior releases, C-Kermit had to pick the "most appropriate" transfer
30745 +   character-set as the intermediate set, and this would result in the
30746 +   loss of any characters that the source and target sets had in common
30747 +   but were lacking from the intermediate set (for example the OE digraph
30748 +   when translating from NeXT to DEC MCS through Latin-1). This never
30749 +   happens when Unicode is the intermediate set because Unicode is a
30750 +   superset of all other character sets supported by Kermit. A more
30751 +   dramatic example would be translation between Cyrillic PC code page 866
30752 +   and KOI8-R ([554]Section 6.4); formerly all the line- and box-drawing
30753 +   characters would be lost (since ISO 8859-5 does not have any); now the
30754 +   ones that these two sets have in common are preserved.
30755 +
30756 +   UCS-2 and UTF-8 are now both supported as source-file and
30757 +   destination-file character sets by C-Kermit's TRANSLATE command, for
30758 +   example:
30759 +
30760 +  translate oofa.txt ucs2 latin1 oofa-l1.txt
30761 +
30762 +   translates oofa.txt from UCS-2 to Latin-1, storing the result as
30763 +   oofa-l1.txt. Similarly:
30764 +
30765 +  translate oofa.txt utf8 latin1 oofa-l1.txt
30766 +  translate oofa.txt latin1 ucs2 oofa-ucs2.txt
30767 +  translate oofa.txt latin1 utf8 oofa-utf8.txt
30768 +  translate oofa.txt ucs2 utf8 oofa-utf8.txt
30769 +  translate oofa.txt utf8 ucs2 oofa-ucs2.txt
30770 +
30771 +   Treatment of the UCS-2 BOM is exactly the same as for file transfer.
30772 +   Note that if a UCS-2 source file is in the "wrong" byte order and lacks
30773 +   a BOM, and you don't tell Kermit about it with SET FILE UCS BYTE-ORDER,
30774 +   the result of the translation is total gibberish. Recall that you can
30775 +   use COPY /SWAP-BYTES to switch the byte order of an errant UCS-2 file
30776 +   (or any other file for that matter, if you can think of a reason to).
30777 +   Also note that:
30778 +
30779 +  translate oofa.txt ucs2 ucs2 new.txt
30780 +
30781 +   Produces a result in the native (or SET FILE UCS) byte-order as long as
30782 +   oofa.txt has a BOM.
30783 +
30784 +   As a side benefit of the Unicode work, the TRANSLATE command now works
30785 +   for the first time also for all Japanese character sets that Kermit
30786 +   supports. In other words, if you have a Japanese text file in any of
30787 +   the following encodings:
30788 +
30789 +  EUC-JP
30790 +  Shift-JIS
30791 +  JIS-7
30792 +  UCS-2
30793 +  UTF-8
30794 +
30795 +   You can use the TRANSLATE command to convert to any other encoding from
30796 +   the same list.
30797 +
30798 +    6.6.5.3. Terminal Connection
30799 +
30800 +   The CONNECT command now allows UTF-8 as a local or remote terminal
30801 +   character-set:
30802 +
30803 +  SET TERMINAL CHARACTER-SET { ..., UTF8 } { ..., UTF8 }
30804 +  SET TERMINAL REMOTE-CHARACTER-SET { ..., UTF8 }
30805 +  SET TERMINAL LOCAL-CHARACTER-SET { ..., UTF8 }
30806 +
30807 +   (Recall that Kermit's terminal character-set has two "ends" -- the set
30808 +   used on the host to which Kermit is connected, and the set used on the
30809 +   local keyboard and screen.)
30810 +
30811 +   UCS-2 is not supported as a terminal character-set (either end) since
30812 +   (a) it is not used that way anywhere to our knowledge, and (b) the
30813 +   problems of Endianness and the high likelihood of loss of
30814 +   synchronization make it impractical. (Telecommunications is
30815 +   byte-oriented; if one byte, or any odd number of bytes, is lost because
30816 +   of buffer overruns, circuit resets, etc (or likewise if a burst of
30817 +   noise appears that takes the guise of an odd number of bytes), the byte
30818 +   order of the subsequent data stream will be backwards; unlike UTF-8 and
30819 +   traditional byte-based character sets, UCS-2 is not "self
30820 +   synchronizing".)
30821 +
30822 +   UTF-8 does not have byte-order or synchronization problems and is
30823 +   growing in popularity as a terminal character set as well as in other
30824 +   application areas. It allows a single terminal session to use multiple
30825 +   scripts (Roman, Cyrillic, Greek, etc) without ISO 2022 character-set
30826 +   switching (which terminal emulators like Kermit 95 can handle but few
30827 +   host applications understand or use), and meshes nicely with the
30828 +   Unicode screen fonts that are beginning to appear.
30829 +
30830 +   UTF-8 was first used in Plan 9 and soon will be available in Linux. It
30831 +   will probably spread from there (Unicode in some form is, of course,
30832 +   also used in Windows NT, but only internally -- not for access from
30833 +   outside).
30834 +
30835 +   To use UTF-8 or any other character set that uses 8-bit bytes in your
30836 +   terminal session, be sure to tell C-Kermit to:
30837 +
30838 +  SET TERMINAL BYTESIZE 8
30839 +  SET COMMAND BYTESIZE 8
30840 +  SET PARITY NONE
30841 +
30842 +   (or use the shortcut command, EIGHTBIT, which does all three at once).
30843 +
30844 +   In a setup where your local Kermit program uses a single-byte character
30845 +   set such as PC Code Page 850 and the remote host uses UTF-8:
30846 +
30847 +  SET TERM CHAR UTF8 CP850
30848 +
30849 +   or:
30850 +
30851 +  SET TERM REMOTE CHAR UTF8
30852 +  SET TERM LOCAL CHAR CP850
30853 +
30854 +   all works as expected. UTF-8 text on the remote displays correctly on
30855 +   your screen, and when you type CP850 characters, they are translated to
30856 +   UTF-8 sequences for transmission, and the echo from the host is
30857 +   translated from UTF-8 back to CP850. Telnet negotiations and
30858 +   autodownload take place before any character-set translation and work
30859 +   as before. The session log (if text mode was selected for it) contains
30860 +   only the local terminal character-set. And so on.
30861 +
30862 +   Kermit merely supplies translations from UTF-8 to your local terminal
30863 +   character-set (this includes treating UTF-8 Line Separator and
30864 +   Paragraph separator as CRLF). However, Kermit does does not, at
30865 +   present, perform "canonicalization" of composed sequences, nor does it
30866 +   automatically execute bidirectionality algorithms for display of
30867 +   mixed-direction text (e.g. Hebrew and English). Such presentation
30868 +   issues, like all others in the terminal-host regime, are left to the
30869 +   host.
30870 +
30871 +   By the way, C-Kermit also allows UTF-8 to be the local end of the
30872 +   terminal character-set, but so far this code is not tested, since we
30873 +   don't have a UTF-8 console or terminal to work with. However, it can be
30874 +   stated without doubt that C-Kermit's key mapping will not work for
30875 +   UTF-8 values, since (a) the key map is indexed by 8-bit byte values and
30876 +   (b) C-Kermit reads keystrokes a byte at a time (these comments do not
30877 +   apply to K95, which has direct access to the keyboard and can read
30878 +   "wide" keycodes and uses them to index a "wide" keymap).
30879 +
30880 +   Restrictions: As noted, the CONNECT command does not support UCS-2 as a
30881 +   REMOTE TERMINAL character-set. Neither does it support the Japanese
30882 +   sets EUC-JP, JIS-7, and Shift-JIS. Support for the Japanese sets (and
30883 +   possibly Chinese and Korean too) might be added in a future release.
30884 +   Since the TRANSMIT command (next section) uses the same REMOTE TERMINAL
30885 +   character-sets as the CONNECT command, it has the same restrictions.
30886 +
30887 +    6.6.5.4. The TRANSMIT Command
30888 +
30889 +   As described in Chapter 15 of [555]Using C-Kermit and [556]Section 4.21
30890 +   of this document, the TRANSMIT command can be used to upload a file
30891 +   without protocol, more or less as if you were typing it on your
30892 +   keyboard while connected to the host. When TRANSMITting in text mode,
30893 +   the file's character set is converted to the host's unless you have SET
30894 +   TERMINAL CHARACTER-SET TRANSPARENT, or you include the new TRANSMIT
30895 +   switch, /TRANSPARENT.
30896 +
30897 +   Before C-Kermit 7.0, the file character-set was assumed to be the same
30898 +   as the local end of the terminal character-set, and the TRANSMIT
30899 +   command used the same translations as the CONNECT command, ignoring the
30900 +   file character-set.
30901 +
30902 +   In C-Kermit 7.0, that assumption (a poor one to begin with) can no
30903 +   longer be made, since UCS-2 can be a file character-set but not a
30904 +   terminal character-set. So now the file's character-set is given by
30905 +   your most recent SET FILE CHARACTER-SET command. The host's character
30906 +   set is the remote end of your most recent SET TERMINAL CHARACTER-SET
30907 +   command:
30908 +
30909 +  SET TERMINAL CHARACTER-SET remote-set [ local-set ]
30910 +
30911 +   or:
30912 +
30913 +  SET TERMINAL REMOTE-CHARACTER-SET remote-set
30914 +
30915 +   The TRANSMIT command converts each source-file character from the FILE
30916 +   character-set to the REMOTE TERMINAL character-set, and then transmits
30917 +   the translated characters according to your SET TRANSMIT preferences
30918 +   (Chapter 15).
30919 +
30920 +   If you have SET TRANSMIT ECHO ON, and the host is echoing the
30921 +   transmitted characters, the echos are converted from the remote
30922 +   terminal character-set to the local terminal character-set.
30923 +
30924 +  [ A picture would help... ]
30925 +
30926 +   Confused? Let's work through an example. Suppose your local computer is
30927 +   a NeXTstation, on which text files are encoded in the NeXT character
30928 +   set, and that the remote computer is a Data General AViiON, which uses
30929 +   the Data General International character set. Further suppose that you
30930 +   are logged in to the NeXT from a VT220 terminal which uses the DEC
30931 +   Multinational character set.
30932 +
30933 +   You need to convert the file from NeXT encoding to DG encoding and
30934 +   convert the echoes from DG encoding to DEC encoding. So on the NeXT,
30935 +   tell C-Kermit to:
30936 +
30937 +  eightbit
30938 +  set file character-set next
30939 +  set term character-set dg-international dec-mcs
30940 +  transmit /text nextdata.txt
30941 +
30942 +   (This assumes you have some sort of collection process already set up
30943 +   on the Data General, such as a text editor or the venerable "cat >
30944 +   foo". The EIGHTBIT command is equivalent to SET TERMINAL BYTESIZE 8,
30945 +   SET COMMAND BYTESIZE 8, SET PARITY NONE.)
30946 +
30947 +   To further complicate matters, suppose your local terminal character
30948 +   set is the same as the remote one, so you don't need terminal
30949 +   character-set translation, but you need to TRANSMIT a file that is in a
30950 +   different character set and you want it translated to the host set. In
30951 +   this case, use SET TERM CHARACTER-SET to actually specify the character
30952 +   set used on each end, rather than specifying TRANSPARENT:
30953 +
30954 +  eightbit
30955 +  set file character-set ucs2
30956 +  set term character-set latin1 latin1
30957 +  transmit /text ucs2data.txt
30958 +
30959 +   The distinction between:
30960 +
30961 +  SET TERMINAL CHARACTER-SET xxx yyy
30962 +
30963 +   (where xxx and yyy are the same set) and:
30964 +
30965 +  SET TERMINAL CHARACTER-SET TRANSPARENT
30966 +
30967 +   is new to C-Kermit 7.0, but affects only the TRANSMIT command.
30968 +
30969 +   The TRANSMIT command currently does nothing special with UCS-2/UTF-8
30970 +   Line and Paragraph Separator characters; more experience is required to
30971 +   find out how these behave in a genuine Unicode terminal-host setting.
30972 +
30973 +   Restrictions: As noted, the TRANSMIT command translates from the FILE
30974 +   character-set to the REMOTE TERMINAL character-set. This rules out
30975 +   translations to any character set that is not supported as a REMOTE
30976 +   TERMINAL character-set, such as UCS-2, EUC-JP, JIS-7, and Shift-JIS.
30977 +
30978 +    6.6.5.5. Summary of Kermit Unicode Commands
30979 +
30980 +   Specifying file character-set and byte order:
30981 +          SET FILE CHARACTER-SET { ..., UCS2, UTF8 }
30982 +          REMOTE SET FILE CHARACTER-SET { ..., UCS2, UTF8 } (See next
30983 +          section)
30984 +          SET FILE UCS BOM { ON, OFF }
30985 +          SET FILE UCS BYTE-ORDER { BIG-ENDIAN, LITTLE-ENDIAN }
30986 +
30987 +   Specifying the transfer character-set:
30988 +          SET TRANSFER CHARACTER-SET { ..., UCS-2, UTF-8 }
30989 +          REMOTE SET TRANSFER CHARACTER-SET { ..., UCS-2, UTF-8 }
30990 +
30991 +   Specifying the terminal character-set:
30992 +          SET TERMINAL CHARACTER-SET { ..., UTF8 } { ..., UTF8 }
30993 +          SET TERMINAL REMOTE-CHARACTER-SET { ..., UTF8 }
30994 +          SET TERMINAL LOCAL-CHARACTER-SET { ..., UTF8 }
30995 +
30996 +   Displaying settings:
30997 +          SHOW FILE
30998 +          SHOW TRANSFER
30999 +          SHOW TERMINAL
31000 +          SHOW CHARACTER-SETS
31001 +
31002 +   Commands that use these settings include:
31003 +          SEND, RECEIVE, GET, etc.
31004 +          CONNECT
31005 +          TRANSMIT
31006 +          LOG SESSION
31007 +
31008 +   Converting files:
31009 +          TRANSLATE infile { ..., UCS-2, UTF-8 } { ..., UCS-2, UTF-8 }
31010 +          outfile
31011 +          COPY /SWAP-BYTES infile outfile
31012 +
31013 +  6.7. Client/Server Character-Set Switching
31014 +
31015 +   A simple mechanism has been added to allow the client to change the
31016 +   server's FILE CHARACTER-SET:
31017 +
31018 +   REMOTE SET FILE CHARACTER-SET name
31019 +          The client asks the server to change its file character-set to
31020 +          the one given. The name must match one of the server's file
31021 +          character-set names. For convenience, C-Kermit uses its own file
31022 +          character-set keyword list for parsing this command so you can
31023 +          use ? for help and Tab or Esc for completion. However, since the
31024 +          server might have a different repertoire (or even use different
31025 +          names for the same sets), C-Kermit accepts any string you supply
31026 +          and sends it to the server. The server, if it supports this
31027 +          command (C-Kermit 7.0 and K95 1.1.19 do), sets its file
31028 +          character-set as requested, and also disables automatic
31029 +          character-set switching ([557]Section 6.5). If the server does
31030 +          not support this command or if it does not support the given
31031 +          character set, the REMOTE SET FILE CHARACTER-SET command fails.
31032 +
31033 +   Here's an example that sends a Japanese text file encoded in Shift-JIS
31034 +   to a server using every combination of Kermit's Japanese-capable file
31035 +   and transfer character sets:
31036 +
31037 +  dcl \&x[] = euc ucs2 utf8             ; transfer character-sets
31038 +  dcl \&y[] = eu uc ut                  ; 2-letter abbreviations for them
31039 +  dcl \&f[] = shift euc jis7 ucs2 utf8  ; file character-sets
31040 +  dcl \&g[] = sj eu j7 uc ut            ; 2-letter abbreviations
31041 +
31042 +  set file char shift-jis               ; local file character-set is Shift-JIS
31043 +  for \%i 1 \fdim(&x) 1 {               ; for each transfer character-set...
31044 +      set xfer char \&x[\%i]            ; set it
31045 +      for \%j 1 \fdim(&f) 1 {           ; for each remote file character-set...
31046 +          remote set file char \&f[\%j] ; set it
31047 +          if fail exit 1 SERVER REJECTED CHARSET
31048 +          send /text meibo-sj.html meibo-sj-\&y[\%i]-\&g[\%j].txt ; send the fil
31049 +e
31050 +          if fail exit 1 TRANSFER FAILED
31051 +      }
31052 +  }
31053 +
31054 +   The Kermit-370 server does not support REMOTE SET FILE CHARACTER-SET,
31055 +   but since it supports REMOTE KERMIT commands, you can get the same
31056 +   effect with REMOTE KERMIT SET FILE CHARACTER-SET name.
31057 +
31058 +  7. SCRIPT PROGRAMMING
31059 +
31060 +   (Also see [558]Section 2.8, Scripting Local Programs.)
31061 +
31062 +  7.0. Bug Fixes
31063 +
31064 +   The following script programming bugs were fixed in C-Kermit 7.0:
31065 +
31066 +     * IF EXIST and IF DIRECTORY were fixed to properly strip braces from
31067 +       around their arguments, so "if directory {C:\Program Files}", etc,
31068 +       would work as expected. However, this means that if the file or
31069 +       directory name is actually enclosed in braces, the braces must be
31070 +       doubled.
31071 +     * The READ command did not fail if the READ file wasn't open; now it
31072 +       does.
31073 +     * The READ command refused to read the last or only line of a file if
31074 +       it did not end with a proper line terminator; now it does.
31075 +     * The END command, when given from within a SWITCH statement, did not
31076 +       exit from the current macro or command file; instead it just
31077 +       terminated the SWITCH.
31078 +
31079 +  7.1. The INPUT Command
31080 +
31081 +   7.1.1. INPUT Timeouts
31082 +
31083 +   The description of the INPUT command on page 422 fails to mention the
31084 +   following two points about the timeout (which apply to C-Kermit 6.0 and
31085 +   later):
31086 +
31087 +    1. "INPUT -1 text" (or "INPUT \%x text", where \%x is any variable
31088 +       whose value is -1 or less) means "wait forever". This form of the
31089 +       INPUT command fails only if it is interrupted, since it will never
31090 +       time out.
31091 +    2. INPUT 0 performs a nonblocking read of material that has already
31092 +       arrived but has not yet been read, and succeeds immediately if the
31093 +       target string is found, or fails immediately if it is not found.
31094 +
31095 +   The same points apply to MINPUT. REINPUT ignores its timeout parameter.
31096 +
31097 +    7.1.2. New INPUT Controls
31098 +
31099 +   The following new INPUT controls were added in version 7.0:
31100 +
31101 +   SET INPUT AUTODOWNLOAD { ON, OFF }
31102 +          Explained in [559]Section 7.7.
31103 +
31104 +   SET INPUT CANCELLATION { ON, OFF }
31105 +          This governs whether an INPUT command can be canceled by
31106 +          "pressing any key" on the keyboard. Normally it can be, in which
31107 +          case the INPUT command fails immediately and \v(instatus) is set
31108 +          to 2, indicating interruption. SET INPUT CANCELLATION OFF
31109 +          disables keyboard cancellations; thus if the search text is not
31110 +          encountered, the INPUT command will run for its entire timeout
31111 +          interval. SET INPUT CANCELLATION OFF does not disable
31112 +          interruption by Ctrl-C, however; every command needs an
31113 +          emergency exit. (If you really want to disable interruption by
31114 +          Ctrl-C, use SET COMMAND INTERRUPTION OFF.)
31115 +
31116 +   Also see [560]Section 7.2 for any new variables related to INPUT.
31117 +
31118 +    7.1.3. INPUT with Pattern Matching
31119 +
31120 +   C-Kermit 7.0 allows INPUT, MINPUT, and REINPUT targets to be a pattern
31121 +   (explained in [561]Sections 1.19 and [562]4.9). This solves a
31122 +   long-standing problem illustrated by the following scenario: a certain
31123 +   company has a bank of TCP/IP modem servers, with hostnames server1,
31124 +   server2, server3, and so on. Each server's prompt is its name, followed
31125 +   by a colon (:), for example "Server72:". Without INPUT patterns, it
31126 +   would be rather difficult to wait for the prompt. The brute force
31127 +   approach:
31128 +
31129 +  minput 20 Server1: Server2: Server3: ... (enumerating each one)
31130 +
31131 +   is subject to failure whenever a new server is added. A more subtle
31132 +   approach:
31133 +
31134 +  input 20 Server
31135 +  if fail ...
31136 +  input 2 :
31137 +
31138 +   is liable to false positives, e.g. "Welcome to the XYZ Corp Modem
31139 +   Server. Please read the following message:"...
31140 +
31141 +   With patterns, you can match the prompt with "Server*:" (which doesn't
31142 +   solve the "false positives" problem, but certainly is more compact than
31143 +   the brute force method), or with more specific patterns such as
31144 +   "Server[1-9]:" and "Server[1-9][0-9]:", or equivalently:
31145 +
31146 +  Server{[1-9],[1-9][0-9]}:
31147 +
31148 +   meaning the word "Server" followed by a single digit (1-9) or by two
31149 +   digits representing a number from 1 to 99, followed by a colon.
31150 +
31151 +   INPUT pattern matching has been added in a way that does not interfere
31152 +   with existing scripts. No new commands or switches are used. The simple
31153 +   rule is: if an INPUT search target is the argument of the (new)
31154 +   \fpattern() function, it is a pattern. Otherwise it is taken literally,
31155 +   as before. For example:
31156 +
31157 +  input 5 a*b
31158 +
31159 +   searches for an 'a' followed by an asterisk ('*'), followed by a 'b'.
31160 +   But:
31161 +
31162 +  input 5 \fpattern(a*b)
31163 +
31164 +   searches for an 'a' followed by anything at all up to and including the
31165 +   first 'b'. This means that any search target to INPUT, MINPUT, or
31166 +   REINPUT can be a pattern or a literal string, and in particular that
31167 +   MINPUT can accommodate any mixture of patterns and literal strings.
31168 +
31169 +   In selecting patterns, note that:
31170 +
31171 +     * A leading '*' is always implied so there is no need to include one.
31172 +     * A trailing '*' is meaningless and ignored.
31173 +     * A '*' by itself matches the first character that arrives.
31174 +
31175 +   A syntax note: If your pattern is a selection list, meaning a list of
31176 +   alternatives separated by commas and enclosed in braces, then the outer
31177 +   braces will be stripped by various levels of parsers, so you must
31178 +   include three of each:
31179 +
31180 +  input 10 \fpattern({{{abc,mno,xyz}}})
31181 +
31182 +   Note that this is equivalent to:
31183 +
31184 +  minput 10 abc mno xyz
31185 +
31186 +   except for the setting of the \v(minput) variable.
31187 +
31188 +   And a caution: INPUT pattern matching has a limitation that you
31189 +   probably never noticed with literal-string matching, namely that there
31190 +   is a limit on the size of the match. For example, if the pattern is
31191 +   "a*b", the match will succeed if the 'a' and 'b' are not separated by
31192 +   more than (say) 8K bytes, but will fail if they are farther apart than
31193 +   that. In such cases, it better to use two INPUTs (e.g. "input 10 a" and
31194 +   then "input 100 b").
31195 +
31196 +    7.1.4. The INPUT Match Result
31197 +
31198 +   The result of any INPUT, MINPUT, or REINPUT command, no matter whether
31199 +   the search targets are patterns or literal strings, is available in the
31200 +   new \v(inmatch) variable. For example:
31201 +
31202 +  minput 10 cat \fpattern([dh]og)
31203 +  if success echo MINPUT matched "\v(inmatch)"
31204 +
31205 +   This is especially useful when a pattern was matched, since it makes
31206 +   the string that matched the pattern available to Kermit; there would be
31207 +   no way to get it otherwise.
31208 +
31209 +   After an INPUT command, you can view all the INPUT-related variables by
31210 +   typing "show variables in" (abbreviate as "sho var in"), which shows
31211 +   the values of all built-in variables whose names start with "in".
31212 +
31213 +  7.2. New or Improved Built-In Variables
31214 +
31215 +   \v(blockcheck)
31216 +          Current BLOCK-CHECK setting, 1, 2, 3, or 4. 4 is the code for
31217 +          BLANK-FREE-2.
31218 +
31219 +   \v(byteorder)
31220 +          The machine's byte order: 0 = Big Endian, 1 = Little Endian.
31221 +
31222 +   \v(cmdbufsize)
31223 +          The length of the command buffer, which is the maximum size for
31224 +          a macro, a command, a variable, or anything else in C-Kermit's
31225 +          script language.
31226 +
31227 +   \v(ctty)
31228 +          The device name of C-Kermit's controlling (login) terminal.
31229 +
31230 +   \v(filename)
31231 +          Described in [563]Sections 4.1 and [564]4.2.
31232 +
31233 +   \v(filenumber)
31234 +          Described in [565]Sections 4.1 and [566]4.2.
31235 +
31236 +   \v(filespec)
31237 +          As of C-Kermit 7.0, contains fully qualified filenames rather
31238 +          than (usually) relative ones.
31239 +
31240 +   \v(return)
31241 +          Now holds the END n value of the macro that most recently
31242 +          returned, in case END was used rather than RETURN.
31243 +
31244 +   \v(editor)
31245 +          Pathname of preferred text editor
31246 +
31247 +   \v(editopts)
31248 +          Command-line options for editor
31249 +
31250 +   \v(editfile)
31251 +          File most recently edited
31252 +
31253 +   \v(browser)
31254 +          Pathname of preferred Web browser
31255 +
31256 +   \v(browsopts)
31257 +          Command-line options for Web browser
31258 +
31259 +   \v(browsurl)
31260 +          URL most recently given to Web browser
31261 +
31262 +   \v(dialtype)
31263 +          Type of call most recently placed (see [567]Section 2.1.11).
31264 +
31265 +   \v(kbchar)
31266 +          The character, if any, that was typed at the keyboard to to
31267 +          interrupt the most recent PAUSE, SLEEP, WAIT, MSLEEP, or INPUT
31268 +          command; empty if the most recent such command was not
31269 +          interrupted from the keyboard.
31270 +
31271 +   \v(lockdir)
31272 +          UNIX only - The name of the UUCP lockfile directory, if known,
31273 +          otherwise "(unknown)".
31274 +
31275 +   \v(lockpid)
31276 +          UNIX only - PID of process that owns the communication port that
31277 +          you tried to open with a SET LINE command that failed because
31278 +          the port was in use, otherwise empty. This variable is set with
31279 +          every SET LINE command.
31280 +
31281 +   \v(cx_time)
31282 +          If no connection (SET HOST, SET LINE, DIAL, TELNET, etc) is
31283 +          active, this is 0. If a connection is active, this is the number
31284 +          of seconds since the connection was made.
31285 +
31286 +   \v(hwparity)
31287 +          If hardware parity is in effect, this variable gives its value,
31288 +          such as "even" or "odd" (in which case, the \v(parity) variable
31289 +          will be "none"). Otherwise this variable is empty.
31290 +
31291 +   \v(serial)
31292 +          Current serial port settings in 8N1 format ([568]Section 2.10).
31293 +
31294 +   \v(errno)
31295 +          In UNIX, the current value of the C runtime errno variable,
31296 +          which is quite volatile (meaning that often an "interesting"
31297 +          error code can be overwritten by some other library call or
31298 +          system service that sets errno before you have a chance to look
31299 +          at it). In VMS, the error code returned by the system or library
31300 +          call that most recently failed (success codes are not saved).
31301 +          Not available in other operating systems.
31302 +
31303 +   \v(errstring)
31304 +          The UNIX or VMS system error message that corresponds to
31305 +          \v(errno). Not available in all OS's. Also see
31306 +          [569]\ferrstring().
31307 +
31308 +   \v(setlinemsg)
31309 +          The error message, if any, from the most recent SET LINE, SET
31310 +          PORT, SET HOST, TELNET, or other connection-making command. This
31311 +          is not necessarily the same as \v(errstring) since these
31312 +          commands might fail without generating a system error code, for
31313 +          example (in UNIX) because a lockfile existed indicating the
31314 +          device was assigned by another user.
31315 +
31316 +   \v(exitstatus)
31317 +          The exit status C-Kermit would return if it exited now.
31318 +
31319 +   \v(pexitstat)
31320 +          The exit status of the inferior process most recently invoked by
31321 +          C-Kermit (by RUN, !, REDIRECT, SEND /COMMAND, etc). In VMS, this
31322 +          code can be given to \ferrstring() to get the corresponding
31323 +          error message (in UNIX, program/command return codes are not the
31324 +          same as system error codes). Not available in operating systems
31325 +          other than UNIX and VMS. See [570]Section 4.2.5 for details.
31326 +
31327 +   \v(inmatch)
31328 +          The incoming string of characters, if any, that matched the most
31329 +          recent INPUT, REINPUT, or MINPUT command.
31330 +
31331 +   \v(intime)
31332 +          The number of milliseconds (thousandths of seconds) it took for
31333 +          the most recent INPUT command to find its match, or -1 if no
31334 +          INPUT command has been given yet. If the INPUT command timed
31335 +          out, the value is approximately equal to 1000 times the INPUT
31336 +          timeout. If INPUT failed for some other reason, the value is
31337 +          undefined (\v(instatus) gives INPUT completion status). If your
31338 +          version of C-Kermit is built without high-precision
31339 +          floating-point timers, this number will always be a multiple of
31340 +          1000.
31341 +
31342 +   \v(inwait)
31343 +          The number of seconds specified as the timeout in the most
31344 +          recent INPUT command.
31345 +
31346 +   \v(dialsuffix)
31347 +          Dialing suffix for use during PDIAL sequence; see [571]Section
31348 +          2.1.10.
31349 +
31350 +   \v(pid)
31351 +          UNIX, VMS, and K95 only. C-Kermit's primary process ID, numeric,
31352 +          decimal. If you want to show it in hex, use \fn2hex(\v(pid)) If
31353 +          you want to show it in octal, use \fn2octal(\v(pid)).
31354 +
31355 +   \v(printer)
31356 +          Current printer name or SET PRINTER value.
31357 +
31358 +   \v(p_ctl)
31359 +          Control prefix char \v(p_8bit) 8-bit prefix char (if parity not
31360 +          none)
31361 +
31362 +   \v(p_rpt)
31363 +          Repeat prefix char (if repeat compression enabled)
31364 +
31365 +   \v(herald)
31366 +          Kermit's version herald
31367 +
31368 +   \v(test)
31369 +          Kermit's test version, if any, or 0 if this is not a test
31370 +          version. Typical values for test versions are "Alpha.03" or
31371 +          "Beta.14".
31372 +
31373 +   \v(sendlist)
31374 +          The number of entries in the SEND-LIST, 0 if none. Note: entries
31375 +          do not necessarily correspond to files, since an entry might
31376 +          contain wildcards. Also note that the value does not go back to
31377 +          0 after the files in the list are sent. To reset this variable,
31378 +          use CLEAR SEND-LIST. The purpose of this variable is to
31379 +          determine if a SEND command, when given without any filenames,
31380 +          will be legal. Example:
31381 +
31382 +  xif \v(sendlist) { send } else { send oofa.txt }
31383 +
31384 +   \v(trigger)
31385 +          If the most recent CONNECT session was terminated automatically
31386 +          by a trigger, this variable contains the trigger value.
31387 +
31388 +   \v(ty_ln)
31389 +          TYPE line number (during TYPE)
31390 +
31391 +   \v(ty_lc)
31392 +          TYPE line count (after TYPE)
31393 +
31394 +   \v(ty_mc)
31395 +          TYPE match count (after TYPE)
31396 +
31397 +   \v(xferstat)
31398 +          Status of most recent file transfer:
31399 +
31400 +-1: No transfer yet
31401 + 0: Succeeded
31402 + 1: Failed
31403 +
31404 +   \v(xfermsg)
31405 +          If the most recent file transfer failed, this is the reason. If
31406 +          it succeeded, \v(xfermsg) is an empty string.
31407 +
31408 +   \v(tftime)
31409 +          Total elapsed time of most recent file transfer operation, in
31410 +          seconds.
31411 +
31412 +   \v(textdir)
31413 +          Directory that holds (or is supposed to hold) Kermit text files
31414 +          such as installation instructions, release notes, update notes,
31415 +          read-me files, "beware" files, etc.
31416 +
31417 +   \v(name)
31418 +          The name with which the Kermit program was invoked, e.g.
31419 +          "kermit", "wermit", "k95", "k2", etc (see [572]Section 9.1).
31420 +
31421 +   \v(osname)
31422 +          Name of operating system on computer where C-Kermit is running,
31423 +          obtained at runtime (from uname or equivalent).
31424 +
31425 +   \v(osversion)
31426 +          Version of operating system on computer where C-Kermit is
31427 +          running, obtained at runtime (from uname or equivalent).
31428 +
31429 +   \v(osrelease)
31430 +          Release of operating system on computer where C-Kermit is
31431 +          running, obtained at runtime (from uname or equivalent).
31432 +
31433 +   \v(model)
31434 +          The specific hardware model of the computer where C-Kermit is
31435 +          running, if known.
31436 +
31437 +   \v(math_pi)
31438 +          The value of Pi (see [573]Section 7.23)
31439 +
31440 +   \v(math_e)
31441 +          The value of e (see [574]Section 7.23)
31442 +
31443 +   \v(math_precision)
31444 +          How many significant digits in a floating-point number.
31445 +
31446 +   \v(f_count)
31447 +          Result of the most recent FILE COUNT (FCOUNT) command.
31448 +
31449 +   \v(f_error)
31450 +          Numeric error code of most recent FILE command.
31451 +
31452 +   \v(f_max)
31453 +          Maximum number of files open simultaneously.
31454 +
31455 +   The math constants are given in the precision of underlying computer's
31456 +   floating-point arithmetic.
31457 +
31458 +   Note the distinction between \v(osname), \v(osversion), and
31459 +   \v(platform); the latter refers to the platform for which and/or upon
31460 +   which C-Kermit was built, as opposed to the one on which it is actually
31461 +   running. Also note that each operating system can, and probably will,
31462 +   interpret and fill in the os* variables differently, or not at all.
31463 +
31464 +   The SHOW VARIABLES command now accepts a variable name, prefix, or
31465 +   pattern:
31466 +
31467 +  show variables         Shows all variables.
31468 +  show variables t       Shows all variables that start with "t".
31469 +  show variables *ver*   Shows all variables whose names contain "ver".
31470 +  show variables *ver    Ditto (an implied "*" is appended).
31471 +
31472 +  7.3. New or Improved Built-In Functions
31473 +
31474 +   The following new file-i/o functions are explained in [575]Section
31475 +   1.22.
31476 +
31477 +  \f_status(channel)           Status of file open on channel
31478 +  \f_pos(channel)              Read/write (byte) pointer of given file
31479 +  \f_line(channel)             Current line of file
31480 +  \f_handle(channel)           Handle of file
31481 +  \f_eof(channel)              Whether given file is at EOF
31482 +  \f_getchar(channel)          Read a char from given file
31483 +  \f_getline(channel)          Read a line from given file
31484 +  \f_getblock(channel,n)       Read a block from given file
31485 +  \f_putchar(channel,c)        Write a char to given file
31486 +  \f_putline(channel,string)   Write a line to given file
31487 +  \f_putblock(channel,string)  Write a block to given file
31488 +
31489 +   The following new date-time-related functions are explained in
31490 +   [576]Section 1.6:
31491 +
31492 +  \fday()                Returns day of week of given date
31493 +  \fnday()               Returns numeric day of week of given date
31494 +  \ftime()               Returns time portion of given date-time
31495 +  \fntime()              Converts time to seconds since midnight
31496 +  \fn2time()             Converts seconds since midnight to hh:mm:ss
31497 +  \fcvtdate(date-time)   Converts free-format date to yyyymmdd hh:mm:ss
31498 +  \fdayofyear(date-time) Converts date to yyyyddd (day-of-year) format
31499 +  \fdoy(date-time)       Synonym for \fdayofyear()
31500 +  \fdoy2date(dayofyear)  Converts yyyyddd to yyyymmdd
31501 +  \fmjd(date-time)       Converts free-format date to Modified Julian Date
31502 +  \fmjd2date(mjd)        Converts modified Julian date to yyyymmdd
31503 +
31504 +   The new floating-point arithmetic functions are explained in
31505 +   [577]Section 7.23. f1 and f2 are floating-point (real) numbers; d is
31506 +   the number of decimal places to show:
31507 +
31508 +  \ffpabsolute(f1,d)     Absolute value of f1
31509 +  \ffpadd(f1,f2,d)       f1 + f1
31510 +  \ffpcosine(f1,d)       Cosine of f1
31511 +  \ffpdivide(f1,f2,d)    f1 divided by f2
31512 +  \ffpexp(f1,d)          e to the f1 power
31513 +  \ffpint(f1)            Integer part of f1
31514 +  \ffplog10(f1,d)        Log base 10 of f1
31515 +  \ffplogn(f1,d)         Natural log of f1
31516 +  \ffpmaximum(f1,f2,d)   Maximum of f1 and f2
31517 +  \ffpminimum(f1,f2,d)   Minimum of f1 and f2
31518 +  \ffpmodulus(f1,f2,d)   Modulus of f1 and f2
31519 +  \ffpmultiply(f1,f2,d)  Product of f1 and f2
31520 +  \ffpraise(f1,f2,d)     Raise f1 to power f2
31521 +  \ffpround(f1,d)        Round f1 to d places
31522 +  \ffpsine(f1,d)         Sine of f1
31523 +  \ffpsqrt(f1,d)         Square root of f1
31524 +  \ffpsubtract(f1,f2,d)  f2 - f1
31525 +  \ffptangent(f1,d)      Tangent of f1
31526 +
31527 +   Integer number functions:
31528 +
31529 +   \fabsolute(n)
31530 +          Absolute value of integer n.
31531 +
31532 +   \frandom(n)
31533 +          Returns a random integer between 0 and n-1.
31534 +
31535 +   \fradix(s,n1,n2)
31536 +          If the string s is an integer in radix n1, the result is the
31537 +          same number expressed in radix n2, where n1 and n2 may be any
31538 +          number from 2 through 36, expressed as decimal numbers, or
31539 +          variables (etc) that evaluate to decimal numbers. For the source
31540 +          and result, the digits of any radix, r, are the first r
31541 +          characters in the sequence 0-9,a-z (case doesn't matter for the
31542 +          letters). The string s may have a sign, + or -; if it starts
31543 +          with a minus (-) sign, the result also has a minus sign.
31544 +
31545 +   The \fradix() function does not work with floating-point numbers. It
31546 +   does not reveal the internal storage format of a number; for example,
31547 +   \fradix(-1,10,16) is -1, not something like FFFFFFFFFF. If all three
31548 +   arguments are not given, or if n1 or n2 are not numbers between 2 and
31549 +   36 inclusive, or s is not a number in radix n1, an error occurs and the
31550 +   empty string is returned. \fradix() also does not offer
31551 +   extended-precision arithmetic; number values are limited to those
31552 +   expressed as a long integer in the architecture of the underlying
31553 +   computer, usually 32 or 64 bits. If you give it an argument whose
31554 +   absolute value is larger than can be held in an unsigned long, the
31555 +   result is -1.
31556 +
31557 +   The next four are shorthand functions for decimal/hexadecimal and
31558 +   decimal/octal number conversion:
31559 +
31560 +   \fn2hex(n)
31561 +          Returns the hexadecimal (base 16) representation of the integer
31562 +          n. This is different from \fhexify(s), which treats its argument
31563 +          as a string rather than a number. The result is always
31564 +          left-padded with 0's to make its length even. Examples:
31565 +
31566 +  \n2hex(0)   = "00"                    \fhexify(0)   = "30"
31567 +  \n2hex(255) = "ff"                    \fhexify(255) = "323535"
31568 +  \n2hex(256) = "0100"                  \fhexify(256) = "323536"
31569 +
31570 +   \fhex2n(x)
31571 +          Converts hexadecimal number x to decimal equivalent decimal
31572 +          number. This is the inverse of \fn2hex(). Equivalent to
31573 +          \fradix(s,16,10).
31574 +
31575 +   \fn2octal(n)
31576 +          Returns the octal (base 8) representation of the number n.
31577 +          Examples:
31578 +
31579 +  \n2octal(0) = "0"
31580 +  \n2oct(255) = "377"
31581 +  \n2oct(256) = "400"
31582 +  Equivalent to \fradix(n,10,8).
31583 +
31584 +   \foct2n(n)
31585 +          Returns the decimal representation of the given octal number, n.
31586 +          The inverse of \fn2octal(). Equivalent to \fradix(n,8,10).
31587 +
31588 +   String functions:
31589 +
31590 +   \s(name[n:m])
31591 +          Equivalent to \fsubstring(\m(name),n,m) ([578]Section 7.24).
31592 +
31593 +   \:(name[n:m])
31594 +          Equivalent to \fsubstring(name,n,m) (where "name" is any
31595 +          \-quantity) ([579]Section 7.24).
31596 +
31597 +   \fleft(s,n)
31598 +          The leftmost ncharacters of string s; equivalent to
31599 +          \fsubstring(s,1,n).
31600 +
31601 +   \fstripx(string,char)
31602 +          Returns the part of the string up to the rightmost occurrence,
31603 +          if any, of the given character. The default character is period
31604 +          (.) Examples:
31605 +
31606 +  \fstripx(foo/bar,/)                 = "foo"
31607 +  \fstripx(foo/bar/baz,/)             = "foo/bar"
31608 +  \fstripx(autoexec.bat,.)            = "autoexec"
31609 +  \fstripx(autoexec.bat)              = "autoexec"
31610 +  \fstripx(fstripx(foo/bar/baz,/),/)  = "foo"
31611 +
31612 +   \flop(string,character)
31613 +          Returns the portion of the string starting after the first
31614 +          occurrence of the given character. The default character is
31615 +          period (.) Examples:
31616 +
31617 +  \flop(autoexec.bat)                 = "bat"
31618 +  \flop(baz.foo/bar)                  = "foo/bar"
31619 +  \flop(baz.foo/bar,/)                = "bar
31620 +
31621 +   \fstripn(string,n)
31622 +          Returns the string with ncharacters removed from the end.
31623 +          Example:
31624 +
31625 +  \fstripn(12345678,3)                = "12345"
31626 +
31627 +          (For more discussion of \fstripx(), \fstripn(), and \flop() see
31628 +          [580]Section 4.2.3).
31629 +
31630 +   \fb64encode(s)
31631 +          Returns the Base-64 encoding of the string s.
31632 +
31633 +   \fb64decode(s)
31634 +          Returns the decoding of the Base-64 string s. Fails if s is not
31635 +          a Base-64 string, or if its length is not a multiple of 4. Note
31636 +          that if any of the result bytes are null (0), the result string
31637 +          stops there. There is no way to represent strings that contain
31638 +          null bytes in C-Kermit (the same is true for \funhexify()).
31639 +
31640 +   \fword(s1,n,s2,s3)
31641 +          Extracts word number nfrom string s1. By default, a "word" is
31642 +          any sequence of ASCII letters or digits; nis 1-based. If n is
31643 +          omitted, "1" is used. Examples:
31644 +
31645 +  \fword(one two three)    = "one"
31646 +  \fword(one two three,1)  = "one"
31647 +  \fword(one two three,2)  = "two"
31648 +  \fword(one two three,3)  = "three"
31649 +
31650 +          and:
31651 +
31652 +    \fword(\v(dialresult),2) = "31200"
31653 +
31654 +          is "31200" if \v(dialresult) is (e.g.) "CONNECT
31655 +          31200/ARQ/V32/LAPM/V42BIS".
31656 +
31657 +          If you include s2, this replaces the default break set. For
31658 +          example, suppose you have a string \%a whose value is:
31659 +
31660 +  $150.00 $300.00 $39.95
31661 +
31662 +          and you want each dollar amount to be a word; use:
31663 +
31664 +  \fword(\%a,\%n,{ })
31665 +
31666 +          This returns dollar amount number \%n, e.g. "$300.00" for \%n =
31667 +          2. "{ }" denotes a space (you must enclose it in braces,
31668 +          otherwise it is squeezed out). Note that ASCII control
31669 +          characters are always included in the break set; you don't have
31670 +          to specify them (and you can't not specify them).
31671 +
31672 +          The optional s3 argument lists characters (even control
31673 +          characters) that normally would be considered separators that
31674 +          you want included in words. So the dollars-and-cents example
31675 +          could also be handled this way:
31676 +
31677 +  \fword(\%a,\%n,,$.)
31678 +
31679 +          in other words, use the default separator list, but remove "$"
31680 +          and "." from it so they will be considered part of a word.
31681 +
31682 +          Note that since 8-bit characters are not ASCII, they act as
31683 +          break characters unless you put them in the include list.
31684 +          Suppose, for example, you have a file in which each line is a
31685 +          Tab-separated list of words, numbers, or phrases that might
31686 +          contain puncuation, special characters like $ and @, 8-bit bit
31687 +          characters, etc (like something that might have been exported
31688 +          from a spreadsheet or database), and you want to split only on
31689 +          Tab; here is a way (\m(line) is a line read from the file):
31690 +
31691 +undef keep
31692 +for \%i 1 255 1 {
31693 +    if == \%i 9 continue
31694 +    .keep := \m(keep)\fchar(\%i)
31695 +}
31696 +while true {
31697 +    fread /line \%c line
31698 +    if fail break
31699 +    .\%n := \fsplit(\m(line),&a,\9,\m(keep))
31700 +    ...
31701 +}
31702 +
31703 +          This problem is addressed in [581]C-Kermit 9.0.
31704 +
31705 +   \fsplit(s1,&a,s2,s3)
31706 +          This is like \fword(), except instead of extracting and
31707 +          returning a particular word from string s1, it counts the words
31708 +          and optionally assigns them to the array whose identifying
31709 +          letter, a-z, is given after the "&" in the second argument, with
31710 +          the first word going into element 1, the second into element 2,
31711 +          and so on. The rules regarding break and include lists (s2 and
31712 +          s3) are exactly the same as for \fword(). \fsplit() returns the
31713 +          number of words that were assigned, which is either the number
31714 +          of words in the string, or the dimension of the array, whichever
31715 +          is less. If the array is not declared, \fsplit() creates it and
31716 +          returns a number which is both the number of words in s1 and the
31717 +          dimension of the new array. Examples:
31718 +
31719 +  declare \&w[20]        ; (Optional.)
31720 +  ...
31721 +  read \%s               ; \%s is "This is a sentence with seven words."
31722 +  ...
31723 +  echo "\fsplit(\%s)"    ; This would print "7".
31724 +  echo "\fsplit(\%s,&w)" ; Ditto, and also assigns them to array \&w[].
31725 +
31726 +  echo "\&w[7]"          ; This would print "words".
31727 +
31728 +          If the line contained fields that were delimited by colon (:),
31729 +          you would use \fsplit(\%s,&w,:). If the fields were delimited by
31730 +          comma, then you would use \fsplit(\%s,&w,{,}); in this case the
31731 +          literal comma must be enclosed in braces to distinguish it from
31732 +          the comma that separates function arguments. To get a word count
31733 +          without loading an array, but still specify break and/or include
31734 +          lists, leave the array argument empty:
31735 +
31736 +   echo "\fsplit(\%s,,:)" ; Use colon as the separator.
31737 +
31738 +          WARNINGS:
31739 +
31740 +         1. If you use the same array repeatedly, \fsplit() leaves any
31741 +            trailing members undisturbed. For example:
31742 +  dcl \&w[10]
31743 +  \fsplit(1 2 3 4 5,&w) ; Sets \&w[1] thru \&w[5].
31744 +  \fsplit(a b c,&w)     ; Sets \&w[1]-[3] leaving [4]-[5] as they were.
31745 +
31746 +         2. If you allow \fsplit to create the array (by not declaring it
31747 +            first), it is dimensioned to the number of elements it was
31748 +            created with:
31749 +  \fsplit(1 2 3,&x)     ; Creates an array \&x[] with 3 elements.
31750 +  \fsplit(a b c d e,&x) ; This overflows the array.
31751 +
31752 +          Thus if you want to use \fsplit() repeatedly on the same array,
31753 +          either dimension it in advance to the maximum expected size (and
31754 +          then some -- more efficient), or else destroy it after each use
31755 +          (to allow for unexpectedly large arguments). Example using a
31756 +          dynamic array:
31757 +
31758 +  fopen /read \%c some-file
31759 +  if fail ...
31760 +  set function error on    ; See [582]Section 7.12
31761 +  while true {
31762 +      dcl \&w[]            ; Destroy \&[w] each time thru the loop
31763 +      fread /line \%c \%a
31764 +      if fail break
31765 +      asg \%x \fsplit(\%a,&w)
31766 +      if fail ...
31767 +      ; (do what you want with \&w[] here...)
31768 +  }
31769 +  fclose \%c
31770 +
31771 +   \frindex(s1,s2,n)
31772 +          The "n" argument to \frindex() now works consistently (in mirror
31773 +          image) with the corresponding \findex() argument. In each case,
31774 +          the (n-1)-most characters of s2 are ignored in the search; for
31775 +          findex, this means the starting position of the search is n (the
31776 +          default n is 1, and 0 is treated like 1). For \frindex() it
31777 +          means the default starting point is:
31778 +
31779 +  length(s2) - length(s1) - n (with the same defaults for n).
31780 +
31781 +   \fsearch(pattern,string[,position])
31782 +          Exactly like \findex(), except with a pattern (see [583]Section
31783 +          7.9) rather than a literal string.
31784 +
31785 +   \frsearch(pattern,string[,position])
31786 +          Exactly like \frindex(), except with a pattern rather than a
31787 +          literal string.
31788 +
31789 +          File Functions:
31790 +
31791 +   \ffiles(), \fnextfile()
31792 +          It is no longer necessary to copy the file list to an array
31793 +          before use, as shown on p.398 of [584]Using C-Kermit 2nd
31794 +          Edition. \ffiles() and friends now make their own safe copies of
31795 +          the file list. Thus constructions like the following are now
31796 +          possible:
31797 +
31798 +  for \%i 1 \ffiles(*.txt) 1 { send \fnextfile() }
31799 +
31800 +          The same is true for the new function \frfiles(),
31801 +          \fdirectories(), and \frdirectories(), described in [585]Section
31802 +          4.11.3.
31803 +
31804 +          But note that each reference to \fnextfile() still gets you the
31805 +          next file. So "if newer \fnextfile() foo.txt send \fnextfile()"
31806 +          compares one file's age with that of foo.txt, and then sends an
31807 +          entirely different file. If you're going to refer to the same
31808 +          file more than once, assign it to a variable:
31809 +
31810 +  asg \%f \fnextfile()
31811 +  if newer \%f foo.txt send \%f
31812 +
31813 +          (note: assign, not define).
31814 +
31815 +          Also note that \ffiles(), \frfiles(), \fdirectories(), and
31816 +          \frdirectories() all now accept on optional 2nd argument: the
31817 +          name of an array to load with the resulting file or directory
31818 +          list, explained in [586]Section 4.11.3. So you can also load an
31819 +          array with the filelist when you need to refer to the same file
31820 +          more than once:
31821 +
31822 +  for \%i 1 \ffiles(*,&a) 1 { if newer \&a[\%i] foo.txt send \&a[\%i] }
31823 +
31824 +   \fpermissions(file)
31825 +          Returns the platform-specific permissions string for the file,
31826 +          such as "-rw-rw-r--" in UNIX or "(RWE,RWE,RE,E)" in VMS.
31827 +
31828 +   \fdirname(f)
31829 +          Given a file specification f, this function returns the complete
31830 +          pathname of directory the file is in.
31831 +
31832 +   Array Functions:
31833 +
31834 +   \fdimension(&a)
31835 +          Returns the dimension declared for the array whose identifying
31836 +          letter, a-z, or special character "_" or "@", is given after the
31837 +          "&" in the argument. If the array is not declared, 0 is
31838 +          returned. Note that when used with the macro argument vector
31839 +          array, \&_[] (see [587]Section 7.5), the value of this function
31840 +          is one less than \v(argc), and when used with the C-Kermit
31841 +          command-line argument vector array, \&@[], it is equal to the
31842 +          \v(args) variable. Examples:
31843 +
31844 +  echo \fdimension(&a)       ; Not declared.
31845 +  0
31846 +  declare \&a[12]            ; Now it's declared.
31847 +  echo \fdim(&a)
31848 +  12
31849 +
31850 +   \farraylook(pattern,arrayname)
31851 +          Looks in the given array for the pattern and returns the index
31852 +          of the first element that matches, if any, or -1 if none match.
31853 +          The arrayname can include a range specifier to restrict to
31854 +          search to a segment of the array, e.g.
31855 +          \farraylook(*xyz*,&a[32:63]). For greater detail see
31856 +          [588]Section 7.10.7.
31857 +
31858 +   \ftablelook(keyword,arrayname[,delimiter])
31859 +          Looks in the given "table", which must be sorted, for the given
31860 +          keyword. Returns the index of the table element that uniquely
31861 +          matches the given keyword, or -1 if none match, or -2 if more
31862 +          than 1 match. For greater detail see [589]Section 7.10.7.
31863 +
31864 +   Other new functions:
31865 +
31866 +   \fip2hex(s)
31867 +          Converts a dotted decimal IP address to an 8-digit hexadecimal
31868 +          number. \fip2hex(128.59.39.2) = 803b2702.
31869 +
31870 +   \fhex2ip(x)
31871 +          Converts an 8-digit hexadecimal IP address to dotted decimal
31872 +          form, e.g. \fhex2ip(803b2702) = 128.59.39.2. The inverse of
31873 +          \fip2hex().
31874 +
31875 +   \fcommand()
31876 +   \frawcommand()
31877 +          These run an external command and return its output; see
31878 +          [590]Section 4.2.8.4.
31879 +
31880 +   \fdialconvert(s)
31881 +          s is a phone number in either literal or portable format (not a
31882 +          dialing directory entry name). The function returns the dial
31883 +          string that would actually be used when dialing from the current
31884 +          location (after processing country code, area code, and other
31885 +          SET DIAL values).
31886 +
31887 +   \ferrstring(n)
31888 +          Returns the system error message associated with the (numeric)
31889 +          error code n. UNIX and VMS only. Use in conjunction with
31890 +          \v(errno) or \v(pexitstat). See [591]Section 4.2.5 for a usage
31891 +          example. Note: This function doesn't work in Windows because
31892 +          there is not a consistent error-code-to-message mapping; error
31893 +          code "x" means something completely different depending on
31894 +          whether it comes from the C runtime library, Winsock, a
31895 +          Windows-32 API, TAPI, etc,
31896 +
31897 +   \fpattern(s)
31898 +          Used in INPUT, REINPUT, and MINPUT commands to denote search
31899 +          strings that are to be treated as patterns rather than
31900 +          literally.
31901 +
31902 +   Also see [592]Section 7.8 on built-in help for functions.
31903 +
31904 +  7.4. New IF Conditions
31905 +
31906 +   IF AVAILABLE feature command
31907 +          Executes the command if the given feature is available.
31908 +          Presently used only to determine if specific authentication and
31909 +          encryption options are available. Type "if available ?" to see
31910 +          which features may be tested.
31911 +
31912 +   IF FLOAT f1 command
31913 +          Executes command if f1 is a legal floating point number (which
31914 +          includes integers). Use this to preverify arguments for the
31915 +          \ffp...() floating-point arithmetic functions, e.g. "if float
31916 +          \%1 echo \ffpint(\%1)".
31917 +
31918 +   IF == n1 n2 command
31919 +          Synonym for "if =" (numeric equality). Note that as of C-Kermit
31920 +          7.0, this and all other numeric comparison operators also work
31921 +          for floating-point numbers.
31922 +
31923 +   IF != n1 n2 command
31924 +          Executes the command if n1 and n2 are both numbers or variables
31925 +          containing numbers and the value of n1 is not equal to the value
31926 +          of n2. This is equivalent to "if not = n1 n2".
31927 +
31928 +   IF <= n1 n2 command
31929 +          Executes the command if n1 and n2 are both numbers or variables
31930 +          containing numbers and the value of n1 is less than or equal to
31931 +          the value of n2. This is equivalent to "if not > n1 n2".
31932 +
31933 +   IF >= n1 n2 command
31934 +          Executes the command if n1 and n2 are both numbers or variables
31935 +          containing numbers and the value of n1 is greater than or equal
31936 +          to the value of n2. Equivalent to "if not < n1 n2".
31937 +
31938 +   IF COMMAND word command
31939 +          Executes the command if word is a built-in C-Kermit command.
31940 +          Example:
31941 +
31942 +  if not command copy define { copy run copy \%1 \%2 }".
31943 +
31944 +          This defines a COPY macro that runs an external COPY command if
31945 +          COPY is not already a built-in command.
31946 +
31947 +   IF LOCAL command
31948 +          Executes the command if Kermit is in local mode, i.e. if it has
31949 +          a SET LINE, SET PORT, or SET HOST (TELNET, RLOGIN, etc) device
31950 +          or connection open. Does not execute the command if in remote
31951 +          mode.
31952 +
31953 +   IF MATCH string pattern command
31954 +          Executes the command if the string matches the pattern. For a
31955 +          description of the syntax for the pattern, see [593]Section
31956 +          4.9.1. If you want to test if the string contains pattern, use
31957 +          IF \fsearch(pattern,string).
31958 +
31959 +   IF OPEN { DEBUG-LOG, SESSION-LOG, TRANSACTION-LOG, ... } command
31960 +          Executes the command if the given file is open, fails if it is
31961 +          not open. Type IF OPEN ? for a complete list of files that can
31962 +          be checked (all the files that can be opened with the OPEN or
31963 +          LOG commands).
31964 +
31965 +   IF QUIET command
31966 +          Executes the command if SET QUIET is ON, and does not execute it
31967 +          if SET QUIET is OFF. Example: IF NOT QUIET ECHO { This is a
31968 +          message.}.
31969 +
31970 +   IF READABLE name
31971 +          Succeeds if name is the name of an existing file or directory
31972 +          that is readable.
31973 +
31974 +   IF WRITEABLE name
31975 +          Succeeds if name is the name of an existing file or directory
31976 +          that is writeable, e.g.:
31977 +
31978 +  if not writeable \v(lockdir) echo Please read installation instructions!
31979 +
31980 +   IF FLAG command
31981 +          This tests a user-settable condition, which can mean anything
31982 +          you like. SET FLAG ON causes subsequent IF FLAG commands to
31983 +          succeed; SET FLAG OFF causes them to fail. One way to use it
31984 +          would be for debugging your scripts; precede any debugging
31985 +          statements with IF FLAG. Then SET FLAG on to debug your script,
31986 +          SET FLAG OFF to run it without debugging. Another common use is
31987 +          for causing an inner loop to cause an outer loop to exit.
31988 +
31989 +   IF C-KERMIT command
31990 +          C-Kermit, but not Kermit 95 or MS-DOS Kermit, executes the
31991 +          command.
31992 +
31993 +   IF K-95 command
31994 +          Kermit 95, but not C-Kermit or MS-DOS Kermit, executes the
31995 +          command.
31996 +
31997 +   IF MS-KERMIT command
31998 +          MS-DOS Kermit, but not C-Kermit or Kermit 95, executes the
31999 +          command.
32000 +
32001 +  7.5. Using More than Ten Macro Arguments
32002 +
32003 +   The \v(argc) variable now gives the actual number of arguments, even if
32004 +   the number is greater than 9:
32005 +
32006 +  C-Kermit> define xx echo \v(argc)
32007 +  C-Kermit> xx a b c d e f g h i j k l m n o p q r s t u v w x y z
32008 +  27
32009 +
32010 +   Remember that \v(argc) includes the name of the macro itself, so it is
32011 +   always at least 1, and is always 1 greater than the actual number of
32012 +   arguments. As in versions 6.0 and earlier, if more than 9 arguments are
32013 +   given, only the first nine are assigned to the variables \%1..\%9.
32014 +
32015 +   The \&_[] array, discussed on page 353 of [594]Using C-Kermit, 2nd ed,
32016 +   now holds all the arguments, up to some implementation-dependent limit
32017 +   (64 or greater), rather than only the first 9. To illustrate: the
32018 +   following macro tells the number of arguments it was called with and
32019 +   then prints them:
32020 +
32021 +  define show_all_args {
32022 +      local \%i
32023 +      echo \&_[0] - Number of arguments: \feval(\v(argc)-1)
32024 +      for \%i 1 \v(argc)-1 1 { echo \flpad(\%i,3). "\&_[\%i]" }
32025 +  }
32026 +
32027 +   Within a macro \&_[0], like \%0, contains the name of the macro.
32028 +
32029 +   At top level, the \&_[] array is filled as follows:
32030 +
32031 +     * If the first argument on the C-Kermit command line was a filename,
32032 +       or C-Kermit was invoked from a "Kerbang" script ([595]Section
32033 +       7.19), element 0 contains the filename, and elements 1 through
32034 +       \v(argc)-1 hold the remaining command-line arguments.
32035 +     * Otherwise the program name goes in element 0, and elements 1
32036 +       through \v(argc)-1 hold any arguments that were included after "--"
32037 +       or "="
32038 +
32039 +   The new \%* variable, when used within a macro, is replaced by the text
32040 +   that followed the macro name in the macro invocation. If no arguments
32041 +   were given, \%* is replaced by the empty string. Examples:
32042 +
32043 +  C-Kermit> define xx echo [\%*]
32044 +  C-Kermit> define \%a oofa
32045 +  C-Kermit> xx
32046 +  []
32047 +  C-Kermit> xx \%a
32048 +  [oofa]
32049 +  C-Kermit> xx a
32050 +  [a]
32051 +  C-Kermit> xx a b
32052 +  [a b]
32053 +  C-Kermit> xx a b c
32054 +  [a b c]
32055 +  C-Kermit> xx a b c d e f g h i j k l m n o p q r s t u v w x y z
32056 +  [a b c d e f g h i j k l m n o p q r s t u v w x y z]
32057 +
32058 +   Note that \%* can not be used at top level, since Kermit does not have
32059 +   access to the raw command line (only to its elements separately, after
32060 +   they have been processed by the shell and the C library).
32061 +
32062 +   C-Kermit 7.0 also adds a SHIFT command:
32063 +
32064 +   SHIFT [ number ]
32065 +          Shifts the macro arguments (except argument 0) the given number
32066 +          of places to the left and adjusts \v(argc) accordingly. The
32067 +          default number is 1.
32068 +
32069 +   To illustrate, suppose macro XXX is invoked as follows:
32070 +
32071 +  xxx arg1 arg2 arg3
32072 +
32073 +   Then inside XXX, \%1 is "arg1", \%2 is "arg2", and \%3 is "arg3". After
32074 +   a SHIFT command is given inside XXX, then \%1 is "arg2", \%2 is "arg3",
32075 +   and \%3 is empty. \%0 (the name of the macro) remains unchanged.
32076 +
32077 +   If more than 9 arguments were given, then arguments are shifted into
32078 +   the \%1..9 variables from the argument vector array.
32079 +
32080 +   At top level, the SHIFT command operates on the \&_[] array and \%1..9
32081 +   variables; the \&@[] array is not affected. See [596]Section 7.16 for
32082 +   details.
32083 +
32084 +   The \%* variable is not affected by the SHIFT command.
32085 +
32086 +  7.6. Clarification of Function Call Syntax
32087 +
32088 +   Spaces are normally stripped from the front and back of each function
32089 +   argument; to prevent this enclose the argument in braces:
32090 +
32091 +  \fsplit(\%a,&a,{ })
32092 +
32093 +   However, function calls that contain spaces can make trouble when the
32094 +   function is to be used in a "word" field, since space separates words.
32095 +   For example:
32096 +
32097 +  for \%i 1 \fsplit(\%a,&a,{ }) 1 {
32098 +    echo \%i. "\&a[\%i]"
32099 +  }
32100 +
32101 +   In most cases, the trouble can be averted by enclosing the function
32102 +   reference in braces:
32103 +
32104 +  for \%i 1 {\fsplit(\%a,&a,{ })} 1 {
32105 +    echo \%i. "\&a[\%i]"
32106 +  }
32107 +
32108 +   or by replacing spaces with \32 (the ASCII code for space):
32109 +
32110 +  for \%i 1 \fsplit(\%a,&a,\32) 1 {
32111 +    echo \%i. "\&a[\%i]"
32112 +  }
32113 +
32114 +   Braces are also used in function calls to indicate grouping. For
32115 +   example:
32116 +
32117 +  \fsubstring(abcd,2,2) = "bc"
32118 +
32119 +   But suppose "abcd" needed to contain a comma:
32120 +
32121 +  \fsubstring(ab,cd,2,2)
32122 +
32123 +   This would cause an error, since "cd" appears to be the second
32124 +   argument, when really you want the first "2" to be the second argument.
32125 +   Braces to the rescue:
32126 +
32127 +  \fsubstring({ab,cd},2,2) = "b,"
32128 +
32129 +   Similarly, leading and trailing spaces are stripped from each argument,
32130 +   so:
32131 +
32132 +  \fsubstring( abcd ,2,2) = "bc"
32133 +
32134 +   but braces preserve them:
32135 +
32136 +  \fsubstring({ abcd },2,2) = "ab"
32137 +
32138 +   Given these special uses for braces, there is no way to pass literal
32139 +   braces to the function itself. For example:
32140 +
32141 +  \fsubstring(ab{cd,2,2)
32142 +
32143 +   causes an error.
32144 +
32145 +   So if you need a function to include braces, define a variable
32146 +   containing the string that has braces. Example:
32147 +
32148 +  define \%a ab{cd
32149 +  \fsubstring(\%a,2,2) = "b{"
32150 +
32151 +   If the string is to start with a leading brace and end with a closing
32152 +   brace, then double braces must appear around the string (which itself
32153 +   is enclosed in braces):
32154 +
32155 +  define \%a {{{foo}}}
32156 +  \fsubstring(\%a) = "{foo}"
32157 +
32158 +   This also works for any other kind of string:
32159 +
32160 +  define \%a {{ab{cd}}
32161 +  echo \fsubstring(\%a) = "ab{cd"
32162 +
32163 +  7.7. Autodownload during INPUT Command Execution
32164 +
32165 +   As of 6.1 / 1.1.12, C-Kermit can be told to look for incoming Kermit
32166 +   (or Zmodem) packets during execution of an INPUT command. By default
32167 +   (for consistency with earlier releases), this is not done. You can
32168 +   enable this feature with:
32169 +
32170 +  SET INPUT AUTODOWNLOAD ON
32171 +
32172 +   (and disable it again with OFF.)
32173 +
32174 +   One possible use for this feature is as a server mode with a time
32175 +   limit:
32176 +
32177 +  INPUT 3600 secret-string-to-end-the-INPUT-command
32178 +
32179 +   In this example, any GET, SEND, or REMOTE commands received within one
32180 +   hour (3600 seconds) of when the INPUT command was issued will be
32181 +   executed. Here's another example, in which we want to stay open until
32182 +   11:30pm, or until interrupted by seven consecutive Ctrl-C (\3)
32183 +   characters:
32184 +
32185 +  INPUT 23:30:00 \3\3\3\3\3\3\3
32186 +
32187 +   The INPUT AUTODOWNLOAD setting is displayed by SHOW SCRIPTS or SHOW
32188 +   INPUT.
32189 +
32190 +  7.8. Built-in Help for Functions.
32191 +
32192 +   Beginning in C-Kermit 7.0, you may obtain a description of the calling
32193 +   conventions and return values of any built-in function, such as
32194 +   \fsubstring(), with the new HELP FUNCTION command; give the function's
32195 +   name without the leading "\f", e.g. "help func substring". You can use
32196 +   ?, completion, and abbreviation in the normal manner.
32197 +
32198 +  7.9. Variable Assignments
32199 +
32200 +    7.9.1. Assignment Operators
32201 +
32202 +   Programmers accustomed to languages such as C or Fortran might find
32203 +   Kermit's method of assigning values to variables unnatural or awkward.
32204 +   Beginning in C-Kermit 7.0, you can use the following alternative
32205 +   notation:
32206 +
32207 + .name = value    is equivalent to   DEFINE name value
32208 + .name := value   is equivalent to   ASSIGN name value
32209 + .name ::= value  is equivalent to   ASSIGN name \feval(value)
32210 +
32211 +   When the command begins with a period (.), this indicates an
32212 +   assignment. The name can be a macro name, a \%{digit,letter} variable,
32213 +   or an array element. There can be space(s) between "." and the name.
32214 +   Examples:
32215 +
32216 +  .\%a = This is a string  ; Same as "define \%a This is a string"
32217 +  echo \%a
32218 +  This is a string
32219 +
32220 +  .xxx = \%a               ; Same as "define xxx \%a"
32221 +  echo \m(xxx)
32222 +  \%a
32223 +
32224 +  .xxx := \%a              ; Same as "assign xxx \%a"
32225 +  echo \m(xxx)
32226 +  This is a string
32227 +
32228 +  declare \&a[2]           ; Use with arrays...
32229 +  define \%i 2
32230 +  .\&a[1] = first
32231 +  .\&a[\%i] = second
32232 +
32233 +   The following sequence illustrates the differences among three levels
32234 +   of evaluation:
32235 +
32236 +  .\%x = 2          ; Define a variable to have a numeric value
32237 +  .\%y = (3 + \%x)  ; Define another variable as an arithmetic expression
32238 +
32239 +  .xxx = 4 * \%y    ; "=" simply copies the right-hand side.
32240 +  echo \m(xxx)
32241 +  4 * \%y
32242 +
32243 +  .xxx := 4 * \%y   ; ":=" evaluates the variables first, then copies.
32244 +  echo \m(xxx)
32245 +  4 * (3 + 2)
32246 +
32247 +  .xxx ::= 4 * \%y  ; "::=" evaluates the expression, then copies.
32248 +  echo \m(xxx)
32249 +  20
32250 +
32251 +   You can also use this syntax to clear (undefine) a variable:
32252 +
32253 +  .\%a = oofa       ; Define the variable
32254 +  echo "\%a"
32255 +  "oofa"
32256 +  .\%a              ; Clear the variable
32257 +  echo "\%a"
32258 +  ""
32259 +
32260 +   Extra credit: Can you guess what happens below when the file "abc" does
32261 +   not exist?
32262 +
32263 +  fopen /read \%c abc
32264 +  if fail ...
32265 +
32266 +    7.9.2. New Assignment Commands
32267 +
32268 +   Recall the DEFINE and ASSIGN commands, and their hidden counterparts,
32269 +   _DEFINE and _ASSIGN. The former take the variable name literally, the
32270 +   latter evaluate the variable-name field to form the variable name
32271 +   dynamically. Examples:
32272 +
32273 +  DEFINE \%x foo    ; Sets the value of the variable \%x to "foo".
32274 +  DEFINE \%a \%x    ; Sets the value of the variable \%a to "\%x".
32275 +  _DEFINE x_\%a \%x ; Sets the value of the variable x_foo to "\%x".
32276 +  ASSIGN \%a \%x    ; Sets the value of the variable \%a to the "foo".
32277 +  _ASSIGN x_\%a \%x ; Sets the value of the variable x_foo to "foo".
32278 +
32279 +   This concept has been carried over to the remaining variable-assignment
32280 +   commands: EVALUATE, INCREMENT, and DECREMENT:
32281 +
32282 +   EVALUATE variablename expression
32283 +          Evaluates the arithmetic expression and assigns its value to the
32284 +          variable whose name is given. Example: "eval \%a 1+1" assigns
32285 +          "2" to \%a.
32286 +
32287 +   _EVALUATE metaname expression
32288 +          Evaluates the arithmetic expression and assigns its value to the
32289 +          variable whose name is computed from the given metaname.
32290 +          Example: "eval foo<\%a>::\%1 \%2 * (\%3 + \%4)" assigns the
32291 +          value of "\%2 * (\%3 + \%4)" to the variable whose name is
32292 +          computed from "foo<\%a>::\%1".
32293 +
32294 +   INCREMENT variablename [ expression ]
32295 +          Evaluates the arithmetic expression and adds its value to the
32296 +          value of the variable whose name is given. Example: "increment
32297 +          \%a".
32298 +
32299 +   _INCREMENT metaname [ expression ]
32300 +          Evaluates the arithmetic expression and adds its value to the
32301 +          value of the variable whose name is computed from the given
32302 +          metaname. Example: "_increment Words::\%1.count[\%2]".
32303 +
32304 +   DECREMENT variablename [ expression ]
32305 +          Evaluates the arithmetic expression and subtracts its value from
32306 +          the value of the variable whose name is given.
32307 +
32308 +   _DECREMENT metaname [ expression ]
32309 +          Evaluates the arithmetic expression and subtracts its value from
32310 +          the value of the variable whose name is computed from the given
32311 +          metaname.
32312 +
32313 +   WARNING: The syntax of the EVALUATE command has changed since C-Kermit
32314 +   6.0 and K95 1.1.17. Previously, it did not include a variable name,
32315 +   only an expression. To restore the old behavior, use SET EVALUATE OLD.
32316 +   To return to the new behavior after restoring the old behavior, use SET
32317 +   EVALUATE NEW.
32318 +
32319 +   NOTE: There are no analogs to the "_" commands for the operators
32320 +   described in [597]Section 7.9.1; those operators can not be used to
32321 +   assign values to variables whose names must be computed.
32322 +
32323 +  7.10. Arrays
32324 +
32325 +   C-Kermit 7.0 adds lots of new array-related features, and groups them
32326 +   together under the NEW ARRAY command:
32327 +
32328 +   ARRAY { CLEAR, COPY, DECLARE, DESTROY, RESIZE, SHOW, SORT }
32329 +
32330 +   In each of the ARRAY commands, wherever an array name is expected,
32331 +   "short forms" may be used. For example, all of the following are
32332 +   acceptable:
32333 +
32334 +  array show \&a[]  (or SHOW ARRAY...)
32335 +  array show &a[]
32336 +  array show a[]
32337 +  array show &a
32338 +  array show a
32339 +
32340 +   In addition, ranges are accepted in the ARRAY COPY, ARRAY CLEAR, ARRAY
32341 +   SET, ARRAY SHOW, and ARRAY SORT commands:
32342 +
32343 +  array clear \&a[16]     ; Clears 16 thru end
32344 +  array clear &a[16]      ; Ditto
32345 +  array clear a[16]       ; Ditto
32346 +
32347 +  array clear \&a[16:32]  ; Clears 16 thru 32
32348 +  array clear &a[16:32]   ; Ditto
32349 +  array clear a[16:32]    ; Ditto
32350 +
32351 +   When using array names as function arguments, you must omit the "\" and
32352 +   you must include the "&". You may optionally include empty brackets.
32353 +   Examples:
32354 +
32355 +  \fsplit(\%a,a)          ; Bad
32356 +  \fsplit(\%a,\&a)        ; Bad
32357 +  \fsplit(\%a,&a[3])      ; Bad
32358 +
32359 +  \fsplit(\%a,&a)         ; Good
32360 +  \fsplit(\%a,&a[])       ; Good
32361 +
32362 +    7.10.1. Array Initializers
32363 +
32364 +   Beginning in C-Kermit 7.0, you may initialize an array -- in whole or
32365 +   in part -- in its declaration:
32366 +
32367 +   [ ARRAY ] DECLARE array-name[size] [ = ] [ value1 [ value2 [...] ] ]
32368 +
32369 +   For compatibility with versions 5A and 6.0, the ARRAY keyword is
32370 +   optional. DECLARE can also be spelled DCL.
32371 +
32372 +   Initializers are (a) optional, (b) start with element 1, (c) must be
32373 +   enclosed in braces if they contain spaces, and (d) are evaluated
32374 +   according to normal rules by the DECLARE command prior to assignment.
32375 +   Thus the assignments made here are the same as those made by the ASSIGN
32376 +   command. This allows you to initialize array elements from the values
32377 +   of other variables. If you actually want to initialize an array element
32378 +   to variable's name, as opposed to its value, use double backslashes (as
32379 +   in "\\&a", "\\v(time)", etc).
32380 +
32381 +   The size (dimension) of the array is optional. If the size is omitted,
32382 +   as in "\&a[]", then the array sizes itself to the number of
32383 +   initializers; if there are no initializers the array is not declared
32384 +   or, if it was declared previously, it is destroyed. If a size is given,
32385 +   any extra elements in the initialization list are discarded and
32386 +   ignored.
32387 +
32388 +   NOTE: Unlike in C, the list of initializers is NOT enclosed in braces.
32389 +   Instead, braces are used to group multiple words together. So:
32390 +
32391 +  ARRAY DECLARE \&a[] = { one two three }
32392 +
32393 +   would create an array with two elements (0 and 1), with element 1
32394 +   having the value " one two three ".
32395 +
32396 +   Examples:
32397 +
32398 +   ARRAY DECLARE \&a[16]
32399 +          Declares the array \&a with 17 elements (0 through 16), in which
32400 +          all elements are initially empty. If the array \&a[] existed
32401 +          before, the earlier copy is destroyed.
32402 +
32403 +   ARRAY DECLARE &a[16]
32404 +   ARRAY DECLARE a[16]
32405 +   ARRAY DCL \&a[16]
32406 +   ARRAY DCL &a[16]
32407 +   ARRAY DCL a[16]
32408 +   DECLARE \&a[16]
32409 +   DECLARE &a[16]
32410 +   DECLARE a[16]
32411 +   DCL \&a[16]
32412 +   DCL &a[16]
32413 +   DCL a[16]
32414 +          All of the above are the same as the first example.
32415 +
32416 +   ARRAY DECLARE \&a[16] = alpha beta {gamma delta}
32417 +          Declares the array \&a with 17 elements (0 through 16),
32418 +          initializing \&a[1] to "alpha", \&a[2] to "beta", and \&a[3] to
32419 +          "gamma delta". The remaining elements are empty.
32420 +
32421 +   ARRAY DECLARE \&a[] = alpha beta {gamma delta}
32422 +          Same as the previous example, but the array is automatically
32423 +          dimensioned to 3.
32424 +
32425 +   ARRAY DECLARE \&a[3] = alpha beta {gamma delta} epsilon zeta
32426 +          Too many initializers; only the first three are kept.
32427 +
32428 +   ARRAY DECLARE \&a[0]
32429 +   ARRAY DECLARE \&a[]
32430 +   ARRAY DECLARE &a[]
32431 +   ARRAY DECLARE &a
32432 +   ARRAY DECLARE a
32433 +   DECLARE \&[0]
32434 +   DECLARE a
32435 +   DCL a
32436 +          All of these are equivalent. Each destroys \&a[] if it exists.
32437 +          Declaring an array with a dimension of 0 is the same as ARRAY
32438 +          DESTROY arrayname.
32439 +
32440 +   ARRAY DECLARE \&a[] = \%1 \%2 \%3
32441 +          Declares the array \&a with 3 elements (0 through 3),
32442 +          initializing \&a[1] to the value of \%1, \&a[2] to the value of
32443 +          \%2, and \&a[3] to the value of \%3. In this case, any reference
32444 +          to one of these array elements is replaced by the value of the
32445 +          corresponding \%n variable at the time the declaration was
32446 +          executed (immediate evaluation; the array element's value does
32447 +          not change if the initializer variable's value changes).
32448 +
32449 +   ARRAY DECLARE \&a[] = \\%1 \\%2 \\%3
32450 +          Declares the array \&a with 3 elements (0 through 3),
32451 +          initializing \&a[1] to the string "\%1", \&a[2] to "\%2", and
32452 +          \&a[3] to "\%3". In this case any reference to one of these
32453 +          array elements is replaced by the CURRENT value of the
32454 +          corresponding \%n variable (deferred evaluation -- the array
32455 +          element's value follows the value of the initializer variable).
32456 +
32457 +   The equal sign (=) preceding the initializer list is optional, but is
32458 +   recommended for clarity. If you need to initialize element 1 to a
32459 +   literal equal sign, use two of them, separated by a space, as in this
32460 +   example:
32461 +
32462 +  ARRAY DECLARE \&a[] = = + - * /
32463 +
32464 +   Remember, element 0 is not initialized by the DECLARE command. To
32465 +   initialize element 0, use a regular DEFINE or ASSIGN command:
32466 +
32467 +  ARRAY DECLARE \&a[] one two three four five six seven eight nine
32468 +  DEFINE \&a[0] zero
32469 +
32470 +   Finally, remember that every command level has its own local array,
32471 +   \&_[], containing all the macro arguments (\%0, \%1, ...) for that
32472 +   level. See [598]Section 7.5 for details.
32473 +
32474 +    7.10.2. Turning a String into an Array of Words
32475 +
32476 +   The \fsplit(s1,&a,s2,s3) function assigns the words of string s1 to
32477 +   successive elements of the array (beginning with element 1) whose
32478 +   identifying letter, a-z, is given after the "&" in the second argument,
32479 +   using break and include characters given in s2 and s3. See [599]Section
32480 +   7.3 for details.
32481 +
32482 +    7.10.3. Arrays of Filenames
32483 +
32484 +   See [600]Section 4.11.3 for news about how \ffiles() and related
32485 +   functions can assign a list of filenames to an array. To recapitulate
32486 +   briefly here:
32487 +
32488 +  \ffiles(*,&a)
32489 +
32490 +   assigns all files that match the first argument to the array denoted by
32491 +   the second argument. If the array has not been declared, it is declared
32492 +   automatically, with exactly the number of elements needed to hold the
32493 +   file list; if it was previously declared, it is destroyed and reused.
32494 +   The filenames are assigned starting at array element 1. Element 0 holds
32495 +   the number of files in the list.
32496 +
32497 +   The DIRECTORY command ([601]Section 4.5.1) can also create filename
32498 +   arrays if you give it the /ARRAY: switch; this allows selection
32499 +   criteria beyond whether the filename matches the given pattern.
32500 +
32501 +   All functions and commands that create filename arrays store the number
32502 +   of filenames, n, as element 0 of the array, and the filenames as
32503 +   elements 1 through n.
32504 +
32505 +    7.10.4. Automatic Arrays
32506 +
32507 +   In a command file or macro, you can now have local (automatic) arrays.
32508 +   Just give the name followed by empty subscript brackets (no spaces
32509 +   inside the brackets please) in a LOCAL command, and then declare the
32510 +   array:
32511 +
32512 +  LOCAL \%a \&a[] oofa
32513 +  ARRAY DECLARE \&a[32] = value1 value2 value3 ...
32514 +
32515 +   This declares the scalar variable \%a, the array \&a[], and the macro
32516 +   name "oofa" to be local, and then declares the new local copy of \&a[]
32517 +   with 32 elements, perhaps assigning some initial values. When C-Kermit
32518 +   exits from the command file or macro containing these command, the
32519 +   previous \&a[] array is restored (and if there was no \&a[] at any
32520 +   higher level, this will still be true). The process can be repeated to
32521 +   any level. Thus it is now safe to write scripts or macros containing
32522 +   arrays without danger of interfering with global arrays of the same
32523 +   name.
32524 +
32525 +   Just as scalars are inherited by lower command levels, so are arrays.
32526 +   So, for example, if \&a[] is declared at top level, all lower levels
32527 +   will see it unless they include a "local \&a[]" statement, in which
32528 +   case all levels at and beneath the level where the LOCAL statement was
32529 +   executed will see the local copy. This too can be repeated to any
32530 +   level.
32531 +
32532 +   On the other hand, if you DECLARE an array at a lower command level
32533 +   without also making it LOCAL, this replaces the copy that was declared
32534 +   at the lowest command level above this one.
32535 +
32536 +    7.10.5. Sorting Arrays
32537 +
32538 +   Although arrays can be sorted using FOR loops as shown on page 383 of
32539 +   Using C-Kermit, 2nd Ed., this involves quite a bit of repetitive
32540 +   interpretation by the command parser, and so can be slow for large
32541 +   arrays. For this reason, C-Kermit 7.0 adds a built-in SORT command:
32542 +
32543 +   ARRAY SORT [ switches ] array [ array2 ]
32544 +          Sorts the given array in place. Sorting is strictly lexical
32545 +          (string based). The array name can be given fully, e.g. "\&a[]",
32546 +          or the "\" and/or "&" and/or brackets can be omitted, e.g.
32547 +          "array sort \&a[]", "sort &a", "sort a". Also, a range can be
32548 +          indicated in the brackets as noted in [602]Section 7.10, to
32549 +          restrict the sort to a range of elements (equivalent to the
32550 +          /RANGE switch, described just below), e.g. "array sort
32551 +          &a[20:30]".
32552 +
32553 +   A second array may be specified. If it is, and if it is at least as big
32554 +   as the first array, it is sorted according to the first array. For a
32555 +   sample application, see [603]Section 7.10.10.
32556 +
32557 +   See [604]Section 1.5 for an explanation of switches. The optional
32558 +   switches are:
32559 +
32560 +   /CASE:{ON,OFF}
32561 +          /CASE:ON means that alphabetic case is significant in
32562 +          comparisons; uppercase letters are sorted before lowercase ones.
32563 +          /CASE:OFF means case is ignored, e.g. "A" is the same as "a". If
32564 +          this switch is not given, sorting is according the current SET
32565 +          CASE setting.
32566 +
32567 +   /KEY:n
32568 +          Comparison begins at position n(1-based) in each string. If no
32569 +          key is given, the entire strings are compared. Only one key can
32570 +          be given. If an array element is shorter than the key value, n,
32571 +          that element is considered empty for comparison purposes, and
32572 +          therefore lexically less than any element at least ncharacters
32573 +          long.
32574 +
32575 +   /NUMERIC
32576 +          If this switch is included, it means sorting should be numeric,
32577 +          rather than lexical. The sort key is the string starting at the
32578 +          key position, skipping any leading blanks or tabs, and then as
32579 +          much of the string from that point on that fits the definition
32580 +          of "numeric", terminating at the first character that does not
32581 +          qualify. A numeric string has an optional sign (+ or -) followed
32582 +          by one or more digits, and (if your version of Kermit was built
32583 +          with floating-point support; see [605]Section 7.23 ) zero or one
32584 +          decimal point (period). If both /CASE and /NUMERIC are given,
32585 +          /NUMERIC takes precedence.
32586 +
32587 +   /RANGE:n[:m]
32588 +          Sort elements nthrough m of the array. By default, the entire
32589 +          array from element 1 to its dimensioned size is sorted, which
32590 +          might produce surprising results if the array is not full; see
32591 +          example in [606]Section 7.10.7. If ":m" is omitted from the
32592 +          range, the dimensioned size is used. Thus, to sort an entire
32593 +          array, \&a[], including its 0th element, use "sort /range:0 &a".
32594 +          You can also sort any desired section of an array, e.g. "sort
32595 +          /range:10:20 &a" or "sort /range:\%i:\%j-1 &b". As noted above,
32596 +          you can also specify a range in the array-name brackets. If you
32597 +          specify a range in the array-name brackets AND with a /RANGE
32598 +          switch, the ones in the brackets take precedence.
32599 +
32600 +   /REVERSE
32601 +          Sort in reverse order. If this switch is not given, the array is
32602 +          sorted in ascending order.
32603 +
32604 +   Remember that numeric switch arguments can be numbers, arithmetic
32605 +   expressions, or variables whose values are numbers or expressions, as
32606 +   illustrated in the /RANGE examples above.
32607 +
32608 +   A typical sorting application might be to list students' test scores in
32609 +   descending order. Suppose you had the following records:
32610 +
32611 +  olaf      65
32612 +  olga      98
32613 +  ivan      83
32614 +  xena     100
32615 +
32616 +   (and so on) stored in array \&s[] (e.g. by reading them from a file as
32617 +   illustrated in [607]section 7.10.7). In these records, the student's
32618 +   name is in columns 1-9 and the score in 10-12. So to rearrange the list
32619 +   in descending order of score:
32620 +
32621 +  sort /key:10 /reverse &s
32622 +
32623 +   Then to list your top five students:
32624 +
32625 +  for \%i 1 5 1 { echo \&s[\%i] }
32626 +
32627 +   Or more simply (see next section):
32628 +
32629 +  show array a[1:5]
32630 +
32631 +   To illustrate the difference between a lexical and a numeric sort,
32632 +   suppose you have the following records (the lines that are numbered,
32633 +   starting at column 1) in array \&a[]:
32634 +
32635 +    Column   1         2
32636 +    12345678901234567890
32637 +
32638 +   1. Ivan 10.0 2. Olaf 9.95 3. Olga 101.5
32639 +
32640 +   ARRAY SORT /KEY:10 &a[] would order them 3,1,2, but ARRAY SORT /KEY:10
32641 +   /NUMERIC &a[] would order them 2,1,3.
32642 +
32643 +    7.10.6. Displaying Arrays
32644 +
32645 +   The SHOW ARRAY command (or ARRAY SHOW) now accepts an optional
32646 +   array-name argument:
32647 +
32648 +  SHOW ARRAY \&a[]
32649 +
32650 +   (you can leave off the \, the \&, and/or the []'s if you like; "show
32651 +   array a" is equivalent to "show array \&a[]"). When an array is
32652 +   specified, its dimension is shown and all defined (non-empty) elements
32653 +   are listed.
32654 +
32655 +   Example:
32656 +
32657 +  assign \%n \ffiles(*,&a)  ; Fill an array with filenames ([608]Section 4.11.3)
32658 +  show array \&a[]          ; Show the array we just read
32659 +  array show \&a[]          ; Same as previous
32660 +  array sort \&a[]          ; Sort the array
32661 +  array show \&a[]          ; Show it after sorting
32662 +  array show \&a            ; Show it again
32663 +  array show &a             ; Show it again
32664 +  array show a              ; Show it again
32665 +
32666 +   (The final four commands demonstrate the alternative forms that are
32667 +   accepted for the array name.)
32668 +
32669 +   If you SHOW ARRAY without giving an array name, all defined arrays are
32670 +   listed by name and dimension, but their contents are not shown.
32671 +
32672 +   You can also show a piece of an array by including a subscript or range
32673 +   within the array brackets:
32674 +
32675 +  array show \&a[5]         ; Shows \&a[5]
32676 +  array show &a[3:8]        ; Shows \&a[3] through \&a[8]
32677 +  array show a[:\%n-1]      ; Shows \&a[0] through \&a[\%n-1]
32678 +
32679 +    7.10.7. Other Array Operations
32680 +
32681 +   ARRAY DESTROY arrayname
32682 +          Destroys and undeclares the named array. Subscripts or ranges
32683 +          are not accepted in this command.
32684 +
32685 +   ARRAY COPY array1 array2
32686 +          Copies the first array to the second array. If the target array
32687 +          has not been declared, it is created automatically with the same
32688 +          size as the first. If it has been declared, it will be used as
32689 +          declared; if the source array is larger, only as much of it as
32690 +          will fit is copied to the target array. Syntax for array1 and
32691 +          array2 is as in ARRAY SHOW (SHOW ARRAY). Example:
32692 +
32693 +  .\%n := \ffiles(*,&a)  ; Create and load array A with a file list.
32694 +  array copy &a &b       ; Copy array A to array B.
32695 +
32696 +          The ARRAY COPY command also lets you copy pieces of arrays by
32697 +          including range specifiers, as in these examples:
32698 +
32699 +        ARRAY COPY \&a[4:27] \&b
32700 +                This copies \&a[] elements 4-27 to \&b[] elements 1-23,
32701 +                creating \&b[] if necessary or, if \&b[] is already
32702 +                declared, stopping early if its size is less than 23.
32703 +
32704 +        ARRAY COPY \&a[4:27] \&b[12]
32705 +                This copies \&a[] elements 4-27 to \&b[] elements 12-35,
32706 +                creating \&b[] if necessary or, if \&b[] is already
32707 +                declared, stopping early if its size is less than 35.
32708 +
32709 +        ARRAY COPY \&a[4:27] \&b[12:14]
32710 +                This copies \&a[] elements 4-6 to \&b[] elements 12-14,
32711 +                creating \&b[] if necessary or, if \&b[] is already
32712 +                declared, stopping early if its size is less than 14.
32713 +
32714 +        ARRAY COPY \&a[17] \&b
32715 +                This copies all the elements of \&a[] starting with 17
32716 +                until the last to \&b[], creating \&b[] if necessary or,
32717 +                if \&b[] is already declared, stopping early if \&b[] is
32718 +                not big enough.
32719 +
32720 +   ARRAY CLEAR arrayname
32721 +          Sets all the elements of the array to the empty value. You may
32722 +          also include a range specifier to clear only a selected portion
32723 +          of the array; for example "array clear \&a[37:214]". If the
32724 +          range is out of bounds, only the part of the array that is in
32725 +          bounds is cleared.
32726 +
32727 +   ARRAY SET arrayname [ value ]
32728 +          Sets all the elements of the array to the given value. If no
32729 +          value is given, the array is cleared. You may also include a
32730 +          range specifier to set only a selected portion of the array; for
32731 +          example "array set \&a[1:9] -1". If the range is out of bounds,
32732 +          only the part of the array that is in bounds is set.
32733 +
32734 +   ARRAY RESIZE arrayname size
32735 +          Resizes the given array. If the size is greater than the array's
32736 +          current dimension, new empty elements are added to the end. If
32737 +          the size is less than the current dimension, the extra elements
32738 +          are discarded. Note: If you have stored the array size in
32739 +          element 0, ARRAY RESIZE does not change this value. Alternative
32740 +          notation: ARRAY RESIZE arrayname[size]. For a practical example,
32741 +          see [609]Section 7.10.11.
32742 +
32743 +   \farraylook(pattern,arrayname)
32744 +          This function returns the index of the first element of the
32745 +          given array that matches the given pattern (for details about
32746 +          pattern syntax, see [610]section 4.9). The array name can
32747 +          include a range specification to restrict the search to a given
32748 +          segment of the array. If no elements match the pattern, -1 is
32749 +          returned.
32750 +
32751 +   \ftablelook(keyword,arrayname[,delimiter])
32752 +          Looks in the given "table", which must be sorted, for the given
32753 +          keyword. The keyword need not be spelled out in full.
32754 +          Pattern-matching characters should not be included as part of
32755 +          the keyword. The function returns the index of the table element
32756 +          that uniquely matches the given keyword, or -1 if none match, or
32757 +          -2 if more than 1 match.
32758 +
32759 +   A "table" is an array that is sorted in lexical order; each of its
32760 +   elements may contain multiple fields, delimited by the given delimiter
32761 +   character or, if no delimiter is specified, a colon (:).
32762 +
32763 +   The \farraylook() function does exactly what you tell it. If you give
32764 +   it a pattern that does not include wildcard characters (such as *, ?,
32765 +   etc), it requires an exact match. For example:
32766 +
32767 +  \farraylook(oofa,&a)
32768 +
32769 +   searches for the first element of \&a[] whose value is "oofa". But:
32770 +
32771 +  \farraylook(oofa*,&a)
32772 +
32773 +   finds the first element whose value starts with "oofa", and;
32774 +
32775 +  \farraylook(*oofa,&a)
32776 +
32777 +   finds the first element whose value ends with "oofa", and;
32778 +
32779 +  \farraylook(*oofa*,&a)
32780 +
32781 +   finds the first element whose value contains "oofa".
32782 +
32783 +   Here's a simple demonstration of looking up patterns in arrays:
32784 +
32785 +  local \&a[] \%x \%n
32786 +  declare \&a[] = zero one two three four five six seven eight nine ten
32787 +  while true {
32788 +      .\%x = 1
32789 +      .\%n = 0
32790 +      ask \%a { Pattern? }
32791 +      if not def \%a exit 0 Done.
32792 +      while <= \%x \fdim(&a) {
32793 +          .\%x := \farraylook(\%a,&a[\%x])
32794 +          if ( < \%x 0 ) break
32795 +          echo \flpad(\%x,3). \&a[\%x]
32796 +          increment \%x
32797 +          increment \%n
32798 +      }
32799 +      if ( < \%n 1 ) echo Pattern not found - "\%a"
32800 +  }
32801 +
32802 +   The array need not be sorted. When a pattern is given, a search is
32803 +   performed; if there is a match, the matching element's index and the
32804 +   element itself are printed, and the search begins again at the next
32805 +   element. Thus each matching element is printed. If none match, the
32806 +   "Pattern not found" message is printed. The process repeats for as many
32807 +   patterns as the user wants to type, and terminates when the user types
32808 +   an empty pattern.
32809 +
32810 +   Now let's build a little command parser, consisting of a keyword table,
32811 +   and a loop to look up the user's commands in it with \ftablelook(). In
32812 +   this case the array elements have "fields" separated by colon (:) -- a
32813 +   keyword and a value. Keyword tables must be sorted if \tablelook() is
32814 +   to work right, so after declaring and initializing the table array, we
32815 +   sort it.
32816 +
32817 +  local \&k[] \%a \%i \%n
32818 +
32819 +  array declare \&k[] = drive:9 do:8 discuss:7 live:6 spend:5 help:4 quit:0
32820 +
32821 +  array sort &k                             ; Make sure array is sorted
32822 +  echo Type "help" for help.                ; Print greeting & instructions
32823 +
32824 +  while true {                              ; Loop to get commands
32825 +      undefine \%a
32826 +      while not defined \%a {               ; Get a command
32827 +          ask \%a { Command? }
32828 +      }
32829 +      .\%n := \ftablelook(\%a,&k)           ; Look up the command
32830 +      switch \%n {                          ; Handle errors
32831 +        :-1, echo Not found - "\%a"         ; Doesn't match
32832 +             continue
32833 +        :-2, echo Ambiguous - "\%a"         ; Matches too many
32834 +             continue
32835 +      }
32836 +      switch \fword(\&k[\%n],2) {           ; Dispatch according to value
32837 +         :9, echo Driving..., break
32838 +         :8, echo Doing..., break
32839 +         :7, echo Discussing..., break
32840 +         :6, echo Living..., break
32841 +         :5, echo Spending..., break
32842 +         :4, echo { Commands (may be abbreviated):}
32843 +             for \%i 1 \fdim(&k) 1 {
32844 +                echo {  \%i. \fword(\&k[\%i],1) }
32845 +             }
32846 +             break
32847 +         :0, exit 0 Bye!
32848 +         :default, stop 1 Internal error
32849 +      }
32850 +  }
32851 +
32852 +   In this example, keywords are "drive", "do", "discuss", etc, and their
32853 +   values are unique numbers (values need not be numbers, and there need
32854 +   not be only one value -- there can be 0, 1, 2, or more of them). The
32855 +   user types a command, which can be the whole word (like "help") or any
32856 +   abbreviation (like "hel", "he", or just "h"). If this does not match
32857 +   any keywords, \ftablelook() returns -1; if it matches more than one (as
32858 +   would "d"), it returns -2. Otherwise the array index is returned, 1 or
32859 +   higher.
32860 +
32861 +   Given the array index \%n, we can get the table values as follows:
32862 +
32863 +  \fword(\&k[\%n],1) is the keyword (first field)
32864 +  \fword(\&k[\%n],2) is the value (second field, in this case a number)
32865 +
32866 +   In our example, we use the value (number) as the SWITCH variable. As
32867 +   noted, \fablelook() expects the array elements to contain multiple
32868 +   fields separated by colon (:) (or other character that you specify,
32869 +   e.g. \ftablelook(\%a,&a,^)) and when matching the keyword, ignores the
32870 +   first delimiter and everything after it.
32871 +
32872 +    7.10.8. Hints for Using Arrays
32873 +
32874 +   C programmers are accustomed to out-of-bounds array references causing
32875 +   core dumps or worse. In C-Kermit:
32876 +
32877 +     * A reference to an an out-of-bounds array element returns the empty
32878 +       string.
32879 +     * An attempt to set the value of an array element that is out of
32880 +       bounds or that has not been declared simply fails.
32881 +
32882 +   C programmers expect an array of size nto have elements 0 through n-1.
32883 +   Fortran programmers expect the same array to have elements 1 through n.
32884 +   C-Kermit accommodates both styles; when you declare an array of size n,
32885 +   it has n=1 elements, 0 through n, and you can use the array in your
32886 +   accustomed manner, 0-based or 1-based.
32887 +
32888 +   However, note that C-Kermit has certain biases towards 1-based arrays:
32889 +
32890 +     * Assignment of file lists starts with element 1 ([611]Section
32891 +       7.10.3).
32892 +     * Assignment by \fsplit() starts with element 1 ([612]Section 7.3).
32893 +     * Array initialization skips the 0th element. To initialize a 0-based
32894 +       array, use something like this:
32895 +  declare \&a[3] = one two three
32896 +  .\&a[0] = zero
32897 +
32898 +     * The ARRAY SORT command skips the 0th element unless you include
32899 +       /RANGE:0
32900 +     * The SHIFT command ignores element 0 of the \&_[] array.
32901 +
32902 +   The distinction between an array's dimensioned size and the number of
32903 +   elements in the array is important when sorting. To illustrate:
32904 +
32905 +  declare \&a[100]                  ; Declare array &a with 100 elements
32906 +  fopen /read \%c oofa.txt          ; Open a file
32907 +  if fail...
32908 +  for \%i 1 \fdim(&a) 1 {           ; Read the file into the array
32909 +      fread \%c \&a[\%i]
32910 +      if fail break
32911 +  }
32912 +  fclose \%c
32913 +  if > \%i \fdim(&a) end 1 File has too many lines for array.
32914 +  .\%n ::= \%i - 1
32915 +  echo File has \%n line(s).
32916 +
32917 +   Let's say the file had 95 lines. This leaves elements 96-100 of the
32918 +   array empty. Now suppose you sort the array and write out the result:
32919 +
32920 +  sort &a                           ; Sort the whole array
32921 +  fopen /write \%o oofa.txt.sorted  ; Open an output file
32922 +  if fail ...
32923 +  for \%i 1 \%n 1 {                 ; Write out 95 records
32924 +      fwrite /line \%o \&a[\%i]
32925 +      if fail end 1 Write error
32926 +  }
32927 +  close write
32928 +
32929 +   You might be surprised at the contents of "oofa.txt.sorted" -- five
32930 +   empty elements, 96-100, floated to the top of the array in the sort,
32931 +   and since your write loop only had 95 iterations, the final 5 lines of
32932 +   the sorted file are lost.
32933 +
32934 +   Therefore, when dealing with partially filled arrays -- especially when
32935 +   sorting them -- remember to specify the number of elements. A handy way
32936 +   of recording an array's "true" size is to put it in the 0th element.
32937 +   That way, it "travels with the array". To illustrate (continuing the
32938 +   previous example at the "close read" statement):
32939 +
32940 +  close read
32941 +  if > \%i \fdim(&a) end 1 File has too many lines for array.
32942 +  .\&a[0] ::= \%i - 1     ; Assign number of lines to \&a[0].
32943 +  echo File has \&a[0] line(s).
32944 +  sort /range:1:\&a[0] &a
32945 +  open write oofa.txt.sorted
32946 +  if fail ...
32947 +  for \%i 1 \&a[0] 1 {
32948 +      writeln file \&a[\%j]
32949 +      if fail end 1 Write error
32950 +  }
32951 +  close write
32952 +
32953 +   Note the SORT switch, /RANGE:1:\&a[0]. This keeps the sort 1-based, and
32954 +   uses element 0 of the array as its size indicator.
32955 +
32956 +   Finally, note that even though some commands or functions might put a
32957 +   size in array element 0, no built-in functions or commands depend on a
32958 +   size actually being there. Thus you are perfectly free to replace the
32959 +   size with something else and treat the array as 0-based.
32960 +
32961 +    7.10.9. Do-It-Yourself Arrays
32962 +
32963 +   Kermit's \&x[] arrays are nice because of the accompanying built-in
32964 +   functionality -- ARRAY commands, built-in functions that load and
32965 +   search arrays, automatic evaluation of arithmetic expressions within
32966 +   the subscript brackets, and so on. Yet they also have certain
32967 +   limitations:
32968 +
32969 +    1. Except when created by dynamic loading (e.g. by \ffiles()) they
32970 +       must be declared and dimensioned in advance.
32971 +    2. Indices must be numeric, positive, and in range.
32972 +    3. There can be only one dimension. Matrices or other
32973 +       higher-dimensioned arrays are not available.
32974 +
32975 +   But none of this is to say you can't invent any kind of data structure
32976 +   you like. In [613]Section 7.9.2 you can see some examples. Here's
32977 +   another (courtesy of Dat Thuc Nguyen), in which a pair of matrices is
32978 +   created and then added: no dimensioning necessary.
32979 +
32980 +  .row = 4
32981 +  .col = 9
32982 +
32983 +  ; MACRO TO PRINT A MATRIX
32984 +  define PMATRIX {
32985 +      echo Matrix \%1:
32986 +      for \%r 1 \m(row) 1 {
32987 +          for \%c 1 \m(col) 1 {
32988 +              xecho \flpad(\m(\%1[\%r][\%c]),4)
32989 +          }
32990 +          echo
32991 +      }
32992 +      echo
32993 +  }
32994 +  ; CREATE MATRICES A AND B
32995 +  for \%r 1 \m(row) 1 {
32996 +      for \%c 1 \m(col) 1 {
32997 +          _eval A[\%r][\%c] \%r + \%c
32998 +          _eval B[\%r][\%c] \%r * \%c
32999 +      }
33000 +  }
33001 +  ; CREATE MATRIX C = SUM OF MATRIX A AND MATRIX B
33002 +  for \%r 1 \m(row) 1 {
33003 +      for \%c 1 \m(col) 1 {
33004 +          _eval C[\%r][\%c] \m(A[\%r][\%c]) + \m(B[\%r][\%c])
33005 +      }
33006 +  }
33007 +  pmatrix A  ; Print Matrix A
33008 +  pmatrix B  ; Print Matrix B
33009 +  pmatrix C  ; Print Matrix C
33010 +
33011 +   In the example, we use matrix-like notation to create macros with names
33012 +   like "A[1][1]", "B[3][7]", and so on.
33013 +
33014 +    7.10.10. Associative Arrays
33015 +
33016 +   An associative array is a special kind of Do-It-Yourself array. It
33017 +   differs from a regular array in that its indices need not be numbers --
33018 +   they can be anything at all -- words, filenames, names of months, any
33019 +   character string at all, and that it doesn't have to be (and in fact
33020 +   can't be) declared. An associative array element is simply a macro
33021 +   whose name ends with an index enclosed in angle brackets, for example:
33022 +
33023 +  file<oofa.txt>
33024 +
33025 +   More formally:
33026 +
33027 +  basename<index>
33028 +
33029 +   An associative array is a collection of all associative array elements
33030 +   that have the same basename. Any number of associative arrays, each
33031 +   with any number of elements, can exist at the same time.
33032 +
33033 +   An associative array element can be assigned a value, such as "1", just
33034 +   like any other macro:
33035 +
33036 +  define file<oofa.txt> 1     ; Give "file<oofa.txt>" the value "1".
33037 +
33038 +   or:
33039 +
33040 +  assign file<oofa.txt> \%a   ; Give it the value of the variable \%a.
33041 +
33042 +   However, since an associative array element is a macro, it may not have
33043 +   an empty (null) value, since assigning an empty value to a macro
33044 +   undefines the macro.
33045 +
33046 +   You can refer to the value of an associative array element using the
33047 +   familiar notation for macro values:
33048 +
33049 +  echo \m(file<oofa.txt>)     ; Echo the value of "file<oofa.txt>".
33050 +
33051 +   Associative arrays are most useful, however, when the value of the
33052 +   index is a variable. In that case, you must use the "hidden" forms of
33053 +   the DEFINE or ASSIGN commands that evaluate the macro name before
33054 +   making the assignment (see [614]Using C-Kermit, page 457). Example:
33055 +
33056 +  define \%f oofa.txt
33057 +  _define file<\%f> 1
33058 +  echo file<\%f> = \m(file<\%f>)
33059 +
33060 +   prints:
33061 +
33062 +  file<oofa.txt> = 1
33063 +
33064 +   and then:
33065 +
33066 +  _increment file<\%f>
33067 +  echo file<\%f> = \m(file<\%f>)
33068 +
33069 +   prints:
33070 +
33071 +  file<oofa.txt> = 2
33072 +
33073 +   What are associative arrays good for? The classic example is "word
33074 +   counts": finding the number of times each word is used in a text
33075 +   without knowing in advance what the words are. Without associative
33076 +   arrays, your program would have to build a table of some kind, and
33077 +   every time a word was encountered, look it up in the table to find its
33078 +   position and counter, or add it to the table if it wasn't found -- a
33079 +   time-consuming and laborious process. Associative arrays, however, let
33080 +   you use the word itself as the table index and therefore sidestep all
33081 +   the table building and lookups.
33082 +
33083 +   Let's work through a practical example. Suppose you have a
33084 +   file-transfer log in which each line is composed of a number of
33085 +   blank-separated fields, and the 9th field is a filename (which happens
33086 +   to be the format of certain FTP server logs, as well as of C-Kermit's
33087 +   new FTP-format transaction log, described in [615]Section 4.17.2), for
33088 +   example:
33089 +
33090 +  Wed Jul 14 09:35:31 1999 22 xx.mit.edu 13412 /pub/ftp/mm/intro.txt ....
33091 +
33092 +   and you want to find out how many times each file was transferred. The
33093 +   following code builds an associative array, file<>, containing the
33094 +   counts for each file:
33095 +
33096 +  local name line max \%c \%n          ; Declare local variables
33097 +  fopen /read \%c /var/log/ftpd.log    ; Open the log file ([616]Section 1.22)
33098 +  if fail exit 1 Can't open log        ; Check
33099 +  while true {                         ; Loop for each record
33100 +      fread /line \%c line             ; Read a line
33101 +      if fail break                    ; Check for end of file
33102 +      .name := \fword(\m(line),9,{ })  ; Get 9th field = filename (Sec 7.3)
33103 +      _increment file<\m(name)>        ; Increment its counter (Sec 7.9.2)
33104 +  }
33105 +  fclose \%c                           ; Close file when done.
33106 +
33107 +   Note that _INCREMENT (and INCREMENT, and [_]DECREMENT) treat an empty
33108 +   (i.e. nonexistent) variable as having a value of 0, and therefore
33109 +   creates the variable with a value of 1.
33110 +
33111 +   At this point, if you told Kermit to "show macro file<", it would list
33112 +   the associative array. But since you don't necessarily know the names
33113 +   of the files in the array, or even how many elements are in the array,
33114 +   how can you use it in a script program?
33115 +
33116 +   The idea of creating macro names that include character-string indices
33117 +   enclosed in angle brackets is perfectly arbitrary and doesn't depend on
33118 +   any Kermit features that weren't already there -- we could just as
33119 +   easily have used some other notation, such as "file[index]",
33120 +   "file:index", or "file.index", and the code above would have worked
33121 +   just as well (with the corresponding syntax adjustments). But to be
33122 +   able to use an associative array in a program after the array is built,
33123 +   we need a method of accessing all its elements without knowing in
33124 +   advance what they are. That's where the chosen notation comes in.
33125 +
33126 +   First of all, any macro name that ends with "<xxx>" (where "xxx" is any
33127 +   string) is case sensitive, unlike all other macro names, which are case
33128 +   independent. To illustrate, "file<oofa.txt>" and "file<OOFA.TXT>" are
33129 +   two distinct macros, whereas "OOFA", "Oofa", and "oofa", when used as
33130 +   macro names, are all the same.
33131 +
33132 +   Second, the new \faaconvert() function converts an associative array
33133 +   (that is, all macros with names of the form "base<index>" that have the
33134 +   same "base" part) into a pair of regular arrays and returns the number
33135 +   of elements:
33136 +
33137 +  \faaconvert(name,&a[,&b])
33138 +
33139 +   "name" is the name of the associative array, without the angle brackets
33140 +   or index ("file" in our example).
33141 +
33142 +   The second argument is the name of a regular array in which to store
33143 +   the indices of the associative array (filenames in our example); if an
33144 +   array of this name already exists, it is destroyed unless the array is
33145 +   LOCAL. The third argument is the name of another regular array in which
33146 +   to store the values (the counts in our example), with the same rules
33147 +   about array name collisions. If you care only about the indices and not
33148 +   the values, you can omit the third argument to \faaconvert(). In any
33149 +   case, the associative array is converted, not copied: its elements are
33150 +   moved to the specified regular arrays, so after conversion the original
33151 +   associative array is gone.
33152 +
33153 +   As with other array-loading functions, \faaconvert() sets element 0 of
33154 +   each array to the number of elements in the array.
33155 +
33156 +   To continue our example:
33157 +
33158 +  .max := 0                                   ; Maximum count
33159 +  .\%n := \faaconvert(file,&a,&b)             ; Convert
33160 +  for \%i 1 \%n 1 {                           ; Loop through values
33161 +      echo \flpad(\%i,3). \&a[\%i]: \&b[\%i]  ; Echo this pair
33162 +      if ( > \&b[\%i] \m(max) ) {             ; Check for new maximum
33163 +          .name := \&a[\%i]
33164 +          .max  := \&b[\%i]
33165 +      }
33166 +  }
33167 +  echo Most popular file: \m(name), accesses: \m(max)
33168 +
33169 +   This lists the files and counts and then announces which file has the
33170 +   highest count.
33171 +
33172 +   Now suppose you want to sort the array pair created from an associative
33173 +   array. In our example, \&a[] contains filenames, and \&b[] contains the
33174 +   associated counts. Here we take advantage of the ARRAY SORT command's
33175 +   ability to sort a second array according to the first one:
33176 +
33177 +  array sort /reverse /numeric &b &a          ; Descending sort by count
33178 +
33179 +   Now to see the top five files and their counts:
33180 +
33181 +  echo The top 5 files are:
33182 +  for \%i 1 5 1 {                             ; Loop through top 5 values
33183 +      echo \flpad(\%i,3). \&a[\%i]: \&b[\%i]  ; Echo this pair
33184 +  }
33185 +
33186 +    7.10.11. Transferring Array Contents to Other Computers
33187 +
33188 +   The SEND /ARRAY:arrayname command ([617]Section 4.7.1) allows you to
33189 +   send the contents of any array, or any contiguous segment of it, in
33190 +   either text or binary mode to another computer, using Kermit protocol.
33191 +   When used in conjunction with C-Kermit's other features (the array
33192 +   features described in this section; the file i/o package from
33193 +   [618]Section 1.22; its decision-making, pattern-matching, and string
33194 +   manipulation capabilities, and so on) the possibilities are endless:
33195 +   extracts of large files, remote database queries, ..., all without
33196 +   recourse to system-dependent mechanisms such UNIX pipes and filters,
33197 +   thus ensuring cross-platform portability of scripts that use these
33198 +   features.
33199 +
33200 +   When sending an array in text mode, Kermit appends a line terminator to
33201 +   each array element, even empty ones, and it also converts the character
33202 +   set from your current FILE character-set to your current TRANSFER
33203 +   character-set, if any. No conversions are made or line terminations
33204 +   added in binary mode. For example, the following array:
33205 +
33206 +  dcl \&a[] = One Two Three Four Five Six
33207 +
33208 +   is sent as six lines, one word per line, in text mode, and as the bare
33209 +   unterminated string "OneTwoThreeFourFiveSix" in binary mode.
33210 +
33211 +   You should always include a /TEXT or /BINARY switch in any SEND /ARRAY
33212 +   command to force the desired transfer mode, otherwise you're likely to
33213 +   be surprised by the effects described in [619]Section 4.3.
33214 +
33215 +   Here are some examples:
33216 +
33217 +   send /text /array:\&a[]
33218 +          Sends the entire contents of the array \&a[] in text mode. Since
33219 +          an as-name is not included, the receiver is told the filename is
33220 +          _array_a_.
33221 +
33222 +   send /text /array:&a[]
33223 +   send /text /array:a[]
33224 +   send /text /array:&a
33225 +   send /text /array:a
33226 +          These are all equivalent to the previous example.
33227 +
33228 +   send /text /array:&a /as-name:foo.bar
33229 +          As above, but the array is sent under the name foo.bar.
33230 +
33231 +   send /text /array:&a[100:199] /as:foo.bar
33232 +          As above, but only the elements from 100 through 199 are sent.
33233 +
33234 +   In text-mode transfers, character sets are translated according to your
33235 +   current settings, just as for text files. In binary mode, of course,
33236 +   there is no character-set translation or other conversion of any kind.
33237 +   But remember that array elements can not contain the NUL (ASCII 0)
33238 +   character, since they are implemented as NUL-terminated strings.
33239 +
33240 +   Here's an example that shows how to send all the lines (up to 1000 of
33241 +   them) from a file animals.txt that contain the words "cat", "dog", or
33242 +   "hog" (see [620]Section 4.9 about pattern matching):
33243 +
33244 +  declare \&a[1000]
33245 +  fopen /read \%c animals.txt
33246 +  if fail exit 1
33247 +  .\%i = 0
33248 +  while true {
33249 +      fread \%c line
33250 +      if fail break
33251 +      if match {\m(line)} {*{cat,[dh]og}*} {
33252 +          increment \%i
33253 +          if ( > \%i \fdim(&a) ) break
33254 +          .\&a[\%i] := \m(line)
33255 +      }
33256 +  }
33257 +  fclose \%c
33258 +  send /array:a[1:\%i] /text
33259 +
33260 +   Note that we are careful to send only the part of the array that was
33261 +   filled, not the entire array, because there are likely to be lots of
33262 +   unused elements at the end, and these would be sent as blank lines
33263 +   otherwise.
33264 +
33265 +   This example raises an interesting question: what if we want to send
33266 +   ALL the matching lines, even if there are more than 1000 of them, but
33267 +   we don't know the number in advance? Clearly the problem is limited by
33268 +   Kermit's (and the computer's) memory. If there are a thousand trillion
33269 +   matching lines, they most likely will not fit in memory, and in this
33270 +   case the only solution is to write them first to a temporary file on
33271 +   mass storage and then send the temporary file and delete it afterwards.
33272 +
33273 +   However, when the selection is likely to fit in memory, the
33274 +   once-familiar technique of initial allocation with extents can be used:
33275 +
33276 +  if match {\m(line)} {*{cat,[dh]og}*} {
33277 +      increment \%i
33278 +      if ( > \%i \fdim(&a) ) {
33279 +          array resize a \fdim(&a)+100
33280 +          if fail stop 1 MEMORY FULL
33281 +          echo NEW DIMENSION: \fdim(&a)
33282 +      }
33283 +      .\&a[\%i] := \m(line)
33284 +  }
33285 +
33286 +   This grows the array in chunks of 100 as needed.
33287 +
33288 +  7.11. OUTPUT Command Improvements
33289 +
33290 +   LINEOUT [ text ]
33291 +          This command is exactly like OUTPUT, except it supplies a
33292 +          carriage return at the end of the text. "lineout exit" is
33293 +          exactly the same as "output exit\13".
33294 +
33295 +   SET OUTPUT SPECIAL-ESCAPES { ON, OFF }
33296 +          This command lets you tell C-Kermit whether to process \N, \L,
33297 +          and \B specially in an OUTPUT command, as distinct from other \
33298 +          sequences (such as \%a, \13, \v(time), etc). Normally the
33299 +          special escapes are handled. Use SET OUTPUT SPECIAL-ESCAPES OFF
33300 +          to disable them.
33301 +
33302 +   Disabling special escapes is necessary in situations when you need to
33303 +   transmit lines of data and you have no control over what is in the
33304 +   lines. For example, a file oofa.txt that contains:
33305 +
33306 +  This is a file
33307 +  It has \%a variables in it
33308 +  And it has \B in it.
33309 +  And it has \L in it.
33310 +  And it has \N in it.
33311 +  And this is the last line.
33312 +
33313 +   can be sent like this:
33314 +
33315 +  local line
33316 +  set output special-escapes off
33317 +  fopen /read \%c oofa.txt
33318 +  if fail stop 1 Can't open oofa.txt
33319 +  while success {
33320 +      fread \%c line
33321 +      if fail break
33322 +      ; Add filtering or processing commands here...
33323 +      output \m(line)\13
33324 +  }
33325 +
33326 +  7.12. Function and Variable Diagnostics
33327 +
33328 +   In C-Kermit 6.0 and earlier, the only diagnostic returned by a failing
33329 +   function call was an empty value, which (a) could not be distinguished
33330 +   from an empty value returned by a successful function call; (b) did not
33331 +   give any indication of the cause of failure; and (c) did not cause the
33332 +   enclosing statement to fail. C-Kermit 7.0 corrects these deficiencies.
33333 +
33334 +   SET FUNCTION DIAGNOSTICS { ON, OFF }
33335 +          when ON, allows built-in functions to return diagnostic messages
33336 +          when improperly referenced, instead of an empty string. FUNCTION
33337 +          DIAGNOSTICS are ON by default. When OFF, improperly referenced
33338 +          functions continue to return an empty string. This command also
33339 +          affects built-in variables; in this case, an error message is
33340 +          returned only if the variable does not exist. When FUNCTION
33341 +          DIAGNOSTICS are ON, the error message is also printed.
33342 +
33343 +   For variables, the only message is:
33344 +
33345 +  <ERROR:NO_SUCH_VARIABLE:\v(name)>
33346 +
33347 +   where "name" is the name of the nonexistent variable.
33348 +
33349 +   For functions, the diagnostic message is:
33350 +
33351 +  <ERROR:message:\fname()>
33352 +
33353 +   where "message" is replaced by a message, and "name" is replaced by the
33354 +   function name, e.g. <ERROR:ARG_NOT_NUMERIC:\fmod()>. Messages include:
33355 +
33356 +  ARG_BAD_ARRAY       An argument contains a malformed array reference.
33357 +  ARG_BAD_DATE        An argument contains a malformed date and/or time.
33358 +  ARG_BAD_PHONENUM    An argument contains a malformed telephone number.
33359 +  ARG_BAD_VARIABLE    An argument contains a malformed \%x variable.
33360 +  ARG_INCOMPLETE      An argument is incomplete (e.g. a broken Base64 string).
33361 +  ARG_EVAL_FAILURE    An argument could not be evaluated (internal error).
33362 +  ARG_NOT_ARRAY       An argument references an array that is not declared.
33363 +  ARG_NOT_NUMERIC     An argument that must be integer contains non-digits.
33364 +  ARG_NOT_FLOAT       An argument has bad floating-point number format.
33365 +  ARG_NOT_VARIABLE    An argument that must be a variable is not a variable.
33366 +  ARG_OUT_OF_RANGE    An argument's numeric value is too big or too small,
33367 +                      or an argument contains illegal characters (e.g. a hex
33368 +                      or Base-64 string).
33369 +  ARG_TOO_LONG        An argument's value is too long.
33370 +  ARRAY_FAILURE       Failure to create an array.
33371 +  DIVIDE_BY_ZERO      Execution of the function would cause division by zero.
33372 +  FLOATING_POINT_OP   Execution error in a floating-point operation.
33373 +  FILE_NOT_FOUND      Filename argument names a file that can't be found.
33374 +  FILE_NOT_READABLE   Filename argument is not a regular file.
33375 +  FILE_NOT_ACCESSIBLE Filename argument names a file that is read-protected.
33376 +  FILE_ERROR          Other error with filename argument.
33377 +  FILE_NOT_OPEN       A file function was given a channel that is not open.
33378 +  FILE_ERROR_-n       A file function got error -n ([621]Section 1.22).
33379 +  LOOKUP_FAILURE      Error looking up function (shouldn't happen).
33380 +  MALLOC_FAILURE      Failure to allocate needed memory (shouldn't happen).
33381 +  NAME_AMBIGUOUS      The function is not uniquely identified.
33382 +  MISSING_ARG         A required argument is missing.
33383 +  NO_SUCH_FUNCTION    An argument references a function that is not defined.
33384 +  NO_SUCH_MACRO       An argument references a macro that is not defined.
33385 +  RESULT_TOO_LONG     The result of a function is too long.
33386 +  UNKNOWN_FUNCTION    Internal error locating function (shouldn't happen).
33387 +
33388 +   Examples:
33389 +
33390 +  assign \%m \fmod()
33391 +  ?<ERROR:MISSING_ARG:\fmod()>
33392 +  echo "\fcontents(\%m)"
33393 +  "<ERROR:MISSING_ARG:\fmod()>"
33394 +  echo \fmod(3,x)
33395 +  ?<ERROR:ARG_NOT_NUMERIC:\fmod()>
33396 +  echo \fmod(3,4-2*2)
33397 +  ?<ERROR:DIVIDE_BY_ZERO:\fmod()>
33398 +
33399 +   Notice the use of \fcontents() in echoing the value of a variable that
33400 +   contains a returned error message. That's because the error message
33401 +   includes the name of the variable or function that failed, so you must
33402 +   use \fcontents() to prevent it from being evaluated again -- otherwise
33403 +   the same error will occur.
33404 +
33405 +   The handling of function and variable errors is controlled by:
33406 +
33407 +   SET FUNCTION ERROR { ON, OFF }
33408 +          Tells whether invalid function calls or variable references
33409 +          should cause command errors. FUNCTION ERROR is ON by default.
33410 +          When ON, and an error is diagnosed in a built-in function or
33411 +          variable, the command that includes the function call or
33412 +          variable reference fails. The failing command can be handled in
33413 +          the normal way with IF FAILURE / IF SUCCESS, SET TAKE ERROR, or
33414 +          SET MACRO ERROR.
33415 +
33416 +   When FUNCTION DIAGNOSTICS is OFF, there is no error message.
33417 +
33418 +   SHOW SCRIPTS displays the current FUNCTION DIAGNOSTICS and ERROR
33419 +   settings.
33420 +
33421 +  7.13. Return Value of Macros
33422 +
33423 +   In C-Kermit 5A and 6.0, there are two ways to return one level from a
33424 +   macro: RETURN value and END number text. When RETURN is used, the
33425 +   value, which can be a number or a text string, is assigned to
33426 +   \v(return). When END was used, however, \v(return) was not set.
33427 +   SUCCESS/FAILURE was set according to whether the number was zero, and
33428 +   the text was printed, but the actual value of the number was lost.
33429 +
33430 +   In C-Kermit 7.0, the END number is available in the \v(return)
33431 +   variable.
33432 +
33433 +  7.14. The ASSERT, FAIL, and SUCCEED Commands.
33434 +
33435 +   The ASSERT command is just like the IF command, but without a command
33436 +   to execute. It simply succeeds or fails, and this can be tested by a
33437 +   subsequent IF SUCCESS or IF FAILURE command. Example:
33438 +
33439 +  ASSERT = 1 1
33440 +  IF SUCCESS echo 1 = 1.
33441 +
33442 +   The FAIL command does nothing, but always fails. The SUCCEED command
33443 +   does nothing, but always succeeds.
33444 +
33445 +   These commands are handy in debugging scripts when you want to induce a
33446 +   failure (or success) that normally would not occur, e.g. for testing
33447 +   blocks of code that normally are not executed.
33448 +
33449 +  7.15. Using Alarms
33450 +
33451 +   Alarms may be set in two ways:
33452 +
33453 +   SET ALARM number
33454 +          Sets an alarm for the given number of seconds "from now", i.e.
33455 +          in the future, relative to when the SET ALARM command was given.
33456 +          Examples:
33457 +
33458 +  set alarm 60        ; 60 seconds from now
33459 +  set alarm +60       ; The same as "60"
33460 +  set alarm -60       ; Not legal - you can't set an alarm in the past.
33461 +  set alarm 60*60     ; 60 minutes from now.
33462 +  set alarm \%a+10    ; You can use variables, etc.
33463 +
33464 +   SET ALARM hh:mm:ss
33465 +          Sets an alarm for the specified time. If the given time is
33466 +          earlier than the current time, the alarm is set for the given
33467 +          time in the next day. You may give the time in various formats:
33468 +
33469 +  set alarm 15:00:00  ; 3:00:00pm
33470 +  set alarm 3:00:00pm ; 3:00:00pm
33471 +  set alarm 3:00pm    ; 3:00:00pm
33472 +  set alarm 3pm       ; 3:00:00pm
33473 +
33474 +   SHOW ALARM
33475 +          Displays the current alarm, if any, in standard date-time format
33476 +          (see [622]Section 1.6): yyyymmdd hh:mm:ss.
33477 +
33478 +   IF ALARM command
33479 +          Executes the command if an alarm has been set and the alarm time
33480 +          has passed.
33481 +
33482 +   IF ALARM { command-list } [ ELSE { command-list } ]
33483 +          Executes the command-list if an alarm has been set and the alarm
33484 +          time has passed. Otherwise, if an ELSE part is given, its
33485 +          command-list is executed.
33486 +
33487 +   CLEAR ALARM
33488 +          Clears the alarm.
33489 +
33490 +   Only one alarm may be set at a time.
33491 +
33492 +   Example: Suppose you have a script that is always running, and that
33493 +   transfers files periodically, and that keeps a transaction log. Suppose
33494 +   you want to start a new transaction log each day:
33495 +
33496 +  log transactions \v(date).log
33497 +  set alarm 00:00:00                     ; Set an alarm for midnight
33498 +  while true {                           ; Main script loop
33499 +      xif alarm {                        ; If the alarm time is past...
33500 +          close transactions             ; Close current log
33501 +          log transactions \v(date).log  ; Start new one
33502 +          pause 1                        ; To make sure 00:00:00 is past
33503 +          set alarm 00:00:00             ; Set a new alarm
33504 +      }
33505 +      ; put the rest of the script here...
33506 +  }
33507 +
33508 +   Note that IF ALARM -- no matter whether it succeeds or fails -- does
33509 +   NOT clear an expired alarm. Thus, once an alarm has expired, every IF
33510 +   ALARM will succeed until the alarm is cleared (with the CLEAR ALARM
33511 +   command) or reset with a new SET ALARM command.
33512 +
33513 +  7.16. Passing Arguments to Command Files
33514 +
33515 +   Beginning in version 7.0, C-Kermit accepts arguments on the TAKE
33516 +   command line, for example:
33517 +
33518 +  C-Kermit> take oofa.ksc one two {this is three} four
33519 +
33520 +   This automatically sets the variables \%1 through \%9 to the arguments,
33521 +   and \%0 to the name of the file, in this case:
33522 +
33523 +  \%0 = /usr/olga/oofa.ksc
33524 +  \%1 = one
33525 +  \%2 = two
33526 +  \%3 = this is three
33527 +  \%4 = four
33528 +
33529 +   and \%5..\%9 are undefined (empty). Arguments past the ninth are
33530 +   available in the \&_[] argument-vector array ( [623]Section 7.5).
33531 +
33532 +   The variables are those at the current macro level. Thus, if the TAKE
33533 +   command is executed from within a macro, the macro's arguments are
33534 +   replaced by those given on the TAKE command line (but only if at least
33535 +   one argument is given). The command shown above is exactly equivalent
33536 +   to:
33537 +
33538 +  assign \%0 /usr/olga/oofa.ksc
33539 +  assign \%1 one
33540 +  assign \%2 two
33541 +  assign \%3 this is three
33542 +  assign \%4 four
33543 +  assign \%5
33544 +  assign \%6
33545 +  assign \%7
33546 +  assign \%8
33547 +  assign \%9
33548 +  take oofa.ksc
33549 +
33550 +   Remember, the variables \%0..\%9 are on the macro call stack, and
33551 +   command files are independent of the macro stack. Thus, if a command
33552 +   file TAKEs another command file and passes arguments to it, the
33553 +   variables are changed from that point on for both files, and so forth
33554 +   for all levels of nested command files without intervening macro
33555 +   invocations.
33556 +
33557 +   It would have been possible to change C-Kermit to use the overall
33558 +   command stack, rather than the macro stack, for arguments -- this would
33559 +   have made TAKE work exactly like DO, which is "nicer", but it would
33560 +   also have broken countless existing scripts. However, the new SHIFT
33561 +   command ([624]Section 7.5) makes it possible to create an alternative
33562 +   TAKE command that does indeed save and restore the argument variables
33563 +   at its own level around execution of a command file:
33564 +
33565 +  define mtake {
33566 +     local \%f
33567 +     assign \%f \fcontents(\%1)
33568 +     shift
33569 +     take \%f
33570 +  }
33571 +
33572 +   C-Kermit 7.0 also supports a new, easier way to pass arguments to
33573 +   scripts from the system command line:
33574 +
33575 +  kermit filename arg1 arg2 arg3 ...
33576 +
33577 +   in which arg1, arg2, arg3 (etc) are arguments for the script (whose
33578 +   filename is given), and are assigned to \%1, \%2, ... \%9. The filename
33579 +   is assigned to \%0. This applies equally to "Kerbang" scripts in UNIX
33580 +   ([625]Section 7.19). For example, suppose you have a file called
33581 +   "showargs" containing the following lines:
33582 +
33583 +  #!/usr/local/bin/kermit +
33584 +  echo Hello from \%0
33585 +  show args
33586 +  exit
33587 +
33588 +   (except not indented, since the "#!" line must be on the left margin).
33589 +   If you give this file execute permission:
33590 +
33591 +  chmod +x showargs
33592 +
33593 +   then you can run it exactly as you would run a UNIX shell script, e.g.:
33594 +
33595 +  $ showargs one two three
33596 +  Hello from /usr/olga/showargs
33597 +  Top-level arguments (\v(argc) = 4):
33598 +   \&_[0] = /usr/olga/showargs
33599 +   \&_[1] = one
33600 +   \&_[2] = two
33601 +   \&_[3] = three
33602 +
33603 +   Furthermore, the \&_[] array now contains the filename, if one was
33604 +   given as the first command line argument, or it is a "Kerbang" script,
33605 +   in element 0.
33606 +
33607 +   Otherwise element 0 is program name, and elements 1 through \v(argc)-1
33608 +   contain the command-line arguments, if any, that appear after "--" or
33609 +   "=", if any. This array is saved and restored around macro calls;
33610 +   recall that inside macros it contains the macro argument vector
33611 +   (allowing you to access arguments programmatically, and to have more
33612 +   than 9 of them).
33613 +
33614 +   At top level, notice the difference between the \&@[] and \&_[] arrays.
33615 +   The former includes C-Kermit options; the latter omits them.
33616 +
33617 +  7.17. Dialogs with Timed Responses
33618 +
33619 +   The ASK, ASKQ, GETOK, and GETC commands (let's call them the "ASK-class
33620 +   commands") let you write scripts that carry on dialogs with the user,
33621 +   asking them for text, a Yes/No answer, or a character, respectively.
33622 +   Prior to C-Kermit 7.0, these questions would always wait forever for an
33623 +   answer. In C-Kermit 7.0, you may specify a time limit for them with the
33624 +   new command:
33625 +
33626 +   SET ASK-TIMER number
33627 +          Sets a time-limit on ASK-CLASS commands to the given number of
33628 +          seconds. If the number is 0 or less, there is no time limit and
33629 +          these commands wait forever for a response. Any timer that is
33630 +          established by this command remains in effect for all future
33631 +          ASK-class commands until another SET ASK-TIMER command is given
33632 +          (e.g. with a value of 0 to disable ASK timeouts).
33633 +
33634 +   IF ASKTIMEOUT command
33635 +          An ASK-class command that times out returns a failure status.
33636 +          You can test explicitly for a timeout with:
33637 +
33638 +  7.18. Increased Flexibility of SWITCH Case Labels
33639 +
33640 +   Prior to C-Kermit 7.0 / K95 1.1.19, the case labels in SWITCH
33641 +   statements were string constants.
33642 +
33643 +   Now case labels can be variables, function calls, or any mixture of
33644 +   these with each other and/or with regular characters.
33645 +
33646 +   Furthermore, after the case label is evaluated, it is treated not as a
33647 +   string constant, but as a pattern against which the SWITCH variable is
33648 +   matched ([626]Section 4.9.1).
33649 +
33650 +   This introduces a possible incompatibility with previous releases,
33651 +   since the following characters in case labels are no longer taken
33652 +   literally:
33653 +
33654 +  \ * ? [ {
33655 +
33656 +   Any scripts that previously included any of these characters in case
33657 +   labels must now quote them with backslash (\).
33658 +
33659 +  7.19. "Kerbang" Scripts
33660 +
33661 +   In UNIX only, Kermit scripts can be stored in files and run "directly",
33662 +   without starting Kermit first (as noted on page 467 of the manual),
33663 +   just as a shell script can be "run" as if it were a program. This
33664 +   section amplifies on that idea a bit, and presents some new aspects of
33665 +   version 7.0 that make it easier to write and run Kermit scripts
33666 +   directly.
33667 +
33668 +     NOTE: On non-UNIX platforms, such as VMS or Windows, Kerbang scripts
33669 +     can be run as "kermit + scriptfilename arg1 arg2 arg3 ...". Windows
33670 +     95/98/NT file associations do not allow for the passing of
33671 +     parameters. In VMS, however, you can achieve the Kerbang effect by
33672 +     defining a symbol, as in this example:
33673 +
33674 +  $ autotelnet :== "$SYS$TOOLS:KERMIT.EXE + AUTOTELNET.KSC"
33675 +
33676 +     and then running the script like any other command:
33677 +
33678 +  $ autotelnet xyzcorp.com myuserid
33679 +
33680 +     See [627]Section 9.3 for an explanation of the "+" symbol.
33681 +
33682 +   UNIX shell scripts can specify which shell should run them by including
33683 +   a "shebang" line at the top, e.g.:
33684 +
33685 +  #!/bin/sh
33686 +
33687 +   (but not indented; the shebang line must be on the left margin). The
33688 +   term "shebang" is a contraction of "shell" and "bang". "Bang" is a
33689 +   slang word for the exclamation mark ("!"); "shebang" itself is an
33690 +   American slang word used in in the phrase "the whole shebang".
33691 +
33692 +   We can run Kermit scripts directly too, by including a "shebang" line
33693 +   that names Kermit as the "shell"; thus we call these "Kerbang" scripts.
33694 +   This mechanism has been considerably simplified in C-Kermit 7.0 to
33695 +   facilitate C-Kermit's use a scripting tool just like any of the UNIX
33696 +   shells or scripting languages. The rules are the same as for shell
33697 +   scripts:
33698 +
33699 +    1. The first line of the Kermit script must begin with "#!"
33700 +       immediately followed by the full pathname of the program that will
33701 +       execute the script (in this case, C-Kermit rather than a UNIX
33702 +       shell), followed by any Kermit command-line options. To suppress
33703 +       execution of the C-Kermit initialization file and to make command
33704 +       line arguments available to the script, the final option should be
33705 +       "+":
33706 +  #!/usr/local/bin/kermit +
33707 +
33708 +       Some users have reported that in some circumstances a space might
33709 +       be necessary after the plus sign; this depends on your shell -- it
33710 +       has nothing to do with Kermit. In most cases, no space is needed.
33711 +    2. The file must have execute permission (granted via "chmod +x
33712 +       filename").
33713 +
33714 +   When C-Kermit is invoked from a Kerbang script (or from the system
33715 +   prompt with a "+" command-line argument, which amounts to the same
33716 +   thing), the following special rules apply:
33717 +
33718 +    1. The C-Kermit initialization file is NOT executed automatically. If
33719 +       you want it to be executed, include a TAKE command for it in the
33720 +       script, e.g. "take \v(home).kermrc". (In previous releases, the
33721 +       initialization file was always executed, with no way to prevent it
33722 +       except for the user to include Kermit-specific command line options
33723 +       which had nothing to do with the script). Many scripts have no need
33724 +       for the standard Kermit initialization file, which is quite lengthy
33725 +       and not only delays startup of the script, but also spews forth
33726 +       numerous messages that are most likely unrelated to the script.
33727 +    2. If the initialization file is not executed, neither is your
33728 +       customization file, since the initialization file is the command
33729 +       file from which the customization file is TAKEn. Again, you can
33730 +       include a TAKE command for the initialization file if desired, or
33731 +       for the customization file by itself, or for any other file.
33732 +    3. C-Kermit does not process command-line arguments at all. Instead,
33733 +       it passes all words on the command line after the "+" to the script
33734 +       as \%0 (the script name), \%1..\%9 (the first nine arguments), as
33735 +       well as in the argument vector array \&_[]. The variable \v(argc)
33736 +       is set to the total number of "words" (as passed by the shell to
33737 +       Kermit) including the script name. Quoting and grouping rules are
33738 +       those of the shell.
33739 +    4. At any point where the script terminates, it must include an EXIT
33740 +       command if you want it to exit back to the shell; otherwise
33741 +       C-Kermit enters interactive prompting mode when the script
33742 +       terminates. The EXIT command can include a numeric status to be
33743 +       returned to the shell (0, 1, etc), plus an optional message.
33744 +
33745 +   Here is a simple Kerbang script that prints its arguments:
33746 +
33747 +  #/usr/local/bin/kermit +
33748 +  echo Hello from \%0
33749 +  for \%i 0 \v(argc)-1 1 {
33750 +      echo \%i. "\&_[\%i]"
33751 +  }
33752 +  exit 0
33753 +
33754 +   Save this file as (say) "showargs", then give it execute permission and
33755 +   run it (the \&_[] array is the same as \%0..\%9, but allows you to
33756 +   refer to argument variables programmatically; see [628]Section 7.5).
33757 +   (Yes, you could substitute SHOW ARGUMENTS for the loop.)
33758 +
33759 +  $ chmod +x showargs
33760 +  $ ./showargs one "this is two" three
33761 +
33762 +   The script displays its arguments:
33763 +
33764 +  Hello from /usr/olga/showargs
33765 +  0. "/usr/olga/showargs"
33766 +  1. "one"
33767 +  2. "this is two"
33768 +  3. "three"
33769 +  $
33770 +
33771 +   Notice that no banners or greetings are printed and that startup is
33772 +   instantaneous, just like a shell script. Also notice that grouping of
33773 +   arguments is determined by *shell* quoting rules, not Kermit ones,
33774 +   since the command line is parsed by the shell before Kermit ever sees
33775 +   it.
33776 +
33777 +   Of course you can put any commands at all into a Kerbang script. It can
33778 +   read and write files, make connections, transfer files, anything that
33779 +   Kermit can do -- because it *is* Kermit. And of course, Kerbang scripts
33780 +   can also be executed from the Kermit prompt (or from another script)
33781 +   with a TAKE command; the Kerbang line is ignored since it starts with
33782 +   "#", which is a comment introducer to Kermit just as it is to the UNIX
33783 +   shell. In VMS and other non-UNIX platforms, the Kerbang line has no
33784 +   effect and can be omitted.
33785 +
33786 +   It might be desireable for a script to know whether it has been invoked
33787 +   directly from the shell (as a Kerbang script) or by a TAKE command
33788 +   given to the Kermit prompt or in a Kermit command file or macro. This
33789 +   can be done as in this example:
33790 +
33791 +  #!/usr/local/bin/kermit +
33792 +  assign \%m \fbasename(\%0)
33793 +  define usage { exit 1 {usage: \%m phonenumber message} }
33794 +  define apage { (definition of APAGE...) } ; (See [629]book pp.454-456)
33795 +  xif equal "\%0" "\v(cmdfil)" {
33796 +      if not def \%1 usage
33797 +      if not def \%2 usage
33798 +      apage {\%1} {\%2}
33799 +      exit \v(status)
33800 +  }
33801 +
33802 +   In a Kerbang script, \%0 and \v(cmdfile) are the same; both of them are
33803 +   the name of the script. When a script is invoked by a Kermit TAKE
33804 +   command, \%0 is the name of the Kermit program, but \v(cmdfile) is the
33805 +   name of the script. In the example above, a macro called APAGE is
33806 +   defined. If the script was invoked directly, the APAGE macro is also
33807 +   executed. Otherwise, it is available for subsequent and perhaps
33808 +   repeated use later in the Kermit session.
33809 +
33810 +   An especially handy use for Kerbang scripts is to have the
33811 +   initialization file itself be one. Since the standard initialization
33812 +   file is rather long and time-consuming to execute, it is often overkill
33813 +   if you want to start Kermit just to transfer a file. Of course there
33814 +   are command-line switches to suppress initialization-file execution,
33815 +   etc, but another approach is to "run" the initialization file when you
33816 +   want its features (notably the services directory), and run C-Kermit
33817 +   directly when you don't. A setup like this requires that (a) the
33818 +   C-Kermit initialization file is configured as a Kerbang script (has
33819 +   #!/path.../kermit as first line), has execute permission, and is in
33820 +   your PATH; and (b) that you don't have a .kermrc file in your login
33821 +   directory.
33822 +
33823 +  7.20. IF and XIF Statement Syntax
33824 +
33825 +   The IF command has been improved in two significant ways in C-Kermit
33826 +   7.0, described in the following subsections. All changes are backwards
33827 +   compatible.
33828 +
33829 +    7.20.1. The IF/XIF Distinction
33830 +
33831 +   The distinction between IF and XIF is no longer important as of
33832 +   C-Kermit 7.0. You should be able to use IF in all cases (and of course,
33833 +   also XIF for backwards compatibility). In the past, IF was used for
33834 +   single-command THEN parts, followed optionally by a separate ELSE
33835 +   command:
33836 +
33837 +  IF condition command1    ; THEN part
33838 +  ELSE command2            ; ELSE part
33839 +
33840 +   whereas XIF was required if either part had multiple commands:
33841 +
33842 +  XIF condition { command, command, ... } ELSE { command, command, ... }
33843 +
33844 +   The syntactic differences were primarily that IF / ELSE was two
33845 +   commands on two separate lines, whereas XIF was one command on one
33846 +   line, and that XIF allowed (and in fact required) braces around its
33847 +   command lists, whereas IF did not allow them.
33848 +
33849 +   Furthermore, the chaining or nesting of parts and conditions was
33850 +   inconsistent. For example, the IF command could be used like this:
33851 +
33852 +  IF condition command
33853 +  ELSE IF condition command
33854 +  ELSE IF condition command
33855 +  ELSE IF condition command
33856 +  ...
33857 +
33858 +   but XIF could not. C-Kermit 7.0 accepts the old syntax and executes it
33859 +   the same as previous versions, but also accepts a new unified and more
33860 +   convenient syntax:
33861 +
33862 +   IF condition command-list [ ELSE command-list ]
33863 +
33864 +   or:
33865 +
33866 +IF condition command-list
33867 +ELSE command-list
33868 +
33869 +   in which the ELSE part is optional, and where command-list can be a
33870 +   single command (with or without braces around it) or a list of commands
33871 +   enclosed in braces. Examples:
33872 +
33873 +   Example 1:
33874 +
33875 +  IF condition { command1, command2 } ELSE { command3, command4 }
33876 +
33877 +   Example 2 (same as Example 1):
33878 +
33879 +  IF condition {
33880 +     command1
33881 +     command2
33882 +  } ELSE {
33883 +     command3
33884 +     command4
33885 +  }
33886 +
33887 +   Example 3 (same as 1 and 2):
33888 +
33889 +  IF condition {
33890 +     command1
33891 +     command2
33892 +  }
33893 +  ELSE { command3, command4 }
33894 +
33895 +   Example 4 (same as 1-3):
33896 +
33897 +  IF condition {
33898 +     command1
33899 +     command2
33900 +  }
33901 +  ELSE {
33902 +     command3
33903 +     command4
33904 +  }
33905 +
33906 +   Example 5 (ELSE can be followed by another command):
33907 +
33908 +  IF condition1 {
33909 +     command1
33910 +     command2
33911 +  } ELSE IF condition2 {
33912 +     command3
33913 +     command4
33914 +  } ELSE {
33915 +     command5
33916 +     command6
33917 +  }
33918 +
33919 +   Example 5 suggests other possibilities:
33920 +
33921 +  IF condition {
33922 +     command1
33923 +     command2
33924 +  } ELSE FOR variable initial final increment {
33925 +     command3
33926 +     command4
33927 +  }
33928 +
33929 +   And this too is possible, except for some non-obvious quoting
33930 +   considerations:
33931 +
33932 +  dcl \&a[6] = one two three four five six
33933 +
33934 +  IF < \%n 3 {
33935 +      echo \\%n is too small: \%n
33936 +  } ELSE FOR \\%i 1 \\%n 1 {
33937 +      echo \\%i. \\&a[\\%i]
33938 +  }
33939 +
33940 +   (The loop variable must be quoted in this context to prevent premature
33941 +   evaluation.)
33942 +
33943 +   Many C programmers prefer to code IF-ELSE, WHILE, FOR, and SWITCH with
33944 +   the block-open bracket on its own line. This does not work in Kermit:
33945 +
33946 +  IF condition        ; THIS FORMAT DOES NOT NOT WORK
33947 +  {
33948 +     command1
33949 +     command2
33950 +  }
33951 +  ELSE
33952 +  {
33953 +     command3
33954 +     command4
33955 +  }
33956 +
33957 +   Explanation: the Kermit command language is line oriented; each line is
33958 +   a command, each command is a line. The first line above, having no hint
33959 +   of continuation, is an incomplete command, yet syntactically correct --
33960 +   an IF statement with an empty THEN part. Interestingly enough, since
33961 +   the next line begins with "{" it is a block that (in [630]C-Kermit 8.0
33962 +   and later) is a block that is executed unconditionally. Thus the
33963 +   commands in the THEN part are executed regardless of whether the
33964 +   condition is true -- not what you wanted!
33965 +
33966 +   The new block syntax used in the IF, WHILE, FOR, and SWITCH commands
33967 +   employs certain tricks to allow multiple lines to be treated as a
33968 +   single line:
33969 +
33970 +     * Any line ending with "{" (ignoring whitespace and comments) marks
33971 +       the beginning of a block;
33972 +     * Any line beginning with "}" (ignoring whitespace) marks the end of
33973 +       a block;
33974 +     * Line breaks within a block separate commands; the comma is implied
33975 +       by the line end.
33976 +
33977 +   Thus:
33978 +
33979 +  IF condition {
33980 +     command1
33981 +     command2
33982 +  } ELSE {
33983 +     command3
33984 +     command4
33985 +  }
33986 +
33987 +   is "assembled" into:
33988 +
33989 +  IF condition { command1, command2 } ELSE { command3, command4 }
33990 +
33991 +   Note the addition of commas to separate commands within blocks. As
33992 +   always, if you need continue a command onto additional lines, you can
33993 +   end the continued lines with the continuation character, "-". You can
33994 +   also do this if you want to put opening brackets on their own line:
33995 +
33996 +  IF condition -
33997 +  {
33998 +     command1
33999 +     command2
34000 +  }
34001 +  ELSE -
34002 +  {
34003 +     command3
34004 +     command4
34005 +  }
34006 +
34007 +    7.20.2. Boolean Expressions (The IF/WHILE Condition)
34008 +
34009 +   Prior to C-Kermit 7.0, the IF and WHILE commands accepted only a single
34010 +   Boolean ("true or false") assertion, e.g. "if > \%m 0 command" or "if
34011 +   exist filename command". There was no way to form Boolean expressions
34012 +   and, in particular, nothing that approached a Boolean OR function (AND
34013 +   could be simulated by concatenating IF statements: "if condition1 if
34014 +   condition2..").
34015 +
34016 +   C-Kermit 7.0 (and K95 1.1.19) allow grouping of Boolean assertions
34017 +   using parentheses and combining them using AND (or &&) and OR (or ||).
34018 +   Each of these operators -- including the parentheses -- is a field and
34019 +   must be set off by spaces. AND has higher precedence than OR, NOT has
34020 +   higher precedence than AND, but parentheses can be used to force any
34021 +   desired order of evaluation. The old syntax is still accepted.
34022 +
34023 +   Here are some examples:
34024 +
34025 +  define \%z 0                          ; Define some variables
34026 +  define \%n 1                          ; for use in the examples.
34027 +
34028 +  if > \%n \%z echo \%n is greater.     ; Original format - still accepted.
34029 +  if ( > \%n \%z ) echo \%n is greater. ; Parentheses may be used in 7.0.
34030 +  if ( > \%n \%z && not = \%z 0 ) ...   ; Two assertions combined with AND.
34031 +  if ( > \%n \%z and not = \%z 0 ) ...  ; Same as previous ("and" = "&&").
34032 +  if ( > \%n \%z || not = \%z 0 ) ...   ; Two assertions combined with OR.
34033 +  if ( > \%n \%z or not = \%z 0 ) ...   ; Same as previous ("or" = "||").
34034 +  if ( > \%n \%z || != \%z 0 ) ...      ; Ditto ("!=" = "not =").
34035 +  while ( 1 ) { ... }                   ; Just like C.
34036 +
34037 +   Notice the spaces around all operators including the parentheses --
34038 +   these are required. The following examples show how parentheses can be
34039 +   used to alter the precedence of the AND and OR operators:
34040 +
34041 +  if ( false || false && false || true ) ,..         ; True
34042 +  if ( false || ( false && false ) || true ) ...     ; Same as previous
34043 +  if ( ( false || false ) && ( false || true ) ) ... ; False
34044 +
34045 +   Similarly for NOT:
34046 +
34047 +  if ( not true && false ) ...          ; False (NOT binds to TRUE only)
34048 +  if ( ( not true ) && false ) ...      ; Same as previous
34049 +  if ( not ( true && false ) ) ...      ; True (NOT binds to (TRUE && FALSE))
34050 +
34051 +   Notes:
34052 +
34053 +    1. The syntax of the Boolean expression itself has not changed; each
34054 +       expression begins with a keyword or token such as "EXIST", ">", or
34055 +       "=", etc; operators such as "<", "=", and ">" do not go between
34056 +       their operands but precede them as before; this might be called
34057 +       "reverse reverse Polish notation"; it allows deterministic
34058 +       on-the-fly parsing of these expressions at the C-Kermit> prompt as
34059 +       well as in scripts, and allows ?-help to be given for each item
34060 +       when IF or WHILE commands are typed at the prompt.
34061 +    2. Parentheses are required when there is more than one Boolean
34062 +       assertion.
34063 +    3. Parentheses are not required, but are allowed, when there is only
34064 +       one Boolean assertion.
34065 +    4. Evaluation of Boolean assertions occurs left to right, but the
34066 +       resulting Boolean expression is evaluated afterwards according to
34067 +       the rules of precedence. All Boolean assertions are always
34068 +       evaluated; there is no "early stopping" property and therefore no
34069 +       question about when or if side effects will occur -- if any Boolean
34070 +       assertion has side effects, they will always occur.
34071 +
34072 +   Constructions of arbitrary complexity are possible, within reason.
34073 +
34074 +   Also see [631]Section 7.4 for new IF / WHILE conditions.
34075 +
34076 +  7.21. Screen Formatting and Cursor Control
34077 +
34078 +   C-Kermit 7.0 adds a simple way to create formatted screens, the SCREEN
34079 +   command:
34080 +
34081 +   SCREEN { CLEAR, CLEOL, MOVE-TO row [ column ] }
34082 +          Performs screen-formatting actions. Correct operation of these
34083 +          commands depends on proper terminal setup on both ends of the
34084 +          connection -- mainly that the host terminal type is set to agree
34085 +          with the kind of terminal or the emulation you are viewing
34086 +          C-Kermit through. The UNIX version uses terminfo or termcap (not
34087 +          curses); the VMS version uses SMG; K-95 uses its built in screen
34088 +          manager.
34089 +
34090 +   SCREEN CLEAR
34091 +          Moves the cursor to home position and clears the entire screen.
34092 +          Synonyms: CLEAR COMMAND-SCREEN ALL (K-95 only), CLS, CLEAR
34093 +          SCREEN.
34094 +
34095 +   SCREEN CLEOL
34096 +          Clears from the current cursor position to the end of the line.
34097 +          Synonym: CLEAR COMMAND-SCREEN EOL (K-95 only)
34098 +
34099 +   SCREEN MOVE-TO row column
34100 +          Moves the cursor to the indicated row and column. The row and
34101 +          column numbers are 1-based, so on a 24x80 screen the home
34102 +          position is 1 1 and the lower right corner is 24 80. If a row or
34103 +          column number is given that too large for what Kermit or the
34104 +          operating system thinks is your screen size, the appropriate
34105 +          number is substituted.
34106 +
34107 +   These escape sequences used by these commands depends on the platform.
34108 +   In UNIX, your TERM environment variable is used to query the
34109 +   terminfo/termcap database; if the query fails, ANSI/VT100 sequences are
34110 +   used. In VMS, the SMG library is used, which sends sequences based on
34111 +   your VMS terminal type. K95 does its own screen control. On other
34112 +   platforms (such as AOS/VS, VOS, etc), screen formatting is not
34113 +   supported, and the SCREEN command does nothing.
34114 +
34115 +   The three SCREEN actions can be used in scripts to produce menus,
34116 +   formatted screens, dynamic displays, etc. Related variables include:
34117 +
34118 +  \v(terminal)     The type terminal C-Kermit thinks you have.
34119 +  \v(rows)         The number of rows C-Kermit thinks your terminal has.
34120 +  \v(columns)      The number of columns C-Kermit thinks your terminal has.
34121 +
34122 +   And functions:
34123 +
34124 +  \fscrncurx()     The current X coordinate of the cursor (K-95 only).
34125 +  \fscrncury()     The current Y coordinate of the cursor (K-95 only).
34126 +  \fscrnstr(x,y,n) The string of length nat position (x,y) (K-95 only).
34127 +
34128 +   And commands:
34129 +
34130 +  ECHO string      Writes string + CRLF at the current cursor position.
34131 +  XECHO string     Writes string at current cursor position; CRLF not supplied.
34132 +  GETC v prompt    Issues prompt, reads one character into variable v, no echo.
34133 +
34134 +   And special characters:
34135 +
34136 +  Ctrl-L           At the C-Kermit> command prompt, or in a C-Kermit command,
34137 +                   works like Return or Enter, but also clears the screen
34138 +
34139 +   Example 1: A macro that prints a message \%1 at cursor position
34140 +   (\%2,\%3):
34141 +
34142 +  define MSG {
34143 +      if not def \%3 def \%3 0             ; Default column to 0
34144 +      if > \v(argc) 2 screen move \%2 \%3  ; Move to given row/col (if any)
34145 +      screen cleol                         ; Clear to end of line
34146 +      if def \%1 xecho \fcontents(\%1)     ; Print message (if any)
34147 +  }
34148 +
34149 +   Example 2: A macro put the cursor on the bottom screen line, left
34150 +   margin:
34151 +
34152 +  define BOT {
34153 +      screen move \v(rows) 0
34154 +  }
34155 +
34156 +   Example 3: A macro to center message \%1 on line \%2.
34157 +
34158 +  define CENTER {
34159 +      if not def \%2 def \%2 1
34160 +      .\%x ::= (\v(cols)-\flen(\%1))/2
34161 +      msg {\%1} {\%2} {\%x}
34162 +  }
34163 +
34164 +   Example 4: A simple menu (building on Examples 1-3):
34165 +
34166 +  def \%c 0                             ; Menu choice variable
34167 +  screen clear                          ; Clear the screen
34168 +  center {Welcome to This Menu} 2       ; Display the menu
34169 +  msg {Choices:} 4
34170 +  msg { 1. File} 6
34171 +  msg { 2. Edit} 7
34172 +  msg { 3. Exit} 8
34173 +  while ( != \%c 3 ) {                  ; Read and verify choice
34174 +      while true {                      ; Keep trying till we get a good one
34175 +          screen move 10                ; Move to line 10
34176 +          screen cleol                  ; Clear this line
34177 +          getc \%c {Your choice: }      ; Prompt and get and echo 1 character
34178 +          xecho \%c
34179 +          if ( not numeric \%c ) { msg {Not numeric - "\%c"} 12, continue }
34180 +          if ( >= \%c 1 && <= \%c 3 ) break
34181 +          msg {Out of range - "\%c"} 12
34182 +      }
34183 +      switch \%c {                      ; Valid choice - execute it.
34184 +        :1, msg {Filing... } 12, break
34185 +        :2, msg {Editing...} 12, break
34186 +        :3, msg {Exiting...} 12, break
34187 +      }
34188 +  }
34189 +  echo Bye                              ; Exit chosen - say goodbye.
34190 +  bot                                   ; Leave cursor at screen bottom.
34191 +  exit                                  ; And exit.
34192 +
34193 +   Similar scripts can work over the communication connection; substitute
34194 +   INPUT and OUTPUT for GETC and ECHO/XECHO.
34195 +
34196 +  7.22. Evaluating Arithmetic Expressions
34197 +
34198 +   A new arithmetic operator was added to the list recognized by the
34199 +   EVALUATE command, the \feval() function, and which can also be used
34200 +   anywhere else arithmetic expressions are accepted (numeric command
34201 +   fields, array subscripts, etc):
34202 +
34203 +   Prefix "!"
34204 +          This operator inverts the "truth value" of the number or
34205 +          arithmetic expression that follows. If the value of the operand
34206 +          is 0, the result is 1. If the value is nonzero, the result is 0.
34207 +
34208 +   Examples:
34209 +
34210 +  set eval old
34211 +  evaluate 0
34212 +  0
34213 +
34214 +  evaluate !0
34215 +  1
34216 +
34217 +  evaluate !3
34218 +  0
34219 +
34220 +  evaluate !(-3)
34221 +  0
34222 +
34223 +  .\%a = 1
34224 +  .\%b = 0
34225 +  evaluate !(\%a|\%b)
34226 +  0
34227 +
34228 +  evaluate !(\%a&\%b)
34229 +  1
34230 +
34231 +  evaluate !(!(\%a&\%b))
34232 +  0
34233 +
34234 +   Note the distinction between Prefix ! (invert truth value) and Suffix !
34235 +   (factorial). Also the distinction between Prefix ! and Prefix ~ (which
34236 +   inverts all the bits in its operand). Also note that prefix operators
34237 +   (!, -, and ~) can not be adjacent unless you use parentheses to
34238 +   separate them, as shown in the final example above.
34239 +
34240 +  7.23. Floating-Point Arithmetic
34241 +
34242 +   C-Kermit 7.0 adds limited support for floating-point numbers (numbers
34243 +   that have fractional parts, like 3.141592653). This support is provided
34244 +   through a small repertoire of functions and in Boolean expressions that
34245 +   compare numbers, but does not apply to number parsing in general, or to
34246 +   expression evaluation, array subscripts, the INCREMENT and DECREMENT
34247 +   commands, or in any context other than those listed in this section.
34248 +
34249 +   A floating point number has an optional sign (+ or -), followed by a
34250 +   series of decimal digits containing either zero or one period (.)
34251 +   character, which is the decimal point. The use of comma or any other
34252 +   character besides period as a decimal point is not supported.
34253 +   Scientific notation is not supported either. Examples of legal
34254 +   floating-point numbers:
34255 +
34256 +  0                Integers can be used
34257 +  1                Ditto
34258 +  2.               A decimal point without decimal digits
34259 +  3.0              A decimal point with decimal digits
34260 +  3.141592653      Ditto
34261 + -4.0              A negative sign can be included
34262 + +5.0              A positive sign can be included
34263 +
34264 +   Examples of notations that are not accepted:
34265 +
34266 +  1,000,000        Separators can not be used
34267 +  1.000.000        Ditto (or multiple decimal points)
34268 +  6.022137E23      No scientific notation
34269 +  6.62606868e-34   Ditto
34270 +  12.5+6.25        No "bare" expressions
34271 +
34272 +   You can use IF FLOAT test a string or variable to see if it's in
34273 +   acceptable floating-point format. Example:
34274 +
34275 +  ask \%f { Type a number: }
34276 +  if not def \%f .\%f = 0.0
34277 +  if not float \%f stop 1 Invalid floating-point number: "\%f"
34278 +
34279 +   C-Kermit's floating-point support, like its support for whole numbers
34280 +   (integers), relies on the capabilities of the underlying computer. Your
34281 +   computer has only a limited amount of precision for numbers, depending
34282 +   on its architecture. Thus floating-point numbers that have too many
34283 +   digits will not be accurate; adding a very small number to a very large
34284 +   one might have no effect at all; and so on. For details, read a text on
34285 +   numerical analysis. Example:
34286 +
34287 +  .\%a = 11111111111111111111  ; A long number
34288 +  .\%b = 22222222222222222222  ; Another one
34289 +  echo \ffpadd(\%a,\%b)        ; Add them - the result should be all 3's
34290 +  33333333333333330000.0       ; See the result
34291 +
34292 +   In this example, the computer has 16 digits of precision; after that,
34293 +   the (low-order) digits are set to 0, since the computer doesn't know
34294 +   what they really are. In fact, the computer returns random digits, but
34295 +   Kermit sets all digits beyond the computer's precision to 0.
34296 +
34297 +   C-Kermit's floating-point functions have names of the form
34298 +   "\ffpxxx(args)" ("\f" for function, "fp" for floating-point), where
34299 +   "xxx" is replaced by the name of the function, such as "sqrt", and
34300 +   "args" is the argument list, consisting of one or two floating-point
34301 +   numbers (depending on the function), and an optional "d" argument that
34302 +   says now many decimal places should be shown in the result. Example:
34303 +
34304 +  \ffpdiv(10,3,1) returns "3.3"
34305 +  \ffpdiv(10,3,2) returns "3.33"
34306 +  \ffpdiv(10,3,3) returns "3.333"
34307 +
34308 +   and so on, up to the precision of the computer. If the decimal-places
34309 +   argument is less than zero, the fractional part of the result is
34310 +   truncated:
34311 +
34312 +  \ffpdiv(10,3,-1) returns "3".
34313 +
34314 +   If the decimal-places argument is 0, or is omitted, C-Kermit returns as
34315 +   many decimal places as are meaningful in the computer's floating-point
34316 +   precision, truncating any extraneous trailing 0's:
34317 +
34318 +  \ffpdiv(10,8) returns "1.25".
34319 +  \ffpdiv(10,4) returns "2.5".
34320 +  \ffpdiv(10,2) returns "5.0".
34321 +  \ffpdiv(10,3) returns "3.333333333333333" (for 16-digit precision).
34322 +
34323 +   There is no way to request that a floating-point function return a
34324 +   decimal point but no decimal places. However, this is easy enough to
34325 +   accomplish in other ways, for example by supplying it outside the
34326 +   function call:
34327 +
34328 +  echo \ffpadd(\%a,\%b,-1).
34329 +
34330 +   Kermit's floating-point functions always round the result for the
34331 +   requested number of decimal places when the "d" argument is given and
34332 +   has a value greater than 0 (see the description of \ffpround() just
34333 +   below).
34334 +
34335 +   Floating-point arguments can be constants in floating-point format or
34336 +   variables whose values are floating-point numbers. If a floating-point
34337 +   argument is omitted, or is a variable with no value, 0.0 is supplied
34338 +   automatically. Example:
34339 +
34340 +  def \%x 999.999
34341 +  undef \%y
34342 +  echo \ffpmin(\%x,\%y)
34343 +  0.0
34344 +
34345 +   Or equivalently:
34346 +
34347 +  echo \ffpmin(999.999)
34348 +  0.0
34349 +
34350 +   The floating-point functions are:
34351 +
34352 +   \ffpround(f1,d)
34353 +          Returns f1 rounded to d decimal places. For this function only,
34354 +          d = 0 (or d omitted) has a special meaning: return the integer
34355 +          part of f1 rounded according to the fractional part. Examples:
34356 +
34357 +  \ffpround(2.74653,-1) returns "2" (fraction truncated, no rounding).
34358 +  \ffpround(2.74653,0)  returns "3" (integer part is rounded).
34359 +  \ffpround(2.74653)    returns "3" (d omitted same as d = 0).
34360 +  \ffpround(2.74653,1)  returns "2.7".
34361 +  \ffpround(2.74653,2)  returns "2.75".
34362 +  \ffpround(2.74653,3)  returns "2.747".
34363 +  \ffpround(2.74653,4)  returns "2.7465", etc.
34364 +
34365 +   \ffpadd(f1,f2,d)
34366 +          Returns the sum of f1 and f2.
34367 +
34368 +   \ffpsubtract(f1,f2,d)
34369 +          Subtracts f2 from f1 and returns the result.
34370 +
34371 +   \ffpmultiply(f1,f2,d)
34372 +          Returns the product of f1 and f2.
34373 +
34374 +   \ffpdivide(f1,f2,d)
34375 +          If f2 is not 0, divides f1 by f2 and returns the quotient.
34376 +          If f2 is 0, a DIVIDE_BY_ZERO error occurs.
34377 +
34378 +   \ffpraise(f1,f2,d)
34379 +          If f1 = 0 and f2 <= 0, or if f1 < 0 and f2 has a fractional
34380 +          part, an ARG_OUT_OF_RANGE error occurs; otherwise f1 raised to
34381 +          the f2 power is returned.
34382 +
34383 +   \ffpsqrt(f1,d)
34384 +          If f1 >= 0, returns the square root of f1; otherwise
34385 +          ARG_OUT_OF_RANGE.
34386 +
34387 +   \ffpabsolute(f1,d)
34388 +          Returns the absolute value of f1 (i.e. f1 without a sign). This
34389 +          is the floating-point analog of \fabsolute(n1).
34390 +
34391 +   \ffpint(f1)
34392 +          Returns the integer part of f1. Equivalent to \ffpround(f1,-1).
34393 +
34394 +   \ffpexp(f1,d)
34395 +          The base of natural logarithms, e (2.718282...), raised to the
34396 +          f1 power.
34397 +
34398 +   \ffplogn(f1,d)
34399 +          The natural logarithm of f1 (the power to which e must be raised
34400 +          to obtain f1).
34401 +
34402 +   \ffplog10(f1,d)
34403 +          The base-10 logarithm of f1 (the power to which 10 must be
34404 +          raised to obtain f1).
34405 +
34406 +   \ffpmodulus(f1,f2,d)
34407 +          If f2 is not 0, the remainder after dividing f1 by f2.
34408 +          If f2 is 0, a DIVIDE_BY_ZERO error occurs.
34409 +          This is the floating-point analog of \fmod(n1,n2).
34410 +
34411 +   \ffpmaximum(f1,f2,d)
34412 +          Returns the maximum of f1 and f2. This is the floating-point
34413 +          analog of \fmax(n1,n2).
34414 +
34415 +   \ffpminimum(f1,f2,d)
34416 +          Returns the minimum of f1 and f2. This is the floating-point
34417 +          analog of \fmin(n1,n2).
34418 +
34419 +   \ffpsine(f1,d)
34420 +          Returns the sine of f1 radians.
34421 +
34422 +   \ffpcosine(f1,d)
34423 +          Returns the cosine of f1 radians.
34424 +
34425 +   \ffptangent(f1,d)
34426 +          Returns the tangent of f1 radians.
34427 +
34428 +   Note that all of these functions can be used with integer arguments. If
34429 +   you want an integer result, specify d = -1 (to truncate) or feed the
34430 +   result to \ffpround(xxx,0) (to round).
34431 +
34432 +   Floating-point numbers (or variables or functions that return them) can
34433 +   be used in Boolean expressions (see [632]Section 7.20.2) that compare
34434 +   numbers:
34435 +
34436 +  = x y
34437 +  != x y
34438 +  < x y
34439 +  > x y
34440 +  <= x y
34441 +  >= x y
34442 +
34443 +   In these examples, x and y can be either integers or floating-point
34444 +   numbers in any combination. In an arithmetic comparison of an integer
34445 +   and a floating-point number, the integer is converted to floating-point
34446 +   before the comparison is made. Examples:
34447 +
34448 +  .\%t = 3.000000000
34449 +  .\%f = 3.141592653
34450 +  .\%i = 3
34451 +
34452 +  if > \%f \%i echo Pi is greater.
34453 +  if = \%t \%i echo "\%i" = "\%t".
34454 +
34455 +   A floating-point number can also be used in:
34456 +
34457 +  IF number command
34458 +
34459 +   where the command is executed if the number is nonzero. If the number
34460 +   is floating-point, the command is not executed if the number is 0.0,
34461 +   and is executed otherwise.
34462 +
34463 +   Floating-point numbers can be sorted using ARRAY SORT /NUMERIC (see
34464 +   [633]Section 7.10.5 ).
34465 +
34466 +   Two floating-point constants are provided:
34467 +
34468 +  \v(math_pi) = Pi (3.141592653...)
34469 +  \v(math_e)  = e, the base of natural logarithms (2.71828...)
34470 +
34471 +   These are given to the computer's precision, e.g. 16 digits. This
34472 +   number itself is available in a variable:
34473 +
34474 +   \v(math_precision)
34475 +          How many significant digits in a floating-point number.
34476 +
34477 +  7.24. Tracing Script Execution
34478 +
34479 +   The TRACE command is handy for debugging scripts.
34480 +
34481 +   TRACE [ { /ON, /OFF } ] [ { ASSIGNMENTS, COMMAND-LEVEL, ALL } ]
34482 +          Selects tracing of the given object.
34483 +
34484 +   Optional switches are /ON and /OFF. If no switch is given, /ON is
34485 +   implied. The trace objects are ASSIGNMENTS, COMMAND-LEVEL, and ALL. The
34486 +   default object is ALL, meaning to select all trace objects (besides
34487 +   ALL). Thus TRACE by itself selects tracing of everything, as does TRACE
34488 +   /ON, and TRACE /OFF turns off all tracing.
34489 +
34490 +   When tracing of ASSIGNMENTS is on, every time the value of any
34491 +   user-defined variable or macro changes, C-Kermit prints one of the
34492 +   following:
34493 +
34494 +   >>> name: "value"
34495 +          The name of the variable or macro followed by the new value in
34496 +          quotes. This includes implicit macro-parameter assignments
34497 +          during macro invocation.
34498 +
34499 +   >>> name: (undef)
34500 +          This indicates that the variable or macro has been undefined.
34501 +
34502 +   <<< name: "value"
34503 +          For RETURN statements: the name of the macro and the return
34504 +          value.
34505 +
34506 +   <<< name: (null)
34507 +          For RETURN statements that include no value or an empty value.
34508 +
34509 +   When tracing of COMMAND-LEVEL is on, C-Kermit prints:
34510 +
34511 +   [n] +F: "name"
34512 +          Whenever a command file is entered, where "n" is the command
34513 +          level (0 = top); the name of the command file is shown in
34514 +          quotes.
34515 +
34516 +   [n] +M: "name"
34517 +          Whenever a macro is entered; "n" is the command level. The name
34518 +          of the macro is shown in quotes.
34519 +
34520 +   [n] -F: "name"
34521 +          Whenever a command file is reentered from below, when a macro or
34522 +          command file that it has invoked has returned.
34523 +
34524 +   [n] -M: "name"
34525 +          Whenever a macro is reentered from below.
34526 +
34527 +   For other debugging tools, see SHOW ARGS, SHOW STACK, SET TAKE, SET
34528 +   MACRO, and of course, ECHO.
34529 +
34530 +  7.25. Compact Substring Notation
34531 +
34532 +   It is often desirable to extract a substring from a string which is
34533 +   stored in a variable, and for this we have the \fsubstring() function,
34534 +   which is used like this:
34535 +
34536 +  define \%a 1234567890
34537 +  echo \fsubstring(\%a,3,4) ; substring from 3rd character length 4
34538 +  3456
34539 +
34540 +   or like this with macro-named variables:
34541 +
34542 +  define string 1234567890
34543 +  echo \fsubstring(\m(string),3,4)
34544 +  3456
34545 +
34546 +   C-Kermit 7.0 adds a pair of alternative compact notations:
34547 +
34548 +\:(variablename[start:length])  <-- Substring of variable's value
34549 +\s(macroname[start:length])     <-- Substring of macro's definition
34550 +
34551 +   These are exactly equivalent to using \fsubstring(), except more
34552 +   compact to write and also faster since evaluation is in one step
34553 +   instead of two.
34554 +
34555 +   The "\:()" notation can be used with any Kermit variable, that is,
34556 +   almost anything that starts with a backslash:
34557 +
34558 +  \:(\%a[2:6])      <-- equivalent to \fsubstring(\%a,2,6)
34559 +  \:(\&x[1][2:6])   <-- equivalent to \fsubstring(\&x[1],2,6)
34560 +  \:(\m(foo)[2:6])  <-- equivalent to \fsubstring(\m(foo),2,6)
34561 +  \:(\v(time)[2:6]) <-- equivalent to \fsubstring(\v(time),2,6)
34562 +  \:(\$(TERM)[2:6]) <-- equivalent to \fsubstring(\$(TERM),2,6)
34563 +  \:(ABCDEFGH[2:6]) <-- equivalent to \fsubstring(ABCDEFGH,2,6)
34564 +
34565 +   Whatever appears between the left parenthesis and the left bracket is
34566 +   evaluated and then the indicated substring of the result is returned.
34567 +
34568 +   The "\s()" notation is the same, except after evaluating the variable,
34569 +   the result is treated as a macro name and is looked up in the macro
34570 +   table. Then the indicated substring of the macro definition is
34571 +   returned. Example:
34572 +
34573 +  define testing abcdefghijklmnopqrstuvwxyz
34574 +  define \%a testing
34575 +
34576 +  \s(testing[2:6])  -->  bcdefg
34577 +  \:(testing[2:6])  -->  esting
34578 +  \:(\%a[2:6])      -->  esting
34579 +  \s(\%a[2:6])      -->  bcdefg
34580 +
34581 +   Note that the following two examples are equivalent:
34582 +
34583 +  \:(\m(foo)[2:6])
34584 +  \s(foo[2:6])
34585 +
34586 +   The first number in the brackets is the 1-based starting position. If
34587 +   it is omitted, or less than 1, it is treated as 1. If it is greater
34588 +   than the length of the string, an empty string is returned.
34589 +
34590 +   The second number is the length of the desired substring. If the second
34591 +   number is omitted, is less than 0, or would be past the end of the
34592 +   string, then "through the end of the string" is assumed. If it is 0,
34593 +   the empty string is returned.
34594 +
34595 +   If the brackets are empty or omitted, the original string is returned.
34596 +
34597 +   The starting position and length need not be literal numbers; they can
34598 +   also be variables, functions, arithmetic expressions, or even other
34599 +   \s() or \:() quantities; anything that evaluates to a number, for
34600 +   example:
34601 +
34602 +  \s(block[1025:\fhex2n(\s(block[\%b:\%n+4]))/2])
34603 +
34604 +   Syntactically, \m(name) and \s(name) differ only in that the sequence
34605 +   [*] at the end of the name (where * is any sequence of 0 or more
34606 +   characters) is treated as substring notation in \s(name), but is
34607 +   considered part of the name in \m(name) (to see why, see [634]Section
34608 +   7.10.9).
34609 +
34610 +  7.26. New WAIT Command Options
34611 +
34612 +   The WAIT command has been extended to allow waiting for different kinds
34613 +   of things (formerly it only waited for modem signals). Now it also can
34614 +   wait for file events.
34615 +
34616 +    7.26.1. Waiting for Modem Signals
34617 +
34618 +   The previous syntax:
34619 +
34620 +  WAIT time { CD, DSR, RTS, RI, ... }
34621 +
34622 +   has changed to:
34623 +
34624 +  WAIT time MODEM-SIGNALS { CD, DSR, RTS, RI, ... }
34625 +
34626 +   However, the previous syntax is still accepted. The behavior is the
34627 +   same in either case.
34628 +
34629 +    7.26.2. Waiting for File Events
34630 +
34631 +   The new WAIT option:
34632 +
34633 +  WAIT time FILE { CREATION, DELETION, MODIFICATION } filename
34634 +
34635 +   lets you tell Kermit to wait the given amount of time (or until the
34636 +   given time of day) for a file whose name is filename to be created,
34637 +   deleted, or modified, respectively. The filename may not contain
34638 +   wildcards. If the specified event does not occur within the time limit,
34639 +   or if WAIT CANCELLATION is ON and you interrupt from the keyboard
34640 +   before the time is up, the WAIT command fails. If the event is
34641 +   MODIFICATION and the file does not exist, the command fails. Otherwise,
34642 +   if the given event occurs within the time limit, the command succeeds.
34643 +   Examples:
34644 +
34645 +   WAIT 600 FILE DELETION oofa.tmp
34646 +          Wait up to 10 minutes for file oofa.tmp to disappear.
34647 +
34648 +   WAIT 23:59:59 FILE MOD orders.db
34649 +          Wait until just before midnight for the orders.db file to be
34650 +          changed.
34651 +
34652 +   Example: Suppose you want to have the current copy of /etc/motd on your
34653 +   screen at all times, and you want to hear a bell whenever it changes:
34654 +
34655 +  def \%f /etc/motd                      ; The file of interest.
34656 +  while 1 {                              ; Loop forever...
34657 +      cls                                ; Clear the screen.
34658 +      echo \%f: \v(date) \v(time)...     ; Print 2-line heading...
34659 +      echo
34660 +      if ( not exist \%f ) {             ; If file doesn't exist,
34661 +          echo \%f does not exist...     ; print message,
34662 +          wait 600 file creat \%f        ; and wait for it to appear.
34663 +          continue
34664 +      }
34665 +      beep                               ; Something new - beep.
34666 +      type /head:\v(rows-2) \%f          ; Display the file
34667 +      if fail exit 1 \%f: \ferrstring()  ; (checking for errors).
34668 +      wait 999 file mod \%f              ; Wait for it to change.
34669 +  }
34670 +
34671 +   This notices when the file is created, deleted, or modified, and acts
34672 +   only then (or when you interrupt it with); the time shown in the
34673 +   heading is the time of the most recent event (including when the
34674 +   program started).
34675 +
34676 +   See [635]Section 1.10, where the \v(kbchar) variable is explained. This
34677 +   lets you modify a loop like the one above to also accept
34678 +   single-character commands, which interrupt the WAIT, and dispatch
34679 +   accordingly. For example:
34680 +
34681 +  wait 999 file mod \%f              ; Wait for the file to change.
34682 +  if defined \v(kbchar) {            ; Interrupted from keyboard?
34683 +      switch \v(kbchar) {            ; Handle the keystroke...
34684 +        :q, exit                     ; Q to Quit
34685 +        :h, echo blah blah, break    ; H for Help
34686 +        :default, beep, continue     ; Anything else beep and ignore
34687 +      }
34688 +  }
34689 +
34690 +   This lets you write event-driven applications that wait for up to three
34691 +   events at once: a file or modem event, a timeout, and a keystroke.
34692 +
34693 +  7.27. Relaxed FOR and SWITCH Syntax
34694 +
34695 +   For consistency with the extended IF and WHILE syntax, the FOR and
34696 +   SWITCH control lists may (but need not be) enclosed in parentheses:
34697 +
34698 +  FOR ( \%i 1 \%n 1 ) { command-list... }
34699 +  SWITCH ( \%c ) { command-list... }
34700 +
34701 +   In the FOR command, the increment item can be omitted if the control
34702 +   list is enclosed in parentheses, in which case the increment defaults
34703 +   appropriately to 1 or -1, depending on the values of the first two
34704 +   variables.
34705 +
34706 +   As with IF, the parentheses around the FOR-command control list must be
34707 +   set off by spaces (in the SWITCH command, the spaces are not required
34708 +   since the SWITCH expression is a single arithmetic expression).
34709 +
34710 +   Also, outer braces around the command list are supplied automatically
34711 +   if you omit them, e.g.:
34712 +
34713 +  FOR ( \%i 1 %n 1 ) echo \%i
34714 +
34715 +  8. USING OTHER FILE TRANSFER PROTOCOLS
34716 +
34717 +   In C-Kermit 7.0, alternative protocols can be selected using switches.
34718 +   Switches are described in [636]Section 1.5; the use of
34719 +   protocol-selection switches is described in [637]Section 4.7.1.
34720 +   Example:
34721 +
34722 +  send /binary /protocol:zmodem x.tar.gz
34723 +
34724 +   Note that file transfer recovery works only with Kermit and Zmodem
34725 +   protocols. With Zmodem, recovery can be initiated only by the sender.
34726 +
34727 +   Only pre-1988 versions of the publicly-distributed sz/rz programs use
34728 +   Standard I/O; those released later than that do not use Standard I/O
34729 +   and therefore do not work with REDIRECT. However, Omen Technology does
34730 +   offer an up-to-date redirectable version called crzsz, which must be
34731 +   licensed for use:
34732 +
34733 +     "Unix Crz and Csz support XMODEM, YMODEM, and ZMODEM transfers when
34734 +     called by dial-out programs such as Kermit and certain versions of
34735 +     cu(1). They are clients designed for this use.
34736 +
34737 +     "Crz and Csz are Copyrighted shareware programs. Use of these
34738 +     programs beyond a brief evaluation period requires registration.
34739 +     Please print the "mailer.rz" file, fill out the form and return same
34740 +     with your registration."
34741 +
34742 +   To use the crzsz programs as your external XYZMODEM programs in
34743 +   C-Kermit, follow the instructions in the book, but put a "c" before
34744 +   each command, e.g.:
34745 +
34746 +  set protocol zmodem {csz %s} {csz -a %s} crz crz crz crz
34747 +
34748 +   To use Zmodem protocol over Telnet or other non-transparent
34749 +   connections, you might need to add the -e (Escape) option:
34750 +
34751 +  set protocol zmodem {csz -e %s} {csz -e -a %s} crz crz crz crz
34752 +
34753 +  9. COMMAND-LINE OPTIONS
34754 +
34755 +  9.0. Extended-Format Command-Line Options
34756 +
34757 +   Standard UNIX command line options are a single letter. C-Kermit has
34758 +   run out of letters, so new options are in a new extended format:
34759 +
34760 + --word[:arg]
34761 +
34762 +   where a keyword (rather than a single letter) specifies the function,
34763 +   and if an argument is to be included, it is separated by a colon (or
34764 +   equal sign). Most of the new extended-format command-line options are
34765 +   only for use with the Internet Kermit Service Daemon; see the [638]IKSD
34766 +   Administration Guide for details. However, several of them are also
34767 +   general in nature:
34768 +
34769 +   --nointerrupts
34770 +          Disables keyboard interrupts that are normally enabled, which
34771 +          are usually Ctrl-C (to interrupt a command) and Ctrl-Z (UNIX
34772 +          only, to suspend C-Kermit).
34773 +
34774 +   --help
34775 +          Lists the extended command-line options that are available in
34776 +          your version of C-Kermit. If any options seem to be missing,
34777 +          that is because your copy of C-Kermit was built with
34778 +          compile-time options to deselect them.
34779 +
34780 +   --helpfile:filename
34781 +          Specifies the name of a file to be displayed if the user types
34782 +          HELP (not followed by a specific command or topic), in place of
34783 +          the built-in top-level help text. The file need not fit on one
34784 +          screen; more-prompting is used if the file is more than one
34785 +          screen long if COMMAND MORE-PROMPTING is ON, as it is by
34786 +          default.
34787 +
34788 +   --bannerfile:filename
34789 +          The name of a file containing a message to be printed after the
34790 +          user logs in, in place of the normal message (Copyright notice,
34791 +          "Type HELP or ? for help", "Default transfer mode is...", etc).
34792 +
34793 +   --cdmessage:{on,off,0,1,2}
34794 +          For use in the Server-Side Server configuration; whenever the
34795 +          client tells the server to change directory, the server sends
34796 +          the contents of a "read me" file to the client's screen. This
34797 +          feature is On by default, and operates only in client/server
34798 +          mode when ON or 1. If set to 2 or higher, it also operates when
34799 +          the CD command is given at the IKSD> prompt. Synonym: --cdmsg.
34800 +
34801 +   --cdfile:filename
34802 +          When cdmessage is on, this is the name of the "read me" file to
34803 +          be sent. Normally you would specify a relative (not absolute)
34804 +          name, since the file is opened using the literal name you
34805 +          specified, after changing to the new directory. Example:
34806 +
34807 +  --cdfile:READ.ME
34808 +
34809 +          You can also give a list of up to 8 filenames by (a) enclosing
34810 +          each filename in braces, and (b) enclosing the entire list in
34811 +          braces. Example:
34812 +          --cdfile:{{./.readme}{READ.ME}{aaareadme.txt}{README}{read-this-
34813 +          first}} When a list is given, it is searched from left to right
34814 +          and the first file found is displayed. The default list for UNIX
34815 +          is:
34816 +
34817 +  {{./.readme}{README.TXT}{READ.ME}}
34818 +
34819 +  9.1. Command Line Personalities
34820 +
34821 +   Beginning in version 7.0, if the C-Kermit binary is renamed to "telnet"
34822 +   (or TELNET.EXE, telnet.pr, etc, depending on the platform), it accepts
34823 +   the Telnet command line:
34824 +
34825 +  telnet [ host [ port ] ]
34826 +
34827 +   In Unix, you can achieve the same effect with a symlink:
34828 +
34829 +  cd /usr/bin
34830 +  mv telnet oldtelnet
34831 +  ln -ls /usr/local/bin/kermit telnet
34832 +
34833 +   When installed in this manner, C-Kermit always reads its initialization
34834 +   file. If no host (and therefore no port) is given, C-Kermit starts in
34835 +   interactive prompting mode. If a host is given as the first
34836 +   command-line argument, C-Kermit makes a connection to it. The host
34837 +   argument can be an IP host name or address, or the name of a TCP/IP
34838 +   entry in your C-Kermit network directory.
34839 +
34840 +   If a port is given, it is used. If a port is not given, then if the
34841 +   hostname was found in your network directory and port was also listed
34842 +   there, then that port is used. Otherwise port 23 (the Telnet port) is
34843 +   used.
34844 +
34845 +   When C-Kermit is called "telnet" and it is invoked with a hostname on
34846 +   the command line, it exits automatically when the connection is closed.
34847 +   While the connection is open, however, you may escape back and forth as
34848 +   many times as you like, transfer files, etc.
34849 +
34850 +   An rlogin personality is also available, but it is less useful, at
34851 +   least in UNIX and VMS, where the Rlogin TCP port is privileged.
34852 +
34853 +   The new variable \v(name) indicates the name with which C-Kermit was
34854 +   invoked ("kermit", "wermit", "k95", "telnet", etc).
34855 +
34856 +  9.2. Built-in Help for Command Line Options
34857 +
34858 +   "kermit -h", given from the system prompt, lists as many command-line
34859 +   options as will fit on a standard 24x80 screen. For more comprehensive
34860 +   help, use the interactive HELP OPTIONS command that was added in
34861 +   C-Kermit 7.0:
34862 +
34863 +   HELP OPTIONS
34864 +   Explains how command-line options work, their syntax, etc.
34865 +
34866 +   HELP OPTIONS ALL
34867 +   Lists all command-line options and gives brief help about each one.
34868 +
34869 +   HELP OPTION x
34870 +   Gives brief help about option "x".
34871 +
34872 +   HELP EXTENDED-OPTIONS
34873 +   Lists the available extended-format command-line options.
34874 +
34875 +   HELP EXTENDED-OPTION xxx
34876 +   Gives help for the specified extended option.
34877 +
34878 +  9.3. New Command-Line Options
34879 +
34880 +   Command-line options added since C-Kermit 6.0 are:
34881 +
34882 +   +
34883 +          (plus sign by itself): The next argument is the name of a script
34884 +          to execute; all subsequent arguments are ignored by C-Kermit
34885 +          itself, but passed to the script as top-level copies of \%1,
34886 +          \%2, etc; the \&_[] is also set accordingly. \%0 and \&_[0]
34887 +          become the name of the script file, rather than the pathname of
34888 +          the C-Kermit program, which is its normal value. Primarily for
34889 +          use in the top line of "Kerbang" scripts in UNIX (see
34890 +          [639]Section 7.19). Example from UNIX command line:
34891 +
34892 +  $ kermit [ regular kermit args ] + filename
34893 +
34894 +          Sample first line of Kerbang script:
34895 +
34896 +  #!/usr/local/bin/kermit +
34897 +
34898 +   --
34899 +          (two hyphens surrounded by whitespace) Equivalent to "=", for
34900 +          compatibility with UNIX getopt(1,3).
34901 +
34902 +   -G
34903 +          GET (like -g), but send the incoming file to standard output.
34904 +          Example: "kermit -G oofa.txt | lpr" retrieves a file from your
34905 +          local computer (providing it is running a Kermit program that
34906 +          supports the autodownload feature and has it enabled) and prints
34907 +          it.
34908 +
34909 +   -O
34910 +          equivalent to -x (start up in server mode), but exits after the
34911 +          first client command has been executed (mnemonic: O = Only One).
34912 +          This one is handy replacing "kermit -x" in the "automatically
34913 +          start Kermit on the other end" string:
34914 +
34915 +  set protocol kermit {kermit -ir} {kermit -r} {kermit -x}
34916 +
34917 +          since -x leaves the remote Kermit in server mode after the
34918 +          transfer, which can be confusing, whereas -O makes it go away
34919 +          automatically after the transfer.
34920 +
34921 +   -L
34922 +          Recursive, when used in combination with -s (mnemonic: L =
34923 +          Levels). In UNIX or other environments where the shell expands
34924 +          wildcards itself, the -s argument, if it contains wildcards,
34925 +          must be quoted to prevent this, e.g.:
34926 +
34927 +  kermit -L -s "*.c"
34928 +
34929 +          In UNIX only, "kermit -L -s ." means to send the current
34930 +          directory tree. See [640]Sections 4.10 and [641]4.11 about
34931 +          recursive file transfer.
34932 +
34933 +   -V
34934 +          Equivalent to SET FILE PATTERNS OFF ([642]Section 4.3) and SET
34935 +          TRANSFER MODE MANUAL. In other words, take the FILE TYPE setting
34936 +          literally. For example, "kermit -VT oofa.bin" means send the
34937 +          file in Text mode, no matter what its name is and no matter
34938 +          whether a kindred spirit is recognized at the other end of the
34939 +          connection.
34940 +
34941 +   -0
34942 +          (digit zero) means "be 100% transparent in CONNECT mode". This
34943 +          is equivalent to the following series of commands: SET PARITY
34944 +          NONE, SET COMMAND BYTESIZE 8, SET TERMINAL BYTESIZE 8, SET FLOW
34945 +          NONE, SET TERM ESCAPE DISABLED, SET TERM CHAR TRANSPARENT, SET
34946 +          TERM AUTODOWNLOAD OFF, SET TERM APC OFF, SET TELOPT KERMIT
34947 +          REFUSE REFUSE.
34948 +
34949 +  10. C-KERMIT AND G-KERMIT
34950 +
34951 +   Every multifunctioned and long-lived software program grows in
34952 +   complexity and size over time to meet the needs and requests of its
34953 +   users and the demands of the underlying technology as it changes.
34954 +
34955 +   Eventually users begin to notice how big the application has grown, how
34956 +   much disk space it occupies, how long it takes to load, and they start
34957 +   to long for the good old days when it was lean and mean. Not long after
34958 +   that they begin asking for a "light" version that only does the basics
34959 +   with no frills.
34960 +
34961 +   And so it is with C-Kermit. A "light" version of Kermit was released
34962 +   (for UNIX only) in December 1999 under the GNU General Public License;
34963 +   thus it is called G-Kermit (for GNU Kermit). All it does is send and
34964 +   receive files, period. You can find it at:
34965 +
34966 +  [643]http://www.columbia.edu/kermit/gkermit.html
34967 +
34968 +   Where the C-Kermit 7.0 binary might be anywhere from 1 to 3 million
34969 +   bytes in size, the G-Kermit binary ranges from 30K to 100K, depending
34970 +   on the underlying architecture (RISC vs CISC, etc).
34971 +
34972 +   G-Kermit and C-Kermit may reside side-by-side on the same computer.
34973 +   G-Kermit does not make connections; it does not have a script language;
34974 +   it does not translate character sets. G-Kermit may be used instead of
34975 +   C-Kermit when:
34976 +
34977 +     * It is on the remote end.
34978 +     * Files are to be transferred in binary mode or in text mode without
34979 +       character-set translation.
34980 +     * File timestamps don't need to be preserved.
34981 +
34982 +   In such cases G-Kermit might be preferred since it generally starts up
34983 +   faster, and yet transfers files just as fast on most (but not
34984 +   necessarily all) kinds of connections; for example, it supports
34985 +   streaming ([644]Section 4.20).
34986 +
34987 +   G-Kermit is also handy for bootstrapping. It is easier to load on a new
34988 +   computer than C-Kermit -- it fits on a floppy diskette with plenty of
34989 +   room to spare. Thus if you have (say) an old PC running (say) SCO Xenix
34990 +   and no network connection, you can download the Xenix version of
34991 +   G-Kermit to (say) a DOS or Windows PC, copy it to diskette, read the
34992 +   diskette on Xenix with "dosread", and then use G-Kermit to receive
34993 +   C-Kermit (which does not fit on a diskette). If diskettes aren't an
34994 +   option, other bootstrapping methods are possible too -- see the
34995 +   [645]G-Kermit web page for details.
34996 +
34997 +III. APPENDICES
34998 +
34999 +  III.1. Character Set Tables
35000 +
35001 +    III.1.1. The Hewlett Packard Roman8 Character Set
35002 +
35003 +dec col/row oct hex  description
35004 +160  10/00  240  A0  (Undefined)
35005 +161  10/01  241  A1  A grave
35006 +162  10/02  242  A2  A circumflex
35007 +163  10/03  243  A3  E grave
35008 +164  10/04  244  A4  E circumflex
35009 +165  10/05  245  A5  E diaeresis
35010 +166  10/06  246  A6  I circumflex
35011 +167  10/07  247  A7  I diaeresis
35012 +168  10/08  250  A8  Acute accent
35013 +169  10/09  251  A9  Grave accent
35014 +170  10/10  252  AA  Circumflex accent
35015 +171  10/11  253  AB  Diaeresis
35016 +172  10/12  254  AC  Tilde accent
35017 +173  10/13  255  AD  U grave
35018 +174  10/14  256  AE  U circumflex
35019 +175  10/15  257  AF  Lira symbol
35020 +176  11/00  260  B0  Top bar (macron)
35021 +177  11/01  261  B1  Y acute
35022 +178  11/02  262  B2  y acute
35023 +179  11/03  263  B3  Degree Sign
35024 +180  11/04  264  B4  C cedilla
35025 +181  11/05  265  B5  c cedilla
35026 +182  11/06  266  B6  N tilde
35027 +183  11/07  267  B7  n tilde
35028 +184  11/08  270  B8  Inverted exclamation mark
35029 +185  11/09  271  B9  Inverted question mark
35030 +186  11/10  272  BA  Currency symbol
35031 +187  11/11  273  BB  Pound sterling symbol
35032 +188  11/12  274  BC  Yen symbol
35033 +189  11/13  275  BD  Paragraph
35034 +190  11/14  276  BE  Florin (Guilder) symbol
35035 +191  11/15  277  BF  Cent symbol
35036 +192  12/00  300  C0  a circumflex
35037 +193  12/01  301  C1  e circumflex
35038 +194  12/02  302  C2  o circumflex
35039 +195  12/03  303  C3  u circumflex
35040 +196  12/04  304  C4  a acute
35041 +197  12/05  305  C5  e acute
35042 +198  12/06  306  C6  o acute
35043 +199  12/07  307  C7  u acute
35044 +200  12/08  310  C8  a grave
35045 +201  12/09  311  C9  e grave
35046 +202  12/10  312  CA  o grave
35047 +203  12/11  313  CB  u grave
35048 +204  12/12  314  CC  a diaeresis
35049 +205  12/13  315  CD  e diaeresis
35050 +206  12/14  316  CE  o diaeresis
35051 +207  12/15  317  CF  u diaeresis
35052 +208  13/00  320  D0  A ring
35053 +209  13/01  321  D1  i circumflex
35054 +210  13/02  322  D2  O with stroke
35055 +211  13/03  323  D3  AE digraph
35056 +212  13/04  324  D4  a ring
35057 +213  13/05  325  D5  i acute
35058 +214  13/06  326  D6  o with stroke
35059 +215  13/07  327  D7  ae digraph
35060 +216  13/08  330  D8  A diaeresis
35061 +217  13/09  331  D9  i grave
35062 +218  13/10  332  DA  O diaeresis
35063 +219  13/11  333  DB  U diaeresis
35064 +220  13/12  334  DC  E acute
35065 +221  13/13  335  DD  i diaeresis
35066 +222  13/14  336  DE  German sharp s
35067 +223  13/15  337  DF  O circumflex
35068 +224  14/00  340  E0  A acute
35069 +225  14/01  341  E1  A tilde
35070 +226  14/02  342  E2  a tilde
35071 +227  14/03  343  E3  Icelandic Eth
35072 +228  14/04  344  E4  Icelandic eth
35073 +229  14/05  345  E5  I acute
35074 +230  14/06  346  E6  I grave
35075 +231  14/07  347  E7  O acute
35076 +232  14/08  350  E8  O grave
35077 +233  14/09  351  E9  O tilde
35078 +234  14/10  352  EA  o tilde
35079 +235  14/11  353  EB  S caron
35080 +236  14/12  354  EC  s caron
35081 +237  14/13  355  ED  U acute
35082 +238  14/14  356  EE  Y diaeresis
35083 +239  14/15  357  EF  y diaeresis
35084 +240  15/00  360  F0  Icelandic Thorn
35085 +241  15/01  361  F1  Icelandic thorn
35086 +242  15/02  362  F2  Middle dot
35087 +243  15/03  363  F3  Greek mu
35088 +244  15/04  364  F4  Pilcrow sign
35089 +245  15/05  365  F5  Fraction 3/4
35090 +246  15/06  366  F6  Long dash, horizontal bar
35091 +247  15/07  367  F7  Fraction 1/4
35092 +248  15/08  370  F8  Fraction 1/2
35093 +249  15/09  371  F9  Feminine ordinal
35094 +250  15/10  372  FA  Masculine ordinal
35095 +251  15/11  373  FB  Left guillemot
35096 +252  15/12  374  FC  Solid box
35097 +253  15/13  375  FD  Right guillemot
35098 +254  15/14  376  FE  Plus or minus sign
35099 +255  15/15  377  FF  (Undefined)
35100 +
35101 +    III.1.2. Greek Character Sets
35102 +
35103 +    III.1.2.1. The ISO 8859-7 Latin / Greek Alphabet = ELOT 928
35104 +
35105 +dec col/row oct hex  description
35106 +160  10/00  240  A0  No-break space
35107 +161  10/01  241  A1  Left single quotation mark
35108 +162  10/02  242  A2  right single quotation mark
35109 +163  10/03  243  A3  Pound sign
35110 +164  10/04  244  A4  (UNUSED)
35111 +165  10/05  245  A5  (UNUSED)
35112 +166  10/06  246  A6  Broken bar
35113 +167  10/07  247  A7  Paragraph sign
35114 +168  10/08  250  A8  Diaeresis (Dialytika)
35115 +169  10/09  251  A9  Copyright sign
35116 +170  10/10  252  AA  (UNUSED)
35117 +171  10/11  253  AB  Left angle quotation
35118 +172  10/12  254  AC  Not sign
35119 +173  10/13  255  AD  Soft hyphen
35120 +174  10/14  256  AE  (UNUSED)
35121 +175  10/15  257  AF  Horizontal bar (Parenthetiki pavla)
35122 +176  11/00  260  B0  Degree sign
35123 +177  11/01  261  B1  Plus-minus sign
35124 +178  11/02  262  B2  Superscript two
35125 +179  11/03  263  B3  Superscript three
35126 +180  11/04  264  B4  Accent (tonos)
35127 +181  11/05  265  B5  Diaeresis and accent (Dialytika and Tonos)
35128 +182  11/06  266  B6  Alpha with accent
35129 +183  11/07  267  B7  Middle dot (Ano Teleia)
35130 +184  11/08  270  B8  Epsilon with accent
35131 +185  11/09  271  B9  Eta with accent
35132 +186  11/10  272  BA  Iota with accent
35133 +187  11/11  273  BB  Right angle quotation
35134 +188  11/12  274  BC  Omicron with accent
35135 +189  11/13  275  BD  One half
35136 +190  11/14  276  BE  Upsilon with accent
35137 +191  11/15  277  BF  Omega with accent
35138 +192  12/00  300  C0  iota with diaeresis and accent
35139 +193  12/01  301  C1  Alpha
35140 +194  12/02  302  C2  Beta
35141 +195  12/03  303  C3  Gamma
35142 +196  12/04  304  C4  Delta
35143 +197  12/05  305  C5  Epsilon
35144 +198  12/06  306  C6  Zeta
35145 +199  12/07  307  C7  Eta
35146 +200  12/08  310  C8  Theta
35147 +201  12/09  311  C9  Iota
35148 +202  12/10  312  CA  Kappa
35149 +203  12/11  313  CB  Lamda
35150 +204  12/12  314  CC  Mu
35151 +205  12/13  315  CD  Nu
35152 +206  12/14  316  CE  Ksi
35153 +207  12/15  317  CF  Omicron
35154 +208  13/00  320  D0  Pi
35155 +209  13/01  321  D1  Rho
35156 +210  13/02  322  D2  (UNUSED)
35157 +211  13/03  323  D3  Sigma
35158 +212  13/04  324  D4  Tau
35159 +213  13/05  325  D5  Upsilon
35160 +214  13/06  326  D6  Phi
35161 +215  13/07  327  D7  Khi
35162 +216  13/08  330  D8  Psi
35163 +217  13/09  331  D9  Omega
35164 +218  13/10  332  DA  Iota with diaeresis
35165 +219  13/11  333  DB  Upsilon with diaeresis
35166 +220  13/12  334  DC  alpha with accent
35167 +221  13/13  335  DD  epsilon with accent
35168 +222  13/14  336  DE  eta with accent
35169 +223  13/15  337  DF  iota with accent
35170 +224  14/00  340  E0  upsilon with diaeresis and accent
35171 +225  14/01  341  E1  alpha
35172 +226  14/02  342  E2  beta
35173 +227  14/03  343  E3  gamma
35174 +228  14/04  344  E4  delta
35175 +229  14/05  345  E5  epsilon
35176 +230  14/06  346  E6  zeta
35177 +231  14/07  347  E7  eta
35178 +232  14/08  350  E8  theta
35179 +233  14/09  351  E9  iota
35180 +234  14/10  352  EA  kappa
35181 +235  14/11  353  EB  lamda
35182 +236  14/12  354  EC  mu
35183 +237  14/13  355  ED  nu
35184 +238  14/14  356  EE  ksi
35185 +239  14/15  357  EF  omicron
35186 +240  15/00  360  F0  pi
35187 +241  15/01  361  F1  rho
35188 +242  15/02  362  F2  terminal sigma
35189 +243  15/03  363  F3  sigma
35190 +244  15/04  364  F4  tau
35191 +245  15/05  365  F5  upsilon
35192 +246  15/06  366  F6  phi
35193 +247  15/07  367  F7  khi
35194 +248  15/08  370  F8  psi
35195 +249  15/09  371  F9  omega
35196 +250  15/10  372  FA  iota with diaeresis
35197 +251  15/11  373  FB  upsilon with diaeresis
35198 +252  15/12  374  FC  omicron with diaeresis
35199 +253  15/13  375  FD  upsilon with accent
35200 +254  15/14  376  FE  omega with accent
35201 +255  15/15  377  FF  (UNUSED)
35202 +
35203 +    III.1.2.2. The ELOT 927 Character Set
35204 +
35205 +dec col/row oct hex  description
35206 + 32  02/00   40  20  SPACE
35207 + 33  02/01   41  21  EXCLAMATION MARK
35208 + 34  02/02   42  22  QUOTATION MARK
35209 + 35  02/03   43  23  NUMBER SIGN
35210 + 36  02/04   44  24  DOLLAR SIGN
35211 + 37  02/05   45  25  PERCENT SIGN
35212 + 38  02/06   46  26  AMPERSAND
35213 + 39  02/07   47  27  APOSTROPHE
35214 + 40  02/08   50  28  LEFT PARENTHESIS
35215 + 41  02/09   51  29  RIGHT PARENTHESIS
35216 + 42  02/10   52  2A  ASTERISK
35217 + 43  02/11   53  2B  PLUS SIGN
35218 + 44  02/12   54  2C  COMMA
35219 + 45  02/13   55  2D  HYPHEN, MINUS SIGN
35220 + 46  02/14   56  2E  PERIOD, FULL STOP
35221 + 47  02/15   57  2F  SOLIDUS, SLASH
35222 + 48  03/00   60  30  DIGIT ZERO
35223 + 49  03/01   61  31  DIGIT ONE
35224 + 50  03/02   62  32  DIGIT TWO
35225 + 51  03/03   63  33  DIGIT THREE
35226 + 52  03/04   64  34  DIGIT FOUR
35227 + 53  03/05   65  35  DIGIT FIVE
35228 + 54  03/06   66  36  DIGIT SIX
35229 + 55  03/07   67  37  DIGIT SEVEN
35230 + 56  03/08   70  38  DIGIT EIGHT
35231 + 57  03/09   71  39  DIGIT NINE
35232 + 58  03/10   72  3A  COLON
35233 + 59  03/11   73  3B  SEMICOLON
35234 + 60  03/12   74  3C  LESS-THAN SIGN, LEFT ANGLE BRACKET
35235 + 61  03/13   75  3D  EQUALS SIGN
35236 + 62  03/14   76  3E  GREATER-THAN SIGN, RIGHT ANGLE BRACKET
35237 + 63  03/15   77  3F  QUESTION MARK
35238 + 64  04/00  100  40  COMMERCIAL AT SIGN
35239 + 65  04/01  101  41  CAPITAL LETTER A
35240 + 66  04/02  102  42  CAPITAL LETTER B
35241 + 67  04/03  103  43  CAPITAL LETTER C
35242 + 68  04/04  104  44  CAPITAL LETTER D
35243 + 69  04/05  105  45  CAPITAL LETTER E
35244 + 70  04/06  106  46  CAPITAL LETTER F
35245 + 71  04/07  107  47  CAPITAL LETTER G
35246 + 72  04/08  110  48  CAPITAL LETTER H
35247 + 73  04/09  111  49  CAPITAL LETTER I
35248 + 74  04/10  112  4A  CAPITAL LETTER J
35249 + 75  04/11  113  4B  CAPITAL LETTER K
35250 + 76  04/12  114  4C  CAPITAL LETTER L
35251 + 77  04/13  115  4D  CAPITAL LETTER M
35252 + 78  04/14  116  4E  CAPITAL LETTER N
35253 + 79  04/15  117  4F  CAPITAL LETTER O
35254 + 80  05/00  120  50  CAPITAL LETTER P
35255 + 81  05/01  121  51  CAPITAL LETTER Q
35256 + 82  05/02  122  52  CAPITAL LETTER R
35257 + 83  05/03  123  53  CAPITAL LETTER S
35258 + 84  05/04  124  54  CAPITAL LETTER T
35259 + 85  05/05  125  55  CAPITAL LETTER U
35260 + 86  05/06  126  56  CAPITAL LETTER V
35261 + 87  05/07  127  57  CAPITAL LETTER W
35262 + 88  05/08  130  58  CAPITAL LETTER X
35263 + 89  05/09  131  59  CAPITAL LETTER Y
35264 + 90  05/10  132  5A  CAPITAL LETTER Z
35265 + 91  05/11  133  5B  LEFT SQUARE BRACKET
35266 + 92  05/12  134  5C  REVERSE SOLIDUS, BACKSLASH
35267 + 93  05/13  135  5D  RIGHT SQUARE BRACKET
35268 + 94  05/14  136  5E  CIRCUMFLEX ACCENT
35269 + 95  05/15  137  5F  UNDERSCORE
35270 + 96  06/00  140  60  ACCENT GRAVE
35271 + 97  06/01  141  61  GREEK LETTER ALPHA
35272 + 98  06/02  142  62  GREEK LETTER BETA
35273 + 99  06/03  143  63  GREEK LETTER GAMMA
35274 +100  06/04  144  64  GREEK LETTER DELTA
35275 +101  06/05  145  65  GREEK LETTER EPSILON
35276 +102  06/06  146  66  GREEK LETTER ZETA
35277 +103  06/07  147  67  GREEK LETTER ETA
35278 +104  06/08  150  68  GREEK LETTER THETA
35279 +105  06/09  151  69  GREEK LETTER IOTA
35280 +106  06/10  152  6A  GREEK LETTER KAPPA
35281 +107  06/11  153  6B  GREEK LETTER LAMDA
35282 +108  06/12  154  6C  GREEK LETTER MU
35283 +109  06/13  155  6D  GREEK LETTER NU
35284 +110  06/14  156  6E  GREEK LETTER KSI
35285 +111  06/15  157  6F  GREEK LETTER OMICRON
35286 +112  07/00  160  70  GREEK LETTER PI
35287 +113  07/01  161  71  GREEK LETTER RHO
35288 +114  07/02  162  72  GREEK LETTER SIGMA
35289 +115  07/03  163  73  GREEK LETTER TAU
35290 +116  07/04  164  74  GREEK LETTER UPSILON
35291 +117  07/05  165  75  GREEK LETTER FI
35292 +118  07/06  166  76  GREEK LETTER XI
35293 +119  07/07  167  77  GREEK LETTER PSI
35294 +120  07/08  170  78  GREEK LETTER OMEGA
35295 +121  07/09  171  79  SPACE
35296 +122  07/10  172  7A  SPACE
35297 +123  07/11  173  7B  LEFT CURLY BRACKET, LEFT BRACE
35298 +124  07/12  174  7C  VERTICAL LINE, VERTICAL BAR
35299 +125  07/13  175  7D  RIGHT CURLY BRACKET, RIGHT BRACE
35300 +126  07/14  176  7E  TILDE
35301 +127  07/15  177  7F  RUBOUT, DELETE
35302 +
35303 +    III.1.2.3. PC Code Page 869
35304 +
35305 +   (to be filled in...)
35306 +
35307 +    III.2. Updated Country Codes
35308 +
35309 +   Date: Mon, 7 Apr 1997 23:23:49 EDT
35310 +   From: Dave Leibold <dleibold@else.net>
35311 +   Newsgroups: comp.dcom.telecom
35312 +   Subject: Ex-USSR Country Codes Profile
35313 +   Organization: TELECOM Digest
35314 +
35315 +   Ex-USSR Country Codes Profile
35316 +   4 April 1997
35317 +
35318 +   Below is a summary of the country codes that have formed in the wake of
35319 +   the USSR dissolution, along with some updated findings and reports.
35320 +   Additional or corrected information on any of these nations would be
35321 +   welcome (c/o dleibold@else.net).
35322 +     * Kyrgyz Republic country code 996 will take effect, at least in
35323 +       Canada, effective 1 May 1997, according to CRTC Telecom Order
35324 +       97-464, based on Stentor Tariff Notice 433. There is no indication
35325 +       whether there will be a permissive dialing period involved or for
35326 +       how long such a permissive operation would remain.
35327 +     * Country code 992 was reported as a recent assignment for
35328 +       Tajikistan, which will be moving from country code 7 at some
35329 +       unknown time.
35330 +     * Uzbekistan has its own country code assignment, but I have no
35331 +       information if this is in service yet or what implementation dates
35332 +       have been set.
35333 +     * Kazakstan does not have a known separate country code assignment at
35334 +       present. It remains in country code 7 for the time being.
35335 +     * Russia seems destined to keep country code 7.
35336 +     * Recent news reports speak of some agreements forming between Russia
35337 +       and Belarus. While there is no outright reunification yet, there is
35338 +       expected to be much closer ties between the two nations. Whether
35339 +       this will lead to a reunification of telephone codes remains to be
35340 +       seen.
35341 +
35342 +   In the table, "Effective" means the date at which the country code
35343 +   began service (which could vary according to the nation). "Mandatory"
35344 +   means the date at which the country code 7 is invalid for calls to that
35345 +   nation. There are a number of question marks since exact dates have not
35346 +   been collected in all cases.
35347 +
35348 +CC  Nation            Effective     Mandatory    Notes
35349 +
35350 +370 Lithuania         1993?         ???          Announced Jan 1993
35351 +371 Latvia            1993?         ???
35352 +372 Estonia           1 Feb 1993?   March 1993?
35353 +373 Moldova           1993?         ???          Announced Jan 1993
35354 +374 Armenia           1 May 1995    1 July 1995  Announced Jan 1995 (ITU)
35355 +375 Belarus           16 Apr 1995   1997?
35356 +380 Ukraine           16 Apr 1995   Oct 1995?
35357 +7   Kazakstan         (no known changes)
35358 +7   Russia            (presumably not changing)
35359 +992 Tajikistan        ???           ???          Announced 1996-7?
35360 +993 Turkmenistan      3 Jan 1997    3 Apr 1997   Canada as of 29 Nov 1996
35361 +994 Azerbaijan        Sept 1994?    ???          Announced 1992
35362 +995 Georgia           1994?         ???          ref: Telecom Digest Oct 1994
35363 +996 Kyrgyz Republic   1 May 1997    ???          ref: Stentor Canada/CRTC
35364 +998 Uzbekistan        ???           ???          Announced 1996? (ITU)
35365 +
35366 +   Details courtesy Toby Nixon, ITU, Stentor (Canada), CRTC (Canada),
35367 +   TELECOM Digest (including information collected for the country code
35368 +   listings).
35369 +
35370 +IV. ERRATA & CORRIGENDA
35371 +
35372 +   The following errors in [646]Using C-Kermit, Second Edition, first
35373 +   printing, have been noted.
35374 +
35375 +   First, some missing acknowledgements for C-Kermit 6.0: JE Jones of
35376 +   Microware for help with OS-9, Nigel Roles for his help with Plan 9,
35377 +   Lucas Hart for help with VMS and Digital UNIX, Igor Kovalenko for his
35378 +   help with QNX. And later, to Susan Kleinmann for her help with Debian
35379 +   Linux packaging; Patrick Volkerding for his help with Slackware Linux
35380 +   packaging; Jim Knoble for his help with Red Hat Linux packaging; and to
35381 +   dozens of others for sending individual C-Kermit binaries for varied
35382 +   and diverse platforms.
35383 +
35384 +   Thanks to James Spath for both binaries and reporting many of the typos
35385 +   noted below. Also to Dat Thuc Nguyen for spotting several typos.
35386 +
35387 +PAGE    REMARKS
35388 +COVER   "COS" is a misprint.  There is no COS.  Pretend it says "SCO" or "VOS".
35389 +        (This is fixed in the second printing.)
35390 + xxi    Second line: Fred Smith's affiliation should be Computrition.
35391 + 83     Change "commands other" to "commands as other" (1st paragraph)
35392 + 87     Change "The the" to "The" (2nd paragraph)
35393 + 92     "set modem-type user-defined supra" should be "set modem type ..."
35394 + 95     Change "VI" to "vi" (1st paragraph)
35395 + 96     Change "it it" to "it is" (1st paragraph)
35396 + 97     Change "advantage a literal" to "advantage of a literal" (2nd
35397 +        paragraph)
35398 +102     The call-waiting example would be better as SET DIAL PREFIX *70W
35399 +        (rather than "*70,") because the former will not cause an incorrect
35400 +        call to be placed with pulse dialing.
35401 +123     Third paragraph from bottom: "..otherwise if a your local username.."
35402 +        should be "..otherwise your local username..".
35403 +160     Delete the "it" between "and" and "to" (2nd paragraph)
35404 +185     In "When TRANSFER DISPLAY is OFF, C-Kermit skips the display...",
35405 +        "OFF" should be "NONE".
35406 +187     The last paragraph says the "A command" is ignored, should be "S".
35407 +194     Change "it known" to "it is known" (4th paragraph).
35408 +235     In C-Kermit 7.0, the syntax of the GET command changed.  MGET now
35409 +        must be used to get a list of files and there is no more multiline
35410 +        GET command.
35411 +268     Last paragraph: "effect" should be "affect".
35412 +275     In the SET PROTOCOL KERMIT description, the following sentence is
35413 +        incorrect and should be removed: 'If you omit the commands, the
35414 +        default ones are restored: "kermit -ir" and "kermit -r" respectively".
35415 +        The correct information is given at the bottom of page 281.
35416 +279     9th line.  The decimal value of ST is 156, not 155.
35417 +295     In the stepping stones, skip ahead to Chapter 17 on p. 327.
35418 +298     Table 16-2, Portuguese entry.  Column 4/00 should show section sign,
35419 +        not acute accent.
35420 +316     Other languages written in the Hebrew alphabet include Karaim (a Turkic
35421 +        language spoken in Lithuania and Poland), Judeo-Kurdish, and Judeo-
35422 +        Georgian.
35423 +332     UNDEFINE definition, change "This just" to "This is just".
35424 +344     It might be necessary to set the modem's pulse generation rate when
35425 +        sending numeric pages; most Hayes compatible modems use the S11
35426 +        register for this.
35427 +350     Delete "is" from between "It" and "ceases" (4th paragraph)
35428 +351     Top - both occurrences of "print \%a" should be "echo \%a".
35429 +364     \v(input) and \v(query) out of alphabetical order.
35430 +378     In the MYSEND macro, "if not \m(rc) goto bad" should be:
35431 +        "if \m(rc) goto bad" (remove the "not").
35432 +382-383 It should be stated that the loop control variable must be of the \%a
35433 +        type, or else an array element; macro names can not be used for this.
35434 +383     In line 3, "\%f[\%i]" should be "\&f[\%i]".
35435 +383     In the sort example, it should be stated that the array is 1-based.
35436 +387     Change "You can list" to "You can get a list" (5th paragraph)
35437 +393     \Fverify() description.  The 3rd sentence could be stated more clearly
35438 +        as "If all characters in string2 are also in string1, 0 is returned."
35439 +398     Copying \ffiles() results to an array before is not required as of
35440 +        C-Kermit 7.0 (see [647]Section 7.3).
35441 +403     In "(\%a + 3) * (\%b  5)", a minus sign is missing between b and 5.
35442 +407     C-Kermit 7.0 no longer supports multiline GET.  Change
35443 +        "get, \%1, \%2" to "get {\%1} {\%2}" or "get /as:{\%2} {\%1}".
35444 +409     READ example while loop should be:
35445 +        while success { echo \m(line), read line }
35446 +409     "WRITE file" should be "WRITE keyword" (you can't put a filename there)
35447 +        (The same applies to WRITE-LINE / WRITELN).
35448 +414     \Funhexify() missing from Table 18-3.
35449 +425     MINPUT definition, change 2nd "text2" to "text3".
35450 +436     Several lines are missing from the UNIXLOGIN macro listing.
35451 +        After the "xif fail" block, insert:
35452 +
35453 +          out \%1\13                    ; Send username, carriage return
35454 +          inp 5 Password:               ; Wait 5 sec for this prompt
35455 +          if fail end 1 No password prompt
35456 +          pause                         ; Wait a sec
35457 +          out \%2\13                    ; Send password
35458 +
35459 +440     Change "set terminal byteszie" to "set terminal bytesize".
35460 +        Change "input Password:" to "input 10 Password".
35461 +448     Franchise script: "access line" should be "access \m(line)".
35462 +453     There are two incorrectly coded IF statements in the DELIVER macro
35463 +        definition.  Replace both occurrences of "if > \%1 \%3 {" with
35464 +        "xif > \%i \%3 {" (replace "if" by "xif" and "\%1" with "\%i").
35465 +453     "the the" (last paragraph) should be "the".
35466 +454     EOT (last paragraph) is End of Transmission, not End of Text.
35467 +457     _DEFINE definition: "name constructed" should be "name is constructed".
35468 +457     "macro for and" (last paragraph) should be "macro and".
35469 +459     Should explain that \v(user) is a legal abbreviation of \v(userid).
35470 +480     Figure II-2 is backwards; the least-significant bit is transmitted
35471 +        first, then up to the highest, and the parity bit last.
35472 +534     The VMS Appendix section on Odd Record Lengths no longer applies;
35473 +        C-Kermit 7.0 handles odd record lengths as well as even ones.
35474 +559     Table VIII-3, Portuguese entry.  Column 4/00 should show section sign,
35475 +        not acute accent.
35476 +560-563 HP-Roman8 missing from Table VII-4; there wasn't room to squeeze it in.
35477 +        It is listed in section II(6).
35478 +565     "d stroke" in Table VII-5 has the wrong appearance; the stem should
35479 +        be upright.  The letter shown in the table is actually a lowercase
35480 +        Icelandic eth, which has a curved stem.
35481 +601-604 BeBox, BeOS, Plan 9, and probably others not listed in trademarks.
35482 +604     The words "SCRIBE TEXT FORMATTER" appear at the end of the last
35483 +        sentence of the first paragraph of the Colophon.  They should have
35484 +        been in the Index.
35485 +Index:  Missing entries: SET { SEND, RECEIVE } PATHNAMES, Call waiting, ...
35486 +        \F()            Page 605, add also 413-414
35487 +        \Fbreak         389
35488 +        \Fcapitalize    390
35489 +        \Fchecksum      414
35490 +        \Fcrc16         414
35491 +        \Fexecute       414
35492 +        \Fhexify        390
35493 +        \Fltrim         391
35494 +        \Frepeat        392
35495 +        \Fspawn         392
35496 +        \Ftod2secs      399
35497 +        \v() built_in   Page 606, add also 361-364
35498 +        \v(_line)       354, 361
35499 +        \v(apcactive)   361
35500 +        \v(charset)     362
35501 +        \v(cpu)         362
35502 +        \v(crc16)       357, 362
35503 +        \v(d$xxx)       add page 362
35504 +        \v(dialnumber)  362
35505 +        \v(dialresult)  362
35506 +        \v(errno)       362
35507 +        \v(errstring)   362
35508 +        \v(exedir)      362
35509 +        \v(inidir)      363
35510 +        \v(ipaddress)   363
35511 +        \v(keyboard)    363
35512 +        \v(macro)       363
35513 +        \v(minput)      363
35514 +        \v(m_xxx)       94, 363
35515 +        \v(password)    364
35516 +        \v(query)       364
35517 +        \v(prompt)      364
35518 +        \v(speed)       356, 364
35519 +        \v(startup)     364
35520 +        \v(status)      364
35521 +        \v(sysid)       364
35522 +        \v(system)      364
35523 +        \v(fsize)       at lower half page 606 should read \v(tfsize)
35524 +        \v(xversion)    364
35525 +        BEEP Command    40
35526 +        SET FLOW        62, 212
35527 +
35528 +   Figure II-5 on page 493. The pin assignments of the Mini Din-8
35529 +   connector are not described anywhere. As noted in the text, these tend
35530 +   to vary from vendor to vendor. One common arrangement is:
35531 +
35532 +  1. HSKout (Handshake out -- definition depends on software)
35533 +  2. HSKin  (Handshake in or external clock)
35534 +  3. TxD-
35535 +  4. Not used
35536 +  5. RxD-
35537 +  6. TxD+
35538 +  7. Not used
35539 +  8. RxD+
35540 +
35541 +   Note the "balanced pairs" for Receive Data (RxD) and Transmit Data
35542 +   (TxD), and the utter lack of modem signals. These connectors follow the
35543 +   RS-423 standard, rather than RS-232. In some arrangements, Pin 1 is
35544 +   used for DTR and Pin 2 for CD; in others Pin 1 is RTS and Pin 2 is CTS.
35545 +
35546 +   Please send reports of other errors to the authors, as well as
35547 +   suggestions for improvements, additional index entries, and any other
35548 +   comments:
35549 +
35550 +   [648]kermit@columbia.edu
35551 +
35552 +APPENDIX V. ADDITIONAL COPYRIGHT NOTICES
35553 +
35554 +   The following copyrights cover some of the source code used in the
35555 +   development of C-Kermit, Kermit 95, or Kermit 95 support libraries.
35556 +
35557 +/*****************************************************************************/
35558 +/*                                                                           */
35559 +/*              Copyright (c) 1995 by Oy Online Solutions Ltd.               */
35560 +/*                                                                           */
35561 +/*   Distribution of this source code is strictly forbbidden. Use of this    */
35562 +/*   source code is granted to the University of Columbia C-Kermit project   */
35563 +/*   to be distributed in binary format only. Please familiarize yourself    */
35564 +/*   with the accompanying LICENSE.P file.                                   */
35565 +/*                                                                           */
35566 +/*****************************************************************************/
35567 +
35568 +   used for Xmodem, Ymodem, and Zmodem protocol in Kermit 95 (p95.dll,
35569 +   p2.dll)
35570 +
35571 +   Copyright (c) 1997 Stanford University
35572 +
35573 +   The use of this software for revenue-generating purposes may require a
35574 +   license from the owners of the underlying intellectual property.
35575 +   Specifically, the SRP-3 protocol may not be used for revenue-generating
35576 +   purposes without a license.
35577 +
35578 +   Within that constraint, permission to use, copy, modify, and distribute
35579 +   this software and its documentation for any purpose is hereby granted
35580 +   without fee, provided that the above copyright notices and this
35581 +   permission notice appear in all copies of the software and related
35582 +   documentation.
35583 +
35584 +   THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
35585 +   EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
35586 +   WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
35587 +
35588 +   IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
35589 +   INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
35590 +   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT
35591 +   ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY,
35592 +   ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
35593 +   SOFTWARE.
35594 +
35595 +   Used for Secure Remote Password (TM) protocol (SRP) in C-Kermit, Kermit
35596 +   95 (k95.exe, k2.exe, k95crypt.dll, k2crypt.dll)
35597 +
35598 +   Copyright 1990 by the Massachusetts Institute of Technology. All Rights
35599 +   Reserved.
35600 +
35601 +   Export of this software from the United States of America may require a
35602 +   specific license from the United States Government. It is the
35603 +   responsibility of any person or organization contemplating export to
35604 +   obtain such a license before exporting.
35605 +
35606 +   WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
35607 +   this software and its documentation for any purpose and without fee is
35608 +   hereby granted, provided that the above copyright notice appear in all
35609 +   copies and that both that copyright notice and this permission notice
35610 +   appear in supporting documentation, and that the name of M.I.T. not be
35611 +   used in advertising or publicity pertaining to distribution of the
35612 +   software without specific, written prior permission. M.I.T. makes no
35613 +   representations about the suitability of this software for any purpose.
35614 +   It is provided "as is" without express or implied warranty.
35615 +
35616 +   Used for Telnet Authentication Option, Telnet Encryption Option, and
35617 +   Kerberos (TM) authentication in C-Kermit, Kermit 95 (k95.exe, k2.exe,
35618 +   k95crypt.dll, k2crypt.dll)
35619 +
35620 +   Copyright (c) 1991, 1993 The Regents of the University of California.
35621 +   All rights reserved.
35622 +
35623 +   Redistribution and use in source and binary forms, with or without
35624 +   modification, are permitted provided that the following conditions are
35625 +   met:
35626 +    1. Redistributions of source code must retain the above copyright
35627 +       notice, this list of conditions and the following disclaimer.
35628 +    2. Redistributions in binary form must reproduce the above copyright
35629 +       notice, this list of conditions and the following disclaimer in the
35630 +       documentation and/or other materials provided with the
35631 +       distribution.
35632 +    3. All advertising materials mentioning features or use of this
35633 +       software must display the following acknowledgement:
35634 +
35635 +     This product includes software developed by the University of
35636 +     California, Berkeley and its contributors.
35637 +    4. Neither the name of the University nor the names of its
35638 +       contributors may be used to endorse or promote products derived
35639 +       from this software without specific prior written permission.
35640 +
35641 +   THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
35642 +   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
35643 +   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
35644 +   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
35645 +   BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35646 +   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35647 +   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
35648 +   BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
35649 +   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35650 +   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35651 +   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35652 +
35653 +   Used for Telnet Authentication Option, Telnet Encryption Option, and
35654 +   Kerberos (TM) authentication in C-Kermit, Kermit 95 (k95.exe, k2.exe,
35655 +   k95crypt.dll, k2crypt.dll)
35656 +
35657 +   Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) All rights
35658 +   reserved.
35659 +
35660 +   This package is an DES implementation written by Eric Young
35661 +   (eay@cryptsoft.com). The implementation was written so as to conform
35662 +   with MIT's libdes.
35663 +
35664 +   This library is free for commercial and non-commercial use as long as
35665 +   the following conditions are aheared to. The following conditions apply
35666 +   to all code found in this distribution.
35667 +
35668 +   Copyright remains Eric Young's, and as such any Copyright notices in
35669 +   the code are not to be removed. If this package is used in a product,
35670 +   Eric Young should be given attribution as the author of that the SSL
35671 +   library. This can be in the form of a textual message at program
35672 +   startup or in documentation (online or textual) provided with the
35673 +   package.
35674 +
35675 +   Redistribution and use in source and binary forms, with or without
35676 +   modification, are permitted provided that the following conditions are
35677 +   met:
35678 +    1. Redistributions of source code must retain the copyright notice,
35679 +       this list of conditions and the following disclaimer.
35680 +    2. Redistributions in binary form must reproduce the above copyright
35681 +       notice, this list of conditions and the following disclaimer in the
35682 +       documentation and/or other materials provided with the
35683 +       distribution.
35684 +    3. All advertising materials mentioning features or use of this
35685 +       software must display the following acknowledgement: This product
35686 +       includes software developed by Eric Young (eay@cryptsoft.com)
35687 +
35688 +   THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND ANY EXPRESS OR
35689 +   IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
35690 +   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35691 +   DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
35692 +   ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35693 +   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35694 +   OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35695 +   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
35696 +   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35697 +   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35698 +   POSSIBILITY OF SUCH DAMAGE.
35699 +
35700 +   The license and distribution terms for any publically available version
35701 +   or derivative of this code cannot be changed. i.e. this code cannot
35702 +   simply be copied and put under another distrubution license [including
35703 +   the GNU Public License.]
35704 +
35705 +   The reason behind this being stated in this direct manner is past
35706 +   experience in code simply being copied and the attribution removed from
35707 +   it and then being distributed as part of other packages. This
35708 +   implementation was a non-trivial and unpaid effort.
35709 +
35710 +   Used DES encryption in Kermit 95 (k95crypt.dll, k2crypt.dll)
35711 +     __________________________________________________________________
35712 +
35713 + * This is version 1.1 of CryptoLib
35714 + *
35715 + * The authors of this software are Jack Lacy, Don Mitchell and Matt Blaze
35716 + *              Copyright (c) 1991, 1992, 1993, 1994, 1995 by AT&T.
35717 + * Permission to use, copy, and modify this software without fee
35718 + * is hereby granted, provided that this entire notice is included in
35719 + * all copies of any software which is or includes a copy or
35720 + * modification of this software and in all copies of the supporting
35721 + * documentation for such software.
35722 + *
35723 + * NOTE:
35724 + * Some of the algorithms in cryptolib may be covered by patents.
35725 + * It is the responsibility of the user to ensure that any required
35726 + * licenses are obtained.
35727 + *
35728 + *
35729 + * SOME PARTS OF CRYPTOLIB MAY BE RESTRICTED UNDER UNITED STATES EXPORT
35730 + * REGULATIONS.
35731 + *
35732 + *
35733 + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
35734 + * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
35735 + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
35736 + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
35737 +
35738 +   Used for Big Number library in Kermit 95 (k95crypt.dll, k2crypt.dll).
35739 +
35740 +   [ [649]Top ] [ [650]C-Kermit ] [ [651]Kermit Home ]
35741 +     __________________________________________________________________
35742 +     __________________________________________________________________
35743 +
35744 +   CKERMIT70.HTM / The Kermit Project / Columbia University / 8 Feb 2000
35745 +
35746 +References
35747 +
35748 +   1. http://www.columbia.edu/
35749 +   2. mailto:kermit@columbia.edu
35750 +   3. http://www.columbia.edu/kermit/index.html
35751 +   4. http://www.columbia.edu/kermit/k95.html
35752 +   5. http://www.columbia.edu/kermit/ckermit.html
35753 +   6. http://www.columbia.edu/kermit/ckscripts.html
35754 +   7. http://www.columbia.edu/kermit/current.html
35755 +   8. http://www.columbia.edu/kermit/whatsnew.html
35756 +   9. http://www.columbia.edu/kermit/faq.html
35757 +  10. http://www.columbia.edu/kermit/support.html
35758 +  11. http://www.amazon.com/gp/product/1555581641?ie=UTF8&tag=aleidmoreldom-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=1555581641
35759 +  12. mailto:kermit-support@columbia.edu
35760 +  13. http://www.columbia.edu/kermit/
35761 +  14. http://www.kermit-project.org/
35762 +  15. http://www.columbia.nyc.ny.us/kermit/
35763 +  16. ftp://kermit.columbia.edu/kermit/f/COPYING.TXT
35764 +  17. ftp://kermit.columbia.edu/kermit/f/ckcmai.c
35765 +  18. http://www.columbia.edu/kermit/ckermit70.html#xv
35766 +  19. http://www.columbia.edu/kermit/ckb2.htm
35767 +  20. ftp://kermit.columbia.edu/kermit/f/ckcbwr.txt
35768 +  21. ftp://kermit.columbia.edu/kermit/f/ckubwr.txt
35769 +  22. ftp://kermit.columbia.edu/kermit/f/ckvbwr.txt
35770 +  23. ftp://kermit.columbia.edu/kermit/f/ckubwr.txt
35771 +  24. ftp://kermit.columbia.edu/kermit/f/ckermit70.txt
35772 +  25. ftp://kermit.columbia.edu/kermit/f/security.txt
35773 +  26. http://www.columbia.edu/kermit/security.htm
35774 +  27. ftp://kermit.columbia.edu/kermit/f/iksd.txt
35775 +  28. http://www.columbia.edu/kermit/iksd.htm
35776 +  29. http://www.columbia.edu/kermit/cuiksd.htm
35777 +  30. ftp://kermit.columbia.edu/kermit/f/telnet.txt
35778 +  31. http://www.columbia.edu/kermit/telnet.htm
35779 +  32. ftp://kermit.columbia.edu/kermit/f/COPYING.TXT
35780 +  33. http://www.columbia.edu/kermit/k95.html
35781 +  34. http://www.opensource.org/
35782 +  35. http://www.columbia.edu/kermit/ckb2.htm
35783 +  36. http://www.columbia.edu/kermit/ckermit70.html#xi
35784 +  37. http://www.columbia.edu/kermit/ckermit70.html#xii
35785 +  38. http://www.columbia.edu/kermit/ckermit70.html#x0
35786 +  39. http://www.columbia.edu/kermit/ckermit70.html#x1
35787 +  40. http://www.columbia.edu/kermit/ckermit70.html#x1.0
35788 +  41. http://www.columbia.edu/kermit/ckermit70.html#x1.1
35789 +  42. http://www.columbia.edu/kermit/ckermit70.html#x1.2
35790 +  43. http://www.columbia.edu/kermit/ckermit70.html#x1.3
35791 +  44. http://www.columbia.edu/kermit/ckermit70.html#x1.4
35792 +  45. http://www.columbia.edu/kermit/ckermit70.html#x1.5
35793 +  46. http://www.columbia.edu/kermit/ckermit70.html#x1.5.1
35794 +  47. http://www.columbia.edu/kermit/ckermit70.html#x1.5.2
35795 +  48. http://www.columbia.edu/kermit/ckermit70.html#x1.5.3
35796 +  49. http://www.columbia.edu/kermit/ckermit70.html#x1.5.4
35797 +  50. http://www.columbia.edu/kermit/ckermit70.html#x1.5.5
35798 +  51. http://www.columbia.edu/kermit/ckermit70.html#x1.6
35799 +  52. http://www.columbia.edu/kermit/ckermit70.html#x1.7
35800 +  53. http://www.columbia.edu/kermit/ckermit70.html#x1.8
35801 +  54. http://www.columbia.edu/kermit/ckermit70.html#x1.9
35802 +  55. http://www.columbia.edu/kermit/ckermit70.html#x1.10
35803 +  56. http://www.columbia.edu/kermit/ckermit70.html#x1.11
35804 +  57. http://www.columbia.edu/kermit/ckermit70.html#x1.11.1
35805 +  58. http://www.columbia.edu/kermit/ckermit70.html#x1.11.2
35806 +  59. http://www.columbia.edu/kermit/ckermit70.html#x1.11.3
35807 +  60. http://www.columbia.edu/kermit/ckermit70.html#x1.11.4
35808 +  61. http://www.columbia.edu/kermit/ckermit70.html#x1.11.5
35809 +  62. http://www.columbia.edu/kermit/ckermit70.html#x1.11.6
35810 +  63. http://www.columbia.edu/kermit/ckermit70.html#x1.11.7
35811 +  64. http://www.columbia.edu/kermit/ckermit70.html#x1.12
35812 +  65. http://www.columbia.edu/kermit/ckermit70.html#x1.13
35813 +  66. http://www.columbia.edu/kermit/ckermit70.html#x1.14
35814 +  67. http://www.columbia.edu/kermit/ckermit70.html#x1.15
35815 +  68. http://www.columbia.edu/kermit/ckermit70.html#x1.16
35816 +  69. http://www.columbia.edu/kermit/ckermit70.html#x1.17
35817 +  70. http://www.columbia.edu/kermit/ckermit70.html#x1.18
35818 +  71. http://www.columbia.edu/kermit/ckermit70.html#x1.19
35819 +  72. http://www.columbia.edu/kermit/ckermit70.html#x1.20
35820 +  73. http://www.columbia.edu/kermit/ckermit70.html#x1.21
35821 +  74. http://www.columbia.edu/kermit/ckermit70.html#x1.22
35822 +  75. http://www.columbia.edu/kermit/ckermit70.html#x1.22.1
35823 +  76. http://www.columbia.edu/kermit/ckermit70.html#x1.22.2
35824 +  77. http://www.columbia.edu/kermit/ckermit70.html#x1.22.3
35825 +  78. http://www.columbia.edu/kermit/ckermit70.html#x1.22.4
35826 +  79. http://www.columbia.edu/kermit/ckermit70.html#x1.22.5
35827 +  80. http://www.columbia.edu/kermit/ckermit70.html#x1.22.6
35828 +  81. http://www.columbia.edu/kermit/ckermit70.html#x1.22.7
35829 +  82. http://www.columbia.edu/kermit/ckermit70.html#x1.22.8
35830 +  83. http://www.columbia.edu/kermit/ckermit70.html#x1.23
35831 +  84. http://www.columbia.edu/kermit/ckermit70.html#x1.24
35832 +  85. http://www.columbia.edu/kermit/ckermit70.html#x2
35833 +  86. http://www.columbia.edu/kermit/ckermit70.html#x2.0
35834 +  87. http://www.columbia.edu/kermit/ckermit70.html#x2.1
35835 +  88. http://www.columbia.edu/kermit/ckermit70.html#x2.1.1
35836 +  89. http://www.columbia.edu/kermit/ckermit70.html#x2.1.2
35837 +  90. http://www.columbia.edu/kermit/ckermit70.html#x2.1.3
35838 +  91. http://www.columbia.edu/kermit/ckermit70.html#x2.1.4
35839 +  92. http://www.columbia.edu/kermit/ckermit70.html#x2.1.5
35840 +  93. http://www.columbia.edu/kermit/ckermit70.html#x2.1.6
35841 +  94. http://www.columbia.edu/kermit/ckermit70.html#x2.1.7
35842 +  95. http://www.columbia.edu/kermit/ckermit70.html#x2.1.8
35843 +  96. http://www.columbia.edu/kermit/ckermit70.html#x2.1.9
35844 +  97. http://www.columbia.edu/kermit/ckermit70.html#x2.1.10
35845 +  98. http://www.columbia.edu/kermit/ckermit70.html#x2.1.11
35846 +  99. http://www.columbia.edu/kermit/ckermit70.html#x2.1.12
35847 + 100. http://www.columbia.edu/kermit/ckermit70.html#x2.1.13
35848 + 101. http://www.columbia.edu/kermit/ckermit70.html#x2.1.14
35849 + 102. http://www.columbia.edu/kermit/ckermit70.html#x2.1.15
35850 + 103. http://www.columbia.edu/kermit/ckermit70.html#x2.1.16
35851 + 104. http://www.columbia.edu/kermit/ckermit70.html#x2.2
35852 + 105. http://www.columbia.edu/kermit/ckermit70.html#x2.2.1
35853 + 106. http://www.columbia.edu/kermit/ckermit70.html#x2.2.2
35854 + 107. http://www.columbia.edu/kermit/ckermit70.html#x2.3
35855 + 108. http://www.columbia.edu/kermit/ckermit70.html#x2.3.0
35856 + 109. http://www.columbia.edu/kermit/ckermit70.html#x2.3.1
35857 + 110. http://www.columbia.edu/kermit/ckermit70.html#x2.3.2
35858 + 111. http://www.columbia.edu/kermit/ckermit70.html#x2.3.3
35859 + 112. http://www.columbia.edu/kermit/ckermit70.html#x2.3.4
35860 + 113. http://www.columbia.edu/kermit/ckermit70.html#x2.3.5
35861 + 114. http://www.columbia.edu/kermit/ckermit70.html#x2.3.6
35862 + 115. http://www.columbia.edu/kermit/ckermit70.html#x2.4
35863 + 116. http://www.columbia.edu/kermit/ckermit70.html#x2.5
35864 + 117. http://www.columbia.edu/kermit/ckermit70.html#x2.6
35865 + 118. http://www.columbia.edu/kermit/ckermit70.html#x2.7
35866 + 119. http://www.columbia.edu/kermit/ckermit70.html#x2.7.0
35867 + 120. http://www.columbia.edu/kermit/ckermit70.html#x2.7.1
35868 + 121. http://www.columbia.edu/kermit/ckermit70.html#x2.7.2
35869 + 122. http://www.columbia.edu/kermit/ckermit70.html#x2.7.3
35870 + 123. http://www.columbia.edu/kermit/ckermit70.html#x2.7.4
35871 + 124. http://www.columbia.edu/kermit/ckermit70.html#x2.7.4.1
35872 + 125. http://www.columbia.edu/kermit/ckermit70.html#x2.7.4.2
35873 + 126. http://www.columbia.edu/kermit/ckermit70.html#x2.7.4.3
35874 + 127. http://www.columbia.edu/kermit/ckermit70.html#x2.7.4.4
35875 + 128. http://www.columbia.edu/kermit/ckermit70.html#x2.7.4.5
35876 + 129. http://www.columbia.edu/kermit/ckermit70.html#x2.8
35877 + 130. http://www.columbia.edu/kermit/ckermit70.html#x2.9
35878 + 131. http://www.columbia.edu/kermit/ckermit70.html#x2.9.1
35879 + 132. http://www.columbia.edu/kermit/ckermit70.html#x2.9.2
35880 + 133. http://www.columbia.edu/kermit/ckermit70.html#x2.10
35881 + 134. http://www.columbia.edu/kermit/ckermit70.html#x2.11
35882 + 135. http://www.columbia.edu/kermit/ckermit70.html#x2.12
35883 + 136. http://www.columbia.edu/kermit/ckermit70.html#x2.13
35884 + 137. http://www.columbia.edu/kermit/ckermit70.html#x2.14
35885 + 138. http://www.columbia.edu/kermit/ckermit70.html#x2.15
35886 + 139. http://www.columbia.edu/kermit/ckermit70.html#x3
35887 + 140. http://www.columbia.edu/kermit/ckermit70.html#x3.1
35888 + 141. http://www.columbia.edu/kermit/ckermit70.html#x3.2
35889 + 142. http://www.columbia.edu/kermit/ckermit70.html#x3.3
35890 + 143. http://www.columbia.edu/kermit/ckermit70.html#x3.4
35891 + 144. http://www.columbia.edu/kermit/ckermit70.html#x4
35892 + 145. http://www.columbia.edu/kermit/ckermit70.html#x4.0
35893 + 146. http://www.columbia.edu/kermit/ckermit70.html#x4.1
35894 + 147. http://www.columbia.edu/kermit/ckermit70.html#x4.1.1
35895 + 148. http://www.columbia.edu/kermit/ckermit70.html#x4.1.2
35896 + 149. http://www.columbia.edu/kermit/ckermit70.html#x4.1.3
35897 + 150. http://www.columbia.edu/kermit/ckermit70.html#x4.2
35898 + 151. http://www.columbia.edu/kermit/ckermit70.html#x4.2.1
35899 + 152. http://www.columbia.edu/kermit/ckermit70.html#x4.2.1.1
35900 + 153. http://www.columbia.edu/kermit/ckermit70.html#x4.2.1.2
35901 + 154. http://www.columbia.edu/kermit/ckermit70.html#x4.2.1.3
35902 + 155. http://www.columbia.edu/kermit/ckermit70.html#x4.2.2
35903 + 156. http://www.columbia.edu/kermit/ckermit70.html#x4.2.2.1
35904 + 157. http://www.columbia.edu/kermit/ckermit70.html#x4.2.2.2
35905 + 158. http://www.columbia.edu/kermit/ckermit70.html#x4.2.3
35906 + 159. http://www.columbia.edu/kermit/ckermit70.html#x4.2.3.1
35907 + 160. http://www.columbia.edu/kermit/ckermit70.html#x4.2.3.2
35908 + 161. http://www.columbia.edu/kermit/ckermit70.html#x4.2.4
35909 + 162. http://www.columbia.edu/kermit/ckermit70.html#x4.2.5
35910 + 163. http://www.columbia.edu/kermit/ckermit70.html#x4.2.6
35911 + 164. http://www.columbia.edu/kermit/ckermit70.html#x4.2.7
35912 + 165. http://www.columbia.edu/kermit/ckermit70.html#x4.2.8
35913 + 166. http://www.columbia.edu/kermit/ckermit70.html#x4.2.8.1
35914 + 167. http://www.columbia.edu/kermit/ckermit70.html#x4.2.8.2
35915 + 168. http://www.columbia.edu/kermit/ckermit70.html#x4.2.8.3
35916 + 169. http://www.columbia.edu/kermit/ckermit70.html#x4.2.8.4
35917 + 170. http://www.columbia.edu/kermit/ckermit70.html#x4.3
35918 + 171. http://www.columbia.edu/kermit/ckermit70.html#x4.3.1
35919 + 172. http://www.columbia.edu/kermit/ckermit70.html#x4.3.2
35920 + 173. http://www.columbia.edu/kermit/ckermit70.html#x4.3.3
35921 + 174. http://www.columbia.edu/kermit/ckermit70.html#x4.3.4
35922 + 175. http://www.columbia.edu/kermit/ckermit70.html#x4.4
35923 + 176. http://www.columbia.edu/kermit/ckermit70.html#x4.4.1
35924 + 177. http://www.columbia.edu/kermit/ckermit70.html#x4.4.1.1
35925 + 178. http://www.columbia.edu/kermit/ckermit70.html#x4.4.1.2
35926 + 179. http://www.columbia.edu/kermit/ckermit70.html#x4.4.2
35927 + 180. http://www.columbia.edu/kermit/ckermit70.html#x4.4.2.1
35928 + 181. http://www.columbia.edu/kermit/ckermit70.html#x4.4.2.1.1
35929 + 182. http://www.columbia.edu/kermit/ckermit70.html#x4.4.2.1.2
35930 + 183. http://www.columbia.edu/kermit/ckermit70.html#x4.4.2.2
35931 + 184. http://www.columbia.edu/kermit/ckermit70.html#x4.5
35932 + 185. http://www.columbia.edu/kermit/ckermit70.html#x4.5.1
35933 + 186. http://www.columbia.edu/kermit/ckermit70.html#x4.5.2
35934 + 187. http://www.columbia.edu/kermit/ckermit70.html#x4.5.2.1
35935 + 188. http://www.columbia.edu/kermit/ckermit70.html#x4.5.2.2
35936 + 189. http://www.columbia.edu/kermit/ckermit70.html#x4.5.3
35937 + 190. http://www.columbia.edu/kermit/ckermit70.html#x4.5.4
35938 + 191. http://www.columbia.edu/kermit/ckermit70.html#x4.6
35939 + 192. http://www.columbia.edu/kermit/ckermit70.html#x4.7
35940 + 193. http://www.columbia.edu/kermit/ckermit70.html#x4.7.1
35941 + 194. http://www.columbia.edu/kermit/ckermit70.html#x4.7.2
35942 + 195. http://www.columbia.edu/kermit/ckermit70.html#x4.7.3
35943 + 196. http://www.columbia.edu/kermit/ckermit70.html#x4.8
35944 + 197. http://www.columbia.edu/kermit/ckermit70.html#x4.8.1
35945 + 198. http://www.columbia.edu/kermit/ckermit70.html#x4.8.2
35946 + 199. http://www.columbia.edu/kermit/ckermit70.html#x4.9
35947 + 200. http://www.columbia.edu/kermit/ckermit70.html#x4.9.1
35948 + 201. http://www.columbia.edu/kermit/ckermit70.html#x4.9.2
35949 + 202. http://www.columbia.edu/kermit/ckermit70.html#x4.9.3
35950 + 203. http://www.columbia.edu/kermit/ckermit70.html#x4.10
35951 + 204. http://www.columbia.edu/kermit/ckermit70.html#x4.11
35952 + 205. http://www.columbia.edu/kermit/ckermit70.html#x4.11.1
35953 + 206. http://www.columbia.edu/kermit/ckermit70.html#x4.11.2
35954 + 207. http://www.columbia.edu/kermit/ckermit70.html#x4.11.3
35955 + 208. http://www.columbia.edu/kermit/ckermit70.html#x4.11.4
35956 + 209. http://www.columbia.edu/kermit/ckermit70.html#x4.11.5
35957 + 210. http://www.columbia.edu/kermit/ckermit70.html#x4.11.6
35958 + 211. http://www.columbia.edu/kermit/ckermit70.html#x4.12
35959 + 212. http://www.columbia.edu/kermit/ckermit70.html#x4.13
35960 + 213. http://www.columbia.edu/kermit/ckermit70.html#x4.14
35961 + 214. http://www.columbia.edu/kermit/ckermit70.html#x4.15
35962 + 215. http://www.columbia.edu/kermit/ckermit70.html#x4.16
35963 + 216. http://www.columbia.edu/kermit/ckermit70.html#x4.17
35964 + 217. http://www.columbia.edu/kermit/ckermit70.html#x4.17.1
35965 + 218. http://www.columbia.edu/kermit/ckermit70.html#x4.17.2
35966 + 219. http://www.columbia.edu/kermit/ckermit70.html#x4.18
35967 + 220. http://www.columbia.edu/kermit/ckermit70.html#x4.19
35968 + 221. http://www.columbia.edu/kermit/ckermit70.html#x4.20
35969 + 222. http://www.columbia.edu/kermit/ckermit70.html#x4.20.1
35970 + 223. http://www.columbia.edu/kermit/ckermit70.html#x4.20.2
35971 + 224. http://www.columbia.edu/kermit/ckermit70.html#x4.20.2.1
35972 + 225. http://www.columbia.edu/kermit/ckermit70.html#x4.20.2.2
35973 + 226. http://www.columbia.edu/kermit/ckermit70.html#x4.20.2.3
35974 + 227. http://www.columbia.edu/kermit/ckermit70.html#x4.20.2.4
35975 + 228. http://www.columbia.edu/kermit/ckermit70.html#x4.20.2.5
35976 + 229. http://www.columbia.edu/kermit/ckermit70.html#x4.20.3
35977 + 230. http://www.columbia.edu/kermit/ckermit70.html#x4.21
35978 + 231. http://www.columbia.edu/kermit/ckermit70.html#x4.22
35979 + 232. http://www.columbia.edu/kermit/ckermit70.html#x4.22.1
35980 + 233. http://www.columbia.edu/kermit/ckermit70.html#x4.22.2
35981 + 234. http://www.columbia.edu/kermit/ckermit70.html#x4.22.3
35982 + 235. http://www.columbia.edu/kermit/ckermit70.html#x4.22.4
35983 + 236. http://www.columbia.edu/kermit/ckermit70.html#x4.22.5
35984 + 237. http://www.columbia.edu/kermit/ckermit70.html#x4.22.6
35985 + 238. http://www.columbia.edu/kermit/ckermit70.html#x4.22.7
35986 + 239. http://www.columbia.edu/kermit/ckermit70.html#x4.22.8
35987 + 240. http://www.columbia.edu/kermit/ckermit70.html#x4.23
35988 + 241. http://www.columbia.edu/kermit/ckermit70.html#x4.24
35989 + 242. http://www.columbia.edu/kermit/ckermit70.html#x4.25
35990 + 243. http://www.columbia.edu/kermit/ckermit70.html#x5
35991 + 244. http://www.columbia.edu/kermit/ckermit70.html#x5.0
35992 + 245. http://www.columbia.edu/kermit/ckermit70.html#x5.1
35993 + 246. http://www.columbia.edu/kermit/ckermit70.html#x5.2
35994 + 247. http://www.columbia.edu/kermit/ckermit70.html#x5.3
35995 + 248. http://www.columbia.edu/kermit/ckermit70.html#x5.3.1
35996 + 249. http://www.columbia.edu/kermit/ckermit70.html#x5.3.2
35997 + 250. http://www.columbia.edu/kermit/ckermit70.html#x5.4
35998 + 251. http://www.columbia.edu/kermit/ckermit70.html#x5.5
35999 + 252. http://www.columbia.edu/kermit/ckermit70.html#x5.6
36000 + 253. http://www.columbia.edu/kermit/ckermit70.html#x5.7
36001 + 254. http://www.columbia.edu/kermit/ckermit70.html#x6
36002 + 255. http://www.columbia.edu/kermit/ckermit70.html#x6.0
36003 + 256. http://www.columbia.edu/kermit/ckermit70.html#x6.1
36004 + 257. http://www.columbia.edu/kermit/ckermit70.html#x6.2
36005 + 258. http://www.columbia.edu/kermit/ckermit70.html#x6.3
36006 + 259. http://www.columbia.edu/kermit/ckermit70.html#x6.4
36007 + 260. http://www.columbia.edu/kermit/ckermit70.html#x6.5
36008 + 261. http://www.columbia.edu/kermit/ckermit70.html#x6.6
36009 + 262. http://www.columbia.edu/kermit/ckermit70.html#x6.6.1
36010 + 263. http://www.columbia.edu/kermit/ckermit70.html#x6.6.2
36011 + 264. http://www.columbia.edu/kermit/ckermit70.html#x6.6.2
36012 + 265. http://www.columbia.edu/kermit/ckermit70.html#x6.6.3
36013 + 266. http://www.columbia.edu/kermit/ckermit70.html#x6.6.4
36014 + 267. http://www.columbia.edu/kermit/ckermit70.html#x6.6.5
36015 + 268. http://www.columbia.edu/kermit/ckermit70.html#x6.6.5.1
36016 + 269. http://www.columbia.edu/kermit/ckermit70.html#x6.6.5.2
36017 + 270. http://www.columbia.edu/kermit/ckermit70.html#x6.6.5.3
36018 + 271. http://www.columbia.edu/kermit/ckermit70.html#x6.6.5.4
36019 + 272. http://www.columbia.edu/kermit/ckermit70.html#x6.6.5.5
36020 + 273. http://www.columbia.edu/kermit/ckermit70.html#x6.7
36021 + 274. http://www.columbia.edu/kermit/ckermit70.html#x7
36022 + 275. http://www.columbia.edu/kermit/ckermit70.html#x7.0
36023 + 276. http://www.columbia.edu/kermit/ckermit70.html#x7.1
36024 + 277. http://www.columbia.edu/kermit/ckermit70.html#x7.1.1
36025 + 278. http://www.columbia.edu/kermit/ckermit70.html#x7.1.2
36026 + 279. http://www.columbia.edu/kermit/ckermit70.html#x7.1.3
36027 + 280. http://www.columbia.edu/kermit/ckermit70.html#x7.1.4
36028 + 281. http://www.columbia.edu/kermit/ckermit70.html#x7.2
36029 + 282. http://www.columbia.edu/kermit/ckermit70.html#x7.3
36030 + 283. http://www.columbia.edu/kermit/ckermit70.html#x7.4
36031 + 284. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36032 + 285. http://www.columbia.edu/kermit/ckermit70.html#x7.6
36033 + 286. http://www.columbia.edu/kermit/ckermit70.html#x7.7
36034 + 287. http://www.columbia.edu/kermit/ckermit70.html#x7.8
36035 + 288. http://www.columbia.edu/kermit/ckermit70.html#x7.9
36036 + 289. http://www.columbia.edu/kermit/ckermit70.html#x7.9.1
36037 + 290. http://www.columbia.edu/kermit/ckermit70.html#x7.9.2
36038 + 291. http://www.columbia.edu/kermit/ckermit70.html#x7.10
36039 + 292. http://www.columbia.edu/kermit/ckermit70.html#x7.10.1
36040 + 293. http://www.columbia.edu/kermit/ckermit70.html#x7.10.2
36041 + 294. http://www.columbia.edu/kermit/ckermit70.html#x7.10.3
36042 + 295. http://www.columbia.edu/kermit/ckermit70.html#x7.10.4
36043 + 296. http://www.columbia.edu/kermit/ckermit70.html#x7.10.5
36044 + 297. http://www.columbia.edu/kermit/ckermit70.html#x7.10.6
36045 + 298. http://www.columbia.edu/kermit/ckermit70.html#x7.10.7
36046 + 299. http://www.columbia.edu/kermit/ckermit70.html#x7.10.8
36047 + 300. http://www.columbia.edu/kermit/ckermit70.html#x7.10.9
36048 + 301. http://www.columbia.edu/kermit/ckermit70.html#x7.10.10
36049 + 302. http://www.columbia.edu/kermit/ckermit70.html#x7.11
36050 + 303. http://www.columbia.edu/kermit/ckermit70.html#x7.12
36051 + 304. http://www.columbia.edu/kermit/ckermit70.html#x7.13
36052 + 305. http://www.columbia.edu/kermit/ckermit70.html#x7.14
36053 + 306. http://www.columbia.edu/kermit/ckermit70.html#x7.15
36054 + 307. http://www.columbia.edu/kermit/ckermit70.html#x7.16
36055 + 308. http://www.columbia.edu/kermit/ckermit70.html#x7.17
36056 + 309. http://www.columbia.edu/kermit/ckermit70.html#x7.18
36057 + 310. http://www.columbia.edu/kermit/ckermit70.html#x7.19
36058 + 311. http://www.columbia.edu/kermit/ckermit70.html#x7.20
36059 + 312. http://www.columbia.edu/kermit/ckermit70.html#x7.20.1
36060 + 313. http://www.columbia.edu/kermit/ckermit70.html#x7.20.2
36061 + 314. http://www.columbia.edu/kermit/ckermit70.html#x7.21
36062 + 315. http://www.columbia.edu/kermit/ckermit70.html#x7.22
36063 + 316. http://www.columbia.edu/kermit/ckermit70.html#x7.23
36064 + 317. http://www.columbia.edu/kermit/ckermit70.html#x7.24
36065 + 318. http://www.columbia.edu/kermit/ckermit70.html#x7.25
36066 + 319. http://www.columbia.edu/kermit/ckermit70.html#x7.26
36067 + 320. http://www.columbia.edu/kermit/ckermit70.html#x7.26.1
36068 + 321. http://www.columbia.edu/kermit/ckermit70.html#x7.26.2
36069 + 322. http://www.columbia.edu/kermit/ckermit70.html#x7.27
36070 + 323. http://www.columbia.edu/kermit/ckermit70.html#x8
36071 + 324. http://www.columbia.edu/kermit/ckermit70.html#x9
36072 + 325. http://www.columbia.edu/kermit/ckermit70.html#x9.0
36073 + 326. http://www.columbia.edu/kermit/ckermit70.html#x9.1
36074 + 327. http://www.columbia.edu/kermit/ckermit70.html#x9.2
36075 + 328. http://www.columbia.edu/kermit/ckermit70.html#x9.3
36076 + 329. http://www.columbia.edu/kermit/ckermit70.html#x10
36077 + 330. http://www.columbia.edu/kermit/ckermit70.html#xiii
36078 + 331. http://www.columbia.edu/kermit/ckermit70.html#xiii.1
36079 + 332. http://www.columbia.edu/kermit/ckermit70.html#xiii.1.1
36080 + 333. http://www.columbia.edu/kermit/ckermit70.html#xiii.1.2
36081 + 334. http://www.columbia.edu/kermit/ckermit70.html#xiii.1.2.1
36082 + 335. http://www.columbia.edu/kermit/ckermit70.html#xiii.1.2.2
36083 + 336. http://www.columbia.edu/kermit/ckermit70.html#xiii.1.2.3
36084 + 337. http://www.columbia.edu/kermit/ckermit70.html#xiii.2
36085 + 338. http://www.columbia.edu/kermit/ckermit70.html#xiv
36086 + 339. http://www.columbia.edu/kermit/ckermit70.html#xv
36087 + 340. http://www.columbia.edu/kermit/ckb2.htm
36088 + 341. http://www.columbia.edu/kermit/ckbreviews.html
36089 + 342. http://www.bhusa.com/
36090 + 343. http://www.columbia.edu/kermit/manuals.html#ckde
36091 + 344. http://www.columbia.edu/kermit/manuals.html#ktb
36092 + 345. http://www.columbia.edu/kermit/news.html
36093 + 346. news:comp.protocols.kermit.announce
36094 + 347. news:comp.protocols.kermit.misc
36095 + 348. http://www.columbia.edu/kermit/ckb2.htm
36096 + 349. http://www.columbia.edu/kermit/ckermit70.html#x4
36097 + 350. http://www.columbia.edu/kermit/ckermit70.html#x4.3
36098 + 351. http://www.columbia.edu/kermit/ckermit70.html#x4.23
36099 + 352. http://www.columbia.edu/kermit/ckermit70.html#x4.5.1
36100 + 353. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36101 + 354. http://www.columbia.edu/kermit/ckermit70.html#x4.7.1
36102 + 355. http://www.columbia.edu/kermit/ckermit70.html#x4.9.
36103 + 356. http://www.columbia.edu/kermit/ckb2.htm
36104 + 357. http://www.columbia.edu/kermit/ckermit70.html#x7.9.2
36105 + 358. http://www.columbia.edu/kermit/ckermit70.html#x2.15
36106 + 359. http://www.columbia.edu/kermit/ckermit70.html#x9.1
36107 + 360. http://www.columbia.edu/kermit/ckermit70.html#x1.6
36108 + 361. http://www.columbia.edu/kermit/ckermit70.html#x7.4
36109 + 362. http://www.columbia.edu/kermit/ckermit70.html#x4.9.1
36110 + 363. http://www.columbia.edu/kermit/ckermit70.html#mjd
36111 + 364. http://www.columbia.edu/kermit/ckermit70.html#mjd
36112 + 365. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36113 + 366. http://www.columbia.edu/kermit/ckb2.htm
36114 + 367. http://www.columbia.edu/kermit/ckb2.htm
36115 + 368. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36116 + 369. http://www.columbia.edu/kermit/ckermit70.html#x2.12
36117 + 370. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36118 + 371. http://www.columbia.edu/kermit/ckermit70.html#x4.9.1
36119 + 372. http://www.columbia.edu/kermit/ckermit70.html#x6.6.5
36120 + 373. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36121 + 374. http://www.columbia.edu/kermit/ckermit70.html#x7.18
36122 + 375. http://www.columbia.edu/kermit/ckermit70.html#x7.4
36123 + 376. http://www.columbia.edu/kermit/ckermit70.html#x1.15
36124 + 377. http://www.columbia.edu/kermit/ckermit70.html#x4.3
36125 + 378. http://www.columbia.edu/kermit/ckermit70.html#x7.3
36126 + 379. http://www.columbia.edu/kermit/ckermit70.html#x7.10.7
36127 + 380. http://www.columbia.edu/kermit/ckermit70.html#x7.1
36128 + 381. http://www.columbia.edu/kermit/ckermit70.html#x4.9.1
36129 + 382. ftp://kermit.columbia.edu/kermit/f/ckccfg.txt
36130 + 383. ftp://kermit.columbia.edu/kermit/f/ckccfg.txt
36131 + 384. http://www.columbia.edu/kermit/ckermit70.html#x1.22.4
36132 + 385. http://www.columbia.edu/kermit/ckermit70.html#x1.22.5
36133 + 386. http://www.columbia.edu/kermit/ckb2.htm
36134 + 387. http://www.columbia.edu/kermit/ckermit70.html#x1.22.5
36135 + 388. http://www.columbia.edu/kermit/ckermit70.html#x7.12
36136 + 389. http://www.columbia.edu/kermit/ckermit70.html#x2.1.16
36137 + 390. http://www.columbia.edu/kermit/ckermit70.html#x2.7
36138 + 391. http://www.columbia.edu/kermit/ckermit70.html#x2.3.5
36139 + 392. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36140 + 393. http://www.telefonica.es/cambiodenumeracion/
36141 + 394. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36142 + 395. http://www.columbia.edu/kermit/ckb2.htm
36143 + 396. http://www.columbia.edu/kermit/ckermit70.html#x2.2.2
36144 + 397. http://www.columbia.edu/kermit/ckermit70.html#x2.1.11
36145 + 398. http://www.columbia.edu/kermit/ckermit70.html#x2.1.13
36146 + 399. http://www.columbia.edu/kermit/ckermit70.html#x2.1.12
36147 + 400. http://www.columbia.edu/kermit/ckb2.htm
36148 + 401. http://www.columbia.edu/kermit/ckermit70.html#x2.1.1
36149 + 402. http://www.columbia.edu/kermit/ckb2.htm
36150 + 403. http://www.columbia.edu/kermit/ckb2.htm
36151 + 404. http://www.columbia.edu/kermit/ckermit70.html#x2.1.7
36152 + 405. http://www.columbia.edu/kermit/ckermit70.html#x2.1.6
36153 + 406. http://www.columbia.edu/kermit/ckb2.htm
36154 + 407. ftp://kermit.columbia.edu/kermit/f/telnet.txt
36155 + 408. http://www.columbia.edu/kermit/telnet.htm
36156 + 409. ftp://kermit.columbia.edu/kermit/f/telnet.txt
36157 + 410. http://www.columbia.edu/kermit/telnet.htm
36158 + 411. ftp://ftp.isi.edu/in-notes/rfc1572.txt
36159 + 412. ftp://ftp.isi.edu/in-notes/rfc779.txt
36160 + 413. http://www.columbia.edu/kermit/ckb2.htm
36161 + 414. http://www.columbia.edu/kermit/ckermit70.html#x2.10
36162 + 415. http://www.columbia.edu/kermit/ckermit70.html#x2.8
36163 + 416. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36164 + 417. http://www.columbia.edu/kermit/ckermit70.html#x4.20
36165 + 418. http://www.psy.uq.oz.au/~ftp/Crypto/
36166 + 419. http://www.columbia.edu/kermit/security.htm
36167 + 420. http://srp.stanford.edu/srp/
36168 + 421. http://www.columbia.edu/kermit/ckermit70.html#x2.7.1,
36169 + 422. ftp://kermit.columbia.edu/kermit/f/ckccfg.txt
36170 + 423. http://www.columbia.edu/kermit/security.htm
36171 + 424. http://www.columbia.edu/kermit/ckb2.htm
36172 + 425. http://www.columbia.edu/kermit/ckermit70.html#x2.7
36173 + 426. http://www.columbia.edu/kermit/ckermit70.html#x2.0
36174 + 427. ftp://kermit.columbia.edu/kermit/f/ckuins.txt
36175 + 428. ftp://kermit.columbia.edu/kermit/f/ckubwr.txt
36176 + 429. ftp://kermit.columbia.edu/kermit/f/ckuins.txt
36177 + 430. http://www.columbia.edu/kermit/iksd.html#x4.2
36178 + 431. http://www.columbia.edu/kermit/iksd.html
36179 + 432. http://www.columbia.edu/kermit/ckermit70.html#x4.2.8.1
36180 + 433. ftp://ftp.isi.edu/in-notes/rfc1945.txt
36181 + 434. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36182 + 435. http://www.columbia.edu/kermit/ckermit70.html#x3.2
36183 + 436. http://www.columbia.edu/kermit/ckermit70.html#x3.2
36184 + 437. http://www.columbia.edu/kermit/ckb2.htm
36185 + 438. http://www.columbia.edu/kermit/ckb2.htm
36186 + 439. http://www.columbia.edu/kermit/ckermit70.html#x5.4
36187 + 440. ftp://kermit.columbia.edu/kermit/f/ckubwr.txt
36188 + 441. http://www.columbia.edu/kermit/ckermit70.html#x4.10
36189 + 442. http://www.columbia.edu/kermit/ckermit70.html#x4.7.1
36190 + 443. http://www.columbia.edu/kermit/ckermit70.html#x4.7.3
36191 + 444. http://www.columbia.edu/kermit/ckermit70.html#x4.3
36192 + 445. http://www.columbia.edu/kermit/ckermit70.html#x4.10
36193 + 446. http://www.columbia.edu/kermit/ckermit70.html#x4.11
36194 + 447. http://www.columbia.edu/kermit/ckermit70.html#x4.15
36195 + 448. http://www.columbia.edu/kermit/ckermit70.html#x4.2.4
36196 + 449. http://www.columbia.edu/kermit/ckermit70.html#x4.7
36197 + 450. http://www.columbia.edu/kermit/ckermit70.html#x4.2.3
36198 + 451. http://www.columbia.edu/kermit/ckermit70.html#x4.2.1.3
36199 + 452. http://www.columbia.edu/kermit/ckb2.htm
36200 + 453. http://www.columbia.edu/kermit/ckermit70.html#x4.2.2
36201 + 454. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36202 + 455. http://www.columbia.edu/kermit/ckermit70.html#x4.2.8.2
36203 + 456. http://www.columbia.edu/kermit/ckermit70.html#x4.3
36204 + 457. http://www.columbia.edu/kermit/ckermit70.html#x4.10
36205 + 458. http://www.columbia.edu/kermit/ckermit70.html#x4.11
36206 + 459. http://www.columbia.edu/kermit/ckermit70.html#x4.15
36207 + 460. http://www.telstra.com.au/docs/PGP/
36208 + 461. http://www.telstra.com.au/docs/PGP/pgpdoc2/pgpdoc2_17.html
36209 + 462. http://www.columbia.edu/kermit/security.htm
36210 + 463. http://www.columbia.edu/kermit/ckermit70.html#x2.7
36211 + 464. http://www.columbia.edu/kermit/ckb2.htm
36212 + 465. http://www.columbia.edu/kermit/ckermit70.html#x2.14
36213 + 466. http://www.columbia.edu/kermit/ckermit70.html#x1.23
36214 + 467. http://www.columbia.edu/kermit/ckermit70.html#x4.7
36215 + 468. http://www.columbia.edu/kermit/ckb2.htm
36216 + 469. http://www.columbia.edu/kermit/ckb2.htm
36217 + 470. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36218 + 471. http://www.columbia.edu/kermit/ckb2.htm
36219 + 472. http://www.columbia.edu/kermit/ckermit70.html#x1.5.4
36220 + 473. http://www.columbia.edu/kermit/ckermit70.html#x4.3
36221 + 474. http://www.columbia.edu/kermit/ckermit70.html#x1.5.5
36222 + 475. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36223 + 476. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36224 + 477. http://www.columbia.edu/kermit/ckermit70.html#x1.5.4
36225 + 478. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36226 + 479. http://www.columbia.edu/kermit/ckermit70.html#x1.5.4
36227 + 480. http://www.columbia.edu/kermit/ckermit70.html#x1.5.5
36228 + 481. http://www.columbia.edu/kermit/ckb2.htm
36229 + 482. http://www.columbia.edu/kermit/ckb2.htm
36230 + 483. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36231 + 484. http://www.columbia.edu/kermit/ckermit70.html#x1.6
36232 + 485. http://www.columbia.edu/kermit/ckermit70.html#x7.10
36233 + 486. http://www.columbia.edu/kermit/ckermit70.html#x7.10.11
36234 + 487. http://www.columbia.edu/kermit/ckermit70.html#x1.6
36235 + 488. http://www.columbia.edu/kermit/ckermit70.html#x4.2.2
36236 + 489. http://www.columbia.edu/kermit/ckermit70.html#x4.11
36237 + 490. http://www.columbia.edu/kermit/ckermit70.html#x1.5.4
36238 + 491. http://www.columbia.edu/kermit/ckermit70.html#x4.9.1
36239 + 492. http://www.columbia.edu/kermit/ckermit70.html#x4.0.6
36240 + 493. http://www.columbia.edu/kermit/ckermit70.html#x4.2
36241 + 494. http://www.columbia.edu/kermit/ckermit70.html#x4.1
36242 + 495. http://www.columbia.edu/kermit/ckermit70.html#x4.7.1
36243 + 496. http://www.columbia.edu/kermit/ckb2.htm
36244 + 497. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36245 + 498. http://www.columbia.edu/kermit/ckermit70.html#x4.2.2
36246 + 499. http://www.columbia.edu/kermit/ckermit70.html#x4.7.1
36247 + 500. http://www.columbia.edu/kermit/ckermit70.html#x4.2
36248 + 501. http://www.columbia.edu/kermit/ckermit70.html#x4.10
36249 + 502. http://www.columbia.edu/kermit/ckermit70.html#x4.2.2
36250 + 503. http://www.columbia.edu/kermit/ckermit70.html#x4.7.1
36251 + 504. http://www.columbia.edu/kermit/ckermit70.html#x4.2
36252 + 505. http://www.columbia.edu/kermit/ckermit70.html#x4.10
36253 + 506. http://www.columbia.edu/kermit/ckermit70.html#x1.11.5
36254 + 507. http://www.columbia.edu/kermit/ckermit70.html#x4.0.6
36255 + 508. http://www.columbia.edu/kermit/ckermit70.html#x4.11
36256 + 509. http://www.columbia.edu/kermit/ckermit70.html#x4.9.1
36257 + 510. http://www.columbia.edu/kermit/ckermit70.html#x4.11.3
36258 + 511. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36259 + 512. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36260 + 513. http://www.columbia.edu/kermit/ckermit70.html#x4.5.1
36261 + 514. http://www.columbia.edu/kermit/ckermit70.html#x7.10
36262 + 515. http://www.columbia.edu/kermit/ckermit70.html#x7.10.5
36263 + 516. http://www.columbia.edu/kermit/ckermit70.html#x7.10.3
36264 + 517. http://www.columbia.edu/kermit/ckermit70.html#x7.10.5
36265 + 518. http://www.columbia.edu/kermit/ckb2.htm
36266 + 519. http://www.columbia.edu/kermit/ckermit70.html#x4.3
36267 + 520. http://www.columbia.edu/kermit/ckermit70.html#x4.10
36268 + 521. http://www.columbia.edu/kermit/ckermit70.html#x4.3
36269 + 522. http://www.columbia.edu/kermit/ckermit70.html#x4.10
36270 + 523. http://www.columbia.edu/kermit/ckermit70.html#x4.15
36271 + 524. http://www.columbia.edu/kermit/ckermit70.html#x4.18
36272 + 525. http://www.columbia.edu/kermit/ckermit70.html#x4.20
36273 + 526. http://www.columbia.edu/kermit/ckermit70.html#x4.20
36274 + 527. http://www.columbia.edu/kermit/ckermit70.html#x4.20
36275 + 528. http://www.columbia.edu/kermit/ckermit70.html#x4.19
36276 + 529. http://www.columbia.edu/kermit/ckermit70.html#x4.16
36277 + 530. http://www.columbia.edu/kermit/ckermit70.html#x4.19
36278 + 531. http://www.columbia.edu/kermit/ckermit70.html#x4.20.2.3
36279 + 532. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36280 + 533. http://www.columbia.edu/kermit/ckermit70.html#x6.6.5.4
36281 + 534. http://www.columbia.edu/kermit/ckermit70.html#x4.22.2
36282 + 535. http://www.columbia.edu/kermit/ckermit70.html#x4.22.3
36283 + 536. http://www.columbia.edu/kermit/ckb2.htm
36284 + 537. http://www.columbia.edu/kermit/ckb2.htm
36285 + 538. http://www.columbia.edu/kermit/ckermit70.html#x9.3
36286 + 539. http://www.columbia.edu/kermit/ckermit70.html#x5.2.1
36287 + 540. http://www.columbia.edu/kermit/ckermit70.html#x4.5.1
36288 + 541. http://www.columbia.edu/kermit/ckermit70.html#x4.5.2
36289 + 542. http://www.columbia.edu/kermit/ckermit70.html#x6.6
36290 + 543. http://www.columbia.edu/kermit/ckermit70.html#xiii
36291 + 544. http://www.columbia.edu/kermit/ckermit70.html#xiii
36292 + 545. ftp://ftp.isi.edu/in-notes/rfc1489.txt
36293 + 546. ftp://ftp.isi.edu/in-notes/rfc2319.txt
36294 + 547. http://www.unicode.org/
36295 + 548. http://www.columbia.edu/kermit/ckermit70.html#x6.6.2
36296 + 549. http://www.columbia.edu/kermit/ckermit70.html#x6.6.5.1
36297 + 550. ftp://ftp.isi.edu/in-notes/rfc2640.txt
36298 + 551. http://www.columbia.edu/kermit/ckermit70.html#x6.6.2
36299 + 552. http://www.columbia.edu/kermit/ckermit70.html#x6.0
36300 + 553. http://www.columbia.edu/kermit/ckermit70.html#x6.5
36301 + 554. http://www.columbia.edu/kermit/ckermit70.html#x6.4
36302 + 555. http://www.columbia.edu/kermit/ckb2.htm
36303 + 556. http://www.columbia.edu/kermit/ckermit70.html#x4.21
36304 + 557. http://www.columbia.edu/kermit/ckermit70.html#x6.5
36305 + 558. http://www.columbia.edu/kermit/ckermit70.html#x2.8
36306 + 559. http://www.columbia.edu/kermit/ckermit70.html#x7.7
36307 + 560. http://www.columbia.edu/kermit/ckermit70.html#x7.2
36308 + 561. http://www.columbia.edu/kermit/ckermit70.html#x1.19
36309 + 562. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36310 + 563. http://www.columbia.edu/kermit/ckermit70.html#x4.1
36311 + 564. http://www.columbia.edu/kermit/ckermit70.html#x4.2
36312 + 565. http://www.columbia.edu/kermit/ckermit70.html#x4.1
36313 + 566. http://www.columbia.edu/kermit/ckermit70.html#x4.2
36314 + 567. http://www.columbia.edu/kermit/ckermit70.html#x2.1.11
36315 + 568. http://www.columbia.edu/kermit/ckermit70.html#x2.10
36316 + 569. http://www.columbia.edu/kermit/ckermit70.html#ferrstring
36317 + 570. http://www.columbia.edu/kermit/ckermit70.html#x4.2.5
36318 + 571. http://www.columbia.edu/kermit/ckermit70.html#x2.1.10
36319 + 572. http://www.columbia.edu/kermit/ckermit70.html#x9.1
36320 + 573. http://www.columbia.edu/kermit/ckermit70.html#x7.23
36321 + 574. http://www.columbia.edu/kermit/ckermit70.html#x7.23
36322 + 575. http://www.columbia.edu/kermit/ckermit70.html#x1.22
36323 + 576. http://www.columbia.edu/kermit/ckermit70.html#x1.6
36324 + 577. http://www.columbia.edu/kermit/ckermit70.html#x7.23
36325 + 578. http://www.columbia.edu/kermit/ckermit70.html#x7.24
36326 + 579. http://www.columbia.edu/kermit/ckermit70.html#x7.24
36327 + 580. http://www.columbia.edu/kermit/ckermit70.html#x4.2.3
36328 + 581. http://www.columbia.edu/kermit/ck90.html
36329 + 582. http://www.columbia.edu/kermit/ckermit70.html#x7.12
36330 + 583. http://www.columbia.edu/kermit/ckermit70.html#x7.9
36331 + 584. http://www.columbia.edu/kermit/ckb2.htm
36332 + 585. http://www.columbia.edu/kermit/ckermit70.html#x4.11.3
36333 + 586. http://www.columbia.edu/kermit/ckermit70.html#x4.11.3
36334 + 587. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36335 + 588. http://www.columbia.edu/kermit/ckermit70.html#x7.10.7
36336 + 589. http://www.columbia.edu/kermit/ckermit70.html#x7.10.7
36337 + 590. http://www.columbia.edu/kermit/ckermit70.html#x4.2.8.4
36338 + 591. http://www.columbia.edu/kermit/ckermit70.html#x4.2.5
36339 + 592. http://www.columbia.edu/kermit/ckermit70.html#x7.8
36340 + 593. http://www.columbia.edu/kermit/ckermit70.html#x4.9.1
36341 + 594. http://www.columbia.edu/kermit/ckb2.htm
36342 + 595. http://www.columbia.edu/kermit/ckermit70.html#x7.19
36343 + 596. http://www.columbia.edu/kermit/ckermit70.html#x7.16
36344 + 597. http://www.columbia.edu/kermit/ckermit70.html#x7.9.1
36345 + 598. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36346 + 599. http://www.columbia.edu/kermit/ckermit70.html#x7.3
36347 + 600. http://www.columbia.edu/kermit/ckermit70.html#x4.11.3
36348 + 601. http://www.columbia.edu/kermit/ckermit70.html#x4.5.1
36349 + 602. http://www.columbia.edu/kermit/ckermit70.html#x7.10
36350 + 603. http://www.columbia.edu/kermit/ckermit70.html#x7.10.10
36351 + 604. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36352 + 605. http://www.columbia.edu/kermit/ckermit70.html#x7.23
36353 + 606. http://www.columbia.edu/kermit/ckermit70.html#x7.10.7
36354 + 607. http://www.columbia.edu/kermit/ckermit70.html#x7.10.7
36355 + 608. http://www.columbia.edu/kermit/ckermit70.html#x4.11.3
36356 + 609. http://www.columbia.edu/kermit/ckermit70.html#x7.10.11
36357 + 610. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36358 + 611. http://www.columbia.edu/kermit/ckermit70.html#x7.10.3
36359 + 612. http://www.columbia.edu/kermit/ckermit70.html#x7.3
36360 + 613. http://www.columbia.edu/kermit/ckermit70.html#x7.9.2
36361 + 614. http://www.columbia.edu/kermit/ckb2.htm
36362 + 615. http://www.columbia.edu/kermit/ckermit70.html#x4.17.2
36363 + 616. http://www.columbia.edu/kermit/ckermit70.html#x1.22
36364 + 617. http://www.columbia.edu/kermit/ckermit70.html#x4.7.1
36365 + 618. http://www.columbia.edu/kermit/ckermit70.html#x1.22
36366 + 619. http://www.columbia.edu/kermit/ckermit70.html#x4.3
36367 + 620. http://www.columbia.edu/kermit/ckermit70.html#x4.9
36368 + 621. http://www.columbia.edu/kermit/ckermit70.html#x1.22
36369 + 622. http://www.columbia.edu/kermit/ckermit70.html#x1.6
36370 + 623. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36371 + 624. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36372 + 625. http://www.columbia.edu/kermit/ckermit70.html#x7.19
36373 + 626. http://www.columbia.edu/kermit/ckermit70.html#x4.9.1
36374 + 627. http://www.columbia.edu/kermit/ckermit70.html#x9.3
36375 + 628. http://www.columbia.edu/kermit/ckermit70.html#x7.5
36376 + 629. http://www.columbia.edu/kermit/ckb2.htm
36377 + 630. http://www.columbia.edu/kermit/ckermit80.html
36378 + 631. http://www.columbia.edu/kermit/ckermit70.html#x7.4
36379 + 632. http://www.columbia.edu/kermit/ckermit70.html#x7.20.2
36380 + 633. http://www.columbia.edu/kermit/ckermit70.html#x7.10.5
36381 + 634. http://www.columbia.edu/kermit/ckermit70.html#x7.10.9
36382 + 635. http://www.columbia.edu/kermit/ckermit70.html#x1.10
36383 + 636. http://www.columbia.edu/kermit/ckermit70.html#x1.5
36384 + 637. http://www.columbia.edu/kermit/ckermit70.html#x4.7.1
36385 + 638. http://www.columbia.edu/kermit/iksd.html
36386 + 639. http://www.columbia.edu/kermit/ckermit70.html#x7.19
36387 + 640. http://www.columbia.edu/kermit/ckermit70.html#x4.10
36388 + 641. http://www.columbia.edu/kermit/ckermit70.html#x4.11
36389 + 642. http://www.columbia.edu/kermit/ckermit70.html#x4.3
36390 + 643. http://www.columbia.edu/kermit/gkermit.html
36391 + 644. http://www.columbia.edu/kermit/ckermit70.html#x4.20
36392 + 645. http://www.columbia.edu/kermit/gkermit.html
36393 + 646. http://www.columbia.edu/kermit/ckb2.htm
36394 + 647. http://www.columbia.edu/kermit/ckermit70.html#x7.3
36395 + 648. mailto:kermit@columbia.edu
36396 + 649. http://www.columbia.edu/kermit/ckermit70.html#top
36397 + 650. http://www.columbia.edu/kermit/ckermit.html
36398 + 651. http://www.columbia.edu/kermit/index.html
36399 --- /dev/null
36400 +++ ckermit-301/ckccfg.txt
36401 @@ -0,0 +1,1738 @@
36402 +
36403 +   [1]The Columbia Crown The Kermit Project | Columbia University
36404 +   612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
36405 +   ...since 1981
36406 +   [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
36407 +   [10]Support
36408 +
36409 +C-Kermit Configuration Options
36410 +
36411 +   As of: C-Kermit 9.0.300, 30 June 2011
36412 +   This page last updated: Tue Jun 28 08:48:49 2011 (New York USA Time)
36413 +
36414 +     IF YOU ARE READING A PLAIN-TEXT version of this document, note that
36415 +     this file is a plain-text dump of a Web page. You can visit the
36416 +     original (and possibly more up-to-date) Web page here:
36417 +
36418 +  [11]http://www.columbia.edu/kermit/ckccfg.html
36419 +
36420 +   [ [12]C-Kermit Home ] [ [13]Kermit Home ]
36421 +
36422 +  CONTENTS
36423 +
36424 +  1. [14]FILE TRANSFER
36425 +  2. [15]SERIAL COMMUNICATION SPEEDS
36426 +  3. [16]FULLSCREEN FILE TRANSFER DISPLAY
36427 +  4. [17]CHARACTER SETS
36428 +  5. [18]APC EXECUTION
36429 +  6. [19]PROGRAM SIZE
36430 +  7. [20]MODEM DIALING
36431 +  8. [21]NETWORK SUPPORT
36432 +  9. [22]EXCEPTION HANDLING
36433 + 10. [23]SECURITY FEATURES
36434 + 11. [24]ENABLING SELECT()
36435 + 12. [25]I/O REDIRECTION
36436 + 13. [26]FLOATING-POINT NUMBERS, TIMERS, AND ARITHMETIC
36437 + 14. [27]SPECIAL CONFIGURATIONS
36438 +  I. [28]SUMMARY OF COMPILE-TIME OPTIONS
36439 +
36440 +  OVERVIEW
36441 +
36442 +   This document describes configuration options for C-Kermit (5A and
36443 +   later). The major topics covered include program size (and how to
36444 +   reduce it), how to include or exclude particular features, notes on
36445 +   serial-port, modem, and network support, and a list of C-Kermit's
36446 +   compile-time options.
36447 +
36448 +   For details about your particular operating system, also see the
36449 +   system-specific installation instructions file, such as the
36450 +   [29]C-Kermit Installation Instructions for Unix.
36451 +
36452 +   [ [30]C-Kermit Home ] [ [31]Kermit Home ]
36453 +
36454 +  1. FILE TRANSFER
36455 +
36456 +   [ [32]Top ] [ [33]Contents ] [ [34]Next ] [ [35]Previous ]
36457 +
36458 +   Prior to version 7.0, C-Kermit was always built with the most
36459 +   conservative Kermit file-transfer protocol defaults on every platform:
36460 +   no control-character prefixing, 94-byte packets, and a window size of
36461 +   1.
36462 +
36463 +   Starting in version 7.0, fast settings are the default. To override
36464 +   these at compile time, include:
36465 +
36466 +  -DNOFAST
36467 +
36468 +   in the C compiler CFLAGS. Even with the fast defaults, C-Kermit
36469 +   automatically drops down to whatever window and packet sizes requested
36470 +   by the other Kermit, if these are smaller, when sending files (except
36471 +   for control-character unprefixing, which is not negotiated, and which
36472 +   is now set to CAUTIOUS rather than NONE at startup). C-Kermit's
36473 +   settings prevail when it is receiving.
36474 +
36475 +   [ [36]C-Kermit Home ] [ [37]Kermit Home ]
36476 +
36477 +  2. SERIAL COMMUNICATION SPEEDS
36478 +
36479 +   [ [38]Top ] [ [39]Contents ] [ [40]Next ] [ [41]Previous ]
36480 +
36481 +   As of 6 September 1997, a new simplified mechanism for obtaining the
36482 +   list of legal serial interface speeds is in place:
36483 +
36484 +     * If the symbol TTSPDLIST is defined, the system-dependent routine
36485 +       ttspdlist() is called at program initialization to obtain the list.
36486 +     * This symbol should be defined only for C-Kermit implementations
36487 +       that have implemented the ttspdlist() function, typically in the
36488 +       ck?tio.c module. See [42]ckutio.c for an example.
36489 +     * TTSPDLIST is automatically defined in [43]ckcdeb.h for UNIX. Add
36490 +       the appropriate #ifdefs for other platforms when the corresponding
36491 +       ttspdlist() functions are filled in.
36492 +     * If TTSPDLIST is (or normally would be) defined, the old code
36493 +       (described below) can still be selected by defining NOTTSPDLIST.
36494 +
36495 +   The ttspdlist() function can obtain the speeds in any way that works.
36496 +   For example, based simply on #ifdef Bnnnn..#endif (in UNIX). Although
36497 +   it might be better to actually check each speed against the currently
36498 +   selected hardware interface before allowing it in the array, there is
36499 +   usually no passive and/or reliable and safe way to do this, and so it's
36500 +   better to let some speeds into the array that might not work, than it
36501 +   is to erroneously exclude others. Speeds that don't work are caught
36502 +   when the SET SPEED command is actually given.
36503 +
36504 +   Note that this scheme does not necessarily rule out split speed
36505 +   operation, but effectively it does in C-Kermit as presently constituted
36506 +   since there are no commands to set input and output speed separately
36507 +   (except the special case "set speed 75/1200").
36508 +
36509 +   Note that some platforms, notably AIX 4.2 and 4.3, implement high
36510 +   serial speeds transparently to the application, e.g. by mapping 50 bps
36511 +   to 57600 bps, and so on.
36512 +
36513 +   That's the whole deal. When TTSPDLIST is not defined, the following
36514 +   applies:
36515 +
36516 +   Speeds are defined in two places: the SET SPEED keyword list in the
36517 +   command parser (as of this writing, in the [44]ckuus3.c source file),
36518 +   and in the system- dependent communications i/o module, ck?tio.c,
36519 +   functions ttsspd() (set speed) and ttgspd() (get speed). The following
36520 +   speeds are assumed to be available in all versions:
36521 +
36522 +  0, 110, 300, 600, 1200, 2400, 4800, 9600
36523 +
36524 +   If one or more of these speeds is not supported by your system, you'll
36525 +   need to change the source code (this has never happened so far). Other
36526 +   speeds that are not common to all systems have Kermit-specific symbols:
36527 +
36528 +               Symbol       Symbol
36529 +  Speed (bps)  to enable    to disable
36530 +       50       BPS_50       NOB_50
36531 +       75       BPS_75       NOB_75
36532 +       75/1200  BPS_7512     NOB_7512
36533 +      134.5     BPS_134      NOB_134
36534 +      150       BPS_150      NOB_150
36535 +      200       BPS_200      NOB_200
36536 +     1800       BPS_1800     NOB_1800
36537 +     3600       BPS_3600     NOB_3600
36538 +     7200       BPS_7200     NOB_7200
36539 +    14400       BPS_14K      NOB_14K
36540 +    19200       BPS_19K      NOB_19K
36541 +    28800       BPS_28K      NOB_28K
36542 +    38400       BPS_38K      NOB_38K
36543 +    57600       BPS_57K      NOB_57K
36544 +    76800       BPS_76K      NOB_76K
36545 +   115200       BPS_115K     NOB_155K
36546 +   230400       BPS_230K     NOB_230K
36547 +   460800       BPS_460K     NOB_460K
36548 +   921600       BPS_921K     NOB_921K
36549 +
36550 +   The [45]ckcdeb.h header file contains default speed configurations for
36551 +   the many systems that C-Kermit supports. You can override these
36552 +   defaults by (a) editing ckcdeb.h, or (b) defining the appropriate
36553 +   enabling and/or disabling symbols on the CC command line, for example:
36554 +
36555 +  -DBPS_14400 -DNOB_115200
36556 +
36557 +   or the "make" command line, e.g.:
36558 +
36559 +  make blah "KFLAGS=-DBPS_14400 -DNOB_115200"
36560 +
36561 +   Note: some speeds have no symbols defined for them, because they have
36562 +   never been needed: 12.5bps, 45.5bps, 20000bps, etc. These can easily be
36563 +   added if required (but they will work only if the OS supports them).
36564 +
36565 +   IMPORTANT: Adding one of these flags at compile time does not
36566 +   necessarily mean that you will be able to use that speed. A particular
36567 +   speed is usable only if your underlying operating system supports it.
36568 +   In particular, it needs to be defined in the appropriate system header
36569 +   file (e.g. in UNIX, cd to /usr/include and grep for B9600 in *.h and
36570 +   sys/*.h to find the header file that contains the definitions for the
36571 +   supported speeds), and supported by the serial device driver, and of
36572 +   course by the physical device itself.
36573 +
36574 +   ALSO IMPORTANT: The list of available speeds is independent of how they
36575 +   are set. The many UNIXes, for example, offer a wide variety of APIs
36576 +   that are BSD-based, SYSV-based, POSIX-based, and purely made up. See
36577 +   the ttsspd(), ttgspd(), and ttspdlist() routines in [46]ckutio.c for
36578 +   illustrations.
36579 +
36580 +   The latest entries in this horserace are the tcgetspeed() and
36581 +   ttsetspeed() routines found in UnixWare 7. Unlike other methods, they
36582 +   accept the entire range of integers (longs really) as speed values,
36583 +   rather than certain codes, and return an error if the number is not, in
36584 +   fact, a legal speed for the device/driver in question. In this case,
36585 +   there is no way to build a list of legal speeds at compile time, since
36586 +   no Bnnnn symbols are defined (except for "depracated, legacy"
36587 +   interfaces like ioctl()) and so the legal speed list must be enumerated
36588 +   in the code -- see ttspdlist() in [47]ckutio.c.
36589 +
36590 +   [ [48]C-Kermit Home ] [ [49]Kermit Home ]
36591 +
36592 +  3. FULLSCREEN FILE TRANSFER DISPLAY
36593 +
36594 +   [ [50]Top ] [ [51]Contents ] [ [52]Next ] [ [53]Previous ]
36595 +
36596 +   New to edit 180 is support for an MS-DOS-Kermit-like local-mode full
36597 +   screen file transfer display, accomplished using the curses library, or
36598 +   something equivalent (for example, the Screen Manager on DEC VMS). To
36599 +   enable this feature, include the following in your CFLAGS:
36600 +
36601 +  -DCK_CURSES
36602 +
36603 +   and then change your build procedure (if necessary) to include the
36604 +   necessary libraries. For example, in Unix these are usually "curses" or
36605 +   "ncurses" (and more recenlty, "ncursesw" and "slang"), perhaps also
36606 +   "termcap", "termlib", or "tinfo":
36607 +
36608 +  "LIBS= -lcurses -ltermcap"
36609 +  "LIBS= -lcurses -ltermlib"
36610 +  "LIBS= -lncurses"
36611 +  "LIBS= -ltermlib"
36612 +  "LIBS= -ltinfo"
36613 +
36614 +   "man curses" for further information, and search through the Unix
36615 +   [54]makefile for "CK_CURSES" to see many examples, and also see the
36616 +   relevant sections of the [55]Unix C-Kermit Installation Instructions,
36617 +   particularly Sections [56]4 and [57]9.2.
36618 +
36619 +   There might still be a complication. Some implementations of curses
36620 +   reserve the right to alter the buffering on the output file without
36621 +   restoring it afterwards, which can leave Kermit's command processing in
36622 +   a mess when the prompt comes back after a fullscreen file transfer
36623 +   display. The typical symptom is that characters you type at the prompt
36624 +   after a local-mode file transfer (i.e. after seeing the curses
36625 +   file-transfer display) do not echo until you press the Return (Enter)
36626 +   key. If this happens to you, try adding
36627 +
36628 +  -DCK_NEWTERM
36629 +
36630 +   to your makefile target (see comments in screenc() in [58]ckuusx.c for
36631 +   an explanation).
36632 +
36633 +   If that doesn't fix the problem, then use a bigger hammer and replace
36634 +   -DCK_NEWTERM with:
36635 +
36636 +  -DNONOSETBUF
36637 +
36638 +   which tells Kermit to force stdout to be unbuffered so CBREAK mode can
36639 +   work.
36640 +
36641 +   In SCO Xenix and SCO UNIX, there are two separate curses libraries, one
36642 +   based on termcap and the other based on terminfo. The default library,
36643 +   usually terminfo, is established when the development system is
36644 +   installed. To manually select terminfo (at compile time):
36645 +
36646 +  compile -DM_TERMINFO and link -ltinfo
36647 +
36648 +   and to manually select termcap:
36649 +
36650 +  compile -DM_TERMCAP and link -ltcap -ltermlib
36651 +
36652 +   <curses.h> looks at M_TERMINFO and M_TERMCAP to decide which header
36653 +   files to use. /usr/lib/libcurses.a is a link to either libtinfo.a or
36654 +   libtcap.a. The C-Kermit compilation options must agree with the version
36655 +   of the curses library that is actually installed.
36656 +
36657 +   NOTE: If you are doing an ANSI-C compilation and you get compile time
36658 +   warnings like the following:
36659 +
36660 +  Warning: function not declared in ckuusx.c: wmove, printw, wclrtoeol,
36661 +  wclear, wrefresh, endwin, etc...
36662 +
36663 +   it means that your <curses.h> file does not contain prototypes for
36664 +   these functions. The warnings should be harmless.
36665 +
36666 +   New to edit 190 is the ability to refresh a messed-up full-screen
36667 +   display, e.g. after receiving a broadcast message. This depends on the
36668 +   curses package including the wrefresh() and clearok() functions and the
36669 +   curscr variable. If your version has these, or has code to simulate
36670 +   them, then add:
36671 +
36672 +  -DCK_WREFRESH
36673 +
36674 +   The curses and termcap libraries add considerable size to the program
36675 +   image (e.g. about 20K on a SUN-4, 40K on a 386). On some small systems,
36676 +   such as the AT&T 6300 PLUS, curses can push Kermit over the edge...
36677 +   even though it compiles, loads, and runs correctly, its increased size
36678 +   apparently makes it swap constantly, slowing it down to a crawl, even
36679 +   when the curses display is not in use. Some new makefile targets have
36680 +   been added to take care of this (e.g. sys3upcshcc), but similar tricks
36681 +   might be necessary in other cases too.
36682 +
36683 +   On the curses file-transfer display, just below the "thermometer", is a
36684 +   running display of the transfer rate, as a flat quotient of file
36685 +   characters per elapsed seconds so far. You can change this to an
36686 +   average that gives greater weight to recent history (0.25 *
36687 +   instantaneous cps + 0.75 * historical cps) by adding -DCPS_WEIGHTED to
36688 +   your CFLAGS (sorry folks, this one is not worth a SET command). You can
36689 +   choose a second type of weighted average in which the weighting smooths
36690 +   out progressively as the transfer progresses by adding -DCPS_VINCE to
36691 +   -DCPS_WEIGHTED.
36692 +
36693 +   An alternative to curses is also available at compile time, but should
36694 +   be selected if your version of Kermit is to be run in local mode only
36695 +   in an ANSI terminal environment, for example on a desktop workstation
36696 +   that has an ANSI console driver. To select this option in place of
36697 +   curses, define the symbol MYCURSES:
36698 +
36699 +  -DMYCURSES
36700 +
36701 +   instead of CK_CURSES. The MYCURSES option uses built-in ANSI (VT100)
36702 +   escape sequences, and depends upon your terminal or console driver to
36703 +   interpret them correctly.
36704 +
36705 +   In some C-Kermit builds, we replace printf() via #define printf...
36706 +   However, this can cause conflicts with the [n]curses header files.
36707 +   Various hacks are required to get around this -- see [59]ckutio.c,
36708 +   [60]ckufio.c, [61]ckuusx.c, [62]ckucmd.c, etc.
36709 +
36710 +   [ [63]C-Kermit Home ] [ [64]Kermit Home ]
36711 +
36712 +  4. CHARACTER SETS
36713 +
36714 +   [ [65]Top ] [ [66]Contents ] [ [67]Next ] [ [68]Previous ]
36715 +
36716 +   Since version 5A, C-Kermit has included support for conversion of
36717 +   character sets for Western European languages (i.e. languages that
36718 +   originated in Western Europe, but are now also spoken in the Western
36719 +   Hemisphere and other parts of the world), via ISO 8859-1 Latin Alphabet
36720 +   1, for Eastern European languages (ISO Latin-2), Hebrew (and Yiddish),
36721 +   Greek, and Cyrillic-alphabet languages (ISO Latin/Cyrillic). Many file
36722 +   (local) character sets are supported: ISO 646 7-bit national sets, IBM
36723 +   code pages, Apple, DEC, DG, NeXT, etc.
36724 +
36725 +   To build Kermit with no character-set translation at all, include
36726 +   -DNOCSETS in the CFLAGS. To build with no Latin-2, add -DNOLATIN2. To
36727 +   build with no Cyrillic, add -DNOCYRIL. To omit Hebrew, add -DNOHEBREW.
36728 +   If -DNOCSETS is *not* included, you'll always get LATIN1. To build with
36729 +   no KANJI include -DNOKANJI. There is presently no way to include
36730 +   Latin-2, Cyrillic, Hebrew, or Kanji without also including Latin-1.
36731 +
36732 +   [69]Unicode support was added in C-Kermit 7.0, and it adds a fair
36733 +   amount of tables and code (and this is only a "Level 1" implementation
36734 +   -- a higher level would also require building in the entire Unicode
36735 +   database). On a PC with RH 5.2 Linux, building C-Kermit 7.0, we get the
36736 +   following sizes:
36737 +
36738 +  NOCSETS NOUNICODE NOKANJI   Before    After
36739 +   [   ]    [   ]    [   ]    1329014   (Full)
36740 +   [   ]    [   ]    [ X ]    1325686   (Unicode but no Kanji)
36741 +   [   ]    [ X ]    [   ]    1158837   (All charsets except Unicode)
36742 +   [ X ]    [ x ]    [ x ]    1090845   (NOCSETS implies the other two)
36743 +
36744 +   Note, by the way, that NOKANJI without NOUNICODE only removes the
36745 +   non-Unicode Kanji sets (Shift-JIS, EUC-JP, JIS-7, etc). Kanji is still
36746 +   representable in UCS-2 and UTF-8.
36747 +
36748 +   [ [70]C-Kermit Home ] [ [71]Kermit Home ]
36749 +
36750 +  5. APC EXECUTION
36751 +
36752 +   [ [72]Top ] [ [73]Contents ] [ [74]Next ] [ [75]Previous ]
36753 +
36754 +   The Kermit CONNECT and INPUT commands are coded to execute Application
36755 +   Program Command escape sequences from the host:
36756 +
36757 +  <ESC>_<text><ESC>\
36758 +
36759 +   where <text> is a C-Kermit command, or a list of C-Kermit commands
36760 +   separated by commas, up to about 1K in length.
36761 +
36762 +   To date, this feature has been included in the OS/2, Windows, VMS,
36763 +   OS-9, and Unix versions, for which the symbol:
36764 +
36765 +  CK_APC
36766 +
36767 +   is defined automatically in [76]ckuusr.h. For OS/2, APC is enabled at
36768 +   runtime by default, for UNIX it is disabled. It is controlled by the
36769 +   SET TERMINAL APC command. Configuring APC capability into a version
36770 +   that gets it by default (because CK_APC is defined in [77]ckuusr.h) can
36771 +   be overridden by including:
36772 +
36773 +  -DNOAPC
36774 +
36775 +   on the CC command line.
36776 +
36777 +   C-Kermit's autodownload feature depends on the APC feature, so
36778 +   deconfiguring APC also disables autodownload (it doesn't use APC escape
36779 +   sequences, but uses the APC switching mechanism internally).
36780 +
36781 +   [ [78]C-Kermit Home ] [ [79]Kermit Home ]
36782 +
36783 +  6. PROGRAM SIZE
36784 +
36785 +   [ [80]Top ] [ [81]Contents ] [ [82]Next ] [ [83]Previous ]
36786 +
36787 +   SECTION CONTENTS
36788 +
36789 +  6.1. [84]Feature Selection
36790 +  6.2. [85]Changing Buffer Sizes
36791 +  6.3. [86]Other Size-Related Items
36792 +  6.4. [87]Space/Time Tradeoffs
36793 +
36794 +   (Also see [88]Section 4)
36795 +
36796 +   Each release of C-Kermit is larger than the last. On some computers
36797 +   (usually old ones) the size of the program prevents it from being
36798 +   successfully linked and loaded. On some others (also usually old ones),
36799 +   it occupies so much memory that it is constantly swapping or paging. In
36800 +   such cases, you can reduce C-Kermit's size in various ways, outlined in
36801 +   this section. The following options can cut down on the program's size
36802 +   at compile time by removing features or changing the size of storage
36803 +   areas.
36804 +
36805 +   If you are reading this section because all you want is a small, fast,
36806 +   quick-to-load Kermit file-transfer application for the remote end of
36807 +   your connection, and the remote end is Unix based, take a look at
36808 +   G-Kermit:
36809 +
36810 +  [89]http://www.columbia.edu/kermit/gkermit.html
36811 +
36812 +  6.1. Feature Selection
36813 +
36814 +   Features can be added or removed by defining symbols on the CC (C
36815 +   compiler) command line. "-D" is the normal CC directive to define a
36816 +   symbol so, for example, "-DNODEBUG" defines the symbol NODEBUG. Some C
36817 +   compilers might use different syntax, e.g. "-d NODEBUG" or
36818 +   "/DEFINE=NODEBUG". For C compilers that do not accept command-line
36819 +   definitions, you can put the corresponding #define statements in the
36820 +   file ckcsym.h, for example:
36821 +
36822 +  #define NODEBUG
36823 +
36824 +   The following table shows the savings achieved when building C-Kermit
36825 +   8.0 (Beta.04) with selected feature-deselection switches on an
36826 +   Intel-based PC with Red Hat Linux 7.0 and gcc 2.96. The sizes are for
36827 +   non-security builds. The fully configured non-security build is 2127408
36828 +   bytes.
36829 +
36830 +   Option      Size    Savings Effect
36831 +   NOICP        545330   74.4% No Interactive Command Parser (command-line only)
36832 +   NOLOCAL     1539994   27.6% No making connections.
36833 +   NOXFER      1551108   27.1% No file transfer.
36834 +   IKSDONLY    1566608   26.4% Internet Kermit Server only.
36835 +   NOCSETS     1750097   17.7% No character-set conversion.
36836 +   NOSPL       1800293   15.4% No Script Programming Language.
36837 +   NONET       1808575   15.0% No making network connections.
36838 +   NOUNICODE   1834426   13.8% No Unicode character-set conversion.
36839 +   NOHELP      1837877   13.6% No built-in help text.
36840 +   NODEBUG     1891669   11.1% No debug log.
36841 +   NOFRILLS    1918966    9.8% No "frills".
36842 +   NOFTP       1972496    7.3% No FTP client.
36843 +   NODIAL      1984488    6.7% No automatic modem dialing.
36844 +   NOPUSH      2070184    2.7% No shell access, running external programs, etc.
36845 +   NOIKSD      2074129    2.5% No Internet Kermit Server capability.
36846 +   NOHTTP      2082610    2.1% No HTTP client.
36847 +   NOFLOAT     2091332    1.7% No floating-point arithmetic.
36848 +   NOCHANNELIO 2095978    1.5% No FOPEN/FREAD/FWRITE/FCLOSE, etc.
36849 +   MINIDIAL    2098035    1.4% No built-in support for many kinds of modems.
36850 +   NOSERVER    2098987    1.3% No server mode.
36851 +   NOSEXP      2105898    1.0% No S-Expressions.
36852 +   NOPTY       2117743    0.5% No pseudoterminal support.
36853 +   NORLOGIN    2121089    0.3% No RLOGIN connections.
36854 +   NOOLDMODEMS 2124038    0.2% No built-in support for old kinds of modems.
36855 +   NOSSH       2125696    0.1% No SSH command.
36856 +
36857 +   And here are a few combinations
36858 +
36859 +   Options Size Savings Effect
36860 +   NODEBUG NOICP NOCSETS NOLOCAL 281641 86.7% No debug log, parser,
36861 +   character sets, or making connections.
36862 +   NOICP NOCSETS NOLOCAL 376468 82.3% No parser, character sets, or making
36863 +   connections.
36864 +   NOICP NOCSETS NONET 427510 79.9% No parser, character sets, or network
36865 +   connections.
36866 +   NOSPL NOCSETS 1423784 33.1% No script language, or character sets.
36867 +
36868 +   -DNOFRILLS removes various command synonyms; the following top-level
36869 +   commands: CLEAR, DELETE, DISABLE, ENABLE, GETOK, MAIL, RENAME, TYPE,
36870 +   WHO; and the following REMOTE commands: KERMIT, LOGIN, LOGOUT, PRINT,
36871 +   TYPE, WHO.
36872 +
36873 +  6.2. Changing Buffer Sizes
36874 +
36875 +   Most modern computers have so much memory that (a) there is no need to
36876 +   scrimp and save, and (b) C-Kermit, even when fully configured, is
36877 +   relatively small by today's standards.
36878 +
36879 +   Two major factors affect Kermit's size: feature selection and buffer
36880 +   sizes. Buffer sizes affect such things as the maximum length for a
36881 +   Kermit packet, the maximum length for a command, for a macro, for the
36882 +   name of a macro, etc. Big buffer sizes are used when the following
36883 +   symbol is defined:
36884 +
36885 +  BIGBUFOK
36886 +
36887 +   as it is by default for most modern platforms (Linux, AIX 4 and 5,
36888 +   HP-UX 10 and 11, Solaris, etc) in [90]ckuusr.h. If your build does not
36889 +   get big buffers automatically (SHOW FEATURES tells you), you can
36890 +   include them by rebuilding with BIGBUFOK defined; e.g. in Unix:
36891 +
36892 +  make xxxx KFLAGS=-DBIGBUFOK
36893 +
36894 +   where xxxx is the makefile target. On the other hand, if you want to
36895 +   build without big buffers when they normally would be selected, use:
36896 +
36897 +  make xxxx KFLAGS=-DNOBIGBUF
36898 +
36899 +   There are options to control Kermit's packet buffer allocations. The
36900 +   following symbols are defined in [91]ckcker.h in such a way that you
36901 +   can override them by redefining them in CFLAGS:
36902 +
36903 +  -DMAXSP=xxxx - Maximum send-packet length.
36904 +  -DMAXRP=xxxx - Maximum receive-packet length.
36905 +  -DSBSIZ=xxxx - Total allocation for send-packet buffers.
36906 +  -DRBSIZ=xxxx - Total allocation for receive-packet buffers.
36907 +
36908 +   The defaults depend on the platform.
36909 +
36910 +   Using dynamic allocation (-DDYNAMIC) reduces storage requirements for
36911 +   the executable program on disk, and allows more and bigger packets at
36912 +   runtime. This has proven safe over the years, and now most builds (e.g.
36913 +   all Unix, VMS, Windows, and OS/2 ones) use dynamic memory allocation by
36914 +   default. If it causes trouble, however, then omit the -DDYNAMIC option
36915 +   from CFLAGS, or add -DNODYNAMIC.
36916 +
36917 +  6.3. Other Size-Related Items
36918 +
36919 +   To make Kermit compile and load successfully, you might have to change
36920 +   your build procedure to:
36921 +
36922 +    a. Request a larger ("large" or "huge") compilation / code-generation
36923 +       model. This is needed for 16-bit PC-based UNIX versions (most or
36924 +       all of which fail to build C-Kermit 7.0 and later anyway). This is
36925 +       typically done with a -M and/or -F switch (see your cc manual or
36926 +       man page for details).
36927 +    b. Some development systems support overlays. If the program is too
36928 +       big to be built as is, check your loader manual ("man ld") to see
36929 +       if an overlay feature is available. See the 2.10/2.11 BSD example
36930 +       in the UNIX makefile. (Actually, as of version 7.0, C-Kermit is too
36931 +       big to build, period, even with overlays, on 2.xx BSD).
36932 +    c. Similarly, some small and/or segment-based architectures support
36933 +       "code mapping", which is similar to overlays (PDP11-based VENIX
36934 +       1.0, circa 1984, was an example). See the linker documentation on
36935 +       the affected platform.
36936 +
36937 +   It is also possible to reduce the size of the executable program file
36938 +   in several other ways:
36939 +
36940 +    a. Include the -O (optimize) compiler switch if it isn't already
36941 +       included in your "make" entry (and if it works!). If your compiler
36942 +       supports higher levels of optimization (e.g. -O2 or higher number,
36943 +       -Onolimit (HP-UX), etc), try them; the greater the level of
36944 +       optimization, the longer the compilation and more likely the
36945 +       compiler will run out of memory. The the latter eventuality, some
36946 +       compilers also provide command-line options to allocate more memory
36947 +       for the optimizer, like "-Olimit number" in Ultrix.
36948 +    b. If your platofrm supports shared libraries, change the make entry
36949 +       to take advantage of this feature. The way to do this is, of
36950 +       course, platform dependent; see the NeXT makefile target for an
36951 +       example. some platforms (like Solaris) do it automatically and give
36952 +       you no choice. But watch out: executables linked with shared
36953 +       libraries are less portable than statically linked executables.
36954 +    c. Strip the program image after building ("man strip" for further
36955 +       info), or add -s to the LNKFLAGS (UNIX only). This strips the
36956 +       program of its symbol table and relocation information.
36957 +    d. Move character strings into a separate file. See the 2.11 BSD
36958 +       target for an example.
36959 +
36960 +  6.4. Space/Time Tradeoffs
36961 +
36962 +   There are more than 6000 debug() statements in the program. If you want
36963 +   to save both space (program size) and time (program execution time),
36964 +   include -DNODEBUG in the compilation. If you want to include debugging
36965 +   for tracking down problems, omit -DNODEBUG from the make entry. But
36966 +   when you include debugging, you have two choices for how it's done. One
36967 +   definition defines debug() to be a function call; this is cheap in
36968 +   space but expensive in execution. The other defines debug as "if
36969 +   (deblog)" and then the function call, to omit the function call
36970 +   overhead when the debug log is not active. But this adds a lot of space
36971 +   to the program. Both methods work, take your choice; IFDEBUG is
36972 +   preferred if memory is not a constraint but the computer is likely to
36973 +   be slow. The first method is the default, i.e. if nothing is done to
36974 +   the CFLAGS or in [92]ckcdeb.h (but in some cases, e.g. VMS, it is). To
36975 +   select the second method, include -DIFDEBUG in the compilation (and
36976 +   don't include -DNODEBUG).
36977 +
36978 +   [ [93]C-Kermit Home ] [ [94]Kermit Home ]
36979 +
36980 +  7. MODEM DIALING
36981 +
36982 +   [ [95]Top ] [ [96]Contents ] [ [97]Next ] [ [98]Previous ]
36983 +
36984 +   -DNODIAL removes automatic modem dialing completely, including the
36985 +   entire [99]ckudia.c module, plus all commands that refer to dialing in
36986 +   the various ckuus*.c modules.
36987 +
36988 +   -DMINIDIAL leaves the DIAL and related commands (SET/SHOW MODEM,
36989 +   SET/SHOW DIAL) intact, but removes support for all types of modems
36990 +   except CCITT, Hayes, Unknown, User-defined, Generic-high-speed, and
36991 +   None (= Direct). The MINIDIAL option cuts the size of the dial module
36992 +   approximately in half. Use this option if you have only Hayes or CCITT
36993 +   modems and don't want to carry the baggage for the other types.
36994 +
36995 +   A compromise between full dialer support and MINIDIAL is obtained by
36996 +   removing support for "old" modems -- all the strange non-Hayes
36997 +   compatible 1200 and 2400 bps modems that C-Kermit has been carrying
36998 +   around since 1985 or so. To remove support for these modems, add
36999 +   -DNOOLDMODEMS to CFLAGS at compilation time.
37000 +
37001 +   Finally, if you keep support for old modems, you will notice that their
37002 +   names appear on the "set modem ?" menu. That's because their names are,
37003 +   by default, "visible". But the list is confusing to the younger
37004 +   generation, who have only heard of modems from the V.32bis-and-later
37005 +   era. If you want to be able to use old modems, but don't want their
37006 +   names cluttering up menus, add this to CFLAGS:
37007 +
37008 +  -DM_OLD=1
37009 +
37010 +   [ [100]C-Kermit Home ] [ [101]Kermit Home ]
37011 +
37012 +  8. NETWORK SUPPORT
37013 +
37014 +   [ [102]Top ] [ [103]Contents ] [ [104]Next ] [ [105]Previous ]
37015 +
37016 +   SECTION CONTENTS
37017 +
37018 +  8.1. [106]TCP/IP
37019 +  8.2. [107]X.25
37020 +  8.3. [108]Other Networks
37021 +
37022 +   C-Kermit supports not only serial-port and modem connections, but also
37023 +   TCP/IP and X.25 network connections. Some versions support other
37024 +   network types too like DECnet, LAT, NETBIOS, etc. If you define the
37025 +   following symbol:
37026 +
37027 +  NONET
37028 +
37029 +   then all network support is compiled away.
37030 +
37031 +  8.1. TCP/IP
37032 +
37033 +   SUBSECTION CONTENTS
37034 +
37035 +  8.1.1. [109]Firewalls
37036 +  8.1.2. [110]Compilation and Linking Problems
37037 +  8.1.3. [111]Enabling Host Address Lists
37038 +  8.1.4. [112]Enabling Telnet NAWS
37039 +  8.1.5. [113]Enabling Incoming TCP/IP Connections
37040 +  8.1.6. [114]Disabling SET TCP Options
37041 +
37042 +   C-Kermit's TCP/IP features require the Berkeley sockets library or
37043 +   equivalent, generally available on any Unix system, as well as in
37044 +   Windows 9x/NT, OS/2, VMS, AOS/VS, VOS, etc. The TCP/IP support includes
37045 +   built-in TELNET, FTP, and HTTP protocol. To select TCP/IP support,
37046 +   include -DTCPSOCKET in your makefile target's CFLAGS, or (in VMS) the
37047 +   appropriate variant (e.g. -DWOLLONGONG, -DMULTINET, -DEXCELAN,
37048 +   -DWINTCP, etc).
37049 +
37050 +   The VMS and/or early Unix third-party TCP/IP products are often
37051 +   incompatible with each other, and sometimes with different versions of
37052 +   themselves. For example, Wollongong reportedly put header files in
37053 +   different directories for different UNIX versions:
37054 +
37055 +     * in.h can be in either /usr/include/sys or /user/include/netinet.
37056 +     * telnet.h can be in either /usr/include/arpa or
37057 +       /user/include/netinet.
37058 +     * inet.h can be in either /usr/include/arpa or /user/include/sys.
37059 +
37060 +   In cases like this, use the -I cc command-line option when possible;
37061 +   otherwise it's better to make links in the file system than it is to
37062 +   hack up the C-Kermit source code. Suppose, for example, Kermit is
37063 +   looking for telnet.h in /usr/include/arpa, but on your computer it is
37064 +   in /usr/include/netinet. Do this (as root, or get the system
37065 +   administrator to do it):
37066 +
37067 +  cd /usr/include/arpa
37068 +  ln /usr/include/netinet/telnet.h telnet.h
37069 +
37070 +   ("man ln" for details about links.)
37071 +
37072 +   The network support for TCP/IP and X.25 is in the source files
37073 +   [115]ckcnet.h, [116]ckctel.c, [117]ckctel.c, [118]ckctel.h,
37074 +   [119]ckcftp.c, with miscellaneous SHOW commands, etc, in the various
37075 +   ckuus*.c modules, plus code in the ck*con.c or ckucns.c (CONNECT
37076 +   command) and several other modules to detect TELNET negotiations, etc.
37077 +
37078 +   Within the TCPSOCKET code, some socket-level controls are included if
37079 +   TCPSOCKET is defined in the C-Kermit CFLAGS and SOL_SOCKET is defined
37080 +   in in the system's TCP-related header files, such as <sys/socket.h>.
37081 +   These are:
37082 +
37083 +  SET TCP KEEPALIVE
37084 +  SET TCP LINGER
37085 +  SET TCP RECVBUF
37086 +  SET TCP SENDBUF
37087 +
37088 +   In addition, if TCP_NODELAY is defined, the following command is also
37089 +   enabled:
37090 +
37091 +  SET TCP NODELAY (Nagle algorithm)
37092 +
37093 +   See the [120]C-Kermit user documentation for descriptions of these
37094 +   commands.
37095 +
37096 +  8.1.1. Firewalls
37097 +
37098 +   There exist various types of firewalls, set up to separate users of an
37099 +   internal TCP/IP network ("Intranet") from the great wide Internet, but
37100 +   then to let selected users or services get through after all.
37101 +
37102 +   One firewall method is called SOCKS, in which a proxy server allows
37103 +   users inside a firewall to access the outside world, based on a
37104 +   permission list generally stored in a file. SOCKS is enabled in one of
37105 +   two ways. First, the standard sockets library is modified to handle the
37106 +   firewall, and then all the client applications are relinked (if
37107 +   necessary, i.e. if the libraries are not dynamically loaded) with the
37108 +   modified sockets library. The APIs are all the same, so the
37109 +   applications do not need to be recoded or recompiled.
37110 +
37111 +   In the other method, the applications must be modified to call
37112 +   replacement routines, such as Raccept() instead of accept(), Rbind()
37113 +   instead of bind(), etc, and then linked with a separate SOCKS library.
37114 +   This second method is accomplished (for SOCKS4) in C-Kermit by
37115 +   including -DCK_SOCKS in your CFLAGS, and also adding:
37116 +
37117 +  -lsocks
37118 +
37119 +   to LIBS, or replacing -lsockets with -lsocks (depending on whether the
37120 +   socks library also includes all the sockets entry points).
37121 +
37122 +   For SOCKS5, use -DCK_SOCKS5.
37123 +
37124 +   Explicit firewall support can, in general, not be a standard feature or
37125 +   a feature that is selected at runtime, because the SOCKS library tends
37126 +   to be different at each site -- local modifications abound.
37127 +
37128 +   The ideal situation occurs when firewalls are supported by the first
37129 +   method, using dynamically linked sockets-replacement libraries; in this
37130 +   case, all your TCP/IP client applications negotiate the firewall
37131 +   transparently.
37132 +
37133 +  8.1.2. Compilation and Linking Problems
37134 +
37135 +   If you get a compilation error in [121]ckcnet.c, with a complaint like
37136 +   "incompatible types in assignment", it probably has something to do
37137 +   with the data type your system uses for the inet_addr() function, which
37138 +   is declared (usually) in <arpa/inet.h>. Kermit uses "unsigned long"
37139 +   unless the symbol INADDRX is defined, in which case "struct inaddr" is
37140 +   used instead. Try adding -DINADDRX to CFLAGS in your make entry, and if
37141 +   that fixes the problem, please send a report to kermit@columbia.edu.
37142 +
37143 +   Compilation errors might also have to do with the data type used for
37144 +   getsockopt() and setsockopt() option-length field. This is normally an
37145 +   int, but sometimes it's a short, a long, or an unsigned any of those,
37146 +   or a size_t. To fix the compilation problem, add -DSOCKOPT_T=xxx to the
37147 +   CFLAGS in your makefile target, where xxx is the appropriate type (use
37148 +   "man getsockopt" or grep through your system/network header files to
37149 +   find the needed type).
37150 +
37151 +  8.1.3. Enabling Host Address Lists
37152 +
37153 +   When you give Kermit an IP host name, it calls the socket routine
37154 +   gethostbyname() to resolve it. gethostbyname() returns a hostent
37155 +   struct, which might or might not not include a list of addresses; if it
37156 +   does, then if the first one fails, Kermit can try the second one, and
37157 +   so on. However, this will only work if the symbol "h_addr" is a macro
37158 +   defined as "h_addr_list[0]", usually in netdb.h. If it is, then you can
37159 +   activate this feature by defining the following symbol in CFLAGS:
37160 +
37161 +  HADDRLIST
37162 +
37163 +  8.1.4. Enabling Telnet NAWS
37164 +
37165 +   The Telnet Negotiation About Window Size (NAWS) option requires the
37166 +   ability to find out the terminal screen's dimensions. E.g. in Unix, we
37167 +   need something like ioctl(0, TIOCGWINSZ, ...). If your version of
37168 +   Kermit was built with NAWS capability, SHOW VERSIONS includes CK_NAWS
37169 +   among the compiler options. If it doesn't, you can add it by defining
37170 +   CK_NAWS at compile time. Then, if the compiler or linker complain about
37171 +   undefined or missing symbols, or there is no complaint but SHOW
37172 +   TERMINAL fails to show reasonable "Rows =, Columns =" values, then take
37173 +   a look at (or write) the appropriate ttgwsiz() routine. On the other
37174 +   hand, if CK_NAWS is defined by default for your system (in
37175 +   [122]ckcnet.h), but causes trouble, you can override this definition by
37176 +   including the -DNONAWS switch on your CC command line, thus disabling
37177 +   the NAWS feature.
37178 +
37179 +   This appears to be needed at least on the AT&T 3B2, where in
37180 +   [123]ckutio.c, the routine ttgwsiz() finds that the TIOCGWINSZ symbol
37181 +   is defined but lacks definitions for the corresponding winsize struct
37182 +   and its members ws_col and ws_row.
37183 +
37184 +   The UNIX version of C-Kermit also traps SIGWINCH, so it can send a NAWS
37185 +   to the Telnet server any time the local console terminal window size
37186 +   changes, e.g. when you stretch it with a mouse. The SIGWINCH-trapping
37187 +   code is enabled if SIGWINCH is defined (i.e. in signal.h). If this code
37188 +   should cause problems, you can disable it without disabling the NAWS
37189 +   feature altogether, by defining NOSIGWINCH at compile time.
37190 +
37191 +  8.1.5. Enabling Incoming TCP/IP Connections
37192 +
37193 +   This feature lets you "set host * port" and wait for an incoming
37194 +   connection on the given port. This feature is enabled automatically at
37195 +   compile if TCPSOCKET is defined and SELECT is also defined. But watch
37196 +   out, simply defining SELECT on the cc command line does not guarantee
37197 +   successful compilation or linking (see [124]Section 11).
37198 +
37199 +   If you want to disable incoming TCP/IP connections, then build C-Kermit
37200 +   with:
37201 +
37202 +  -DNOLISTEN
37203 +
37204 +  8.1.6. Disabling SET TCP Options
37205 +
37206 +   The main reason for this is because of header file / prototype
37207 +   conflicts at compile time regardting get- / setsockopt(). If you can't
37208 +   fix them (without breaking other builds), add the following in CFLAGS:
37209 +
37210 +  -DNOTCPOPTS
37211 +
37212 +  8.2. X.25
37213 +
37214 +   X.25 support requires (a) a Sun, (b) the SunLink product (libraries and
37215 +   header files), and (c) an X.25 connection into your Sun. Similarly (in
37216 +   C-Kermit 7.0 or later) Stratus VOS and IBM AIX.
37217 +
37218 +   In UNIX, special makefile targets sunos4x25 and sunos41x25 (for SUNOS
37219 +   4.0 and 4.1, respectively), or aix41x25, are provided to build in this
37220 +   feature, but they only work if conditions (a)-(c) are met. To request
37221 +   this feature, include -DSUNX25 (or -DIBMX25) in CFLAGS.
37222 +
37223 +   SUNX25 (or -DIBMX25) and TCPSOCKET can be freely mixed and matched, and
37224 +   selected by the user at runtime with the SET NETWORK TYPE command or
37225 +   SET HOST switches.
37226 +
37227 +  8.3. Other Networks
37228 +
37229 +   Support for other networking methods -- NETBIOS, LAT, Named Pipes, etc
37230 +   -- is included in ck*net.h and ck*net.c for implementations (such as
37231 +   Windows or OS/2) where these methods are supported.
37232 +
37233 +   Provision is made in the organization of the modules, header files,
37234 +   commands, etc, for addition of new network types such as DECnet, X.25
37235 +   for other systems (HP-UX, VMS, etc), and so on. Send email to
37236 +   [125]kermit@columbia.edu if you are willing and able to work on such a
37237 +   project.
37238 +
37239 +   [ [126]C-Kermit Home ] [ [127]Kermit Home ]
37240 +
37241 +  9. EXCEPTION HANDLING
37242 +
37243 +   [ [128]Top ] [ [129]Contents ] [ [130]Next ] [ [131]Previous ]
37244 +
37245 +   The C language setjmp/longjmp mechanism is used for handling
37246 +   exceptions. The jump buffer is of type jmp_buf, which almost everywhere
37247 +   is typedef'd as an array, in which case you should have no trouble
37248 +   compiling the exception-handling code. However, if you are building
37249 +   C-Kermit in/for an environment where jmp_buf is something other than an
37250 +   array (e.g. a struct), then you'll have to define the following symbol:
37251 +
37252 +  JBNOTARRAY
37253 +
37254 +   [ [132]C-Kermit Home ] [ [133]Kermit Home ]
37255 +
37256 +  10. SECURITY FEATURES
37257 +
37258 +   [ [134]Top ] [ [135]Contents ] [ [136]Next ] [ [137]Previous ]
37259 +
37260 +   Security, in the sense of secure authentication and strong encryption,
37261 +   can be built into versionf of C-Kermit for which the appropriate
37262 +   libraries and header files are available (Kerberos IV, Kerberos V,
37263 +   OpenSSL, SRP), as explained in great detail in the Kermit Security
37264 +   Reference
37265 +   . The following symbols govern C-Kermit's security features at build
37266 +   time:
37267 +
37268 +   NO_AUTHENTICATION
37269 +          Means do not configure any TELNET AUTHENTICATION support. It
37270 +          implies NO_ENCRYPTION and undefines any of the auth and encrypt
37271 +          types. It does not undefine CK_SSL even though builds with
37272 +          CK_SSL cannot succeed without CK_AUTHENTICATION. (This will be
37273 +          supported in a future release. It will be needed to allow
37274 +          C-Kermit to be built only as an FTP client.)
37275 +
37276 +   NO_KERBEROS
37277 +          Means do not compile in any KERBEROS support when
37278 +          CK_AUTHENTICATION has been defined.
37279 +
37280 +   NO_SRP
37281 +          Do not compile in any SRP support when CK_AUTHENTICATION has
37282 +          been defined.
37283 +
37284 +   NO_SSL
37285 +          Do not compile in any SSL/TLS support
37286 +
37287 +   NO_ENCRYPTION
37288 +          Do not compile in any Telnet encryption support. It does not
37289 +          affect the use of SSL/TLS
37290 +
37291 +   NOSSH
37292 +          Do not compile in any SSH support whether internal or external
37293 +
37294 +   CK_AUTHENTICATION
37295 +          Telnet AUTHENTICATION support. (Also, required if SSL/TLS
37296 +          support is desired.) On most platforms this does not autodefine
37297 +          any authentication mechanisms such as Kerberos V, Kerberos IV,
37298 +          SRP, ... Those need to be defined separately.
37299 +
37300 +   CK_KERBEROS
37301 +          Defined automatically when KRB4, KRB5, or KRB524 are defined.
37302 +          Implies that some version of Kerberos is in use.
37303 +
37304 +   KRB4
37305 +          Should be defined when Kerberos IV support is desired.
37306 +
37307 +   KRB5
37308 +          Should be defined when Kerberos V support is desired.
37309 +
37310 +   KRB524
37311 +          Should be defined if both Kerberos V and Kerberos IV are used
37312 +          and the Kerberos IV support is provided by the MIT Kerberos IV
37313 +          compatibility library in the current Kerberos 5 distribution.
37314 +
37315 +   KRB5_U2U
37316 +          Should be defined if KRB5 is defined and Kerberos 5 User to User
37317 +          mode is desired.
37318 +
37319 +   HEIMDAL
37320 +          Should be defined if Kerberos V support is provided by HEIMDAL.
37321 +          Support for this option is not complete in C-Kermit 8.0. Anyone
37322 +          interested in working on this should contact kermit-support.
37323 +
37324 +   CK_SRP
37325 +          Should be defined if SRP support is desired.
37326 +
37327 +   CK_ENCRYPTION
37328 +          Should be defined if TELNET ENCRYPTION option support is
37329 +          desired. This option does not define any particular encryption
37330 +          types. That should be done by defining CK_DES or CK_CAST.
37331 +
37332 +   CK_DES
37333 +          Should be defined if either DES or 3DES Telnet Encryption option
37334 +          support is desired.
37335 +
37336 +   LIBDES
37337 +          If CK_DES is defined and DES support is being provided by either
37338 +          Eric Young's libdes.a or OpenSSL 0.9.6x or earlier, this option
37339 +          must be defined. If it is not defined, it will be assumed that
37340 +          DES support is provided by the MIT Kerberos IV libraries.
37341 +
37342 +   CK_CAST
37343 +          Should be defined if CAST Telnet Encryption option support is
37344 +          desired
37345 +
37346 +   CK_SSL
37347 +          Should be defined if SSL/TLS support (OpenSSL) is desired.
37348 +
37349 +   SSL_KRB5
37350 +          If KRB5 is defined, and OpenSSL is built to support the Kerberos
37351 +          5 ciphers, then you should define SSL_KRB5
37352 +
37353 +   NOSSLKRB5
37354 +          If you are using OpenSSL 0.9.7 or higher and do not wish to
37355 +          build with support for Kerberos 5 TLS ciphers, this option must
37356 +          be defined.
37357 +
37358 +   ZLIB
37359 +          If you are using OpenSSL 0.9.6 or higher and it has been
37360 +          compiled with support for ZLIB compression, this option should
37361 +          be defined to enable Kermit to properly enable the use of
37362 +          compression.
37363 +
37364 +   SSHCMD
37365 +          Defined for C-Kermit to enable the use of external SSH clients
37366 +          from the Kermit command language
37367 +
37368 +   SSHBUILTIN
37369 +          Defined for Kermit implementations that have integrated SSH
37370 +          support. Currently only Windows.
37371 +
37372 +   ANYSSH
37373 +          Defined if either SSHCMD or SSHBUILTIN are defined.
37374 +
37375 +   CK_SNDLOC
37376 +          Telnet Send Location support.
37377 +
37378 +   NOSNDLOC
37379 +          Do not include Telnet Send Location support.
37380 +
37381 +   CK_XDISPLOC
37382 +          Telnet X-Display Location support. Determines if the X-Display
37383 +          location information is sent to the Telnet server either via
37384 +          Telnet XDISPLOC or NEW-ENV options.
37385 +
37386 +   NOXDISPLOC
37387 +          Do not include Telnet X-Display Location support.
37388 +
37389 +   CK_FORWARD_X
37390 +          Telnet Forward X Windows Session Data option. Used to protect
37391 +          the privacy and integrity of X Windows Sessions when secure
37392 +          telnet sessions are in use.
37393 +
37394 +   NOFORWARDX
37395 +          Do not include Telnet Forward X Windows Session Data option.
37396 +
37397 +   Besides the strong forms of security listed above, C-Kermit also
37398 +   embodies various internal security features, including:
37399 +
37400 +   NOPUSH
37401 +          Compiling with the NOPUSH symbol defined removes all the "shell
37402 +          escape" features from the program, including the PUSH, RUN, and
37403 +          SPAWN commands, the "!" and "@" command prefixes, OPEN !READ,
37404 +          OPEN !WRITE, job control (including the SUSPEND command), the
37405 +          REDIRECT command, shell/DCL escape from CONNECT mode, as well as
37406 +          the server's execution of REMOTE HOST commands (and, of course,
37407 +          the ENABLE HOST command). Add NODISPO to also prevent acceptance
37408 +          of incoming MAIL or REMOTE PRINT files. For UNIX, also be sure
37409 +          to read [138]Section 11 of the [139]Unix C-Kermit Installation
37410 +          Instructions. about set[ug]id configuration. Additional
37411 +          restrictions can be enforced when in server mode; read about the
37412 +          DISABLE command in the user manual.
37413 +
37414 +   NOCCTRAP
37415 +          Compiling with NOCCTRAP prevents the trapping of SIGINT by
37416 +          Kermit. Thus if the user generates a SIGINT signal (e.g. by
37417 +          typing the system's interrupt character), Kermit will exit
37418 +          immediately, rather than returning to its prompt.
37419 +
37420 +   NOPUSH and NOCCTRAP together allow Kermit to be run from restricted
37421 +   shells, preventing access to system functions.
37422 +
37423 +   [ [140]C-Kermit Home ] [ [141]Kermit Home ]
37424 +
37425 +  11. ENABLING SELECT()
37426 +
37427 +   [ [142]Top ] [ [143]Contents ] [ [144]Next ] [ [145]Previous ]
37428 +
37429 +   Kermit works best if it can do nonblocking reads, nondestructive input
37430 +   buffer checking, and millisecond sleeps. All of these functions can be
37431 +   accomplished by the select() function, which, unfortunately, is not
37432 +   universally available. Furthermore, select() is required if incoming
37433 +   TCP/IP connections are to be supported.
37434 +
37435 +   select() was introduced with Berkeley UNIX, rejected by AT&T for System
37436 +   V, but is gradually creeping in to all UNIX versions (and other
37437 +   operating systems too) by virtue of its presence in the sockets
37438 +   library, which is needed for TCP/IP. AT&T SVID for System V R4 includes
37439 +   select(), but that does not mean that all SVR4 implementations have it.
37440 +
37441 +   Furthermore, even when select() is available, it might work only on
37442 +   socket file descriptors, but not on others like serial ports, pipes,
37443 +   etc. For example, in AOS/VS and BeOS, it works only with file
37444 +   descriptors that were created by socket() and opened by connect() or
37445 +   accept().
37446 +
37447 +   Other alternatives include poll() and rdchk(). Only one of these three
37448 +   functions should be included. The following symbols govern this:
37449 +
37450 +     SELECT  Use select() (BSD, or systems with sockets libraries)
37451 +     CK_POLL Use poll()   (System V)
37452 +     RDCHK   Use rdchk()  (SCO XENIX and UNIX)
37453 +
37454 +   If your system supports the select() function, but your version of
37455 +   C-Kermit does not, try adding:
37456 +
37457 +  -DSELECT
37458 +
37459 +   to the CFLAGS, and removing -DRDCHK or -DCK_POLL if it is there. If you
37460 +   get compilation errors, some adjustments to ck*tio.c and/or ck*net.c
37461 +   might be needed; search for SELECT (uppercase) in these files (note
37462 +   that there are several variations on the calling conventions for
37463 +   select()).
37464 +
37465 +   Various macros and data types need to be defined in order to use
37466 +   select(). Usually these are picked up from <types.h> or <sys/types.h>.
37467 +   But on some systems, they are in <sys/select.h>. In that case, add the
37468 +   following:
37469 +
37470 +  -DSELECT_H
37471 +
37472 +   to the CFLAGS to tell C-Kermit to #include <sys/select.h>. A good
37473 +   indication that you need to do this would be if you get compile-time
37474 +   complaints about "fd_set" or "FD_SET" not being declared or defined.
37475 +
37476 +   In UNIX, the use of select() vs fork() in the CONNECT command is
37477 +   independent of the above considerations, and is governed by choosing a
37478 +   particular makefile target.
37479 +
37480 +   As of C-Kermit 7.0, select() is also the preferred control mechanism
37481 +   for the CONNECT command. Unfortunately, the structures used by the
37482 +   original UNIX CONNECT command, based on fork(), and those used by
37483 +   select(), are so different, it was not practical to implement them both
37484 +   in one module. So the select()-based CONNECT command module for UNIX is
37485 +   [146]ckucns.c, and the fork-based one remains [147]ckucon.c. To choose
37486 +   the fork-based one, which is more portable (but slower and more
37487 +   fragile), use "wermit" as the make target. To choose the select-based
37488 +   one, use "xermit". Only do this if you can verify that the CONNECT
37489 +   command works on serial connections and PIPE connections as well as TCP
37490 +   connections.
37491 +
37492 +     The select()-based Unix CONNECT module, ckucns.c, must be used if
37493 +     encryption is to be done, since the fork() version (ckucon.c) loses
37494 +     its ability to share vital state information between the two forks.
37495 +     Also note that the select() version is superior in many other ways
37496 +     too. For example, it recovers better from exterior killing, forced
37497 +     disconnections, etc, plus it goes faster.
37498 +
37499 +   SHOW VERSIONS tells whether the CONNECT module uses fork() or select().
37500 +
37501 +   C-Kermit 8.0 adds learned script capability, which depends on select().
37502 +   All the "wermit" based targets (as opposed to "xermit") had NOLEARN
37503 +   added to them. Whenever changing a target over from wermit to xermit,
37504 +   also remember to remove NOLEARN.
37505 +
37506 +   [ [148]C-Kermit Home ] [ [149]Kermit Home ]
37507 +
37508 +  12. I/O REDIRECTION
37509 +
37510 +   [ [150]Top ] [ [151]Contents ] [ [152]Next ] [ [153]Previous ]
37511 +
37512 +   The REDIRECT command allows a local program to be run with its i/o
37513 +   redirected over the communications connection. Your version of C-Kermit
37514 +   has a REDIRECT command if it was built with the following CFLAG:
37515 +
37516 +  -DCK_REDIR
37517 +
37518 +   This, in turn, is possible only if the underlying API is there. In the
37519 +   case of UNIX this is just the wait() system call, so all UNIX versions
37520 +   get this feature as of 6.0.192 (earlier versions needed a <sys/wait.h>
37521 +   header file defining the symbols WIFEXITED and WEXITSTATUS).
37522 +
37523 +   As of version 7.0, file transfer can be done using pipes and filters.
37524 +   To enable this feature, #define PIPESEND (and fill in the code). To
37525 +   disable on systems where it is normally enabled, define NOPIPESEND.
37526 +   This feature is, of course, also disabled by building with NOPUSH (or
37527 +   giving the "nopush" command at runtime).
37528 +
37529 +   C-Kermit 7.0 also adds the PIPE and SET HOST /COMMAND commands, which
37530 +   provide another form of redirection. This feature is selected with
37531 +   -DNETCMD. CK_RDIR must also be defined, since the same mechanisms are
37532 +   used internally.
37533 +
37534 +   [ [154]C-Kermit Home ] [ [155]Kermit Home ]
37535 +
37536 +  13. FLOATING-POINT NUMBERS, TIMERS, AND ARITHMETIC
37537 +
37538 +   [ [156]Top ] [ [157]Contents ] [ [158]Next ] [ [159]Previous ]
37539 +
37540 +   Floating-point support was added in C-Kermit 7.0.
37541 +
37542 +   Floating-point numbers are enabled internally, at least for use in
37543 +   high-precision file-transfer timers and statistics, unless the
37544 +   following symbol is defined at compile time:
37545 +
37546 +  -DNOFLOAT
37547 +
37548 +   This might be necessary on old PCs that do not have built-in
37549 +   floating-point hardware.
37550 +
37551 +   When NOFLOAT is not defined, the following symbol tells which
37552 +   floating-point type to use:
37553 +
37554 +  -DCKFLOAT=xxxx
37555 +
37556 +   The value is either "double" (normal for 32- and 16-bit architectures)
37557 +   or "float" (normal for 64-bit architectures).
37558 +
37559 +   C-Kermit can be configured to use high-precision file-transfer timers
37560 +   for more accurate statistics. This feature is enabled with:
37561 +
37562 +  -DGFTIMER
37563 +
37564 +   and disabled with:
37565 +
37566 +  -DNOGFTIMER
37567 +
37568 +   If you try to build with -DGFTIMER but you get compilation errors,
37569 +   either fix them (and send email to kermit@columbia.edu telling what you
37570 +   did), or else give up and use -DNOGFTIMER (or -DNOFLOAT) instead. Hint:
37571 +   depending on your machine architecture, you might have better luck
37572 +   using double than float as the data type for floating-point numbers, or
37573 +   vice versa. Look in [160]ckcdeb.h for the CKFLOAT definition.
37574 +
37575 +   Floating-point arithmetic is also supported in the script programming
37576 +   language. First via the \fpp...() functions, such as \fppadd(), which
37577 +   adds two floating-point numbers, second in S-Expressions. Addition,
37578 +   subtraction, multiplication, and division are always available. But
37579 +   other functions such as logs, raising to powers, sines and cosines,
37580 +   etc, require the C Math library. To include user-level floating-point
37581 +   math you must put:
37582 +
37583 +  -DFNFLOAT
37584 +
37585 +   and in Unix you must link with the Math library:
37586 +
37587 +  LIBS=".... -lm"
37588 +
37589 +   In K95 and VMS, FNFLOAT is defined automatically if CKFLOAT is defined.
37590 +   In Unix, however, FNFLOAT must be added to each makefile target
37591 +   individually, because of the special linking instructions that must
37592 +   also be added to each target.
37593 +
37594 +   Note: S-Expressions require FNFLOAT.
37595 +
37596 +   [ [161]C-Kermit Home ] [ [162]Kermit Home ]
37597 +
37598 +  14. SPECIAL CONFIGURATIONS
37599 +
37600 +   [ [163]Top ] [ [164]Contents ] [ [165]Previous ]
37601 +
37602 +   As of C-Kermit 7.0, if you build C-Kermit normally, but with -DNOICP
37603 +   (No Interactive Command Parser), you get a program capable of making
37604 +   serial connections (but not dialing) and network connections (if
37605 +   TCPSOCKET or other network option included), and can also transfer
37606 +   files using Kermit protocol, but only via autodownload/upload.
37607 +   Furthermore, if you call the executable "telnet", it will act like
37608 +   Telnet -- using the command-line options. However, in this case there
37609 +   is nothing to escape back to, so if you type Ctrl-\c, it just prints a
37610 +   message to this effect.
37611 +
37612 +   You can also build C-Kermit with -DNOXFER, meaning omit all the
37613 +   file-transfer features. This leaves you with a scriptable
37614 +   communications program that is considerably smaller than the full
37615 +   C-Kermit.
37616 +
37617 +   [ [166]C-Kermit Home ] [ [167]Kermit Home ]
37618 +
37619 +  APPENDIX I: SUMMARY OF COMPILE-TIME OPTIONS
37620 +
37621 +   [ [168]Top ] [ [169]Contents ]
37622 +
37623 +   These are the symbols that can be specified on the cc command line,
37624 +   listed alphabetically. Others are used internally, including those
37625 +   taken from header files, those defined by the compiler itself, and
37626 +   those inferred from the ones given below. Kermit's SHOW VERSIONS
37627 +   command attempts to display most of these. See [170]ckcdeb.h and
37628 +   [171]ckcnet.h for inference rules. For example SVR3 implies ATTSV,
37629 +   MULTINET implies TCPSOCKET, and so on.
37630 +
37631 +   Here is the complete list of the Kermit-specific compile-time switches:
37632 +
37633 +   ACUCNTRL Select BSD 4.3-style acucntrl() bidirectional tty control.
37634 +   aegis Build for Apollo Aegis (predefined on Apollo systems).
37635 +   AIX370 Build for IBM AIX/370 for IBM mainframes.
37636 +   AIXESA Build for IBM AIX/ESA for IBM mainframes.
37637 +   AIXPS2 Build for IBM AIX 3.0 for PS/2 series (never formally released).
37638 +   AIXRS Build for IBM AIX 3.x on RS/6000.
37639 +   AIX41 Build for IBM AIX 4.x on RS/6000.
37640 +   AMIGA Build for Commodore Amiga with Intuition OS.
37641 +   ATT6300 Build for AT&T 6300 PLUS.
37642 +   ATT7300 Build for AT&T 7300 UNIX PC (3B1).
37643 +   ATTSV Build for AT&T System III or V UNIX.
37644 +   AUX Build for Apple A/UX for the Macintosh.
37645 +   BIGBUFOK OK to use big buffers - "memory is not a problem"
37646 +   BPS_xxxx Enable SET SPEED xxxx
37647 +   BSD29 Build for BSD 2.9 or 2.10.
37648 +   BSD4 Build for BSD 4.2.
37649 +   BSD41 Build for BSD 4.1.
37650 +   BSD43 Build for BSD 4.3.
37651 +   BSD44 Build for BSD 4.4.
37652 +   C70 Build for BBN C/70.
37653 +   CIE Build for CIE Systems 680/20.
37654 +   CKCONINTB4CB Work around prompt-disappears after escape back from
37655 +   CONNECT.
37656 +   CKLEARN Build with support for learned scripts.
37657 +   CKLOGDIAL Enable connection log.
37658 +   CKMAXPATH Maximum length for a fully qualified filename.
37659 +   CKREGEX (misnomer) Include [...] or {xxx,xxx,xxx} matching in
37660 +   ckmatch().
37661 +   CKSYSLOG Enable syslogging.
37662 +   CK_ANSIC Enable ANSI C constructs - prototypes, etc.
37663 +   CK_ANSILIBS Use header files for ANSI C libraries.
37664 +   CK_APC Enable APC execution by CONNECT module.
37665 +   CK_CURSES Enable fullscreen file transfer display.
37666 +   CK_DSYSINI Use system-wide init file, with name supplied by Kermit.
37667 +   CK_DTRCD DTR/CD flow control is available.
37668 +   CK_FAST Build with fast Kermit protocol defaults.
37669 +   CK_FORK_SIG UNIX only: signal() number for CONNECT module forks.
37670 +   CK_IFRO IF REMOTE command is available (and can run in remote mode).
37671 +   CK_INI_A System-wide init file takes precedence over user's.
37672 +   CK_INI_B User's init file takes precedence over the system-wide one.
37673 +   CK_LABELED Include support for SET FILE TYPE LABELED.
37674 +   CK_LBRK This version can send Long BREAK.
37675 +   CK_LINGER Add code to turn of TCP socket "linger" parameter.
37676 +   CK_MKDIR This version has a zmkdir() command to create directories.
37677 +   CK_NAWS Include TELNET Negotiate About Window Size support.
37678 +   CK_NEWTERM Use newterm() rather than initscr() to initialize curses.
37679 +   CK_PAM Include PAM authentication (might also require -lpam).
37680 +   CK_PCT_BAR Fullscreen file transfer display should include
37681 +   "thermometer".
37682 +   CK_POLL System-V or POSIX based UNIX has poll() function.
37683 +   CK_POSIX_SIG Use POSIX signal handing: sigjmp_buf, sigsetjmp,
37684 +   siglongjmp.
37685 +   CK_READ0 read(fd,&x,0) can be used to test TCP/IP connections.
37686 +   CK_REDIR Enable the REDIRECT command.
37687 +   CK_RESEND Include the RESEND command (needs zfseek() + append).
37688 +   CK_RTSCTS RTS/CTS flow control is available.
37689 +   CK_SHADOW Include support for shadow passwords (e.g. for IKSD
37690 +   authentication).
37691 +   CK_SOCKBUF Enable TCP socket-buffer-size-increasing code.
37692 +   CK_SOCKS UNIX only: Build with socks library rather than regular
37693 +   sockets
37694 +   CK_SOCKS5 UNIX only: Build with socks 5 lib rather than regular sockets
37695 +   CK_SPEED Enable control-character unprefixing.
37696 +   CK_SYSINI="xxxxx" Quoted string to be used as system-wide init file
37697 +   name.
37698 +   CK_TIMERS Build with support for dynamically calculated packet
37699 +   timeouts.
37700 +   CK_TMPDIR This version of Kermit has an isdir() function.
37701 +   CK_TTYFD Defined on systems where the communications connection file
37702 +   descriptor (ttyfd) can be passed to other processes as a command-line
37703 +   argument via \v(ttyfd).
37704 +   CK_URL Parse URLs as well as hostnames, etc.
37705 +   CK_XONXOFF Xon/Xoff flow control available.
37706 +   CK_XYZ Include support for XYZMODEM protocols.
37707 +   CK_WREFRESH Curses package includes wrefresh(),clearok() for screen
37708 +   refresh.
37709 +   CKFLOAT=type Floating-point data type, "double" or "float".
37710 +   CKTYP_H=xxx Force include of xxx as <types.h> file.
37711 +   CLSOPN When hanging up a tty device, also close and reopen it.
37712 +   CMDDEP Maximum recursion depth for self-referential user-defined fn's.
37713 +   COHERENT Build for Mark Williams Coherent UNIX
37714 +   CONGSPD Define if this version has congspd() routine in ck?tio.c
37715 +   datageneral Build for Data General AOS/VS or AOS/VS II
37716 +   DCLPOPEN popen() is available but needs to be declared
37717 +   DEC_TCPIP Build with support for DEC TCP/IP (UCX) for (Open)VMS
37718 +   DGUX430 Build for DG/UX 4.30
37719 +   DGUX540 Build for DG/UX 5.40
37720 +   DEFPAR=x Default parity, 0, 'e', 'o', 'm', or 's'.
37721 +   DFTTY=xxx Default communications device name.
37722 +   DIRENT UNIX directory structure to be taken from <dirent.h>.
37723 +   DIRPWDRP Prompt for password in REMOTE CWD command.
37724 +   DTILDE Include UNIX ~ notation for username/home-directory
37725 +   DYNAMIC Allocate file transfer packet buffers dynamically with malloc.
37726 +   ENCORE Build for Encore Multimax computers.
37727 +   EXCELAN Build with excelan TCP/IP.
37728 +   FNFLOAT Include floating-point math functions (logs, sin, cos, exp,
37729 +   etc)
37730 +   FT18 Build for Fortune For:Pro 1.8.
37731 +   FT21 Build for Fortune For:Pro 2.1.
37732 +   GEMDOS Build for Atari ST GEMDOS.
37733 +   GFTIMER Use high-precision floating-point file-transfer timers.
37734 +   GID_T=xxx Group IDs are of type xxx (usually int, short, or gid_t).
37735 +   HADDRLIST If gethostbyname() hostent struct contains a list of
37736 +   addresses.
37737 +   HDBUUCP Build with support for Honey DanBer UUCP.
37738 +   HPUX Build for Hewlett Packard HP-UX.
37739 +   HPUX9 Build for Hewlett Packard HP-UX 9.x.
37740 +   HPUX10 Build for Hewlett Packard HP-UX 10.x.
37741 +   HWPARITY Define if this version can SET PARITY HARDWARE { EVEN, ODD...}
37742 +   I386IX Build for Interactive System V R3.
37743 +   IFDEBUG Add IF stmts "if (deblog)" before "debug()" calls.
37744 +   INADDRX TCP/IP inet_addr() type is struct inaddr, not unsigned long.
37745 +   INTERLAN Build with support for Racal/Interlan TCP/IP.
37746 +   ISDIRBUG System defs of S_ISDIR and S_ISREG have bug, define ourselves.
37747 +   ISIII Build for Interactive System III.
37748 +   IX370 Build for IBM IX/370.
37749 +   KANJI Build with Kanji character-set translation support.
37750 +   LCKDIR UUCP lock directory is /usr/spool/uucp/LCK/.
37751 +   LFDEVNO UUCP lockfile name uses device numbers, as in SVR4.
37752 +   LINUXFSSTND For Linux, use FSSTND UUCP lockfile conventions (default).
37753 +   LOCK_DIR=xxx UUCP lock directory is xxx (quoted string).
37754 +   LOCKF Use lockf() (in addition to lockfiles) on serial lines
37755 +   LONGFN BSD long filenames supported using <dir.h> and opendir().
37756 +   LYNXOS Build for Lynx OS 2.2 or later (POSIX-based).
37757 +   MAC Build for Apple Macintosh with Mac OS.
37758 +   MATCHDOT Make wildcards match filenames that start with period (.)
37759 +   MAXRP=number Maximum receive-packet length.
37760 +   MAXSP=number Maximum send-packet length.
37761 +   MDEBUG Malloc-debugging requested.
37762 +   MINIDIAL Minimum modem dialer support: CCITT, Hayes, Unkown, and None.
37763 +   MINIX Build for MINIX.
37764 +   MIPS Build for MIPS workstation.
37765 +   MULTINET Build with support for TGV MultiNet TCP/IP (VAX/VMS).
37766 +   M_UNIX Defined by SCO.
37767 +   NAP The nap() is available (conflicts with SELECT and USLEEP)
37768 +   NAPHACK The nap() call is available but only as syscall(3112,...)
37769 +   NDIR BSD long filenames supported using <ndir.h> and opendir().
37770 +   NDGPWNAM Don't declare getpwnam().
37771 +   NDSYSERRLIST Don't declare sys_errlist[].
37772 +   NEEDSELECTDEFS select() is avaible but we need to define FD_blah
37773 +   ourselves.
37774 +   NETCMD Build with support for SET HOST /COMMAND and PIPE commands.
37775 +   NEXT Build for NeXT Mach 1.x or 2.x or 3.0, 3.1, or 3.2.
37776 +   NEXT33 Build for NeXT Mach 3.3.
37777 +   NOANSI Disable ANSI C function prototyping.
37778 +   NOAPC Do not include CK_APC code.
37779 +   NOARROWKEYS Exclude code to parse ANSI arrow-key sequences.
37780 +   NOB_xxxx Disable SET SPEED xxxx
37781 +   NOBIGBUF Override BIGBUFOK when it is the default
37782 +   NOBRKC Don't try to refer to t_brkc or t_eof tchars structure members.
37783 +   NOCKFQHOSTNAME Exclude code to get fully qualified hostname in case it
37784 +   causes core dumps.
37785 +   NOCCTRAP Disable Control-C (SIGINT) trapping.
37786 +   NOCKSPEED Disable control-prefix removal feature (SET CONTROL).
37787 +   NOCKTIMERS Build without support for dynamic timers.
37788 +   NOCKXYZ Overrides CK_XYZ.
37789 +   NOCKREGEX Do not include [...] or {xxx,xxx,xxx} matching in ckmatch().
37790 +   NOCMDL Build with no command-line option processing.
37791 +   NOCOTFMC No Close(Open()) To Force Mode Change (UNIX version).
37792 +   NOCSETS Build with no support for character set translation.
37793 +   NOCYRIL Build with no support for Cyrillic character set translation.
37794 +   NOCYRILLIC Ditto.
37795 +   NODEBUG Build with no debug logging capability.
37796 +   NODIAL Build with no DIAL or SET DIAL commands.
37797 +   NODISPO Build to always refuse incoming MAIL or REMOTE PRINT files.
37798 +   DNODISPLAY Build with no file-transfer display.
37799 +   NOESCSEQ Build with no support for ANSI escape sequence recognition.
37800 +   NOFAST Do not make FAST Kermit protocol settings the default.
37801 +   NOFDZERO Do not use file descriptor 0 for remote-mode file transfer.
37802 +   NOFILEH Do not #include <sys/file.h>.
37803 +   NOFLOAT Don't include any floating-point data types or operations.
37804 +   NOFRILLS Build with "no frills" (this should be phased out...)
37805 +   NOFTRUNCATE Include this on UNIXes that don't have ftruncate().
37806 +   NOGETUSERSHELL Include this on UNIXes that don't have getusershell().
37807 +   NOGFTIMER Don't use high-precision floating-point file-transfer timers.
37808 +   NOHEBREW Build with no support for Hebrew character sets.
37809 +   NOHELP Build with no built-in help.
37810 +   NOIKSD Build with IKSD support excluded.
37811 +   NOINITGROUPS Include this on UNIXes that don't have initgroups().
37812 +   NOICP Build with no interactive command parser.
37813 +   NOJC Build with no support for job control (suspend).
37814 +   NOKANJI Build with no support for Japanese Kanji character sets.
37815 +   NOKVERBS Build with no support for keyboard verbs (\Kverbs).
37816 +   NOLATIN2 Build with no ISO Latin-2 character-set translation support.
37817 +   NOLEARN Build with no support for learned scripts.
37818 +   NOLINKBITS Use of S_ISLNK and _IFLNK untrustworthy; use readlink()
37819 +   instead.
37820 +   NOLOCAL Build without any local-mode features: No Making Connections.
37821 +   NOLOGDIAL Disable connection log.
37822 +   NOLOGIN Build without IKSD (network login) support.
37823 +   NOLSTAT Not OK to use lstat().
37824 +   NOMDMHUP Build without "modem-specific hangup" (e.g. ATH0) feature.
37825 +   NOMHHOST Exclude the multihomed-host TCP/IP code (if compilcation
37826 +   errors)
37827 +   NOMINPUT Build without MINPUT command.
37828 +   NOMSEND Build with no MSEND command.
37829 +   NONAWS Do not include TELNET Negotiate About Window Size support.
37830 +   NONET Do not include any network support.
37831 +   NONOSETBUF (See NOSETBUF)
37832 +   NOPARSEN Build without automatic parity detection.
37833 +   NOPIPESEND Disable file transfer using pipes and filters.
37834 +   NOPOLL Override CK_POLL definition.
37835 +   NOPOPEN The popen() library call is not available.
37836 +   NOPURGE Build with no PURGE command.
37837 +   NOPUSH Build with no escapes to operating system.
37838 +   NOREALPATH In UNIX, realpath() function is not available.
37839 +   NORECALL Disable the command-recall feature.
37840 +   NOREDIRECT Disable REDIRECT command.
37841 +   NORENAME Don't use rename() system call, use link()/unlink() (UNIX).
37842 +   NORESEND Build with no RESEND command.
37843 +   NORETRY Build with no command-retry feature.
37844 +   NOSCRIPT Build with no SCRIPT command.
37845 +   NOSELECT Don't try to use select().
37846 +   NOSERVER Build with no SERVER mode and no server-related commands.
37847 +   NOSETBUF Don't make console writes unbuffered.
37848 +   NONOSETBUF DO make console writes unbuffered.
37849 +   NOSETREU setreuid() and/or setregid() not available.
37850 +   NOSHOW Build with no SHOW command (not recommended!).
37851 +   NOSIGWINCH Disable SIGWINCH signal trapping.
37852 +   NOSPL Build with no script programming language.
37853 +   NOSTAT Don't call stat() from mainline code.
37854 +   NOSYMLINK Include this for UNIXes that don't have readlink().
37855 +   NOSYSIOCTLH Do not #include <sys/ioctl.h>.
37856 +   NOSYSTIMEH Co not include <sys/time.h>.
37857 +   NOSYSLOG Disable syslogging code.
37858 +   NOTCPOPTS Build with no SET TCP options or underlying support.
37859 +   NOTLOG Build with no support for transaction logging.
37860 +   NOTM_ISDST Struct tm has no tm_isdst member.
37861 +   NOUNICODE Build with no support for Unicode character-set translation.
37862 +   NOURL Don't parse URLs
37863 +   NOUUCP Build with no UUCP lockfile support (dangerous!).
37864 +   NOWARN Make EXIT WARNING be OFF by default (otherwise it's ON).
37865 +   NOWREFRESH Override built-in definition of CK_WREFRESH (q.v.).
37866 +   NOXFER Build with no Kermit or other file-transfer protocols.
37867 +   NOXMIT Build with no TRANSMIT command.
37868 +   NOXPRINT Disables transparent print code.
37869 +   OLDMSG Use old "entering server mode" message (see [172]ckcmai.c).
37870 +   OLINUXHISPEED Build in old Linux hi-serial-speed code (for Linux <=
37871 +   1.0).
37872 +   OPENBSD Build for OpenBSD.
37873 +   OS2 Build for OS/2.
37874 +   OSF Build for OSF/1.
37875 +   OSFPC Build for OSF/1 on a PC.
37876 +   OSF32 Digital UNIX 3.2 or later.
37877 +   OSF40 Build for Digital UNIX 4.0.
37878 +   OSF50 Build for Digital UNIX 5.0.
37879 +   OSK Build for OS-9.
37880 +   OXOS Build for Olivetti X/OS 2.3.
37881 +   PCIX Build for PC/IX
37882 +   PID_T=xxx Type for pids is xxx (normally int or pid_t).
37883 +   POSIX Build for POSIX: use POSIX header files, functions, etc.
37884 +   _POSIX_SOURCE Disable non-POSIX features.
37885 +   PROVX1 Build for Venix 1.0 on DEC Professional 3xx.
37886 +   PTX Build for Dynix/PTX
37887 +   PWID_T=xxx getpwid() type is xxx.
37888 +   RBSIZ=xxx Define overall size of receive-packet buffer (with DYNAMIC).
37889 +   RDCHK rdchk() system call is available.
37890 +   RENAME rename() system call is available (UNIX).
37891 +   RTAIX Build for AIX 2.2.1 on IBM RT PC.
37892 +   RTU Build for Masscomp / Concurrent RTU.
37893 +   SAVEDUID BSD or other non-AT&T UNIX has saved-setuid feature.
37894 +   SBSIZ=xxx Define overall size of send-packet buffer (use with DYNAMIC).
37895 +   SDIRENT Directory structure specified in <sys/dirent.h>.
37896 +   SELECT select() function available (conflicts with RDCHK and CK_POLL)
37897 +   SELECT_H Include <sys/select.h> for select()-releated definitions.
37898 +   SETEUID BSD 4.4-style seteXid() functions available.
37899 +   SIG_V Type for signal() is void. Used to override normal assumption.
37900 +   SIG_I Type for signal() is int. Used to override normal assumption.
37901 +   SOCKOPT_T Override default data type for get/setsockopt() option
37902 +   length.
37903 +   SOLARIS Build for Solaris.
37904 +   SOLARIS25 Build for Solaris 2.5 or later.
37905 +   SONYNEWS Build for Sony NEWS-OS.
37906 +   STERMIOX <sys/termiox.h> is available.
37907 +   STRATUS Build for Stratus VOS.
37908 +   STRATUSX25 Include Stratus VOS X.25 support.
37909 +   SUN4S5 Build for SUNOS 4.x in the System V R3 environment.
37910 +   SUNOS4 Build for SUNOS 4.0 in the BSD environment.
37911 +   SUNOS41 Build for SUNOS 4.1 in the BSD environment.
37912 +   SUNX25 Build with support for SunLink X.25.
37913 +   SVR3 Build for AT&T System V Release 3.
37914 +   SVR3JC Allow job control support on System V Release 3 UNIX versions.
37915 +   SVR4 Build for AT&T System V Release 4.
37916 +   SW_ACC_ID UNIX only -- swap real & effective ids around access() calls.
37917 +   sxaE50 Build for PFU Compact A Series SX/A TISP.
37918 +   SYSLOGLEVEL=n Force syslogging at given level.
37919 +   SYSTIMEH Include <sys/time.h>.
37920 +   SYSUTIMEH Include <sys/utime.h> for setting file dates (88OPEN)
37921 +   TCPSOCKET Build with support for TCP/IP via Berkeley sockets library.
37922 +   TERMIOX <termiox.h> header file is available (mostly SVR4).
37923 +   TNCODE Include TELNET-specific code.
37924 +   TOWER1 Build for NCR Tower 1632 with OS 1.02.
37925 +   TRS16 Build for Tandy 16/6000.
37926 +   UID_T=xxx Type for uids is xxx (normally int or uid_t).
37927 +   UNIX Must be defined for all UNIX versions.
37928 +   UNIX351M AT&T UNIX 3.51m on the AT&T 7300 UNIX PC.
37929 +   USE_ARROWKEYS Include code to parse ANSI arrow-key sequences.
37930 +   USE_LSTAT OK to use lstat().
37931 +   USE_MEMCPY Define this if memcpy()/memset()/memmove() available.
37932 +   USE_STRERROR Define this if strerror() is available.
37933 +   USLEEP usleep() system call available (conflicts with NAP & SELECT).
37934 +   UTEK Build for Tektronix workstations with UTEK OS.
37935 +   UTIMEH Include <utime.h> for setting file dates (SVR4, POSIX)
37936 +   UTS24 Build for Amdahl UTS 2.4.
37937 +   V7 Build for Version 7 UNIX.
37938 +   VMS Build for VAX/VMS.
37939 +   VOID=xxx VOID type for functions (int or void).
37940 +   VXVE Build for CDC VX/VE 5.2.1.
37941 +   WAIT_T=xxx Type of argument passed to wait().
37942 +   WINTCP Build with Wollongong VAX/VMS TCP/IP (implies TCPSOCKET)
37943 +   WOLLONGONG Build with Wollongong UNIX TCP/IP (implies TCPSOCKET)
37944 +   XENIX Build for Xenix (SCO, Tandy, others).
37945 +   XNDIR Support for BSD long filenames via <sys/ndir.h>.
37946 +   XYZ_INTERNAL Support for XYZMODEM protocols is internal, not external.
37947 +   ZFCDAT Define this if zfcdat() function is available in Kermit.
37948 +   ZILOG Build for Zilog ZEUS.
37949 +   ZJDATE Has zjdate() function that converts date to Julian format.
37950 +   XPRINT Transparent print code included in CONNECT module.
37951 +
37952 +   [ [173]Top ] [ [174]Contents ] [ [175]C-Kermit Home ] [ [176]Kermit
37953 +   Home ]
37954 +     __________________________________________________________________
37955 +
37956 +
37957 +    C-Kermit Configuration Options / [177]The Kermit Project /
37958 +    [178]kermit@columbia.edu / 30 June 2011
37959 +
37960 +References
37961 +
37962 +   1. http://www.columbia.edu/
37963 +   2. mailto:kermit@columbia.edu
37964 +   3. http://www.columbia.edu/kermit/index.html
37965 +   4. http://www.columbia.edu/kermit/k95.html
37966 +   5. http://www.columbia.edu/kermit/ckermit.html
37967 +   6. http://www.columbia.edu/kermit/ckscripts.html
37968 +   7. http://www.columbia.edu/kermit/current.html
37969 +   8. http://www.columbia.edu/kermit/whatsnew.html
37970 +   9. http://www.columbia.edu/kermit/faq.html
37971 +  10. http://www.columbia.edu/kermit/support.html
37972 +  11. http://www.columbia.edu/kermit/ckccfg.html
37973 +  12. http://www.columbia.edu/kermit/ckermit.html
37974 +  13. http://www.columbia.edu/kermit/index.html
37975 +  14. http://www.columbia.edu/kermit/ckccfg.html#x1
37976 +  15. http://www.columbia.edu/kermit/ckccfg.html#x2
37977 +  16. http://www.columbia.edu/kermit/ckccfg.html#x3
37978 +  17. http://www.columbia.edu/kermit/ckccfg.html#x4
37979 +  18. http://www.columbia.edu/kermit/ckccfg.html#x5
37980 +  19. http://www.columbia.edu/kermit/ckccfg.html#x6
37981 +  20. http://www.columbia.edu/kermit/ckccfg.html#x7
37982 +  21. http://www.columbia.edu/kermit/ckccfg.html#x8
37983 +  22. http://www.columbia.edu/kermit/ckccfg.html#x9
37984 +  23. http://www.columbia.edu/kermit/ckccfg.html#x10
37985 +  24. http://www.columbia.edu/kermit/ckccfg.html#x11
37986 +  25. http://www.columbia.edu/kermit/ckccfg.html#x12
37987 +  26. http://www.columbia.edu/kermit/ckccfg.html#x13
37988 +  27. http://www.columbia.edu/kermit/ckccfg.html#x14
37989 +  28. http://www.columbia.edu/kermit/ckccfg.html#xa1
37990 +  29. http://www.columbia.edu/kermit/ckuins.html
37991 +  30. http://www.columbia.edu/kermit/ckermit.html
37992 +  31. http://www.columbia.edu/kermit/index.html
37993 +  32. http://www.columbia.edu/kermit/ckccfg.html#top
37994 +  33. http://www.columbia.edu/kermit/ckccfg.html#contents
37995 +  34. http://www.columbia.edu/kermit/ckccfg.html#x2
37996 +  35. http://www.columbia.edu/kermit/ckccfg.html#x0
37997 +  36. http://www.columbia.edu/kermit/ckermit.html
37998 +  37. http://www.columbia.edu/kermit/index.html
37999 +  38. http://www.columbia.edu/kermit/ckccfg.html#top
38000 +  39. http://www.columbia.edu/kermit/ckccfg.html#contents
38001 +  40. http://www.columbia.edu/kermit/ckccfg.html#x3
38002 +  41. http://www.columbia.edu/kermit/ckccfg.html#x1
38003 +  42. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
38004 +  43. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
38005 +  44. ftp://kermit.columbia.edu/kermit/c-kermit/ckuus3.c
38006 +  45. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
38007 +  46. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
38008 +  47. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
38009 +  48. http://www.columbia.edu/kermit/ckermit.html
38010 +  49. http://www.columbia.edu/kermit/index.html
38011 +  50. http://www.columbia.edu/kermit/ckccfg.html#top
38012 +  51. http://www.columbia.edu/kermit/ckccfg.html#contents
38013 +  52. http://www.columbia.edu/kermit/ckccfg.html#x4
38014 +  53. http://www.columbia.edu/kermit/ckccfg.html#x2
38015 +  54. ftp://kermit.columbia.edu/kermit/c-kermit/makefile
38016 +  55. http://www.columbia.edu/kermit/ckuins.html
38017 +  56. http://www.columbia.edu/kermit/ckuins.html#x4
38018 +  57. http://www.columbia.edu/kermit/ckuins.html#x9.2
38019 +  58. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusx.c
38020 +  59. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
38021 +  60. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
38022 +  61. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusx.c
38023 +  62. ftp://kermit.columbia.edu/kermit/c-kermit/ckucmd.c
38024 +  63. http://www.columbia.edu/kermit/ckermit.html
38025 +  64. http://www.columbia.edu/kermit/index.html
38026 +  65. http://www.columbia.edu/kermit/ckccfg.html#top
38027 +  66. http://www.columbia.edu/kermit/ckccfg.html#contents
38028 +  67. http://www.columbia.edu/kermit/ckccfg.html#x5
38029 +  68. http://www.columbia.edu/kermit/ckccfg.html#x3
38030 +  69. http://www.columbia.edu/kermit/unicode.html
38031 +  70. http://www.columbia.edu/kermit/ckermit.html
38032 +  71. http://www.columbia.edu/kermit/index.html
38033 +  72. http://www.columbia.edu/kermit/ckccfg.html#top
38034 +  73. http://www.columbia.edu/kermit/ckccfg.html#contents
38035 +  74. http://www.columbia.edu/kermit/ckccfg.html#x6
38036 +  75. http://www.columbia.edu/kermit/ckccfg.html#x4
38037 +  76. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusr.h
38038 +  77. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusr.h
38039 +  78. http://www.columbia.edu/kermit/ckermit.html
38040 +  79. http://www.columbia.edu/kermit/index.html
38041 +  80. http://www.columbia.edu/kermit/ckccfg.html#top
38042 +  81. http://www.columbia.edu/kermit/ckccfg.html#contents
38043 +  82. http://www.columbia.edu/kermit/ckccfg.html#x7
38044 +  83. http://www.columbia.edu/kermit/ckccfg.html#x5
38045 +  84. http://www.columbia.edu/kermit/ckccfg.html#x6.1
38046 +  85. http://www.columbia.edu/kermit/ckccfg.html#x6.2
38047 +  86. http://www.columbia.edu/kermit/ckccfg.html#x6.3
38048 +  87. http://www.columbia.edu/kermit/ckccfg.html#x6.4
38049 +  88. http://www.columbia.edu/kermit/ckccfg.html#x4
38050 +  89. http://www.columbia.edu/kermit/gkermit.html
38051 +  90. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusr.h
38052 +  91. ftp://kermit.columbia.edu/kermit/c-kermit/ckcker.h
38053 +  92. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
38054 +  93. http://www.columbia.edu/kermit/ckermit.html
38055 +  94. http://www.columbia.edu/kermit/index.html
38056 +  95. http://www.columbia.edu/kermit/ckccfg.html#top
38057 +  96. http://www.columbia.edu/kermit/ckccfg.html#contents
38058 +  97. http://www.columbia.edu/kermit/ckccfg.html#x8
38059 +  98. http://www.columbia.edu/kermit/ckccfg.html#x6
38060 +  99. ftp://kermit.columbia.edu/kermit/c-kermit/ckudia.c
38061 + 100. http://www.columbia.edu/kermit/ckermit.html
38062 + 101. http://www.columbia.edu/kermit/index.html
38063 + 102. http://www.columbia.edu/kermit/ckccfg.html#top
38064 + 103. http://www.columbia.edu/kermit/ckccfg.html#contents
38065 + 104. http://www.columbia.edu/kermit/ckccfg.html#x9
38066 + 105. http://www.columbia.edu/kermit/ckccfg.html#x7
38067 + 106. http://www.columbia.edu/kermit/ckccfg.html#x8.1
38068 + 107. http://www.columbia.edu/kermit/ckccfg.html#x8.2
38069 + 108. http://www.columbia.edu/kermit/ckccfg.html#x8.3
38070 + 109. http://www.columbia.edu/kermit/ckccfg.html#x8.1.1
38071 + 110. http://www.columbia.edu/kermit/ckccfg.html#x8.1.2
38072 + 111. http://www.columbia.edu/kermit/ckccfg.html#x8.1.3
38073 + 112. http://www.columbia.edu/kermit/ckccfg.html#x8.1.4
38074 + 113. http://www.columbia.edu/kermit/ckccfg.html#x8.1.5
38075 + 114. http://www.columbia.edu/kermit/ckccfg.html#x8.1.6
38076 + 115. ftp://kermit.columbia.edu/kermit/c-kermit/ckcnet.h
38077 + 116. ftp://kermit.columbia.edu/kermit/c-kermit/ckctel.c
38078 + 117. ftp://kermit.columbia.edu/kermit/c-kermit/ckctel.c
38079 + 118. ftp://kermit.columbia.edu/kermit/c-kermit/ckctel.h
38080 + 119. ftp://kermit.columbia.edu/kermit/c-kermit/ckcftp.c
38081 + 120. http://www.columbia.edu/kermit/ckermit.html
38082 + 121. ftp://kermit.columbia.edu/kermit/c-kermit/ckcnet.c
38083 + 122. ftp://kermit.columbia.edu/kermit/c-kermit/ckcnet.h
38084 + 123. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
38085 + 124. http://www.columbia.edu/kermit/ckccfg.html#x11
38086 + 125. mailto:kermit@columbia.edu
38087 + 126. http://www.columbia.edu/kermit/ckermit.html
38088 + 127. http://www.columbia.edu/kermit/index.html
38089 + 128. http://www.columbia.edu/kermit/ckccfg.html#top
38090 + 129. http://www.columbia.edu/kermit/ckccfg.html#contents
38091 + 130. http://www.columbia.edu/kermit/ckccfg.html#x10
38092 + 131. http://www.columbia.edu/kermit/ckccfg.html#x8
38093 + 132. http://www.columbia.edu/kermit/ckermit.html
38094 + 133. http://www.columbia.edu/kermit/index.html
38095 + 134. http://www.columbia.edu/kermit/ckccfg.html#top
38096 + 135. http://www.columbia.edu/kermit/ckccfg.html#contents
38097 + 136. http://www.columbia.edu/kermit/ckccfg.html#x11
38098 + 137. http://www.columbia.edu/kermit/ckccfg.html#x9
38099 + 138. http://www.columbia.edu/kermit/ckuins.html#x11
38100 + 139. http://www.columbia.edu/kermit/ckuins.html
38101 + 140. http://www.columbia.edu/kermit/ckermit.html
38102 + 141. http://www.columbia.edu/kermit/index.html
38103 + 142. http://www.columbia.edu/kermit/ckccfg.html#top
38104 + 143. http://www.columbia.edu/kermit/ckccfg.html#contents
38105 + 144. http://www.columbia.edu/kermit/ckccfg.html#x12
38106 + 145. http://www.columbia.edu/kermit/ckccfg.html#x10
38107 + 146. ftp://kermit.columbia.edu/kermit/c-kermit/ckucns.c
38108 + 147. ftp://kermit.columbia.edu/kermit/c-kermit/ckucon.c
38109 + 148. http://www.columbia.edu/kermit/ckermit.html
38110 + 149. http://www.columbia.edu/kermit/index.html
38111 + 150. http://www.columbia.edu/kermit/ckccfg.html#top
38112 + 151. http://www.columbia.edu/kermit/ckccfg.html#contents
38113 + 152. http://www.columbia.edu/kermit/ckccfg.html#x13
38114 + 153. http://www.columbia.edu/kermit/ckccfg.html#x11
38115 + 154. http://www.columbia.edu/kermit/ckermit.html
38116 + 155. http://www.columbia.edu/kermit/index.html
38117 + 156. http://www.columbia.edu/kermit/ckccfg.html#top
38118 + 157. http://www.columbia.edu/kermit/ckccfg.html#contents
38119 + 158. http://www.columbia.edu/kermit/ckccfg.html#x14
38120 + 159. http://www.columbia.edu/kermit/ckccfg.html#x12
38121 + 160. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
38122 + 161. http://www.columbia.edu/kermit/ckermit.html
38123 + 162. http://www.columbia.edu/kermit/index.html
38124 + 163. http://www.columbia.edu/kermit/ckccfg.html#top
38125 + 164. http://www.columbia.edu/kermit/ckccfg.html#contents
38126 + 165. http://www.columbia.edu/kermit/ckccfg.html#x13
38127 + 166. http://www.columbia.edu/kermit/ckermit.html
38128 + 167. http://www.columbia.edu/kermit/index.html
38129 + 168. http://www.columbia.edu/kermit/ckccfg.html#top
38130 + 169. http://www.columbia.edu/kermit/ckccfg.html#contents
38131 + 170. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
38132 + 171. ftp://kermit.columbia.edu/kermit/c-kermit/ckcnet.h
38133 + 172. ftp://kermit.columbia.edu/kermit/c-kermit/ckcmai.c
38134 + 173. http://www.columbia.edu/kermit/ckccfg.html#top
38135 + 174. http://www.columbia.edu/kermit/ckccfg.html#contents
38136 + 175. http://www.columbia.edu/kermit/ckermit.html
38137 + 176. http://www.columbia.edu/kermit/index.html
38138 + 177. http://www.columbia.edu/kermit/index.html
38139 + 178. mailto:kermit@columbia.edu
38140 --- /dev/null
38141 +++ ckermit-301/ockermit.ini
38142 @@ -0,0 +1,618 @@
38143 +COMMENT - Standard C-Kermit initialization file
38144 +;
38145 +; For C-Kermit Version: 8.0
38146 +;
38147 +; Filename:
38148 +;   .kermrc     (UNIX, OS-9, Aegis)
38149 +;   CKERMIT.INI (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga)
38150 +;   ckermit.ini (Stratus VOS)
38151 +;   K95.INI     (Kermit 95 -- but this big version is not used there)
38152 +;   K2.INI      (Kermit/2  -- but ditto)
38153 +;
38154 +; Authors:
38155 +;   Frank da Cruz, Christine M. Gianone, Jeffrey Altman
38156 +;   Columbia University, New York, NY 10025-7799, USA
38157 +;
38158 +; This is the standard and recommended C-Kermit 8.0 initialization file.  To
38159 +; override settings or definitions made in this file, to add new settings or
38160 +; definitions, or to make any other desired customizations, create a separate,
38161 +; personal customization file called:
38162 +;
38163 +;   .mykermrc     (UNIX, OS-9, Aegis, BeBox, Plan 9)
38164 +;   CKERMOD.INI   (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga)
38165 +;   ckermod.ini   (VOS)
38166 +;
38167 +; You can also define the customization filename in an environment
38168 +; variable (logical name in VMS), CKERMOD, which takes precedence over
38169 +; the names shown above.
38170 +;
38171 +; WHAT THIS FILE DOES:
38172 +;
38173 +; . Defines your default dialing directory name:
38174 +;     .kdd for UNIX, OS-9 and Aegis; CKERMIT.KDD for other operating systems.
38175 +;        You can override this with the environment variable K_DIAL_DIRECTORY
38176 +; . Defines your default network directory name:
38177 +;     .knd for UNIX, OS-9 and Aegis; CKERMIT.KND for other operating systems.
38178 +;        You can override this with the environment variable K_NET_DIRECTORY
38179 +; . Defines your default services directory name:
38180 +;     .ksd for UNIX, OS-9 and Aegis; CKERMIT.KSD for other operating systems.
38181 +;        You can override this with environment variable K_SERVICE_DIRECTORY.
38182 +; . Defines your customization file name (name given above)
38183 +; . Performs system-dependent setups for UNIX, VMS, OS/2, etc.
38184 +; . Defines VTPRINT macros for use with K95, MS-DOS Kermit, etc.
38185 +; . If you have a services directory, all the macros needed to use it are
38186 +;     defined.  If you don't have a services directory, the macros are not
38187 +;     defined and Kermit starts faster.
38188 +; . Executes your personal customization file, if you have one.
38189 +;   NOTE: Your customization file is NOT executed by Kermit itself; it is
38190 +;   executed by this file.
38191 +;
38192 +; In UNIX, with C-Kermit 7.0 and later, you can store this file with a name
38193 +; other than .kermrc, and it will not be executed automatically, but, if you
38194 +; give this file execute permission, you can execute directly because of the
38195 +; "kerbang line" at the top, whenever you want all of the above actions to
38196 +; occur.  The kerbang line must reflect the actual full path of the Kermit
38197 +; 7.0-or-later executable.
38198 +;
38199 +; C-Kermit 6.0 is documented in the book "Using C-Kermit", 2nd Edition,
38200 +; by Frank da Cruz and Christine M. Gianone, 1997, Digital Press /
38201 +; Butterworth-Heinemann, ISBN 1-55558-164-1.  New features of subsequent
38202 +; versions are documented at the Kermit website:
38203 +; http://www.columbia.edu/kermit/
38204 +;
38205 +; Everything after this point depends on the script programming language.
38206 +; The CHECK command terminates this command file immediately if the script
38207 +; programming language (IF command) is not configured.
38208 +;
38209 +set take error on              ; This makes CHECK quit if no script language.
38210 +check if                       ; Do we have an IF command?  If not, quit now.
38211 +set take error off             ; Back to normal.
38212 +
38213 +local _sd _servicedir _xp       ; Declare local variables.
38214 +
38215 +COMMENT - C-Kermit version 6.0 or later required.
38216 +;
38217 +
38218 +asg _xp \v(xprogram)
38219 +if not def _xp asg _xp \v(program)
38220 +if not equal "\m(_xp)" "C-Kermit" -
38221 +  stop 1 \v(cmdfile): This initialization file is only for C-Kermit.
38222 +echo Executing \v(cmdfile) for \v(system)...
38223 +if < \v(version) 60000 -
38224 +  stop 1 \v(cmdfile): C-Kermit 6.0 or later required.
38225 +
38226 +forward \v(system)             ; First do system-dependent items...
38227 +
38228 +:unknown                       ; Should not happen
38229 +Stop 1 Error: System type unknown!
38230 +
38231 +:Aegis                         ; Apollo Aegis and
38232 +:UNIX                          ; UNIX, all versions
38233 +asg _myinit -
38234 +  \v(home).mykermrc            ; Customization filename
38235 +if remote forward COMMON        ; Skip local-mode items if "-R"
38236 +asg _dialdir -
38237 +  \v(home).kdd                 ; C-Kermit dialing directory
38238 +asg _netdir -
38239 +  \v(home).knd                 ; C-Kermit network directory
38240 +asg _servicedir -
38241 +  \v(home).ksd                 ; C-Kermit services directory
38242 +forward COMMON                  ; End of UNIX section
38243 +
38244 +:OS9/68K                       ; OS-9
38245 +asg _myinit -
38246 +  \v(home).mykermrc            ; Customization filename
38247 +if remote forward COMMON
38248 +asg _dialdir -
38249 +  \v(home).kdd                 ; C-Kermit dialing directory
38250 +asg _netdir -
38251 +  \v(home).knd                 ; C-Kermit network directory
38252 +asg _servicedir -
38253 +  \v(home).ksd                 ; C-Kermit services directory
38254 +else set file display crt
38255 +forward COMMON                 ; End of OS-9 section
38256 +
38257 +:VMS                           ; VMS and OpenVMS
38258 +forward COMMON
38259 +
38260 +:OS/2                          ; Kermit 95
38261 +:WIN32
38262 +echo This initialization file is not for use with K95.
38263 +forward COMMON                  ; End of OS/2 section
38264 +
38265 +:AOS/VS                                ; Data General AOS/VS
38266 +set window 1                   ; Sliding windows don't work
38267 +set file char dg-international ; File character-set
38268 +set xfer char latin1           ; Transfer character-set
38269 +set file display crt            ; File transfer fisplay
38270 +def cli push                   ; Escape to CLI
38271 +def reset -                    ; Macro to reset DG DASHER terminal
38272 + run write [!ascii 236 306 301]
38273 +forward COMMON                  ; End of AOS/VS section
38274 +
38275 +:Amiga                         ; Commodore Amiga
38276 +def cls echo \27[H\27[2J       ; CLS command to clear the screen
38277 +set file char latin1           ; Use Latin Alphabet 1 for file transfer
38278 +set xfer char latin1           ; ...
38279 +forward COMMON                  ; End of Amiga section
38280 +
38281 +:Atari_ST                      ; Atari ST
38282 +def cls echo \27H\27J          ; Clear screen a`la VT52
38283 +set server display on          ; Show file xfer display in server mode too
38284 +set server timeout 15          ; Nonzero required for ^C interruption!
38285 +forward COMMON                  ; End of Atari ST section
38286 +
38287 +:Macintosh                     ; Apple Macintosh
38288 +set server display on          ; Show file xfer display in server mode too.
38289 +forward COMMON
38290 +
38291 +:Stratus_VOS                    ; Stratus VOS
38292 +asg _myinit \v(home)ckermod.ini
38293 +if remote forward COMMON
38294 +asg _dialdir \v(home)ckermit.kdd
38295 +asg _netdir \v(home)ckermit.knd
38296 +asg _servicedir \v(home)ckermit.ksd
38297 +forward COMMON                  ; End of Stratus VOS section
38298 +
38299 +:COMMON                                ; For all systems
38300 +
38301 +; Define macros that are useful when running C-Kermit in remote mode.
38302 +; These macros serve no purpose on local-mode-only versions such as
38303 +; OS/2, Macintosh, Amiga, and Atari ST Kermit, so we skip defining them
38304 +; for those systems.
38305 +;
38306 +if not = 0 \findex(\v(system),WIN32:OS/2:Macintosh:Amiga:Atari_ST) -
38307 +  forward files
38308 +
38309 +; VTPRINT macro.  Print a file on your PC's local printer.
38310 +
38311 +def VTPRINT echo \27[5i, type \%1, echo \27[4i
38312 +; or if your printer needs a formfeed to force the page out:
38313 +; def VTPRINT  def echo \27[5i, type \%1, echo \12\27[4i
38314 +
38315 +; Macros for host-initiated file transfer using APC:
38316 +;   NOT NEEDED ANY MORE because of autodownload/autoupload.
38317 +;   Remove the following FORWARD command to reinstate these definitions:
38318 +
38319 +:FILES
38320 +
38321 +; Get customization and directory file names.  Environment variables take
38322 +; precedence, so you do not have to edit this file to change these filenames.
38323 +;
38324 +if def \$(CKERMOD) assign _myinit \$(CKERMOD)
38325 +if not def _myinit assign _myinit \v(home)CKERMOD.INI
38326 +
38327 +if remote forward CUSTOM ; Skip all this if -R given on command line
38328 +
38329 +if def \$(K_NET_DIRECTORY) assign _netdir \$(K_NET_DIRECTORY)
38330 +if not def _netdir assign _netdir \v(home)CKERMIT.KND
38331 +
38332 +if def \$(K_DIAL_DIRECTORY) assign _dialdir \$(K_DIAL_DIRECTORY)
38333 +if not def _dialdir assign _dialdir \v(home)CKERMIT.KDD
38334 +
38335 +CHECK DIAL                     ; Is there a DIAL command?
38336 +xif fail {                     ; No.
38337 +    echo DIAL disabled
38338 +    forward CUSTOM
38339 +}
38340 +
38341 +CHECK NETWORK
38342 +xif success {
38343 +    xif exist \m(_netdir) {
38344 +       set net directory \m(_netdir)
38345 +       echo { Network directory is \m(_netdir) }
38346 +    }
38347 +}
38348 +
38349 +if eq "\v(name)" "telnet" forward CUSTOM
38350 +
38351 +xif exist \m(_dialdir) {
38352 +    set dial directory \m(_dialdir)
38353 +    echo { Dial directory is \m(_dialdir) }
38354 +}
38355 +
38356 +COMMENT - Services directory
38357 +
38358 +if def \$(K_SERVICE_DIRECTORY) assign _servicedir \$(K_SERVICE_DIRECTORY)
38359 +if not def _servicedir assign _servicedir \v(home)CKERMIT.KSD
38360 +
38361 +; If no services directory is found skip all the big macro definitions and
38362 +; go straight to the bottom, where we execute the customization file.
38363 +
38364 +if not exist \m(_servicedir) forward custom
38365 +
38366 +echo { Services directory is \m(_servicedir)}
38367 +
38368 +def MAX_SVCS 200               ; Adjust this if you have more entries
38369 +define _sd 0                   ; Assume no services directory
38370 +open read \m(_servicedir)      ; Try to open services directory file
38371 +xif success {
38372 +    declare \&d[\m(MAX_SVCS)]  ; It's open, declare directory array
38373 +    for \%i 1 \m(MAX_SVCS) 1 { ; Read the lines into the array
38374 +       read \&d[\%i]
38375 +       if fail break
38376 +    }
38377 +    close read
38378 +    xif > \%i  \m(MAX_SVCS) {
38379 +       echo Too many entries in services directory
38380 +       echo { Maximum is \m(MAX_SVCS).}
38381 +       echo { Change definition of MAX_SVCS in \v(cmdfile) to allow more. }
38382 +       echo { Services directory disabled.}
38383 +    } else {
38384 +        asg \&d[0] \feval(\%i - 1)
38385 +        define _sd 1
38386 +    }
38387 +}
38388 +
38389 +xif not \m(_sd) {
38390 +    def access echo { Services directory not available.}
38391 +    asg list \m(access)
38392 +} else {
38393 +    def FIND {
38394 +       set case off
38395 +       for \%i 1 \&d[0] 1 {
38396 +           if eq {\%1} {\fsubstr(\&d[\%i],1,\flen(\%1))} break
38397 +       }
38398 +       if not > \%i \&d[0] return \&d[\%i]
38399 +    }
38400 +    def LIST {
38401 +       xif > \v(argc) 1 {
38402 +           do find \%1
38403 +           if def \v(return) echo \v(return)
38404 +           else echo \%1: Not found
38405 +       } else {
38406 +           echo \&d[0] items in services directory:
38407 +           for \%i 1 \&d[0] 1 { echo \fcont(\&d[\%i]) }
38408 +       }
38409 +    }
38410 +    def SPLIT { asg _word1 \%1, asg _word2 \%2 }
38411 +    def DOACCESS {               ; (Used internally by ACCESS macro)
38412 +       do \%5 \%6 \%7 \%8 \%9   ; Do the connection macro
38413 +       if fail end 1
38414 +        split \%3                ; Get words from \%3
38415 +       asg \%3 \m(_word1)
38416 +       asg \%2 \m(_word2)
38417 +       do \%3 \%4 {\%1} \%2     ; Login macro, userid, password, prompt
38418 +    }
38419 +    def ACCESS {
38420 +       if not defined \%1 end 1 access what?        ; Check service
38421 +       do find \%1                                  ; Look it up
38422 +       if success doaccess {\%2} \v(return)         ; OK, try it
38423 +       else end 1 "\%1" not in services directory   ; Not found
38424 +       if fail end 1                                ; DOACCESS failed?
38425 +       xif eq \v(cmdlevel) 1 {
38426 +           echo
38427 +           echo ACCESS: Login succeeded - CONNECTing...
38428 +            show escape
38429 +            output \13
38430 +           connect /quietly
38431 +        }
38432 +    }
38433 +}
38434 +
38435 +:CONNECTION ; Macros for making connections
38436 +
38437 +COMMENT - SERIAL macro.  Arguments:
38438 +; \%1 = device name
38439 +; \%2 = speed
38440 +;
38441 +def SERIAL {
38442 +    if < \v(argc) 3                         ; All arguments given?
38443 +      end 1 Usage: SERIAL device speed      ; No.
38444 +    set line \%1                            ; OK, try to SET LINE.
38445 +    if failure -                            ; If this failed,
38446 +      end 1 Can't open device: \%1          ; print message and quit.
38447 +    set speed \%2                           ; Try to set the speed.
38448 +    if fail end 1 Unsupported speed: \%2    ; Failed.
38449 +    echo Connection successful.             ; Succeeded.
38450 +}
38451 +
38452 +COMMENT - NET macro.  Arguments:
38453 +; \%1 = network type
38454 +; \%2 = host name or address
38455 +;
38456 +def NET {
38457 +    if < \v(argc) 3 end 1 Usage: NET network host
38458 +    set network type \%1
38459 +    if fail end 1 unsupported network: \%1
38460 +    set login user                ; Don't send user ID.
38461 +    set host \%2
38462 +    if fail end 1 Can't reach host: \%2
38463 +    echo Connection successful.
38464 +}
38465 +
38466 +COMMENT - CALL macro.  Arguments:
38467 +;
38468 +; \%1 = modem type
38469 +; \%2 = device name
38470 +; \%3 = speed
38471 +; \%4 = phone number
38472 +;
38473 +def CALL {
38474 +    if < \v(argc) 5 -         ; All arguments present?
38475 +      end 1 Usage: CALL modem device speed number
38476 +    xif not equal {\v(modem)} {\%1} { ; Set modem type
38477 +        set modem \%1
38478 +        if fail end 1 unknown modem type: \%1
38479 +    }
38480 +    xif not equal {\v(line)} {\%2} { ; Communication device
38481 +        set line \%2
38482 +        if fail end 1 can't open device: \%2
38483 +    }
38484 +    xif not equal {\v(speed)} {\%3} { ; Communication speed
38485 +        set speed \%3
38486 +        if fail end 1 unsupported speed: \%3
38487 +    }
38488 +    dial \%4                  ; Dial the number
38489 +    if fail end 1 Can't place call: \%4
38490 +    end 0 Connection successful.
38491 +}
38492 +
38493 +COMMENT - TCPCALL macro.  Arguments:
38494 +;
38495 +; \%1 = server name:port
38496 +; \%2 = modem type
38497 +; \%3 = phone number
38498 +;
38499 +def TCPCALL {
38500 +    if < \v(argc) 4 -         ; All arguments present?
38501 +      end 1 Usage: TCPCALL server[:port] modem number
38502 +    set net type tcp/ip       ; Which network to use
38503 +    if fail end 1 unsupported network: tcp/ip
38504 +    set host \%1              ; Access server and port
38505 +    if fail end 1 can't access server \%1
38506 +    set modem \%2             ; Set modem type
38507 +    if fail end 1 unknown modem type: \%2
38508 +    dial \%3                  ; Dial the number
38509 +    if fail end 1 Can't place call: \%3
38510 +    end 0 Connection successful.
38511 +}
38512 +
38513 +COMMENT - SPRINT macro.  Arguments:
38514 +; \%1 = Service name or address
38515 +;
38516 +def SPRINT {
38517 +    if < \v(argc) 2 end 1 Usage: \%0 service
38518 +    set input timeout proceed
38519 +    output @D\13
38520 +    input 10 TERMINAL=
38521 +    if fail end 1 No terminal prompt
38522 +    out D1\13
38523 +    inp 10 @
38524 +    if fail end 1 No atsign prompt
38525 +    output c \%1\13
38526 +    input 10 CONNECTED
38527 +    if fail end 1 Can't access \%1 from SprintNet
38528 +}
38529 +
38530 +COMMENT - ULOGIN macro.  For logging into systems where user ID is required
38531 +; but there is no password.  Arguments:
38532 +; \%1 = UNIX user ID
38533 +;
38534 +define ULOGIN {
38535 +    if < \v(argc) 2 end 1 Usage: \%0 userid
38536 +    set input timeout proceed     ; Handle timeouts ourselves
38537 +    set case on                   ; Case is important in UNIX
38538 +    minput 5 login: Username: {User ID:} {User Name:}
38539 +    out \%1\13                    ; Send username, carriage return
38540 +    end 0
38541 +}
38542 +
38543 +COMMENT - VMSLOGIN macro.  Arguments:
38544 +; \%1 = VMS user ID
38545 +; \%2 = Password.  If password not supplied, it is prompted for.
38546 +; \%3 = System prompt.  If omitted a default is supplied.
38547 +;
38548 +define VMSLOGIN {
38549 +    if < \v(argc) 2 end 1 Usage: \%0 userid [ password [ prompt ] ]
38550 +    while not defined \%2 {
38551 +        askq \%2 { \%1's password: }
38552 +    }
38553 +    set parity none               ; Set communication parameters
38554 +    set duplex full
38555 +    set handshake none
38556 +    set input timeout proceed     ; Handle timeouts ourselves
38557 +    in 5 Username:                ; Is prompt already there?
38558 +    xif fail {                    ; No.
38559 +        for \%i 1 3 1 {           ; Try 3 times to get it.
38560 +            out \13               ; Send carriage return
38561 +            in 5 Username:        ; Look for prompt
38562 +            if success break      ; Success, go log in
38563 +        }
38564 +        if > \%i 3 end 1 No Username prompt
38565 +    }
38566 +    out \%1\13                    ; Send username, carriage return
38567 +    inp 5 Password:               ; Wait 5 sec for this prompt
38568 +    if fail end 1 No password prompt
38569 +    pause                         ; Wait a sec
38570 +    out \%2\13                    ; Send password
38571 +    xif not emulation {           ; No emulator built in?
38572 +        set input echo off        ; Protect terminal from this
38573 +        minput 10 {\27Z} {\27[c} {\27[0c} ; Get terminal ID query
38574 +        xif success {                     ; Got one
38575 +            output \27[\?1c               ; Send VT100 terminal ID
38576 +            in 2 \27[6n                   ; Screen dimension query?
38577 +            if succ out \27[\v(rows);\v(cols)R ; Send dimensions
38578 +        }
38579 +        set input echo on         ; Echo input again
38580 +    }
38581 +    if not def \%3 -              ; If we were not given a prompt
38582 +      asg \%3 {\v(prompt)}        ; use the SET LOGIN PROMPT value
38583 +    if not def \%3 -              ; If we still don't have a prompt
38584 +      asg \%3 {\13$\32}           ; use this one as the default
38585 +    reinp 0 \%3                   ; Did we INPUT the prompt already?
38586 +    if fail inp 60 \%3            ; No, look now.
38587 +    if fail end 1
38588 +}
38589 +
38590 +COMMENT - UNIXLOGIN macro.  Arguments:
38591 +; \%1 = UNIX user ID
38592 +; \%2 = Password.  If password not supplied, it is prompted for.
38593 +; \%3 = System prompt.  If omitted a default is supplied.
38594 +;
38595 +define UNIXLOGIN {
38596 +    local \%m \%i
38597 +    if < \v(argc) 2 -
38598 +      end 1 Usage: \%0 userid [ password [ prompt ] ]
38599 +    while not defined \%2 {
38600 +        askq \%2 { \%1's password: }
38601 +    }
38602 +    set input echo on
38603 +    set parity none               ; Set communication parameters.
38604 +    set duplex full
38605 +    set handshake none
38606 +    set input timeout proceed     ; Handle timeouts ourselves
38607 +    set case on                   ; Case is important in UNIX
38608 +    def \%m 10                    ; Waiting time for INPUT
38609 +    for \%i 1 5 1 {
38610 +        minput \%m login: {ssword:} {Password for \%1:}
38611 +       if success break
38612 +       output \B\13
38613 +        \%m ::= 6-\%1
38614 +    }
38615 +    if > \%i 5 end 1 {No response from host}
38616 +    xif = \v(minput) 1 {         ; Have username prompt
38617 +       output \%1\13             ; Send username
38618 +        minput 5 {ssword:} {ssword for \%1:} ; Wait for password prompt
38619 +       if fail end 1 {No password prompt}
38620 +    }
38621 +    pause                         ; Wait a sec
38622 +    out \%2\13                    ; Send password
38623 +    if not def \%3 -              ; If we were not given a prompt
38624 +      asg \%3 {\v(prompt)}        ; use the SET LOGIN PROMPT value
38625 +    if not def \%3 -              ; If we still don't have a prompt
38626 +      asg \%3 {\10$ }             ; use this one as the default
38627 +    reinp 0 \%3                   ; Did we INPUT the prompt already?
38628 +    if fail inp 60 \%3            ; No, look now.
38629 +    if fail end 1
38630 +}
38631 +
38632 +COMMENT - VMLINELOGIN macro.  Arguments:
38633 +; \%1 = User ID
38634 +; \%2 = Password
38635 +;
38636 +define VMLINELOGIN {
38637 +    if < \v(argc) 2 -
38638 +      end 1 Usage: \%0 userid [ password ]
38639 +    while not defined \%2 {
38640 +        askq \%2 { \%1's password: }
38641 +    }
38642 +    set parity mark               ; Set communication parameters
38643 +    set flow none
38644 +    set handshake xon
38645 +    set duplex half
38646 +    set input timeout quit        ; Don't bother with IF FAILURE
38647 +    input 10 BREAK KEY            ; Look for BREAK KEY prompt
38648 +    pause 1                       ; Wait a second
38649 +    output \B                     ; Send BREAK
38650 +    input 10 .\17, output logon \%1\13    ; Now log in
38651 +    input 10 .\17, output \%2\13          ; Send password
38652 +    input 10 .\17, output \13             ; Send carriage return
38653 +    input 10 .\17, output \13             ; Send another one
38654 +    end 0
38655 +}
38656 +
38657 +COMMENT - VMFULLOGIN macro.  Arguments:
38658 +; \%1 = User ID
38659 +; \%2 = Password
38660 +;
38661 +define VMFULLOGIN {
38662 +    if < \v(argc) 2 -
38663 +      end 1 Usage: \%0 userid [ password ]
38664 +    while not defined \%2 {
38665 +        askq \%2 { \%1's password: }
38666 +    }
38667 +    set input timeout quit      ; Quit if INPUT fails
38668 +    set parity even             ; Set communication parameters
38669 +    set duplex full
38670 +    set handshake none
38671 +    set flow xon/xoff
38672 +    out \13                     ; Send carriage return
38673 +    inp 5 TERMINAL TYPE:        ; Get terminal-type prompt
38674 +    out vt-100\13               ; Just send "vt-100"
38675 +    inp 20 RUNNING              ; Get RUNNING message
38676 +    pau 1                       ; Wait one second
38677 +    out \%1\9\%2\13             ; Send user ID, tab, password
38678 +    out \13\13                  ; Two more carriage returns
38679 +    end 0
38680 +}
38681 +
38682 +COMMENT - CISLOGIN macro.  Arguments:
38683 +; \%1 = CompuServe User ID
38684 +; \%2 = Password
38685 +; \%3 = Prompt
38686 +;
38687 +define CISLOGIN {
38688 +    if < \v(argc) 2 -
38689 +      end 1 Usage: \%0 userid [ password [ prompt ] ]
38690 +    while not defined \%2 {
38691 +        askq \%2 { \%1's password: }
38692 +    }
38693 +    set terminal bytesize 7     ; No 8-bit characters
38694 +    set input timeout quit      ; Skip the IF FAILURE's
38695 +    output \13                  ; Send initial carriage return
38696 +    input 5 Host Name:          ; Look for Host Name prompt
38697 +    output cis\13               ; Send "cis" and carriage return
38698 +    input 5 User ID:            ; Look for User ID prompt
38699 +    output \%1\13               ; Send ID and carriage return
38700 +    input Password:             ; Look for Password prompt
38701 +    output \%2\13               ; Send password and CR
38702 +    if not def \%3 asg \%3 \v(prompt)
38703 +    if not def \%3 asg \%3 {CompuServe Information Service}
38704 +    input 30 \%3
38705 +    end 0
38706 +}
38707 +
38708 +COMMENT - DOWLOGIN macro.  Arguments:
38709 +; \%1 = Dow Jones Password
38710 +;
38711 +define DOWLOGIN {
38712 +    while not defined \%1 {              ; Get password
38713 +        askq \%1 { Dow Jones password: }
38714 +    }
38715 +    set input timeout proceed
38716 +    input 20 SERVICE PLEASE\?\?\?\?      ; Look for Dow prompt
38717 +    if fail end 1 No service prompt
38718 +    out djnr\13                          ; Select DJNR
38719 +    input 10 @@@@@@@@                        ; Get password prompt
38720 +    if fail end 1 No password prompt
38721 +    pause 1                              ; Wait a second, then...
38722 +    output \%1\13                        ; send password and CR
38723 +    input 30 ENTER QUERY                 ; Get DJNR query prompt
38724 +    if fail end 1 No main query prompt
38725 +    pause 1
38726 +}
38727 +
38728 +COMMENT - DJNRSPRINT macro: Log in to Dow Jones via SprintNet.
38729 +;
38730 +def djnrsprint sprint dow, if success dowlogin
38731 +
38732 +COMMENT - NOLOGIN macro.  Does nothing.  Use when login not required.
38733 +;
38734 +def nologin comment
38735 +
38736 +:CUSTOM ; Customization file
38737 +
38738 +; In VMS and OpenVMS, allow for system-wide site customizations
38739 +
38740 +xif equal "\v(system)" "VMS" {
38741 +    xif exist CKERMIT_INI:CKERMIT.SYS {
38742 +       echo Executing CKERMIT_INI:CKERMIT.SYS
38743 +       take CKERMIT_INI:CKERMIT.SYS
38744 +    }
38745 +}
38746 +
38747 +; Execute user's personal customization file
38748 +
38749 +xif exist \m(_myinit)  {               ; If it exists,
38750 +    echo Executing \m(_myinit)...      ; print message,
38751 +    take \m(_myinit)                   ; and TAKE the file.
38752 +}
38753 +
38754 +; Finish up with traditional greeting.
38755 +
38756 +if < \v(ntime) 43200 echo Good Morning!
38757 +  else if < \v(ntime) 61200 echo Good Afternoon!
38758 +  else echo Good Evening.
38759 +
38760 +End ; of C-Kermit 8.0 initialization file.
38761 --- /dev/null
38762 +++ ckermit-301/ckermit90.txt
38763 @@ -0,0 +1,2125 @@
38764 +
38765 +   [1]The Columbia Crown The Kermit Project | Columbia University
38766 +   612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
38767 +   ...since 1981
38768 +   [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
38769 +   [10]Support
38770 +
38771 +          [11]Table of platforms   [12]Book: Using C-Kermit   [13]Download
38772 +                                                              C-Kermit 9.0
38773 +
38774 +C-Kermit 9.0 Update Notes
38775 +
38776 +     * [14]Large Files
38777 +     * [15]How to Test Large-File Transfer
38778 +     * [16]Arithmetic with Large Integers
38779 +     * [17]FORCE-3 Packet Protocol
38780 +     * [18]Variable Evaluation
38781 +
38782 +     * [19]The RENAME Command You Always Wanted
38783 +     * [20]Other New Features
38784 +     * [21]Incompatibilities
38785 +     * [22]What's Not In C-Kermit 9.0
38786 +     * [23]And a Loose End
38787 +
38788 +     * [24]Demonstration: Secure POP mail fetcher
38789 +     * [25]Demonstration: HP Switch Configuration Backup
38790 +     * [26]Demonstration: HP iLO Blade Configuration
38791 +     * [27]Demonstration: IBM/Rolm/Siemens CBX Management
38792 +     * [28]Demonstration: CSV and TSV Files
38793 +     * [29]Demonstration Scripts for Webmasters
38794 +
38795 +   This is the third supplement to [30]Using C-Kermit, Second Edition. I
38796 +   apologize for the scattered nature of the information and I hope I can
38797 +   organize it and gather it all into one place for easy and definitive
38798 +   reference some day. It's a big job and it depends on the demand. For
38799 +   the time being the definitive reference and introduction is the book
38800 +   (which is now available also in a [31]Kindle Edition), plus the
38801 +   [32]C-Kermit 7.0 update, [33]C-Kermit 8.0 update, and now this one.
38802 +   Plus tons of other web pages on this site, sample script programs, and
38803 +   so on.
38804 +
38805 +   In version 6.0, C-Kermit was a pretty powerful and flexible
38806 +   communication program with scripting capabilities. By version 9.0, I'd
38807 +   like to think of it more as a scripting language with built-in
38808 +   communications. You can get an idea of the kinds of programs you can
38809 +   write in Kermit language [34]here. You can develop programs quickly
38810 +   because it's an interactive program, not a compiler. The scripting
38811 +   language is the command language. Kind of like the Unix shell but
38812 +   "somewhat" less cryptic, including concepts not only from C but from
38813 +   PL/I, Snobol, LISP, and Smalltalk. The language itself is built upon
38814 +   the command language of the much-loved [35]DECSYSTEM-20 from the 1970s
38815 +   and 80s, the Clipper Ship of the Text Era. (Text is not a bad word.
38816 +   Those of us who can touch-type and who are proficient in text-based
38817 +   computing environments like Unix shell or VMS DCL are likely to be
38818 +   orders of magnitude more productive than users of GUIs.)
38819 +
38820 +     - Frank da Cruz   [36]fdc@columbia.edu
38821 +
38822 +What's New in General
38823 +
38824 +   Very briefly, the major items:
38825 +     * [37]Open Source license.
38826 +     * [38]64-bit file access and transfer and 64-bit integer arithmetic
38827 +       on most common platforms.
38828 +     * Support for recent releases of Linux, Mac OS X, *BSD, etc ([39]see
38829 +       table).
38830 +     * Support for newer OpenSSL releases up to and including 1.0.0d
38831 +       ([40]see table).
38832 +     * [41]Strengthened error checking for file transfer under extremely
38833 +       harsh conditions.
38834 +     * [42]Simplified semantics for variables used in scripts.
38835 +     * Super-handy and useful [43]extensions to the RENAME command.
38836 +     * Many other scripting improvements including support for reading and
38837 +       writing [44]CSV and TSV files.
38838 +     * [45]MIME character-set names are now recognized.
38839 +     * Improved logging and debugging (see demo [46]here).
38840 +     * Lots more described or listed below, and [47]here.
38841 +
38842 +Open Source License
38843 +
38844 +   C-Kermit 9.0 has the [48]Revised 3-Clause BSD License, an open source
38845 +   license approved by OSI, the [49]Open Source Initiative.
38846 +
38847 +Large Files
38848 +
38849 +   Kermit is, first and foremost, a file-transfer program. One might
38850 +   expect it to be able to transfer any kind of file, but that has been
38851 +   decreasingly the case as file sizes began to cross the 2 gigabyte
38852 +   threshold.
38853 +
38854 +   The biggest change since C-Kermit 8.0.211 is support for large files on
38855 +   platforms that support them. A "large file" is one whose size is
38856 +   greater than 2^31-1 (2,147,483,647) bytes (2GB-1); that is, one whose
38857 +   size requires more than 31 bits to represent. Before now, Kermit was
38858 +   able to access such files only on 100% 64-bit platforms such as Digital
38859 +   Unix, later known as Tru64 Unix. In the new release, Kermit takes
38860 +   advantage of the X/Open Single UNIX Specification Version 2 (UNIX 98)
38861 +   Large File Support (LFS) specification, which allows 32-bit platforms
38862 +   to create, access, and manage files larger than 2GB.
38863 +
38864 +   Accommodating large files required code changes in many modules,
38865 +   affecting not only file transfer, but also file management functions
38866 +   from directory listings to local file manipulation, plus the user
38867 +   interface itself to allow entry and display of large numbers. All this
38868 +   had to be done in a way that would not affect pure 32-bit builds on
38869 +   platforms that do not support large files. Large file support is
38870 +   summarized in the [50]Table of Platforms; entries in Yellow (32-bit
38871 +   builds that support 64-bit integers) and Green (64-bit builds) support
38872 +   large files.
38873 +
38874 +   Note that VMS C-Kermit and Kermit 95 for Windows have always been able
38875 +   to transfer large files. However their user interface used 32-bit
38876 +   integers for statistics and the file transfer display. In C-Kermit 9.0
38877 +   Alpha.03, VMS C-Kermit on 64-bit platforms (Alpha and Itanium) should
38878 +   now give correct statistics and progress displays. (We'll see about
38879 +   Kermit 95 later.)
38880 +
38881 +How to Test Large-File Transfer
38882 +
38883 +   Several methods are available for testing large-file transfers:
38884 +     * By transferring a real file that is more than 2147483648 bytes long
38885 +       (a file whose length requires more than 31 bits to express); or to
38886 +       be totally sure, that is longer than 4294967296 bytes (32 bits or
38887 +       more). Or to be double super sure, longer than 8589934592 (33
38888 +       bits).
38889 +     * If you don't have such a file or there is not sufficient disk space
38890 +       for such a file, you can create a special kind of file that takes
38891 +       up one block on the disk but appears to be 4.3GB long by compiling
38892 +       and running [51]THIS C PROGRAM on Linux, Solaris, HP-UX, or other
38893 +       Unix platform that supports large files. Kermit or FTP or any other
38894 +       file transfer program will transfer the result (BIGFILE) in such a
38895 +       way as to actually put 4.3GB (or other desired size; see source) on
38896 +       the wire.
38897 +     * You can use Kermit's CALIBRATE feature to transfer a large file
38898 +       that doesn't exist. At the receiver, use RECEIVE /CALIBRATE. At the
38899 +       sender, use SEND /CALIBRATE:length, e.g.:
38900 +
38901 +     (At remote kermit...)
38902 +     $ kermit -Y
38903 +     C-Kermit> receive /calibrate
38904 +     (Return to local kermit...)
38905 +     Ctrl-\c
38906 +     C-Kermit> send /calibrate:4300000000
38907 +       This sends a simulated file 4.3GB in length, that does not exist on
38908 +       the sender and will not take up any disk space on the receiver.
38909 +       SEND /CALIBRATE: accepts big numbers only in Kermit versions that
38910 +       support them (this does not include Kermit 95 on Windows). This
38911 +       method tests only Kermit's ability to express and understand large
38912 +       file sizes, but does not test Kermit's file-system interface, since
38913 +       no files are involved.
38914 +
38915 +Arithmetic with Large Integers
38916 +
38917 +   Because large file support requires the availability of a 64-bit signed
38918 +   integer data type, other aspects of C-Kermit were adapted to use it
38919 +   too, most notably Kermit's algebraic expression evaluator and its
38920 +   [52]S-Expression interpreter, on all platforms that support large files
38921 +   (those listed as 64 or 32/64 in the Word column of the [53]table). In
38922 +   fact, every Kermit command that parses a number in any field can now
38923 +   parse a large number on those platforms.
38924 +
38925 +   S-Expressions can now be forced to operate with integers only, without
38926 +   floating-point conversion or having to explicitly truncate each result;
38927 +   as an example. see the revised [54]Easter date calculation script.
38928 +
38929 +FORCE-3 Packet Protocol
38930 +
38931 +   The Kermit protocol has proven itself over the past 30 years to be
38932 +   robust in terms of surviving harsh transmission environments and
38933 +   delivering the data correctly and completely. In these times of
38934 +   Internet everywhere and error-correcting modems in the few places where
38935 +   the Internet isn't, few people even recall the kinds of difficult
38936 +   conditions that were common when the Kermit protocol was first
38937 +   developed: noisy telephone lines, serial interfaces that drop
38938 +   characters, lack of transparency to control or 8-bit characters,
38939 +   absence of flow control, "bare" modems without error correction.
38940 +
38941 +   But the Internet is not everywhere, and not all modems are
38942 +   error-correcting. Perhaps the most difficult trial so far for Kermit or
38943 +   any other protocol is the [55]EM-APEX project, in which floats are
38944 +   dropped into the ocean from an aircraft into the path of a hurricane;
38945 +   these floats dive into the water measuring current, temperature, and
38946 +   salinity at different depths and then surfacing to phone home, sending
38947 +   the data to land stations using Kermit protocol over
38948 +   non-error-correcting 300bps [56]Iridium satellite modems, with high
38949 +   seas and winds battering the floats and heavy ([57]sometimes
38950 +   electrical) storms between the modem and the satellite.
38951 +
38952 +   Because of the transmission speed and long distances involved, the
38953 +   transfers were very slow. The Kermit software in the floats is
38954 +   [58]Embedded Kermit, which did not implement sliding windows, which
38955 +   would have sped up the flow considerably. John Dunlap, engineer at the
38956 +   University of Washington's Applied Physics Laboratory, undertook the
38957 +   task of adding sliding windows to E-Kermit. For testing, he rigged up a
38958 +   [59]simulator in which Kermit transfers take place over a connection
38959 +   with different amounts of noise and delay. He found that occasionally,
38960 +   a transfer would appear to succeed, but the received file would be
38961 +   corrupt.
38962 +
38963 +   According to the Kermit protocol definition, the first packet always
38964 +   has block-check type 1, a 6-bit checksum, which is the only block check
38965 +   type that all Kermit implementations are required to support; thus any
38966 +   Kermit partner can process this packet. This packet itself can
38967 +   negotiate a higher level of checking, such that subsequent packets have
38968 +   (say) block-check type 3, a 16-bit cyclic redundancy check (CRC)
38969 +   encoded as three printable 7-bit ASCII characters. The 16-bit CRC can
38970 +   catch all errors of certain kinds (single-bit, double-bit, bursts of 16
38971 +   bits or less), and more than 99.9984741210937% of all other possible
38972 +   errors.
38973 +
38974 +   John's simulations revealed that file corruption could occur undetected
38975 +   when the initial packet was corrupted in such a way that a parameter or
38976 +   capability byte was changed and the checksum also changed to make the
38977 +   packet appear to be correct, thus allowing the transfer to proceed with
38978 +   the two Kermit partners out of sync as to packet encoding and
38979 +   interpretation (the chances of two such errors producing a seemingly
38980 +   valid packet are about 1 in 6000 when using the 6-bit checksum). For
38981 +   example the compression technique might be misnegotiated and then the
38982 +   receiver might store incoming data without decompressing it.
38983 +
38984 +   The solution is a new option, selected by:
38985 +
38986 +     BLOCK-CHECK TYPE 5
38987 +
38988 +   to require a type 3 block check (16-bit CRC) on every packet, including
38989 +   the initial ones, thus reducing the probability of a misnegotiation by
38990 +   many orders of magnitude. THIS PARAMETER CAN NOT BE NEGOTIATED. Each
38991 +   Kermit program must be given the "set block 5" command prior to
38992 +   transfer. That's because normally every Kermit program expects the
38993 +   first packet to have a 6-bit checksum, and if the first packet has a
38994 +   3-byte, 16-bit CRC, the packet receiver will think it is corrupted.
38995 +
38996 +   In practice, however, it is possible to code the packet receiver
38997 +   "cheat" by reading the packet data before verifying the block check.
38998 +   Thus when the receiver is C-Kermit 9.0 Beta.01 or later or E-Kermit 1.7
38999 +   or later, it is only necessary to give the "set block 5" command to the
39000 +   file sender, and the receiver will check for a FORCE-3 first packet. If
39001 +   the receiver does not support this feature, however, the the initial
39002 +   packet will be be rejected (after several retries) and the file
39003 +   transfer will not take place. There is no attempt to "back off" to
39004 +   normal behavior.
39005 +
39006 +   CAPTION: Table 4. Kermit Protocol Packet Block Check Types
39007 +
39008 +   Type Command Bytes Status Explanation
39009 +   1 SET BLOCK 1 1 Required in all Kermit implementations. Negotiated.
39010 +   6-bit checksum, suitable for good connections.
39011 +   2 SET BLOCK 2 2 Optional, negotiated. 12-bit checksum. 64 times
39012 +   stronger than type 1.
39013 +   3 SET BLOCK 3 3 Optional, negotiated. 16-bit CRC.
39014 +   BLANK-FREE-2 SET BLOCK 4 2 Optional, negotiated. 12-bit checksum, two
39015 +   nonblank bytes.
39016 +   FORCE-3 SET BLOCK 5 3 Optional, not negotiated. 16-bit CRC forced all
39017 +   packets.
39018 +
39019 +   [60]E-Kermit 1.7
39020 +
39021 +Variable Evaluation
39022 +
39023 +     Does the strange behavior of Kermit's \%x variables puzzle or annoy
39024 +     you?
39025 +
39026 +   Kermit software development has been a collaborative project over the
39027 +   years, with contributions coming in from almost every country and every
39028 +   sector of the economy - academic, corporate, government. Thus not all
39029 +   versions, and not all features of a given version, are a product of
39030 +   systematic design.
39031 +
39032 +   One example was the introduction of variables for text substitution,
39033 +   first in a version of MS-DOS Kermit that was sent in by someone
39034 +   somewhere (I could look it up, but no time...) Although the design of
39035 +   the notation for variable names (table below) is mine, the underlying
39036 +   code was contributed. In that code there was only one kind of variable,
39037 +   and if I recall correctly the variable name was a backslash followed by
39038 +   a single letter, for example \a, \b, etc. The contributed code
39039 +   evaluated these variables recursively, meaning if the definition of a
39040 +   variable contained variable references, then these were resolved when
39041 +   dererencing the variable, and the process would continue as deep down
39042 +   as necessary to resolve the thing fully.
39043 +
39044 +   This was sometimes handy, but it had one severe drawback: There was no
39045 +   way to use variables in a straightforward way to represent strings that
39046 +   contained literal backslashes; for example, DOS or Windows pathnames.
39047 +   This gave rise to all kinds of quoting rules and conventions (e.g.
39048 +   doubling backslashes or forcing single-level evaluation with
39049 +   \\fcontents()), and also to the introduction of other kinds of
39050 +   variables that were evaluated one level deep, rather than recursively.
39051 +
39052 +   To accommodate coexistence of different kinds of variables as well as
39053 +   "escape sequences" for representing control and 8-bit characters, the
39054 +   syntax for variable names was extended to include three elements: the
39055 +   leading backslash, then a single character indicating the type of
39056 +   variable, and then the name of the variable in a format corresponding
39057 +   to the type designator, as shown in this somewhat simplified table:
39058 +
39059 +   CAPTION: Table 1. Variable-name Syntax in Kermit
39060 +
39061 +   Notation Meaning
39062 +   \000 - \255 8-bit character constant (decimal)
39063 +   \d000 - \d255 Alternative notation for 8-bit character (byte) constant
39064 +   (decimal)
39065 +   \o000 - \o377 8-bit character constant (octal)
39066 +   \x00 - \xff 8-bit character constant (hexadecimal)
39067 +   \%a - \%z Scalar variable, evaluated recursively.
39068 +   \%0 - \%9 Macro argument, scalar, evaluated recursively.
39069 +   \&a - \%& Array name
39070 +   \&a[x] Array reference, evaluated recursively (x is any constant or
39071 +   variable)
39072 +   \v(name) Built-in scalar variable, evaluated one level deep.
39073 +   \m(name) User-defined scalar variable, evaluated one level deep.
39074 +   \$(name) An environment variable, evaluated one level deep.
39075 +   \s(name[n:m]) Compact substring notation, evaluated one level deep.
39076 +   \fname(args...)) Built-in function with zero or more arguments.
39077 +   \\ Literal backslash
39078 +   \N OUTPUT comand only: NUL, ASCII 0
39079 +   \B OUTPUT comand only: BREAK
39080 +   \L OUTPUT comand only: Long BREAK
39081 +
39082 +   Variable names in Kermit are case-independent. The simplifications in
39083 +   the table are that the notation for decimal and octal bytes can have
39084 +   from one to three digits, and can include braces to separate them from
39085 +   text digits, e.g. \7, \{123}, \o{50}. Hex bytes too, except they must
39086 +   always have exactly two hex digits, 0-9a-f. Array indices must be, or
39087 +   must evaluate to, numbers (floating point numbers are truncated).
39088 +   Associative arrays are also available (dynamic arrays with arbitrary
39089 +   text as subscript), but they are really just a variation on \m()
39090 +   variables (read about associative arrays [61]here). Also, there are
39091 +   some alternative notations for compact substring notation.
39092 +
39093 +   We didn't want to have lots of "distinguished" characters, as the UNIX
39094 +   shell does; one is enough, clarity over brevity. Although the notation
39095 +   can be a bit cumbersome, we can use the \m(name) form to circumvent the
39096 +   overevaluation in most contexts. But macro arguments are always
39097 +   assigned to the \%0-9 variables, and thus always evaluated recursively,
39098 +   making it difficult and confusing to pass (e.g.) Windows pathnames as
39099 +   arguments to macros. The same is true for array elements, especially in
39100 +   contexts where they are used to return results from built-in functions
39101 +   (for example, \fsplit() used to return the elements of a
39102 +   [62]comma-separated value list if any of the values contained
39103 +   backslashes). An even worse scenario is when macro arguments are passed
39104 +   from one macro to another; for some graphic illustrations see
39105 +   [63]Taming the Wild Backslash - Part Deux from the [64]C-Kermit 7.0
39106 +   Update Notes.
39107 +
39108 +   We can't just change how variables are evaluated because that would
39109 +   break existing scripts. But we can always add Yet Another SET Command:
39110 +
39111 +     SET COMMAND VARIABLE-EVALUATION { RECURSIVE, SIMPLE }
39112 +
39113 +   This applies only to \%a-z and \%0-9 variables and to \&a-z[] arrays
39114 +   (since all other kinds of variables are evaluated only one level deep).
39115 +   The default, of course, for backwards compatibility, is RECURSIVE.
39116 +   SIMPLE forces the evaluation of these variables to return their literal
39117 +   contents, without further evaluation:
39118 +
39119 +     * An exception is made in the case of array subscripts, because
39120 +       changing how they are evaluated could break a lot of scripts, and
39121 +       anyway there should never be any harm in evaluating them
39122 +       recursively because their final value is always (or should be)
39123 +       numeric, not some string that might contain backslashes.
39124 +     * The VARIABLE-EVALUTION setting is on the command stack. Thus you
39125 +       can give this command in a macro, command file, or user-defined
39126 +       function without affecting the calling environment.
39127 +     * The new \frecurse() function forces recursive evaluation of its
39128 +       argument regardless of the VARIABLE-EVALUATION setting. The
39129 +       argument can be any string (or nothing at all); all the variables
39130 +       in the string, even \m() ones, are evaluated recursively:
39131 +
39132 +def \%a 1 \%b 3
39133 +def \%b 2
39134 +def xx easy as \%a
39135 +show mac xx
39136 +echo \frecurse(\m(xx))
39137 +easy as 1 2 3
39138 +echo \frecurse(it's as easy as \m(xx))
39139 +it's as easy as easy as 1 2 3
39140 +
39141 +     * The new \v(vareval) built-in variable contains the current setting
39142 +       (recursive or simple) at the current command-stack level.
39143 +
39144 +   Here's a short script for illustration:
39145 +
39146 +define path c:\users\fdc\somefile.txt
39147 +define test1 {        # Normal recursive argument evaluation
39148 +  echo \%0: arg=\%1
39149 +}
39150 +define test2 {        # Simple argument evaluation
39151 +  set var simple
39152 +  echo \%0: arg=\%1
39153 +}
39154 +test1 \m(path)
39155 +test2 \m(path)
39156 +exit
39157 +
39158 +   And here's the result:
39159 +
39160 +?<ERROR:NO_SUCH_FUNCTION:\fdc\somefile.txt()>
39161 +test2: arg=c:\users\fdc\somefile.txt
39162 +
39163 +   The first line might seem surprising, but under the normal rules (see
39164 +   table above) \f indicates a function call, with the letters following
39165 +   the 'f' being the name of the function. But there is no function by
39166 +   that name... and if there were, you probably didn't intend to call it!
39167 +
39168 +   SET COMMAND VARIABLE-EVALUATION SIMPLE has no effect on constants, only
39169 +   on variables. Note how \m(path) is defined. The DEFINE command assigns
39170 +   the literal value of its argument to the named variable (see Table 3
39171 +   below), thus in this case no special syntax is needed. But in other
39172 +   contexts, you must double the backslashes or use the \fliteral()
39173 +   function to use literal backslashes in data:
39174 +
39175 +test2 c:\\users\\fdc\\somefile.txt
39176 +test2 \fliteral(c:\users\fdc\somefile.txt)
39177 +
39178 +   C-Kermit 9.0 adds a new notation for \fliteral() which also has certain
39179 +   advantages over it: \q(string)
39180 +   :
39181 +
39182 +test2 \q(c:\users\fdc\somefile.txt)
39183 +
39184 +   Since \fliteral() is a function, its argument list (the text within
39185 +   parantheses) has special syntax of its own, in which commas and braces
39186 +   are treated specially and introduce another set of quoting problems.
39187 +   \q(string) doesn't have these problems. The only consideration is that
39188 +   parentheses must be balanced or else quoted (preceded by backslash), or
39189 +   represented as numeric character entities (left paren = \40, (right
39190 +   paren = \41).
39191 +
39192 +   Or else hold the value in a simple variable as we did with \\m(path)
39193 +   above.
39194 +
39195 +   SET COMMAND VARIABLE-EVALUATION SIMPLE is a big change and might have
39196 +   repurcussions that didn't show up in the initial tests; a lot more
39197 +   testing is needed.
39198 +
39199 +   On the topic of variables, let's summarize in one place the ways in
39200 +   which values can be explicitly assigned to variables. There is nothing
39201 +   new here except the table itself:
39202 +
39203 +   CAPTION: Table 2. Variable Assignment in Kermit
39204 +
39205 +   Command Shorthand Explanation
39206 +   DEFINE name value .name = value The literal value becomes the contents
39207 +   of the named variable; variables names in the value are copied without
39208 +   evaluation. This command is for defining macros that take parameters,
39209 +   as well as for defining simple variables, especially if the values
39210 +   contain backslashes.
39211 +   _DEFINE name value   Like DEFINE but the name is evaluated before use.
39212 +   ASSIGN name value .name := value The value is evaluated and the result
39213 +   becomes the contents of the named variable.
39214 +   _ASSIGN name value   Like ASSIGN but the name is evaluated before use.
39215 +   EVALUATE name expression .name ::= value The expression (in regular
39216 +   algebraic notation) is evaluated arithmetically and the result becomes
39217 +   the contents of the named variable. If the expression contains any
39218 +   variables they are evaluated first.
39219 +   _EVALUATE name expression   Like EVALUATE but the name is evaluated
39220 +   before use.
39221 +   INCREMENT name expression   Evaluates the variables in the expression,
39222 +   then evaluates the expression arithmetically, and then adds the value
39223 +   to the contents of the named variable, which must be a number or an
39224 +   algebraic expression. If the expression is empty, a value of 1 is used.
39225 +   _INCREMENT name expression   Like INCREMENT but the name is evaluated
39226 +   before use.
39227 +   DECREMENT name expression   Evaluates the variables in the expression,
39228 +   then evaluates the expression arithmetically, and then subtracts the
39229 +   value from the contents of the named variable, which must be a number
39230 +   or an algebraic expression. If the expression is empty, a value of 1 is
39231 +   used.
39232 +   _DECREMENT name expression   Like DECREMENT but the name is evaluated
39233 +   before use.
39234 +   DECLARE name = list   An array declaration can include an initializer
39235 +   list; items in the list are evaluated before assignment. This can be
39236 +   defeated by doubling any backslashes or enclosing individual arguments
39237 +   in \fliteral().
39238 +   DO name arguments name arguments When invoking a macro with a DO
39239 +   command (or an implied one), the arguments are evaluated, then assigned
39240 +   to \%1, \%2, etc, and the macro's name to \%0.
39241 +   (SETQ name value)   Kermit also includes a mini-[65]LISP intpreter
39242 +
39243 +   Variables are evaluated automatically in Kermit commands simply by
39244 +   referencing them, according to rules given in Table 1. The following
39245 +   functions can be used to change how a a particular variable is
39246 +   evaluated:
39247 +
39248 +   CAPTION: Table 3. Kermit Functions for Evaluating Variables
39249 +
39250 +   Function Argument Description
39251 +   \fcontents() \%x or \&x[y] Evaluates the variable or array element
39252 +   (which normally would be evaluated recursively) one level deep.
39253 +   \fdefinition() name If the argument is a \%x variable or an array
39254 +   element, it is evaluated to get the name; otherwise the argument is the
39255 +   name. Its definition is returned with no recursion.
39256 +   \m() name Equivalent to \fdefinition().
39257 +   \recurse() \m(name) Forces recursive evaluation of a macro definition
39258 +   (a.k.a. long variable name). NOTE: \frecurse() can operate on any kind
39259 +   of variable as well as on any string containing any mixture of
39260 +   variables.
39261 +
39262 +C-Kermit's RENAME Command
39263 +
39264 +   C-Kermit's RENAME command, which is used for changing the names of
39265 +   local files or for moving files locally, has two basic forms:
39266 +
39267 +   RENAME [ optional-switches ] oldfilename newfilename
39268 +          This form lets you change the name of a single file from
39269 +          oldfilename to newfilename. Example:
39270 +          rename thismonth.log lastmonth.log
39271 +
39272 +   RENAME [ optional-switches ] filespec directoryname
39273 +          This form lets you move (without renaming) one or more files
39274 +          (all the files that match the filespec, which may contain
39275 +          wildcard characters such as "*") to the given directory.
39276 +          Example:
39277 +          rename *.txt ~/textfiles/
39278 +
39279 +   Traditionally, the optional switches have been:
39280 +
39281 +   RENAME /LIST oldname newname
39282 +          Display the old and new name for each file while renaming.
39283 +          Synonyms: /LOG, /VERBOSE. Example:
39284 +          rename /list *.txt ~/textfiles/
39285 +
39286 +   RENAME /NOLIST oldname newname
39287 +          Don't display the old and new name for each file while renaming.
39288 +          This is the default behavior. Synonyms: /NOLOG, /QUIET. Example:
39289 +          rename /nolist *.txt ~/textfiles/
39290 +
39291 +   Reminder: Every switch starts with a slash (/) and must be preceded by
39292 +   a space.
39293 +
39294 +New RENAME Features for C-Kermit 9.0
39295 +
39296 +   A series of new options (switches) have been added to let you change
39297 +   the names of multiple files at once by case conversion, string
39298 +   substitution, or character-set conversion, and optionally also move
39299 +   them to a different directory:
39300 +
39301 +     /LOWER:   Convert the filename to lowercase
39302 +     /UPPER:   Convert the filename to uppercase
39303 +     /CONVERT: Change the filename's character encoding
39304 +     /REPLACE: Do string substitutions on the filename
39305 +
39306 +   If the source-file specification includes a path or directory, any
39307 +   changes are applied to the filenames only, not to the directory or path
39308 +   specification.
39309 +
39310 +   Since name changes, when applied to many files at once, can have
39311 +   consequences that are not easily undone, there are also some new
39312 +   controls, safeguards, and conveniences:
39313 +
39314 +   RENAME /SIMULATE
39315 +          This switch tells Kermit to show you what the RENAME command
39316 +          would do without actually doing it. /SIMULATE implies /LIST.
39317 +
39318 +   RENAME /COLLISION:{FAIL,SKIP,OVERWRITE}
39319 +          This switch governs Kermit's behavior when renaming multiple
39320 +          files, and any of the names would collide with the name of a
39321 +          file that already exists. The default, for compatibility with
39322 +          earlier releases of C-Kermit, is OVERWRITE, i.e. write over the
39323 +          existing file. The other two protect existing files. SKIP means
39324 +          to skip (not rename) the file that would cause the collision,
39325 +          and proceed to the next file, if any. FAIL means that no files
39326 +          will be renamed if there would be any collisions; for this
39327 +          Kermit makes two passes, checking each new name it constructs
39328 +          for existence before starting the second pass (however, there is
39329 +          no guarantee that in the second pass, it won't create the same
39330 +          new name for more than one file; in that case, it will stop
39331 +          before executing the second rename). Example:
39332 +          rename /simulate /collision:proceed * ~/tmp/
39333 +
39334 +   Reminder: In switches such as /COLLISION that take arguments
39335 +   (operands), the switch name and its argument(s) are separated by a
39336 +   colon (:) with no intevening spaces. Also remember that Kermit keywords
39337 +   can always be abbreviated by leaving off characters from the right, as
39338 +   long as the result is still unique in its context. Thus "ren /col:f"
39339 +   would be equivalent to "rename /collision:fail".
39340 +
39341 +   You can change the following preferences for the RENAME command with
39342 +   the new SET RENAME command:
39343 +
39344 +   SET RENAME LIST { ON, OFF }
39345 +          Tells the RENAME command whether to list its actions if you
39346 +          don't include a /LIST or /NOLIST or equivalent switch.
39347 +
39348 +   SET RENAME COLLISION { FAIL, OVERWRITE, SKIP }
39349 +          Tells the RENAME command how to handle filename collisions in
39350 +          the absence of a /COLLISION switch. That is, it replaces the
39351 +          default action of OVERWRITE with action of your choosing, which
39352 +          is then used in any RENAME command that does not include an
39353 +          explicit /COLLISION switch.
39354 +
39355 +   SHOW RENAME
39356 +          Displays the current SET RENAME settings.
39357 +
39358 +Changing the Case of Filenames
39359 +
39360 +   RENAME /UPPER:{ALL,LOWER} filespec [ directory ]
39361 +          RENAME /LOWER:{ALL,UPPER} filespec [ directory ]
39362 +          These switches let you change the alphabetic case of letters in
39363 +          all the files whose names match the filespec. If a directory
39364 +          name is given after the filespec, then the files are also moved
39365 +          to the given directory.
39366 +
39367 +   By default, all files that match the given filespec have their names
39368 +   changed (if necessary). This is what the ALL argument means, e.g.:
39369 +
39370 +     RENAME /LOWER:ALL *
39371 +     RENAME /LOWER *
39372 +
39373 +   You can use either form: RENAME /LOWER is equivalent to RENAME
39374 +   /LOWER:ALL. The other argument (/LOWER:UPPER or /UPPER:LOWER) means to
39375 +   leave mixed-case filenames alone, and rename only those files whose
39376 +   names contain letters of only the given case. Examples:
39377 +
39378 +   RENAME /UPPER:ALL foo.bar
39379 +          Changes the filename to FOO.BAR.
39380 +
39381 +   RENAME /UPPER foo.bar
39382 +          Same as "rename /upper:all foo.bar".
39383 +
39384 +   RENAME /UPPER foo.bar ~/old/
39385 +          Renames foo.bar to FOO.BAR and moves it to the user's old
39386 +          directory (Unix).
39387 +
39388 +   RENAME /LOWER *
39389 +          Changes the names of all files to have only lowercase letters.
39390 +
39391 +   RENAME /LOWER:UPPER *
39392 +          Changes the names of only those files whose names contain no
39393 +          lowercase letters to have only lowercase letters. For example,
39394 +          FOO.BAR would be changed, Foo.Bar would not be changed. foo.bar
39395 +          would not be changed either because it's already all lowercase.
39396 +
39397 +   RENAME /LOWER:UPPER * ~/new/
39398 +          Same as the previous example, but also moves each file to the
39399 +          user's new directory (whether it was renamed or not).
39400 +
39401 +   Case conversion works reliably for ASCII characters only. Kermit uses
39402 +   the C library for this, which on any given platform might or might not
39403 +   handle non-ASCII letters, and if it does, then how it works would
39404 +   normally depend on your locale definitions (the LC_CTYPE and/or LANG
39405 +   environment variable in Unix). When non-ASCII letters are not handled
39406 +   by the C library, the RENAME command does change their case. For
39407 +   example, Olga_Tañón.txt might become OLGA_TAñóN.TXT.
39408 +
39409 +String Replacement in Filenames
39410 +
39411 +   The RENAME command also lets you change filenames by string
39412 +   substitution.
39413 +
39414 +   RENAME /FIXSPACES[:String] filespec [ directory ]
39415 +          Replaces all spaces in each matching filename by the given
39416 +          string, if any, or if none is given, by underscore. Examples:
39417 +
39418 +     RENAME /FIX *
39419 +     RENAME /FIXSPACES:_ *
39420 +     RENAME /FIXSPACES:"" *
39421 +     RENAME /FIXSPACES:<040> *
39422 +
39423 +          The first two are equivalent, replacing each space with
39424 +          underscore; a file called "My Favorite Photo.jpg" becomes
39425 +          "My_Favorite_Photo.jpg". The third example removes all spaces
39426 +          ("MyFavoritePhoto.jpg"). The fourth replaces each space with the
39427 +          string "<040>" ("My<040>Favorite<040>Photo.jpg").
39428 +
39429 +   RENAME /REPLACE:{{String1}{String2}} filespec [ directory ]
39430 +          Renames each matching file by changing occurrences of String1 in
39431 +          its name to String2. If a directory specification is included,
39432 +          the file is also moved to the given directory (even if the name
39433 +          was not changed). Note that in this case, the curly braces are
39434 +          part of the command. Example:
39435 +
39436 +     RENAME /REPLACE:{{.jpeg}{.jpg}} *
39437 +
39438 +          changes all *.jpeg files to *.jpg.
39439 +
39440 +   By default, RENAME /REPLACE changes all occurrences of String1 in each
39441 +   filename to String2 so, for example, if you had a file called
39442 +   abcjpegxyz.jpeg, the command just shown would change its name to
39443 +   abcjpgxyz.jpg.
39444 +
39445 +   For greater control and flexibility, the /REPLACE: switch argument can
39446 +   take several distinct forms:
39447 +
39448 +   RENAME /REPLACE:String1 filespec [ directory ]
39449 +          This means to remove all occurrences of String1 from the given
39450 +          filenames name. It is equivalent to /REPLACE:{{String1}{}}. A
39451 +          handy use for this option is to remove spaces from filenames.
39452 +
39453 +   RENAME /REPLACE:{{String1}{String2}} filespec [ directory ]
39454 +          As already noted, this replaces every occurrence of String1 with
39455 +          String2 in each filename. Alphabetic case in string matching is
39456 +          done according to the current SET CASE setting.
39457 +
39458 +   RENAME /REPLACE:{{ }{_}} filespec [ directory ]
39459 +          This replaces all spaces in the given filenames with underscore,
39460 +          equivalent to RENAME /FIXSPACES.
39461 +
39462 +   RENAME /REPLACE:{{String1}{String2}{Options}} filespec [ directory ]
39463 +          Options can be included that add more control to the process.
39464 +          The option string is a sequence of characters; each character in
39465 +          the string is an option. The choices are:
39466 +
39467 +   A String matching is to be case-sensitive, regardless of SET CASE.
39468 +   a String matching is to be case-independent, regardless of SET CASE.
39469 +   ^ String replacement will occur only at the beginning of the filename.
39470 +   $ String replacement will occur only at the end of the filename.
39471 +   1 Only the first occurrence of the string will be replaced.
39472 +   2 Only the second occurrence of the string will be replaced.
39473 +   3 4 5 6 7 8 ...
39474 +   9 Only the ninth occurrence of the string will be replaced.
39475 +   - (hyphen, minus sign) Before a digit: occurrences will be counted from
39476 +   the right.
39477 +   ~ (tilde) Before digit or minus sign: all occurrences but the given one
39478 +   will be replaced.
39479 +
39480 +   The tilde modifier works only with single-byte character sets such as
39481 +   ASCII, CP437, ISO 8859-1, etc, but not with multibyte character sets
39482 +   such as UCS2, UTF8, or any of the Japanese Kanji sets.
39483 +
39484 +   Here are some examples showing how to use the /REPLACE options:
39485 +
39486 +   RENAME /REPLACE:{{foo}{bar}{^}} *
39487 +          For all files whose names start with "foo", replaces the "foo"
39488 +          at the beginning with "bar".
39489 +
39490 +   RENAME /REPLACE:{{}{New-}{^}} *
39491 +          Prepends "New-" to the name of each file.
39492 +
39493 +   RENAME /REPLACE:{{.jpeg}{.jpg}{$}} *
39494 +          Replaces ".jpeg" at the end of each filename with ".jpg".
39495 +
39496 +   RENAME /REPLACE:{{}{-Old}{$}} *
39497 +          Appends "-Old" to the name of each file.
39498 +
39499 +   RENAME /REPLACE:{{foo}{bar}{a}} *
39500 +          Replaces "foo", "FOO", "Foo", "fOO", etc, with "bar" in each
39501 +          filename.
39502 +
39503 +   RENAME /REPLACE:{{foo}{bar}{A}} *
39504 +          Replaces only (lowercase) "foo" in filenames with "bar".
39505 +
39506 +   RENAME /REPLACE:{{a}{XX}} *
39507 +          Changes every "a" to "XX". For example a file called "a.a.a.a"
39508 +          would become "XX.XX.XX.XX".
39509 +
39510 +   RENAME /REPLACE:{{a}{X}{2}}
39511 +          Changes only the second "a" to "X". For example a file called
39512 +          "a.a.a.a" would become "a.X.a.a".
39513 +
39514 +   RENAME /REPLACE:{{a}{X}{-1}}
39515 +          Changes only the final "a" in the filename (it doesn't have to
39516 +          be at the end) to "X". For example a file called "a.b.a.c.a.d"
39517 +          would become "a.b.a.c.X.d".
39518 +
39519 +   RENAME /REPLACE:{{foo}{NOTFOO}{-2}}
39520 +          Changes the second-to-last "foo" (if any) in the filename to
39521 +          "NOTFOO".
39522 +
39523 +   RENAME /REPLACE:{{foo}{}{-2}}
39524 +          Deletes the second-to-last "foo" (if any) from the filename.
39525 +
39526 +   RENAME /REPLACE:{{.}{_}{~1}}
39527 +          Changes all but the first period to an underscore; for example,
39528 +          "a.b.c.d.e" would become "a.b_c_d_e".
39529 +
39530 +   RENAME /REPLACE:{{.}{_}{~-1}}
39531 +          Changes all but the final period to an underscore; for example,
39532 +          "a.b.c.d.e" would become "a_b_c_d.e".
39533 +
39534 +   In the Options field, digits (and their modifiers), ^, and $ are
39535 +   mutually exclusive. If you include more than one of these in the option
39536 +   string, only the last one is used. Similarly for 'a' and 'A':
39537 +
39538 +   RENAME /REPLACE:{{foo}{bar}{Aa2$^}} *
39539 +          This replaces "foo" with "bar" no matter what combination of
39540 +          upper and lower case letters are used in "foo" ('a' overrides
39541 +          'A' in the option string), but only if "foo" is at the beginning
39542 +          of the filename ('^' overrides '$' and '2').
39543 +
39544 +   If you give an /UPPER or /LOWER switch and a /REPLACE switch in the
39545 +   same RENAME command, the /REPLACE action occurs first, then the case
39546 +   conversion:
39547 +
39548 +   RENAME /REPLACE:{{foo}{bar}} /UPPER * /tmp
39549 +          For each file: changes all occurrences of "foo" in the name to
39550 +          "bar", then converts the result to uppercase, and then moves the
39551 +          file to the /tmp directory. So (for example) "foot.txt" would
39552 +          become "/tmp/BART.TXT".
39553 +
39554 +Changing the Character Encoding of Filenames
39555 +
39556 +   As you know, text is represented on the computer as a series of
39557 +   numbers, with a given number corresponding to a given character
39558 +   according to some convention or standard. Filenames are represented the
39559 +   same way. The trouble is, different computers, or even different
39560 +   applications on the same computer, might use different standards or
39561 +   conventions ("character sets") for representing the same characters.
39562 +   Usually ASCII is safe, but anything beyond that -- non-ASCII characters
39563 +   such as accented or non-Roman letters -- is likely to vary. Sometimes
39564 +   you have text that's in the "wrong" character set and you need to
39565 +   convert it to something you can can use. Kermit has always been able to
39566 +   handle this as part of file transfer and terminal emulation, as well as
39567 +   being able to convert text files locally with its TRANSLATE command.
39568 +   Now there's a way to convert filenames too, for example after copying
39569 +   files from a CD that uses a different encoding:
39570 +
39571 +   RENAME /CONVERT:charset1:charset2 filespec [ directory ]
39572 +          Converts filenames from the first character set to the second
39573 +          one. The two character sets can be chosen from the SET FILE
39574 +          CHARACTER-SET list; for complete details see [66]this page. For
39575 +          example suppose you have a file called "Olga_Tañón.txt" on a
39576 +          computer where ISO 8859-1 Latin Alphabet 1 is used, and you have
39577 +          transported it (e.g. on CDROM) to another computer where the
39578 +          text encoding is UTF8. Maybe you also have a lot of other files
39579 +          with similar names in the same directory. You can convert the
39580 +          filenames to UTF8 like this:
39581 +
39582 +     RENAME /CONVERT:latin1:utf8 *
39583 +
39584 +   /CONVERT can not be combined with /UPPER, /LOWER, or /REPLACE.
39585 +
39586 +   You should NOT use UCS2 for filenames since this encoding is not
39587 +   compatible with C strings used in Unix and elsewhere.
39588 +
39589 +   RENAME /CONVERT affects only the filename, not the file's contents. You
39590 +   can use the TRANSLATE command to convert the encoding of the contents
39591 +   of a text file.
39592 +
39593 +Other New Features
39594 +
39595 +   See the [67]C-Kermit Daily Builds page for details. Very briefly:
39596 +
39597 +     * Perhaps most important, modernized makefile targets for the major
39598 +       Unix platforms: Linux, Mac OS X, AIX, Solaris, etc. These are
39599 +       somewhat automated; not autoconf exactly, but they cut down
39600 +       significantly on redundant targets. For example, one single "linux"
39601 +       target works on many (hopefully all) different Linux
39602 +       configurations, where before different targets were required for
39603 +       different combinations of (e.g.) curses / ncurses / no curses;
39604 +       32-bit / 64-bit; different feature sets and library locations.
39605 +       (Separate targets are still required for Kerberos and/or SSL
39606 +       builds, but they are "subroutinized".)
39607 +     * Bigger buffers, more storage for commands, macros, scripts,
39608 +       strings, and filename expansion in 64-bit versions and in 32-bit
39609 +       versions that support large files.
39610 +     * New options for the RENAME command, allowing you to rename groups
39611 +       of files at once, changing case of letters in the name or changing
39612 +       its character set, removing spaces or changing them to something
39613 +       else, and/or doing anchored or floating or occurrence-based string
39614 +       replacement, described [68]HERE.
39615 +     * Built-in FTP client for VMS. This is the [69]same FTP client Unix
39616 +       C-Kermit has had since version 8.0, minimally adapted to VMS by
39617 +       SMS, supporting binary and Stream_LF file transfer only (in other
39618 +       words, nothing to handle RMS files), but otherwise fully functional
39619 +       (and scriptable) and theoretically capable of making connections
39620 +       secured by SSL (at least it compiles and links OK with SSL - HP SSL
39621 +       1.3 in this case). In the present Alpha release, this is an
39622 +       optional feature requested by including the "i" option in P1 (and
39623 +       by including "CK_SSL" in P3 if you also want SSL, and then also
39624 +       "OPENSSL_DISABLE_OLD_DES_SUPPORT" if necessary). Much testing is
39625 +       needed to determine if it should be included in the final C-Kermit
39626 +       9.0 release.
39627 +     * Large file support in VMS, also by SMS. Alpha and Itanium only (not
39628 +       VAX). VMS C-Kermit was already able to transfer large files, but
39629 +       the file-transfer display (numbers and progress bar) and statistics
39630 +       were wrong because they used ints. In the present Alpha test
39631 +       release, this is an optional feature requested by including the "f"
39632 +       option in P1.
39633 +     * User-settable FTP timeout, works on both the data and control
39634 +       connection.
39635 +     * FTP access to ports higher than 16383.
39636 +     * New PUTENV command that allows Kermit to pass environment variables
39637 +       to subprocesses (Unix only).
39638 +     * Unix C-Kermit SET TERMINAL TYPE now passes its arguments to
39639 +       subprocesses as an environment variable.
39640 +     * New TOUCH command, many file selection options.
39641 +     * New DIRECTORY command options and switches (/TOP, /COUNT;
39642 +       HDIRECTORY, WDIRECTORY...). To see the ten biggest files in the
39643 +       current directory: "dir /top:10 /sort:size /reverse *" or
39644 +       equivalently, "hdir /top:10 *". WDIR lists files in reverse
39645 +       chronological order, shorthand for "dir /sort:date /reverse".
39646 +     * New command FSEEK /FIND:string-or-pattern, seeks to the first line
39647 +       in an FOPEN'd file that contains the given string or matching the
39648 +       given pattern. Example: Suppose you have a file of lines like this:
39649 +
39650 +     quantity   description...
39651 +       in which the first "word" is a number, and a description (for
39652 +       example, the name of an item). Here is how to use FSEEK to quickly
39653 +       get the total quantity of any given item, which is passed as a
39654 +       parameter (either a literal string or a pattern) on the command
39655 +       line:
39656 +
39657 +#!/usr/local/bin/kermit +
39658 +if not def \%1 exit 1 Usage: \fbasename(\%0) string-or-pattern
39659 +
39660 +.filename = /usr/local/data/items.log        # Substitute the actual filename
39661 +set case off                                 # Searches are case-independent
39662 +fopen /read \%c \m(filename)                 # Open the file
39663 +if fail exit 1 "\m(filename): \v(errstring)" # Fail: exit with error message
39664 +.total = 0                                   # OK: Initialize the total
39665 +echo Searching "\%1"...
39666 +
39667 +while true {
39668 +    fseek /line /relative /find:\%1 \%c 0    # Get next line that has target
39669 +    if fail break                            # Failure indicates EOF
39670 +    fread /line \%c line                     # Read it
39671 +    if fail break                            # (shouldn't happen)
39672 +    increment total \fword(\m(line),1)       # Increment the total
39673 +}
39674 +fclose \%c                                   # Close the file
39675 +echo Total for "\%1" : \m(total)             # Print the result
39676 +exit 0
39677 +
39678 +       The syntax of the FSEEK command in this example indicates that each
39679 +       search should start relative to the current file line. Since Kermit
39680 +       is an interpretive language, FSEEK is a lot faster than FREAD'ing
39681 +       each line and checking it for the target, especially for big files.
39682 +       An especially handy use for FSEEK is for use with potentially huge
39683 +       sequentially timestamped logs, to seek directly to the date-time
39684 +       where you want to start processing. Some other improvements for the
39685 +       FOPEN/FREAD/FWRITE/FCLOSE family of commands are included also
39686 +       (perfomance, bug fixes, convenience features), listed in the
39687 +       [70]change log. (Prior to 9.0.299 Alpha.02, the FSEEK /FIND:
39688 +       command always started from the top.)
39689 +     * SET SESSION-LOG TEXT now strips out ANSI escape sequences from the
39690 +       session log.
39691 +     * For interacting with POP servers over clear-text or SSL-secured
39692 +       connections:
39693 +          + New SSL and TLS "raw" connections (no Telnet protocol).
39694 +          + New INPUT command options for reading and capturing (perhaps
39695 +            while scanning) continuous incoming text, such as INPUT
39696 +            /NOWRAP (explained [71]HERE).
39697 +          + New \femailaddress() command to extract the e-mail address
39698 +            from an Internet mail message To: or From: line, used in
39699 +            fetching mail from POP servers.
39700 +          + Improved date parsing commands and functions for parsing the
39701 +            different date formats that can appear in e-mail.
39702 +          + Production scripts for fetching mail from a secure POP server,
39703 +            available [72]HERE.
39704 +     * Various features added to make Kermit more useful for writing CGI
39705 +       scripts such as INPUT /COUNT:n to INPUT exactly n characters
39706 +       (useful for reading form data).
39707 +     * New \fpictureinfo() function for getting orientation and dimensions
39708 +       of JPG and GIF images, described [73]HERE.
39709 +     * New \fgetpidinfo() function for testing whether a given process
39710 +       exists.
39711 +     * \fkwdvalue() function fixed to allow multiword values.
39712 +     * New function \fcount(s1,s2) to tell the number of occurrences of s1
39713 +       in s2.
39714 +     * New \flopx() function returns rightmost field from string (such as
39715 +       a file's extension).
39716 +     * New function \ffunction(s1) to tell whether a built-in s1 function
39717 +       exists.
39718 +     * New \fsqueeze(s1) function removes leading and trailing whitespace
39719 +       from string s1, changes tabs to spaces, squeezing each run of
39720 +       repeated whitespace characters to a single space (Alpha.02).
39721 +     * Compact substring notation: \s(somestring[12:18]) is the same as
39722 +       \fsubstring(\m(somestring),12,18), i.e. the substring starting at
39723 +       position 12, 18 charcters long. \s(somestring[12_18]) means
39724 +       characters 12 through 18 of the string (7 characters).
39725 +     * The string indexing functions now accept an optional trailing
39726 +       argument specifying the occurrence number of the target string.
39727 +       Likewise, \fword() can fetch words from the right as well as the
39728 +       left.
39729 +     * The COPY command in Unix C-Kermit has a new /PRESERVE switch,
39730 +       equivalent to Unix "cp -p".
39731 +     * ASKQ /ECHO:c can be used to make the characters the user types echo
39732 +       as the character c, e.g. asterisk when typing a password.
39733 +     * IF LINK filename to test if the filename is a symlink.
39734 +     * Ctrl-K, when typed at the command parser, replaces itself with most
39735 +       recently entered file specification.
39736 +     * In Unix, the ability to log a terminal session to a serial port,
39737 +       for use with speaking devices or serial printers; described
39738 +       [74]HERE. Also for the same purpose, SET SESSION-LOG
39739 +       NULL-PADDED-LINES for a speech synthesizer than needed this.
39740 +     * Adaptation to OpenSSL 0.9.8 and 1.0.0.
39741 +     * Lifted the restriction on having a remote Kermit program send
39742 +       REMOTE commands to the local. A very big ex-client needed to be
39743 +       able to do this (branches would connect to headquarters and upload
39744 +       files; HQ would then download patches, a REMOTE HOST command was
39745 +       necessary to allow the remote headquarters machines to install the
39746 +       patches on the local client; of course the client first has to
39747 +       ENABLE HOST because this is a risky scenario). The reason for the
39748 +       restriction was that the server, upon receiving any REMOTE command
39749 +       would send the results (output) back to the client as a file
39750 +       transfer with "destination screen", but of course the remote has no
39751 +       screen.
39752 +     * [75]MIME synonyms for character-set names were introduced in
39753 +       Alpha.05. Nobody seemed to notice that after that, character-set
39754 +       selection didn't work at all. Anyway, now it's fixed.
39755 +     * Added XMESSAGE, which is to MESSAGE (Alpha.03) as XECHO is ECHO: it
39756 +       outputs a string with no line terminator DEBUG MESSAGE is ON.
39757 +     * Fixed \recurse() to not dump core when invoked with no arguments.
39758 +     * Improved text for HELP FUNCTION SPLIT and HELP FUNCTION WORD.
39759 +     * Patches for Debian 6.0 "Squeeze" from Ian Beckwith.
39760 +     * \fcontents(\&a[3]) got an error if the array was declared but its
39761 +       dimension was less than 3. Now it simply returns and empty string.
39762 +     * \fsplit(), when parsing lines from CSV and TSV files, was treating
39763 +       backslash in the data the same way it treats backslash in Kermit
39764 +       commands. This was fixed to treat backslash like any other
39765 +       character.
39766 +     * Builds for Solaris 9 and later now use streams ptys rather then the
39767 +       old BSD-style ptys. Thanks to Gary Mills for this one, who noticed
39768 +       that he couldn't have more than 48 C-Kermit SSH sessions going at
39769 +       once and figured out why.
39770 +     * As noted [76]below DES encryption is being retired from many
39771 +       platforms and libraries that once used it. I changed the Solaris
39772 +       and Linux OpenSSL builds to account for this by testing for it. I
39773 +       probably should also add a OMITDES option to omit DES even if it is
39774 +       installed, but "KFLAGS=-UCK_DES" seems to do the job for now.
39775 +     * I changed the Linux build to test for the OpenSSL version (like the
39776 +       Solaris version already did), rather than assuming OpenSSL 0.9.7.
39777 +     * A couple minor changes for Tru64 Unix 5.1B from Steven Schweda but
39778 +       we still have some trouble on that platform. As a workaround "make
39779 +       osf1" can be used there.
39780 +     * Unix makefile and man page are now included in the Zip
39781 +       distribution.
39782 +     * \fjoin(), which is the inverse function of fsplit() now accepts CSV
39783 +       and TSV as a second argument, to transform an array into a
39784 +       comma-separated or tab-separated value list, as described [77]HERE.
39785 +     * Even in 2010, Unix distributions continue to change their UUCP
39786 +       lockfile conventions. Alpha.08 contains support from Joop Boonen
39787 +       for OpenSuse >= 11.3 and recent Debian, which no longer have
39788 +       baudboy.h, which first appeared in Red Hat 7.2 in 2003.
39789 +     * From Lewis McCarthy:
39790 +
39791 +     Based on code inspection, C-Kermit appears to have an SSL-related
39792 +     security vulnerability analogous to that identified as CVE-2009-3767
39793 +     (see e.g.
39794 +     [78]http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3767).
39795 +
39796 +     I'm attaching a patch for this issue relative to the revision of
39797 +     ck_ssl.c obtained from a copy of
39798 +     [79]http://www.columbia.edu/kermit/ftp/test/tar/x.zip downloaded on
39799 +     2010/07/30, which I believe is the latest.
39800 +     When this flaw was first widely publicized at last year's Black Hat
39801 +     conference, it was claimed that some public certificate authorities
39802 +     had indeed issued certificates that could be used to exploit this
39803 +     class of vulnerability. As far as I know they have not revealed
39804 +     specifically which public CA(s) had been found issuing such
39805 +     certificates. Some references:
39806 +          + [80]http://www.mseclab.com/?p=180
39807 +          + [81]http://www.theregister.co.uk/2009/07/30/universal_ssl_cert
39808 +            ificate/
39809 +
39810 +     * Peter Eichhorn reported that "RENAME ../x ." didn't work; fixed
39811 +       now.
39812 +     * If only one file is FOPEN'd, FCLOSE given with no arguments would
39813 +       close it; this was a "convenience feature" that turned out to be
39814 +       dangerous. For safety FCLOSE has to require a specific channel
39815 +       number or the word ALL.
39816 +     * Added \fstrcmp(s1,s2,case,start,length), which has the advantage
39817 +       over IF EQU,LGT,LLT that case senstivity can be specified as a
39818 +       function arg, and also substrings can be specified.
39819 +     * Fixed a subtle flaw in the [82]CSV feature that was added in
39820 +       Alpha.06, namely that if the last item in a comma separated list
39821 +       was enclosed within doublequotes with a trailing space after the
39822 +       closing doublequote, a spurious empty final element would be
39823 +       created in the result array.
39824 +     * New built-in functions:
39825 +
39826 +        \fcvtcsets(string,cs1,cs2)
39827 +                Function to convert a string from one character set to
39828 +                another.
39829 +
39830 +        \fdecodehex(string[,prefix])
39831 +                Function to decode a string containing hex escapes.
39832 +
39833 +        \fstringtype(string)
39834 +                Function to tell whether a string is 7-bit, 8-bit, or
39835 +                UTF-8.
39836 +
39837 +       For the motivation for these features and an application that uses
39838 +       them to analyze web logs, see the Weblog script below.
39839 +     * MIME Character-Set Names: A new equivalence between MIME names and
39840 +       Kermit names for character sets, with a new table showing the
39841 +       supported sets [83]HERE (this feature is also illustrated in the
39842 +       Weblog script).
39843 +     *
39844 +
39845 +        Lazy IF Conditions: Third, now you can do this:
39846 +                define foo some number
39847 +                if foo command
39848 +
39849 +        instead of this:
39850 +                define foo some number
39851 +                if \m(foo) command
39852 +
39853 +       Of course the old way still works too. But watch out because if the
39854 +       variable name is the same as a symbolic IF condition (for example
39855 +       COUNT), it won't do what you expected. (IF COUNT was used for loop
39856 +       control in early versions of MS-DOS Kermit, before it got true FOR
39857 +       and WHILE loops; it was added to C-Kermit for compatibility, and it
39858 +       can't be removed because it could break existing scripts).
39859 +     * Escape sequences are now stripped from text-mode session logs not
39860 +       only in CONNECT sessions but also in whatever is logged by the
39861 +       INPUT command; described in the [84]next section.
39862 +     * New commands for selectively issuing progress or debugging messages
39863 +       from scripts, also described in the next section.
39864 +     * Fix from [85]John Dunlap to prevent the fixed packet-timeout
39865 +       interval from going to an unexpected value.
39866 +     * Alpha.04 fixes a problem with FTP connections made from 64-bit Unix
39867 +       platforms. All the other changes in this section were to Alpha.03.
39868 +     * Relaunching a closed SSH connection with the CONNECT command is now
39869 +       possible, as it always has been with Telnet and other connection
39870 +       types; suggested by Peter Eichhorn (needs testing).
39871 +     * A symbol conflict fixed that prevented successful build on
39872 +       [86]FreeBSD 8.0.
39873 +     * Fixes from Christian Corti for building on SunOS 4.1.
39874 +     * New aixg target for building on AIX with gcc.
39875 +     * New aix+ibmssl target. This is nice because the IBM-supplied SSL
39876 +       libraries and header files are in a known location; no need to
39877 +       [87]set environment variables giving their locations.
39878 +     * "Large File Support" is now included by default on Alpha and IA64
39879 +       hardware on VMS 7.3 and later, and it should work much better than
39880 +       before.
39881 +     * Kermit's internal FTP client is now included by default in any
39882 +       build that also includes TCP/IP networking. At present, the FTP
39883 +       client seems to work well for binary-mode transfers; text (ASCII)
39884 +       mode transfers still need some work. In builds that also include
39885 +       Secure Sockets Layer (SSL) security (next item) the FTP client
39886 +       should be able to make securely authenticated and encrypted
39887 +       connections.
39888 +     * In network builds that request OpenSSL support, e.g.:
39889 +
39890 +     $ @ckvker  ""  ""  "CK_SSL"
39891 +       the OpenSSL version is detected automatically and the appropriate
39892 +       compile-time options are emitted (such as
39893 +       OPENSSL_DISABLE_OLD_DES_SUPPORT).
39894 +     * Preliminary / limited support for the ODS-5 file system on VMS 7.2
39895 +       and later, Alpha and Itanium only (needs testing): Filenames can be
39896 +       mixed case and can be longer.
39897 +     * Support for older and older VMS versions.
39898 +     * In the VMS build procedure, CKVKER.COM, the "i" option in P1 now
39899 +       means don't include the internal FTP client, and the "f" option
39900 +       means do not include "Large File" support. Large File support in
39901 +       VMS really only applies to the file-transfer display and
39902 +       statistics, which would go out of whack as soon as the byte count
39903 +       overflowed 31 bits because this is C-Kermit, built with the C
39904 +       compiler and the C library (runtime system), which did not support
39905 +       long integers until VMS 7.3.
39906 +     * The [88]LISP Operator ROUND now takes an optional second argument
39907 +       that specifies the number of places to round to, e.g.
39908 +       (ROUND dollars 2) rounds dollars to 2 decimal places.
39909 +     * Improved pattern matching in many commands for both strings and
39910 +       filenames.
39911 +     * Various minor new features, plus numerous bug fixes and speedups.
39912 +
39913 +Incompatibilities
39914 +
39915 +   A top priority for new Kermit software releases has always been
39916 +   backwards compatibility. A script written for a previous Kermit release
39917 +   should run the same way in the new release.
39918 +
39919 +   There's one exception this time. The [89]\fsplit() function is
39920 +   incredibly handy, it can do almost anything, up to and including
39921 +   parsing a LISP program (the underlying code is the basis of the
39922 +   [90]S-Expression interpreter). But did you ever try to use it to parse
39923 +   (say) a Tab-Separated-List (TSV file) or Comma-Separated-List (CSV)? It
39924 +   works as expected as long as the data contains only 7-bit characters.
39925 +   But if your data contains (say) Spanish or German or Russian text
39926 +   written in an 8-bit character set such as ISO 8859-1, every 8-bit
39927 +   character (any value 128-255) is treated as a break character. This is
39928 +   fixed in C-Kermit 9.0 by treating all 8-bit bytes as "include"
39929 +   characters rather than break characters, a total reversal of past
39930 +   behavior. I don't think it will affect anyone though, because if this
39931 +   had happened to anyone, I would have heard about it!
39932 +
39933 +   Since most standard 8-bit character sets have control characters in
39934 +   positions 128-160, it might have made sense to keep 128-160 in the
39935 +   break set, but with the proliferation of Microsoft Windows code pages,
39936 +   there is no telling which 8-bit character is likely to be some kind of
39937 +   text, e.g. "smart quotes" or East European or Turkish accented letters.
39938 +
39939 +What's Not In C-Kermit 9.0
39940 +
39941 +   Some large projects that were contemplated have not been done,
39942 +   including:
39943 +     * IPv6. Honestly, there has been zero demand for this, and it would
39944 +       be a lot of work and disruption to the code base. Volunteers
39945 +       welcome, I guess. It could be a CS project.
39946 +     * A database interface - MySQL or ODBC. For this one, there is some
39947 +       demand but I haven't had a chance to even look into it.
39948 +     * There's a looming issue with DES encryption; major vendors are
39949 +       removing it from their platforms, starting with Apple in Mac OS X
39950 +       10.6, with Microsoft to follow suit. A secure version of Kermit can
39951 +       be built without DES, but in limited testing successful connections
39952 +       were spotty (e.g. with Kerberos 5).
39953 +     * Cleaning up the Unix makefile. It has 25 years' worth of targets in
39954 +       it. It is very likely safe to remove most of them, since (a) most
39955 +       old platforms have gone away by now, or have been upgraded, due to
39956 +       hacking vulnerabilities; (b) the market has consolidated
39957 +       considerably; and (c) most of the new features of C-Kermit 9.0,
39958 +       such as large files, won't be of any use on older platforms and
39959 +       previous C-Kermit versions will remain available.
39960 +     * Packages. Everybody wants an install package custom made for their
39961 +       own computer, Linux RPMs being the prime example but far from the
39962 +       only one. These will come, I suppose (especially with some Linux
39963 +       sites having a policy against installing any application that does
39964 +       not come as an RPM). In the meantime, here's a page that describes
39965 +       some Kermit-specific issues in package construction:
39966 +       [91]ckpackages.html.
39967 +
39968 +And a Loose End...
39969 +Using External File-Transfer Protocols on Secure Connections
39970 +
39971 +   After C-Kermit 8.0.212 Dev.27 (2006/12/22), I spent a big chunk of time
39972 +   trying to solve a particular problem that some of you have complained
39973 +   about and others might be familiar with: If you use C-Kermit to make a
39974 +   secure Telnet connection to another host (e.g. with Telnet SSL/TLS,
39975 +   Kerberos, or SRP) and then attempt to transfer a file using an external
39976 +   protocol such as Zmodem, it doesn't work.
39977 +
39978 +   That's because as coded (through 8.0.211), C-Kermit simply starts the
39979 +   external protocol in a fork with its standard i/o redirected to the
39980 +   connection. This completely bypasses the encryption and decryption that
39981 +   is done by C-Kermit itself, and of course it doesn't work. The same
39982 +   thing occurs if you use the REDIRECT command. The routine that handles
39983 +   this is ttruncmd() in ckutio.c.
39984 +
39985 +   In order to allow (say) Zmodem transfers on secure connections, it is
39986 +   necessary for C-Kermit to interpose itself between the external Zmodem
39987 +   program and the connection, decrypting the incoming stream before
39988 +   feeding it to Zmodem and encrypting Zmodem's output before sending out
39989 +   the connection.
39990 +
39991 +   In principal, this is simple enough. We open a pseudoterminal pair
39992 +   ("master" and "slave") for Zmodem's i/o and we create a fork and start
39993 +   Zmodem in it; we read from the fork pty's standard output, encrypt, and
39994 +   send to the net; we read from the net, decrypt, and write to the fork
39995 +   pty's standard input.
39996 +
39997 +   In practice, it's not so simple. First of all, pseudoterminals (ptys)
39998 +   don't seem to interface correctly with certain crucial APIs, at least
39999 +   not in the OS's I have tried (Mac OS X, Linux, NetBSD, etc), such as
40000 +   select(). And i/o with the pty often - perhaps always - fails to
40001 +   indicate errors when they occur; for example, when the fork has exited.
40002 +
40003 +   But, even after coding around the apparent uselessness of select() for
40004 +   multiplexing pty and net, and using various tricks to detect when the
40005 +   external protocol exits and what its exit status is, I'm still left
40006 +   with a show-stopping problem: I just simply can not download (receive)
40007 +   a file with Zmodem, which is the main thing that people would probably
40008 +   want to do. I can send files just fine, but not receive. The incoming
40009 +   stream is delivered to Zmodem (to the pty slave) but upon arrival at
40010 +   the Zmodem process itself, pieces are always missing and/or corrupt.
40011 +   Yet I can receive files just fine if I use Kermit itself (C-Kermit or
40012 +   G-Kermit) as the external protocol, rather than Zmodem.
40013 +
40014 +   I can think of two reasons why this might be the case:
40015 +
40016 +    1. Zmodem sends all 8-bit bytes and control codes in the clear, and
40017 +       maybe the pty is choking on them because it thinks it is a real
40018 +       terminal.
40019 +
40020 +   But Zmodem puts its controlling terminal into raw mode. And C-Kermit
40021 +   puts the pty into raw mode too, just for good measure. If any 0xFF
40022 +   codes are in the Zmodem data stream, and it's a Telnet session, Kermit
40023 +   does any needed byte stuffing/unstuffing automatically. Anyway, if I
40024 +   tell Zmodem to prefix everything, it makes no difference.
40025 +
40026 +    2. Zmodem is a streaming protocol and perhaps the pty driver can't
40027 +       keep up with a sustained stream of input at network speeds. What
40028 +       would be the method of flow control?
40029 +
40030 +   I can vary the size of the i/o buffers used for writing to the pty, and
40031 +   get different effects, but I am not able to get a clean download, no
40032 +   matter what buffer size I use. write()'ing to the pty does not return
40033 +   an error, and I can't see the errors because they happen on the master
40034 +   side. It's as if the path between the pty slave and master lacks flow
40035 +   control; I deliver a valid data stream to the pty slave and the master
40036 +   gets bits and pieces. This impression is bolstered somewhat by the
40037 +   "[92]man 7 pty" page in HP-UX, which talks about some special modes for
40038 +   ptys that turn off all termio processing and guarantee a
40039 +   flow-controlled reliable stream of bytes in both directions - a feature
40040 +   that seems to be specific to HP-UX, and exactly the one we need
40041 +   everywhere.
40042 +
40043 +   Well, in Pass One I used C-Kermit's existing pty routines from
40044 +   ckupty.[ch], which are well-proven in terms of portability and of
40045 +   actually working. They are currently used by SET HOST /PTY for making
40046 +   terminal connections to external processes. But these routines are
40047 +   written on the assumption that the pty is to be accessed interactively,
40048 +   and maybe they are setting the fork/pty arrangement up in such a way
40049 +   that that's not suitable for file transfer. The Pass One routine is
40050 +   called xttptycmd() in ckutio.c.
40051 +
40052 +   So in Pass Two I made a second copy of the routine, yttptycmd(), that
40053 +   manages the pty and fork itself, so all the code is in one place and
40054 +   it's simple and understandable. But it still doesn't work for Zmodem
40055 +   downloads. In this routine, I use openpty() to get the pty pair, which
40056 +   is not portable, so I can have access to both the master and slave pty
40057 +   file descriptors. This version can be used only a platforms that have
40058 +   openpty(): Linux, Mac OS X, NetBSD, etc.
40059 +
40060 +   In Pass Three, zttptycmd(), I tried using pipes instead of ptys, in
40061 +   case ptys are simply not up to this task (but that can't be true
40062 +   because if I make a Telnet or SSH connection into a host, I can send
40063 +   files to it with Zmodem, and the remote Zmodem receiver is, indeed,
40064 +   running on a pty). But pipes didn't work either.
40065 +
40066 +   In Pass Four, I extracted the relevant routines into a standalone
40067 +   program based on yttptycmd() (the openpty() version, for simplicity),
40068 +   which I tested on Mac OS X, the idea being to rule out any
40069 +   "environmental" effects of running inside the C-Kermit process. There
40070 +   was no difference -- Kermit transfers (with C-Kermit itself as the
40071 +   external protocol) worked; Zmodem transfers (neither sz or lsz) did
40072 +   not.
40073 +
40074 +   Well, it's a much longer story. As the external protocol, I've tried
40075 +   rzsz, crzsz, and lrzsz. We know that some of these have quirks
40076 +   regarding standard i/o, etc, which is one of the reasons for using ptys
40077 +   in the first place, and i/o does work - just not reliably. Anyway, the
40078 +   1100 lines or so of [93]ckc299.txt, starting just below where it says
40079 +   "--- Dev.27 ---" tell the full story. At this point I have to give up
40080 +   and move on; it might be more productive to let somebody else who has
40081 +   more experience with ptys take a look at it - if indeed anyone still
40082 +   cares about being able to do Zmodem transfers over secure Telnet
40083 +   connections.
40084 +
40085 +   C-Kermit 9.0 contains the three new routines (and some auxiliary ones),
40086 +   but they are not compiled or called unless you build it specially:
40087 +
40088 +     make targetname KFLAGS=-DXTTPTYCMD (builds with xttptycmd())
40089 +     make targetname KFLAGS=-DYTTPTYCMD (builds with yttptycmd())
40090 +     make targetname KFLAGS=-DZTTPTYCMD (builds with zttptycmd())
40091 +
40092 +   These are all in [94]ckutio.c. As noted, the second one works only for
40093 +   Linux, FreeBSD, NetBSD, and Mac OS X, because it uses non-POSIX,
40094 +   non-portable openpty(). If you want to try it on some other platform
40095 +   that has openpty(), you can build it like this:
40096 +
40097 +     make targetname "KFLAGS=-DYTTPTYCMD -DHAVE_OPENPTY"
40098 +
40099 +   (and let me know, so I can have HAVE_OPENPTY predefined for that
40100 +   platform too). The best strategy to get this working, I think, would be
40101 +   to concentrate on yttptycmd(), which is the simpler of the two
40102 +   pty-based routines. If it can be made to work, then we'll see if we can
40103 +   retrofit it to use the ckupty.c routines so it will be portable to
40104 +   non-BSD platforms.
40105 +
40106 +   By the way, if you build with any of [XYZ]TTPTYCMD defined, then the
40107 +   selected routine will always be used in place of ttruncmd(). This is to
40108 +   allow testing on all kinds of connections, not just secure ones, in
40109 +   both local and remote mode. Once the thing works, if it ever does, I'll
40110 +   add the appropriate tests and/or commands.
40111 +
40112 +   By default, in the initial test release, C-Kermit 9.0 uses ttruncmd()
40113 +   on serial connections and ttyptycmd() on network connections. Even when
40114 +   a network connection is not encrypted, Kermit still needs to handle the
40115 +   network protocol, e.g. the quoting of 0xff bytes on Telnet connections.
40116 +
40117 +Demonstration: Fetch Mail from POP Server Secured by SSL
40118 +
40119 +   [95]pop.ksc is a fully elaborated production script for fetching one's
40120 +   mail from a POP3 server over a connection secured by SSL. For
40121 +   explanation and documentation, [96]CLICK HERE. [97]mailcheck is a
40122 +   wrapper for the pop.ksc script, which collects your password one time,
40123 +   and then checks for new mail every 5 minutes (or other selected
40124 +   interval) and calls pop.ksc to fetch it if there is any.
40125 +
40126 +Demonstration: HP Switch Configuration Backup
40127 +
40128 +   A common use for Kermit software is to make automated backups of the
40129 +   configuration of network switches and routers, such as those made by
40130 +   Cisco or Hewlett-Packard (although [98]tftp can be used for this, it is
40131 +   not available in all such devices; Kermit, however, works with those
40132 +   that have tftp as well as those that don't).
40133 +
40134 +   Typically a backup can be done by making a Telnet, SSH, or serial
40135 +   connection to the device with Kermit and giving a command such as "show
40136 +   config" at the command-line prompt of the device with Kermit's session
40137 +   log activated. The result is a list of the commands that were used to
40138 +   establish the current configuration, suitable for feeding back to the
40139 +   device's console (e.g. with C-Kermit's TRANSMIT command) to reestablish
40140 +   the same configuration or to duplicate it on another device.
40141 +
40142 +   At an HP installation it was noted, however, that while the HP switches
40143 +   (various ProCurve models) produced the desired list of commands, they
40144 +   were interspersed with escape sequences for special effects, thus
40145 +   rendering the recorded sessions unsuitable for feeding back into the
40146 +   switches.
40147 +
40148 +   C-Kermit 9.0 introduces a new feature to strip the offending sequences
40149 +   out of a session log, leaving just the text. The command SET
40150 +   SESSION-LOG TEXT activates this feature. In C-Kermit 9.0 Alpha.02 and
40151 +   earlier, escape sequence stripping occurred only while logging
40152 +   interactive (CONNECT) sessions; beginning with Alpha.03 it is done also
40153 +   for data that is read by INPUT commands and therefore works for scripts
40154 +   too.
40155 +
40156 +   A sample HP Switch Configuration Backup script is [99]HERE, and its
40157 +   data file is [100]HERE. This script also illustrates some other new
40158 +   features of Alpha.03:
40159 +
40160 +   MESSAGE text
40161 +          This lets you put debugging messages in your script that can be
40162 +          displayed or not, according to SET DEBUG MESSAGE (below). This
40163 +          way you don't have to change your script for debugging.  Hint:
40164 +          In Unix, invoke the script like this:
40165 +
40166 +     $ DEBUG=1 scriptname arg1 arg2...
40167 +
40168 +          and then include the following command in your script:
40169 +
40170 +     if defined \$(DEBUG) set debug message on
40171 +
40172 +   XMESSAGE text
40173 +          Like MESSAGE but prints the text with no line terminator, so it
40174 +          can be continued by subsequent messages.
40175 +
40176 +   SET DEBUG MESSAGE { ON, OFF, STDERR }
40177 +          ON means MESSAGE commands should print to standard output; OFF
40178 +          means they shouldn't print anything; STDERR means the messages
40179 +          should be printed to [101]stderr. DEBUG MESSAGE is OFF by
40180 +          default, i.e. unless you SET it to ON or STDERR.
40181 +
40182 +   IF DEBUG command
40183 +          Executes the command if SET DEBUG MESSAGE is not OFF.
40184 +
40185 +   The \v(lastcommand) variable
40186 +          This variable contains the previous command. You can use it in
40187 +          debugging and error message to show (for example) exactly what
40188 +          the command was that just failed, without having to make a copy
40189 +          of the command:
40190 +
40191 +set host somehost.somecompany.com
40192 +if fail exit 1 "FATAL - \v(lastcommand)"
40193 +
40194 +          which, if the SET HOST command fails, prints "FATAL - set host
40195 +          somehost.somecompany.com" and then exits with status 1 (which
40196 +          normally indicates failure).
40197 +
40198 +Demonstration: HP iLO Blade Configuration
40199 +
40200 +   [102]THIS DOCUMENT describes a script in production use at Columbia
40201 +   University for configuring and deploying racks full of HP blade servers
40202 +   through their "integrated Lights Out" (iLO) management interface,
40203 +   bypassing the tedious and error-prone process of configuring the
40204 +   servers one by one through the vendor-provided point-and-click Web
40205 +   interface, which is ill-suited to configuring large numbers of blades.
40206 +   The script illustrates some of C-Kermit 9.0's new features; source code
40207 +   is available through the link. The code is apt to change from time to
40208 +   time as new requirements surface.
40209 +
40210 +Demonstration: IBM/Rolm/Siemens CBX Management
40211 +
40212 +   [103]THIS DOCUMENT describes a suite of scripts (some in production,
40213 +   some in development) used to manage the Columbia campus 20,000-line
40214 +   main telephone switch, along with about 10 satellite switches at
40215 +   off-campus locations. These switches are 1980s technology*, their
40216 +   management consoles are serial ports. Access is via Telnet to reverse
40217 +   terminal servers. The scripts allow for interactive sessions as well as
40218 +   automatic production (and in some cases formatting) of different
40219 +   reports required by different groups at different intervals. These
40220 +   scripts replace a whole assortment of ad-hoc ProComm ASPECT scripts
40221 +   that were scattered all over the place, with passwords embedded. The
40222 +   new scripts are intended to be run from a centralized server where
40223 +   there is a single well-secured configuration file, and where they can
40224 +   be used on demand, or in cron jobs. They are modular so code
40225 +   duplication is minimal.
40226 +   __________________________
40227 +   *  Of course the University is deploying new technology but the but the
40228 +   old system will be used in parallel for some time to come.
40229 +
40230 +Demonstration: CSV and TSV Files
40231 +
40232 +   Contents
40233 +
40234 +     * [104]Reading a CSV or TSV Record and Converting it to an Array
40235 +     * [105]Using \fjoin() to create a Comma- or Tab-Separated Value List
40236 +       from an Array
40237 +     * [106]Using CSV or TSV Files
40238 +
40239 +   Comma-Separated Value (CSV) format is commonly output by spreadsheets
40240 +   and databases when exporting data into plain-text files for import into
40241 +   other applications. Here are the details:
40242 +
40243 +   Comma-Separated List Syntax
40244 +
40245 +    1. Each record is a series of fields.
40246 +    2. Records are in whatever format is used by the underlying file
40247 +       system for lines of text.
40248 +    3. Fields within records are separated by commas, with zero or more
40249 +       whitespace characters (space or tab) before and/or after the comma;
40250 +       such whitespace is considered part of the separator.
40251 +    4. Fields with imbedded commas must be enclosed in ASCII doublequote
40252 +       characters.
40253 +    5. Fields with leading or trailing spaces must be enclosed in ASCII
40254 +       doublequotes.
40255 +    6. Any field may be enclosed in ASCII doublequotes.
40256 +    7. Fields with embedded doublequotes must be enclosed in doublequotes
40257 +       and each interior doublequote is doubled.
40258 +
40259 +   Here is an example:
40260 +
40261 +aaa, bbb, has spaces,,"ddd,eee,fff", " has spaces ","Muhammad ""The Greatest"" A
40262 +li"
40263 +
40264 +   The first two are regular fields. The second is a field that has an
40265 +   embedded space but in which any leading or trailing spaces are to be
40266 +   ignored. The fourth is an empty field, but still a field. The fifth is
40267 +   a field that contains embedded commas. The sixth has leading and
40268 +   trailing spaces. The last field has embedded quotation marks.
40269 +
40270 +   Prior to C-Kermit 9.0 Alpha.06, C-Kermit did not handle CSV files
40271 +   according to the specification above. Most seriously, there was no
40272 +   provision for a separator to be surrounded by whitespace that was to be
40273 +   considered part of the separator. Also there was no provision for
40274 +   quoting doublequotes inside of a quoted string.
40275 +
40276 +Reading a CSV record
40277 +
40278 +   Now the \fsplit() function can handle any CSV-format string if you
40279 +   include the symbolic include set "CSV" as the 4th parameter. To
40280 +   illustrate, this program:
40281 +
40282 +def xx {
40283 +   echo [\fcontents(\%1)]
40284 +   .\%9 := \fsplit(\fcontents(\%1), &a, \44, CSV)
40285 +   for \%i 1 \%9 1 { echo "\flpad(\%i,3). [\&a[\%i]]" }
40286 +   echo "-----------"
40287 +}
40288 +xx {a,b,c}
40289 +xx { a , b , c }
40290 +xx { aaa,,ccc," with spaces ",zzz }
40291 +xx { "1","2","3","","5" }
40292 +xx { this is a single field }
40293 +xx { this is one field, " and this is another  " }
40294 +xx { name,"Mohammad ""The Greatest"" Ali", age, 67 }
40295 +xx { """field enclosed in doublequotes""" }
40296 +exit
40297 +
40298 +   gives the following results:
40299 +
40300 +[a,b,c]
40301 +  1. [a]
40302 +  2. [b]
40303 +  3. [c]
40304 +-----------
40305 +[ a , b , c ]
40306 +  1. [a]
40307 +  2. [b]
40308 +  3. [c]
40309 +-----------
40310 +[ aaa,,ccc," with spaces ",zzz ]
40311 +  1. [aaa]
40312 +  2. []
40313 +  3. [ccc]
40314 +  4. [ with spaces ]
40315 +  5. [zzz]
40316 +-----------
40317 +[ "1","2","3","","5" ]
40318 +  1. [1]
40319 +  2. [2]
40320 +  3. [3]
40321 +  4. []
40322 +  5. [5]
40323 +-----------
40324 +[ this is a single field ]
40325 +  1. [this is a single field]
40326 +-----------
40327 +[ this is one field, " and this is another  " ]
40328 +  1. [this is one field]
40329 +  2. [ and this is another  ]
40330 +-----------
40331 +[ name,"Mohammad ""The Greatest"" Ali", age, 67 ]
40332 +  1. [name]
40333 +  2. [Mohammad "The Greatest" Ali]
40334 +  3. [age]
40335 +  4. [67]
40336 +-----------
40337 +[ """field enclosed in doublequotes""" ]
40338 +  1. ["field enclosed in doublequotes"]
40339 +-----------
40340 +
40341 +   The separator \44 (comma) must still be specified as the break set (3rd
40342 +   \fsplit() parameter). When "CSV" is specified as the include set:
40343 +     * The Grouping Mask is automatically set to 1 (which specifies that
40344 +       the ASCII doublequote character (") is used for grouping;
40345 +     * The Separator Flag is automatically set to 1 so that adjacent field
40346 +       separators will not be collapsed;
40347 +     * All bytes (values 0 through 255) other than the break character are
40348 +       added to the include set;
40349 +     * Any leading whitespace is stripped from the first element unless it
40350 +       is enclosed in doublequotes;
40351 +     * Any trailing whitespace is trimmed from the end of the last element
40352 +       unless it is enclosed in doublequotes;
40353 +     * If the separator character has any spaces or tabs preceding it or
40354 +       following it, they are ignored and discarded;
40355 +     * The separator character is treated as an ordinary data character if
40356 +       it appears in a quoted field;
40357 +     * A sequence of two doublequote characters ("") within a quoted field
40358 +       is converted to a single doublequote.
40359 +
40360 +   There is also a new TSV symbolic include set, which is like CSV except
40361 +   without the quoting rules or the stripping of whitespace around the
40362 +   separator because, by definition, TSV fields do not contain tabs.
40363 +
40364 +   Of course you can specify any separator(s) you want with either the
40365 +   CSV, TSV, or ALL symbolic include sets. For example, if you have a TSV
40366 +   file in which you want the spaces around each Tab to be discarded, you
40367 +   can use:
40368 +
40369 +\fsplit(variable, &a, \9, CSV)
40370 +
40371 +   \9 is Tab.
40372 +
40373 +   The new symbolic include sets can also be used with \fword(), which is
40374 +   just like \fsplit() except that it retrieves the nth word from the
40375 +   argument string, rather than an array of all the words. In C-Kermit you
40376 +   can get information about these or any other functions with the HELP
40377 +   FUNCTION command, e.g.:
40378 +
40379 +C-Kermit> help func word
40380 +
40381 +Function \fword(s1,n1,s2,s3,n2,n3) - Extracts a word from a string.
40382 +    s1 = source string.
40383 +    n1 = word number (1-based) counting from left; if negative, from right.
40384 +    s2 = optional break set.
40385 +    s3 = optional include set (or ALL, CSV, or TSV).
40386 +    n2 = optional grouping mask.
40387 +    n3 = optional separator flag:
40388 +       0 = collapse adjacent separators;
40389 +       1 = don't collapse adjacent separators.
40390 +
40391 +  \fword() returns the n1th "word" of the string s1, according to the
40392 +  criteria specified by the other parameters.
40393 +
40394 +  The BREAK SET is the set of all characters that separate words. The
40395 +  default break set is all characters except ASCII letters and digits.
40396 +  ASCII (C0) control characters are treated as break characters by default,
40397 +  as are spacing and punctuation characters, brackets, and so on, and
40398 +  all 8-bit characters.
40399 +
40400 +  The INCLUDE SET is the set of characters that are to be treated as
40401 +  parts of words even though they normally would be separators.  The
40402 +  default include set is empty.  Three special symbolic include sets are
40403 +  also allowed:
40404 +
40405 +    ALL (meaning include all bytes that are not in the break set)
40406 +    CSV (special treatment for Comma-Separated-Value records)
40407 +    TSV (special treatment for Tab-Separated-Value records)
40408 +
40409 +  For operating on 8-bit character sets, the include set should be ALL.
40410 +
40411 +  If the GROUPING MASK is given and is nonzero, words can be grouped by
40412 +  quotes or brackets selected by the sum of the following:
40413 +
40414 +     1 = doublequotes:    "a b c"
40415 +     2 = braces:          {a b c}
40416 +     4 = apostrophes:     'a b c'
40417 +     8 = parentheses:     (a b c)
40418 +    16 = square brackets: [a b c]
40419 +    32 = angle brackets:  <a b c>
40420 +
40421 +  Nesting is possible with {}()[]<> but not with quotes or apostrophes.
40422 +
40423 +Returns string:
40424 +  Word number n1, if there is one, otherwise an empty string.
40425 +
40426 +Also see:
40427 +  HELP FUNCTION SPLIT
40428 +
40429 +C-Kermit>
40430 +
40431 +Using \fjoin() to create Comma- or Tab-Separated Value Lists from Arrays
40432 +
40433 +   In C-Kermit 9.0, \fsplit()'s inverse function, [107]\fjoin() received
40434 +   the capability of converting an array into a comma-separated or a
40435 +   tab-separated value list. Thus, given a CSV, if you split it into an
40436 +   array with \fsplit() and then join the array with \fjoin(), giving each
40437 +   function the new CSV parameter in the appropriate argument position,
40438 +   the result will be will be equivalent to the original, according to the
40439 +   CSV definition. It might not be identical, because if the result had
40440 +   extraneous spaces before or after the separating commas, these are
40441 +   discarded, but that does not affect the elements themselves. The new
40442 +   syntax for \fjoin() is:
40443 +
40444 +   \fjoin(&a,CSV)
40445 +          Given the array \&a[] or any other valid array designator, joins
40446 +          its elements into a comma-separated list according to the
40447 +          [108]rules listed above.
40448 +
40449 +   \fjoin(&a,TSV)
40450 +          Joins the elements of the given array into a tab-separated list,
40451 +          also described above.
40452 +
40453 +   [109]Previous calling conventions for \fjoin() are undisturbed,
40454 +   including the ability to specify a portion of an array, rather than the
40455 +   whole array:
40456 +
40457 +declare \&a[] = 1 2 3 4 5 6 7 8 9
40458 +echo \fjoin(&a[3:7],CSV)
40459 +3,4,5,6,7
40460 +
40461 +   Using \fsplit() and \fjoin() it is now possible to convert a
40462 +   comma-separated value list into a tab-separated value list, and vice
40463 +   versa (which is not a simple matter of changing commas to tabs or vice
40464 +   versa).
40465 +
40466 +Applications for CSV Files
40467 +
40468 +   Databases such as MS Access or MySQL can export tables or reports in
40469 +   CSV format, and then Kermit can read the resulting CSV file and do
40470 +   whatever you like with it; typically something that could not be done
40471 +   with the database query language itself (or that you didn't know how to
40472 +   do that way): create reports or datasets based on complex criteria or
40473 +   procedures, edit or modify some fields, etc, and then use \fjoin() to
40474 +   put each record back in CSV form so it can be reimported into a
40475 +   spreadsheet or database.
40476 +
40477 +   Here is a simple example in which we purge all records of customers who
40478 +   have two or more unpaid bills. The file is sorted so that each license
40479 +   purchase record is followed by its annual maintenance payment records
40480 +   in chronological order.
40481 +
40482 +#!/usr/local/bin/kermit
40483 +.filename = somefile.csv        # Input file in CSV format
40484 +fopen /read \%c \m(filename)    # Open it
40485 +if fail exit                    # Don't go on if open failed
40486 +copy \m(filename) ./new         # Make a copy of the file
40487 +
40488 +.oldserial = 00000000000        # Multiple records for each serial number
40489 +.zeros = 0                      # Unpaid bill counter
40490 +
40491 +while true {                    # Loop
40492 +    fread /line \%c line        # Get a record
40493 +    if fail exit                # End of file
40494 +    .n := \fsplit(\m(line),&a,\44,CSV)    # Split the fields into an array
40495 +    if not equ "\m(oldserial)" "\&a[6]" { # Have new serial number?
40496 +        # Remove all records for previous serial number
40497 +        # if two or more bills were not paid...
40498 +        if > \m(zeros) 1 {
40499 +            grep /nomatch \m(oldserial) /output:./new2 ./new
40500 +            rename ./new2 ./new
40501 +        }
40502 +        .oldserial := \&a[6]    # To detect next time serial number changes
40503 +        .zeros = 0              # Reset unpaid bill counter
40504 +    }
40505 +    if equ "\&a[5]" "$0.00" {   # Element 5 is amount paid
40506 +        increment zeros         # If it's zero, count it.
40507 +    }
40508 +}
40509 +fclose \%c
40510 +
40511 +   Rewriting the file multiple times is inelegant, but this is a quick and
40512 +   dirty use-once-and-discard script, so elegance doesn't count. The
40513 +   example is interesting in that it purges certain records based on the
40514 +   contents of other records. Maybe there is a way to do this directly
40515 +   with SQL, but why use SQL when you can use Kermit?
40516 +
40517 +   Here is the same task but this time no shelling out, and this time we
40518 +   do change and add some fields and then join the result back into a CSV
40519 +   record and write it out to a new file. The object is to create a record
40520 +   for each license that shows not only the date and purchase price of the
40521 +   license but also the date and amount of the last maintenance payment,
40522 +   and to add new fields for sorting by anniversary (month and day):
40523 +
40524 +#!usr/local/bin/kermit +
40525 +cd ~/somedirectory                      # CD to appropriate directory
40526 +if fail exit 1                          # Make sure we did
40527 +.filename := \%1                        # Filename from command line
40528 +if not def filename {                   # If none give usage message
40529 +    exit 1 "Usage: \%0: infile [ outfile ]"
40530 +}
40531 +fopen /read \%c \m(filename)            # Open the input CSV file
40532 +if fail exit                            # Make sure we did
40533 +
40534 +.output := \%2                          # Output filename from command line
40535 +if not def output {                     # Supply one if not given
40536 +    .output := New_\m(filename)
40537 +}
40538 +fopen /write \%o \m(output)             # Open output file
40539 +if fail exit                            # Check that we did
40540 +
40541 +.serial = 00000000000                   # Initialize serial number
40542 +.licenses = 0                           # and license counter
40543 +
40544 +fread /line \%c line                        # First line is column labels
40545 +if fail exit                                # Check
40546 +fwrite /line \%o "\m(line),AMM_DD,AYYYY"    # Write new labels line
40547 +
40548 +# Remaining lines are license purchases (K95B) followed by zero or more
40549 +# maintenance invoices (K95BM) for each license.
40550 +
40551 +.datepaid = 00/00/0000                  # Initialize last maint payment date
40552 +.amtpaid = $0.00                        # Initialize last maint payment amount
40553 +set flag off                            # For remembering we're at end of file
40554 +while not flag {                        # Loop to read all records
40555 +    fread /line \%c line                # Read a record
40556 +    if fail set flag on                 # If EOF set flag for later
40557 +    .n := \fsplit(\m(line),&a,\44,CSV)  # Break record into array
40558 +    if ( flag || equ "\&a[3]" "K95B" ) { # License or EOF
40559 +        if fail exit 1 "FAILED: \v(lastcommand)"
40560 +        if licenses {                   # If this is not the first license
40561 +            .\&x[5] := \m(amtpaid)      # Substitute most recent amount paid
40562 +            .\&x[21] := \m(datepaid)    # Substitute most recent date paid
40563 +            void \fsplit(\&x[18],&d,/)  # Break up original (anniversary) date
40564 +            # and put mm_dd and yyyy in separate fields for sorting...
40565 +            fwrite /line \%o "\fjoin(&x,CSV),\flpad(\&d[1],2,0)_\flpad(\&d[2],2,
40566 +0),\&d[3]"
40567 +            if fail exit 1 WRITE        # Check for error
40568 +            xecho .                     # Show progress as one dot per record
40569 +        }
40570 +        if flag break                   # We're at EOF so we're finished
40571 +        increment licenses              # New license - count it
40572 +        array copy &a &x                # Keep this record while reading next
40573 +        .serial := \&a[6]               # Remember serial number
40574 +        .datepaid = 00/00/0000          # Initial maintenance payment date
40575 +        .amtpaid = $0.00                # and amount
40576 +        continue                        # and go back to read next record
40577 +    }
40578 +    if not eq "\m(serial)" "\&a[6]" {   # Catch out-of-sequence record
40579 +        echo
40580 +        echo "SEQUENCE: \m(serial)..\&a[6]: \&a[7] [\&a[1]]"
40581 +        continue
40582 +    }
40583 +    if equ "\&a[5]" "" .\&a[5] = $0.00  # If amount is empty make it $0.00
40584 +    if not equ "\&a[5]" "$0.00" {       # If amount is not $0.00
40585 +        .datepaid := \&a[21]            # remember date paid
40586 +        .amtpaid := \&a[5]              # and amount paid
40587 +    }
40588 +}
40589 +fclose ALL                              # Done - close all files and exit
40590 +exit 0 Done.
40591 +
40592 +
40593 +   The result imports back into Excel, where it can be sorted, formatted,
40594 +   or otherwise manipulated as desired.
40595 +
40596 +Using CSV Files: Extending Kermit's Data Structures
40597 +
40598 +   Now that we can parse a CSV record, what would we do with a CSV file -
40599 +   that is, a sequence of records? If we needed all the data available at
40600 +   once, we would want to load it into a matrix of (row,column) values.
40601 +   But Kermit doesn't have matrices. Or does it?
40602 +
40603 +   Kermit has several built-in data types, but you can invent your own
40604 +   data types as needed using Kermit's macro feature:
40605 +
40606 +define variablename value
40607 +
40608 +   For example:
40609 +
40610 +define alphabet abcdefghijklmnopqrstuvwxyz
40611 +
40612 +   This defines a macro named alphabet and gives it the value
40613 +   abcdefghijklmnopqrstuvwxyz. A more convenient notation (added in
40614 +   C-Kermit 7.0, see [110]Table 2) for this is:
40615 +
40616 +.alphabet = abcdefghijklmnopqrstuvwxyz
40617 +
40618 +   The two are exactly equivalent: they make a literal copy the "right
40619 +   hand side" as the value of the macro. Then you can refer to the macro
40620 +   anywhere in a Kermit command as "\m(macroname)":
40621 +
40622 +echo "Alphabet = \m(alphabet)"
40623 +
40624 +   There is a second way to define a macro, which is like the first except
40625 +   that the right-hand side is evaluated first; that is, any variable
40626 +   references or function calls in the right-hand side are replaced by
40627 +   their values before the result is assigned to the macro. The command
40628 +   for this is ASSIGN rather than DEFINE:
40629 +
40630 +define alphabet abcdefghijklmnopqrstuvwxyz
40631 +assign backwards \freverse(\m(alphabet))
40632 +echo "Alphabet backwards = \m(backwards)"
40633 +
40634 +   which prints:
40635 +
40636 +Alphabet backwards = zyxwvutsrqponmlkjihgfedcba
40637 +
40638 +   This kind of assignment can also be done like this:
40639 +
40640 +.alphabet = abcdefghijklmnopqrstuvwxyz
40641 +.backwards := \freverse(\m(alphabet))
40642 +
40643 +   [111]Any command starting with a period is an assignment, and the
40644 +   operator (= or :=) tells what to do with the right-hand side before
40645 +   making the assignment.
40646 +
40647 +   In both the DEFINE and ASSIGN commands, the variable name itself is
40648 +   taken literally. It is also possible, however, to have Kermit compute
40649 +   the variable name. This is done (as described in [112]Using C-Kermit,
40650 +   2nd Ed., p.457), using parallel commands that start with underscore:
40651 +   _DEFINE and _ASSIGN (alias _DEF and _ASG). These are just like DEFINE
40652 +   and ASSIGN except they evaluate the variable name before making the
40653 +   assigment. For example:
40654 +
40655 +define \%a one
40656 +_define \%a\%a\%a 111
40657 +
40658 +   would create a macro named ONEONEONE with a value of 111, and:
40659 +
40660 +define \%a one
40661 +define number 111
40662 +_assign \%a\%a\%a \m(number)
40663 +
40664 +   would create the same macro with the same value, but:
40665 +
40666 +define \%a one
40667 +define number 111
40668 +_define \%a\%a\%a \m(number)
40669 +
40670 +   would give the macro a value of "\m(number)".
40671 +
40672 +   You can use the _ASSIGN command to create any kind of data structure
40673 +   you want; you can find some examples in the [113]Object-Oriented
40674 +   Programming section of the [114]Kermit Script Library. In the following
40675 +   program we use this capability to create a two-dimensional array, or
40676 +   matrix, to hold the all the elements of the CSV file, and then to
40677 +   display the matrix:
40678 +
40679 +fopen /read \%c data.csv                # Open CSV file
40680 +if fail exit 1
40681 +
40682 +.\%r = 0                                # Row
40683 +.\%m = 0                                # Maximum columns
40684 +while true {
40685 +    fread /line \%c line                # Read a record
40686 +    if fail break                       # End of file
40687 +    .\%n := \fsplit(\m(line),&a,\44,CSV) # Split record into items
40688 +    incr \%r                            # Count this row
40689 +    for \%i 1 \%n 1 {                   # Assign items to this row of matrix
40690 +        _asg a[\%r][\%i] \&a[\%i]
40691 +    }
40692 +    if > \%i \%m { .\%m := \%i }        # Remember width of widest row
40693 +}
40694 +fclose \%c                              # Close CSV file
40695 +decrement \%m                           # (because of how FOR loop works)
40696 +echo MATRIX A ROWS: \%r COLUMNS: \%m    # Show the matrix
40697 +
40698 +for \%i 1 \%r 1 {                       # Loop through rows
40699 +    for \%j 1 \%m 1 {                   # Loop through columns of each row
40700 +        xecho "\flpad(\m(a[\%i][\%j]),6)"
40701 +    }
40702 +    echo
40703 +}
40704 +exit 0
40705 +
40706 +   The matrix is called a and its elements are a[1][1], a[1][2], a[1][3],
40707 +   ... a[2][1], etc, and you can treat this data structure exactly like a
40708 +   two-dimensional array, in which you can refer to any element by its "X
40709 +   and Y coordinates". For example, if the CSV file contained numeric data
40710 +   you could compute row and column sums using simple FOR loops and
40711 +   Kermit's built-in one-dimensional array data type:
40712 +
40713 +declare \&r[\%r]                        # Make an array for the row sums
40714 +declare \&c[\%m]                        # Make an array for the column sums
40715 +for \%i 1 \%r 1 {                       # Loop through rows
40716 +    for \%j 1 \%m 1 {                   # Loop through columns of each row
40717 +        increment \&r[\%i] \m(a[\%i][\%j]) # Accumulate row sum
40718 +        increment \&c[\%j] \m(a[\%i][\%j]) # Accumulate column sum
40719 +    }
40720 +}
40721 +
40722 +   Note that the sum arrays don't have to be initialized to zero because
40723 +   Kermit's INCREMENT command treats empty definitions as zero.
40724 +
40725 +Demonstration Scripts for Webmasters
40726 +
40727 +   [115]ksitemap
40728 +          A C-Kermit 9.0 script to build sitemap.xml for a website,
40729 +          complete with Google image extensions (this is the file used by
40730 +          webmasters to get their sites crawled and indexed optimally).
40731 +
40732 +   [116]The Weblog Script
40733 +          Reads a web log, extracts the Google searches, normalizes the
40734 +          search strings, and prints the top 20 searches, along with their
40735 +          counts. Documented [117]HERE.
40736 +
40737 +   [118]The Amazon Script
40738 +          Reads an Amazon Associate orders report and lists the products
40739 +          according to the number of orders for each, or the number of
40740 +          clicks on each.
40741 +
40742 +   [119]Photoalbum
40743 +          Makes a website from a collecion of JPG images. For explanation
40744 +          and documentation, [120]CLICK HERE. Requires [121]C-Kermit 9.0
40745 +          or later.
40746 +
40747 +            [122]Home [123]Kermit 95 [124]C-Kermit [125]Scripts [126]Current
40748 +   [127]New [128]FAQ  [129]Support
40749 +
40750 +
40751 +    C-Kermit 9.0 / [130]The Kermit Project / [131]Columbia University /
40752 +    [132]kermit@columbia.edu / [133]validate
40753 +
40754 +References
40755 +
40756 +   1. http://www.columbia.edu/
40757 +   2. mailto:kermit@columbia.edu
40758 +   3. http://www.columbia.edu/kermit/index.html
40759 +   4. http://www.columbia.edu/kermit/k95.html
40760 +   5. http://www.columbia.edu/kermit/ckermit.html
40761 +   6. http://www.columbia.edu/kermit/ckscripts.html
40762 +   7. http://www.columbia.edu/kermit/current.html
40763 +   8. http://www.columbia.edu/kermit/whatsnew.html
40764 +   9. http://www.columbia.edu/kermit/faq.html
40765 +  10. http://www.columbia.edu/kermit/support.html
40766 +  11. http://www.columbia.edu/kermit/ck90tables.html
40767 +  12. http://www.amazon.com/gp/product/1555581641?ie=UTF8&tag=aleidmoreldom-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=1555581641
40768 +  13. http://www.columbia.edu/kermit/ckermit.html#download
40769 +  14. http://www.columbia.edu/kermit/ckermit90.html#LargeFiles
40770 +  15. http://www.columbia.edu/kermit/ckermit90.html#TestLargeFiles
40771 +  16. http://www.columbia.edu/kermit/ckermit90.html#Bignums
40772 +  17. http://www.columbia.edu/kermit/ckermit90.html#force3
40773 +  18. http://www.columbia.edu/kermit/ckermit90.html#Vareval
40774 +  19. http://www.columbia.edu/kermit/ckermit90.html#rename
40775 +  20. http://www.columbia.edu/kermit/ckermit90.html#Other
40776 +  21. http://www.columbia.edu/kermit/ckermit90.html#Incompatibilities
40777 +  22. http://www.columbia.edu/kermit/ckermit90.html#NotIn9.0
40778 +  23. http://www.columbia.edu/kermit/ckermit90.html#LooseEnd
40779 +  24. http://www.columbia.edu/kermit/ckermit90.html#pop
40780 +  25. http://www.columbia.edu/kermit/ckermit90.html#HPswitch
40781 +  26. http://www.columbia.edu/kermit/ckermit90.html#iLO
40782 +  27. http://www.columbia.edu/kermit/ckermit90.html#Rolm
40783 +  28. http://www.columbia.edu/kermit/ckermit90.html#CSV
40784 +  29. http://www.columbia.edu/kermit/ckermit90.html#Otherdemos
40785 +  30. http://www.columbia.edu/kermit/ck60manual.html
40786 +  31. http://www.amazon.com/gp/product/B002ACPF9M?ie=UTF8&tag=aleidmoreldom-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B002ACPF9M
40787 +  32. http://www.columbia.edu/kermit/ckermit70.html
40788 +  33. http://www.columbia.edu/kermit/ckermit80.html
40789 +  34. http://www.columbia.edu/kermit/ckscripts.html
40790 +  35. http://www.columbia.edu/kermit/dec20.html
40791 +  36. mailto:fdc@columbia.edu
40792 +  37. http://www.columbia.edu/kermit/cu-bsd-license.html
40793 +  38. http://www.columbia.edu/kermit/ckermit90.html#LargeFiles
40794 +  39. http://www.columbia.edu/kermit/ck90tables.html
40795 +  40. http://www.columbia.edu/kermit/ck90tables.html
40796 +  41. http://www.columbia.edu/kermit/ckermit90.html#force3
40797 +  42. http://www.columbia.edu/kermit/ckermit90.html#Vareval
40798 +  43. http://www.columbia.edu/kermit/ckrename.html
40799 +  44. http://www.columbia.edu/kermit/csv.html
40800 +  45. http://www.columbia.edu/kermit/csetnames.html
40801 +  46. http://www.columbia.edu/kermit/ckermit90.html#HPswitch
40802 +  47. http://www.columbia.edu/kermit/ckdaily.html
40803 +  48. http://www.columbia.edu/kermit/cu-bsd-license.html
40804 +  49. http://www.opensource.org/
40805 +  50. http://kermit.columbia.edu/ck90tables.html#LF
40806 +  51. ftp://kermit.columbia.edu/kermit/utils/bigfile.c
40807 +  52. http://www.columbia.edu/kermit/ckermit80.html#x9
40808 +  53. http://www.columbia.edu/kermit/ck90tables.html#LF
40809 +  54. ftp://kermit.columbia.edu/kermit/scripts/ckermit/easter2
40810 +  55. http://www.columbia.edu/kermit/em-apex.html
40811 +  56. http://www.iridium.com/
40812 +  57. http://science1.nasa.gov/science-news/science-at-nasa/2006/09jan_electrichurricanes/
40813 +  58. http://www.columbia.edu/kermit/ek.html
40814 +  59. ftp://kermit.columbia.edu/kermit/ek/simirid/
40815 +  60. http://www.columbia.edu/kermit/ek.html
40816 +  61. http://www.columbia.edu/kermit/ckermit70.html#x7.10.10
40817 +  62. http://www.columbia.edu/kermit/csv.html
40818 +  63. http://www.columbia.edu/kermit/ckermit70.html#x1.11
40819 +  64. http://www.columbia.edu/kermit/ckermit70.html
40820 +  65. http://www.columbia.edu/kermit/ckermit80.html#x9
40821 +  66. http://www.columbia.edu/kermit/csetnames.html
40822 +  67. http://www.columbia.edu/kermit/ckdaily.html
40823 +  68. http://www.columbia.edu/kermit/ckrename.html
40824 +  69. http://www.columbia.edu/kermit/ftpclient.html
40825 +  70. http://www.columbia.edu/kermit/ckdaily.html
40826 +  71. http://www.columbia.edu/kermit/input_nowrap.html
40827 +  72. http://www.columbia.edu/~fdc/mm/index.html
40828 +  73. http://www.columbia.edu/kermit/photoalbum.html
40829 +  74. http://www.columbia.edu/~fdc/kermit/logserial.html
40830 +  75. http://www.columbia.edu/kermit/csetnames.html
40831 +  76. http://www.columbia.edu/kermit/ckermit90.html#NotIn9.0
40832 +  77. http://www.columbia.edu/kermit/csv.html#join
40833 +  78. http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3767
40834 +  79. http://www.columbia.edu/kermit/ftp/test/tar/x.zip
40835 +  80. http://www.mseclab.com/?p=180
40836 +  81. http://www.theregister.co.uk/2009/07/30/universal_ssl_certificate/
40837 +  82. http://www.columbia.edu/kermit/csv.html
40838 +  83. http://www.columbia.edu/kermit/csetnames.html
40839 +  84. http://www.columbia.edu/kermit/ckermit90.html#HPswitch
40840 +  85. http://www.columbia.edu/kermit/em-apex.html
40841 +  86. http://www.freebsd.org/releases/8.0R/announce.html
40842 +  87. http://www.columbia.edu/kermit/security81.html#x4.2.3
40843 +  88. http://www.columbia.edu/kermit/ckermit80.html#x9
40844 +  89. http://www.columbia.edu/kermit/ckermit80.html#x8.7.2
40845 +  90. http://www.columbia.edu/kermit/ckermit80.html#x9
40846 +  91. http://www.columbia.edu/kermit/ckpackages.html
40847 +  92. http://docs.hp.com/en/B9106-90013/pty.7.html
40848 +  93. http://www.columbia.edu/kermit/test/text/ckc299.txt
40849 +  94. http://www.columbia.edu/kermit/test/text/ckutio.c
40850 +  95. http://www.columbia.edu/~fdc/mm/pop
40851 +  96. http://www.columbia.edu/~fdc/mm/
40852 +  97. http://www.columbia.edu/~fdc/mm/mailcheck
40853 +  98. http://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol
40854 +  99. http://www.columbia.edu/kermit/ftp/scripts/ckermit/gethpconfig
40855 + 100. http://www.columbia.edu/kermit/ftp/scripts/ckermit/TestSwitches.txt
40856 + 101. http://en.wikipedia.org/wiki/Standard_streams
40857 + 102. http://kermit.columbia.edu/cudocs/ilosetup.html
40858 + 103. http://www.columbia.edu/kermit/cudocs/cbx.html
40859 + 104. http://www.columbia.edu/kermit/ckermit90.html#record
40860 + 105. http://www.columbia.edu/kermit/ckermit90.html#join
40861 + 106. http://www.columbia.edu/kermit/ckermit90.html#file
40862 + 107. http://www.columbia.edu/kermit/ckermit80.html#fjoin
40863 + 108. http://www.columbia.edu/kermit/ckermit90.html#rules
40864 + 109. http://www.columbia.edu/kermit/ckermit80.html#fjoin
40865 + 110. http://www.columbia.edu/kermit/ckermit90.html#varasg
40866 + 111. http://www.columbia.edu/kermit/ckermit70.html#x7.9
40867 + 112. http://www.amazon.com/gp/product/1555581641?ie=UTF8&tag=aleidmoreldom-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=1555581641
40868 + 113. http://www.columbia.edu/kermit/ckscripts.html#oops
40869 + 114. http://www.columbia.edu/kermit/ckscripts.html
40870 + 115. http://www.columbia.edu/kermit/ksitemap.html
40871 + 116. http://kermit.columbia.edu/ftp/scripts/ckermit/weblog
40872 + 117. http://www.columbia.edu/kermit/weblog.html
40873 + 118. http://kermit.columbia.edu/ftp/scripts/ckermit/amazon
40874 + 119. http://kermit.columbia.edu/ftp/scripts/ckermit/photoalbum
40875 + 120. http://www.columbia.edu/kermit/photoalbum.html
40876 + 121. http://www.columbia.edu/kermit/ck90.html
40877 + 122. http://www.columbia.edu/kermit/index.html
40878 + 123. http://www.columbia.edu/kermit/k95.html
40879 + 124. http://www.columbia.edu/kermit/ckermit.html
40880 + 125. http://www.columbia.edu/kermit/ckscripts.html
40881 + 126. http://www.columbia.edu/kermit/current.html
40882 + 127. http://www.columbia.edu/kermit/whatsnew.html
40883 + 128. http://www.columbia.edu/kermit/faq.html
40884 + 129. http://www.columbia.edu/kermit/support.html
40885 + 130. http://www.columbia.edu/kermit/index.html
40886 + 131. http://www.columbia.edu/
40887 + 132. mailto:kermit@columbia.edu
40888 + 133. http://validator.w3.org/check?uri=http%3A%2F%2Fkermit.columbia.edu%2Fck90.html
40889 --- /dev/null
40890 +++ ckermit-301/ckcbwr.txt
40891 @@ -0,0 +1,1503 @@
40892 +
40893 +   [1]The Columbia Crown The Kermit Project | Columbia University
40894 +   612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
40895 +   ...since 1981
40896 +   [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
40897 +   [10]Support
40898 +
40899 +   As of: C-Kermit 9.0.300, 30 June 2011
40900 +   This page last updated: Tue Jun 28 08:54:30 2011 (New York USA Time)
40901 +
40902 +     IF YOU ARE READING A PLAIN-TEXT version of this document, it is a
40903 +     plain-text dump of a Web page. You can visit the original (and
40904 +     possibly more up-to-date) Web page here:
40905 +
40906 +  [11]http://www.columbia.edu/kermit/ckcbwr.html
40907 +
40908 +   This document contains platform-independent C-Kermit hints and tips.
40909 +   Also see the platform-specific C-Kermit hints and tips document for
40910 +   your platform, for example:
40911 +
40912 +  [12]http://www.columbia.edu/kermit/ckubwr.html
40913 +
40914 +   for Unix. This document also applies to [13]Kermit 95 for Windows,
40915 +   which is based on C-Kermit.
40916 +
40917 +   [ [14]C-Kermit ] [ [15]TUTORIAL ]
40918 +
40919 +CONTENTS
40920 +
40921 +   0. [16]PATCHES
40922 +   1. [17]INCOMPATIBLE CHANGES
40923 +   2. [18]THE C-KERMIT COMMAND PARSER
40924 +   3. [19]MULTIPLE SESSIONS
40925 +   4. [20]NETWORK CONNECTIONS
40926 +   5. [21]MODEMS AND DIALING
40927 +   6. [22]DIALING HINTS AND TIPS
40928 +   7. [23]TERMINAL SERVERS
40929 +   8. [24]TERMINAL EMULATION
40930 +   9. [25]KEY MAPPING
40931 +  10. [26]FILE TRANSFER
40932 +  11. [27]SCRIPT PROGRAMMING
40933 +
40934 +0. PATCHES
40935 +
40936 +   [ [28]Top ] [ [29]Contents ] [ [30]Next ]
40937 +
40938 +   Source-level patches for C-Kermit 8.0.211:
40939 +
40940 +     (None)
40941 +
40942 +1. INCOMPATIBLE CHANGES
40943 +
40944 +   [ [31]Top ] [ [32]Contents ] [ [33]Next ]
40945 +
40946 +   These are not necessarily exhaustive lists.
40947 +
40948 +1.1. C-Kermit 6.0
40949 +
40950 +   C-Kermit 6.0 was released 6 September 1996 and is completely documented
40951 +   in [34]Using C-Kermit, 2nd Edition. The following incompatible changes
40952 +   were made in C-Kermit 6.0:
40953 +
40954 +     * Unless you tell C-Kermit otherwise, if a serial or network
40955 +       connection seems to be open, and you attempt to EXIT or to open a
40956 +       new connection, C-Kermit warns you that an active connection
40957 +       appears to be open and asks you if you really want to close it. If
40958 +       you do not want these warnings, add SET EXIT WARNING OFF to your
40959 +       customization file or script, or give this command at the prompt.
40960 +     * The default for SET { SEND, RECEIVE } PATHNAMES was changed from ON
40961 +       to OFF, to prevent unexpected creation of directories and
40962 +       depositing of incoming files in places you might not know to look.
40963 +     * The default for SET FILE INCOMPLETE was changed from DISCARD to
40964 +       KEEP to allow for file transfer recovery.
40965 +     * The default file-transfer block-check is now 3, rather than 1. If
40966 +       the other Kermit does not support this, the two will drop back to
40967 +       type 1 automatically unless the other Kermit fails to follow the
40968 +       protocol specification.
40969 +     * The default flow-control is now "auto" ("do the right thing for
40970 +       each type of connection"), not Xon/Xoff.
40971 +     * Backslash (\) is no longer a command continuation character. Only -
40972 +       (hyphen, dash) may be used for this in C-Kermit 6.0 and later.
40973 +     * Negative INPUT timeout now results in infinite wait, rather than 1
40974 +       second.
40975 +
40976 +1.2. C-Kermit 7.0
40977 +
40978 +   C-Kermit 7.0 was released 1 January 2000. Its new features are
40979 +   documented in the C-Kermit 7.0 Supplement,
40980 +   [35]http://www.columbia.edu/kermit/ckermit2.html. The following
40981 +   incompatible changes were made in C-Kermit 7.0:
40982 +     * The "multiline GET" command is gone. Now use either of the
40983 +       following forms instead:
40984 +  get remote-name local-name
40985 +  get /as-name:local-name remote-name
40986 +
40987 +       If either name contains spaces, enclose it in braces (or, in
40988 +       C-Kermit 8.0, doublequotes).
40989 +     * To include multiple file specifications in a GET command, you must
40990 +       now use MGET rather than GET:
40991 +  mget file1 file2 file3 ...
40992 +
40993 +     * C-Kermit 7.0 and later use FAST Kermit protocol settings by
40994 +       default. This includes "unprefixing" of certain control characters.
40995 +       Because of this, file transfers that worked with previous releases
40996 +       might not work in the new release especially against a
40997 +       non-Kermit-Project Kermit protocol implementation (but it is more
40998 +       likely that they will work, and much faster). If a transfer fails,
40999 +       you'll get a context-sensitive hint suggesting possible causes and
41000 +       cures. Usually SET PREFIXING ALL does the trick.
41001 +     * By default C-Kermit 7.0 and later send files in text or binary mode
41002 +       by looking at each file to see which is the appropriate mode. To
41003 +       restore the previous behavior, put SET TRANSFER MODE MANUAL and the
41004 +       desired SET FILE TYPE (TEXT or BINARY) in your C-Kermit
41005 +       initialization file.
41006 +     * The RESEND and REGET commands automatically switch to binary mode;
41007 +       previously if RESEND or REGET were attempted when FILE TYPE was
41008 +       TEXT, these commands would fail immediately, with a message telling
41009 +       you they work only when the FILE TYPE is BINARY. Now they simply do
41010 +       this for you.
41011 +     * SET PREFIXING CAUTIOUS and MINIMAL now both prefix linefeed (10 and
41012 +       138) in case rlogin, ssh, or cu are "in the middle", since
41013 +       otherwise <LF>~ might appear in Kermit packets, and this would
41014 +       cause rlogin, ssh, or cu to disconnect, suspend,escape back, or
41015 +       otherwise wreck the file transfer. Xon and Xoff are now always
41016 +       prefixed too, even when Xon/Xoff flow control is not in effect,
41017 +       since unprefixing them has proven dangerous on TCP/IP connections.
41018 +     * In UNIX, VMS, Windows, and OS/2, the DIRECTORY command is built
41019 +       into C-Kermit itself rather than implemented by running an external
41020 +       command or program. The built-in command might not behave the way
41021 +       the platform-specific external one did, but many options are
41022 +       available for customization. Of course the underlying
41023 +       platform-specific command can still be accessed with "!", "@", or
41024 +       "RUN" wherever the installation does not forbid. In UNIX, the "ls"
41025 +       command can be accessed directly as "ls" in C-Kermit.
41026 +     * SEND ? prints a list of switches rather than a list of filenames.
41027 +       If you want to see a list of filenames, use a (system-dependent)
41028 +       construction such as SEND ./? (for UNIX, Windows, or OS/2), SEND
41029 +       []? (VMS), etc.
41030 +     * In UNIX, OS-9, and Kermit 95, the wildcard characters in previous
41031 +       versions were * and ?. In C-Kermit 7.0 they are *, ?, [, ], {, and
41032 +       }, with dash used inside []'s to denote ranges and comma used
41033 +       inside {} to separate list elements. If you need to include any of
41034 +       these characters literally in a filename, precede each one with
41035 +       backslash (\).
41036 +     * SET QUIET { ON, OFF } is now on the command stack, just like SET
41037 +       INPUT CASE, SET COUNT, SET MACRO ERROR, etc, as described on p.458
41038 +       of [36]Using C-Kermit, 2nd Edition. This allows any macro or
41039 +       command file to SET QUIET ON or OFF without worrying about saving
41040 +       and restoring the global QUIET value. For example, this lets you
41041 +       write a script that tries SET LINE on lots of devices until it
41042 +       finds one free without spewing out loads of error messages, and
41043 +       also without disturbing the global QUIET setting, whatever it was.
41044 +     * Because of the new "." operator (which introduces assignments),
41045 +       macros whose names begin with "." can not be invoked "by name".
41046 +       However, they still can be invoked with DO or \fexecute().
41047 +     * The syntax of the EVALUATE command has changed. To restore the
41048 +       previous syntax, use SET EVALUATE OLD.
41049 +     * The \v(directory) variable now includes the trailing directory
41050 +       separator; in previous releases it did not. This is to allow
41051 +       constructions such as:
41052 +  cd \v(dir)data.tmp
41053 +
41054 +       to work across platforms that might have different directory
41055 +       notation, such as UNIX, Windows, and VMS.
41056 +     * Prior to C-Kermit 7.0, the FLOW-CONTROL setting was global and
41057 +       sticky. In C-Kermit 7.0, there is an array of default flow-control
41058 +       values for each kind of connection, that are applied automatically
41059 +       at SET LINE/PORT/HOST time. Thus a SET FLOW command given before
41060 +       SET LINE/PORT/HOST is likely to be undone. Therefore SET FLOW can
41061 +       be guaranteed to have the desired effect only if given after the
41062 +       SET LINE/PORT/HOST command.
41063 +     * Character-set translation works differently in the TRANSMIT command
41064 +       when (a) the file character-set is not the same as the local end of
41065 +       the terminal character-set, or (b) when the terminal character-set
41066 +       is TRANSPARENT.
41067 +
41068 +1.3. C-Kermit 8.0
41069 +
41070 +   The following incompatible changes were made in C-Kermit 8.0:
41071 +     * C-Kermit now accepts doublequotes in most contexts where you
41072 +       previously had to use braces to group multiple words into a single
41073 +       field, or to force inclusion of leading or trailing blanks. This
41074 +       might cause problems in contexts where you wanted the doublequote
41075 +       characters to be taken literally. Consult [37]Section 5 of the
41076 +       [38]C-Kermit 8.0 Update Notes for further information.
41077 +     * Using the SET HOST command to make HTTP connections is no longer
41078 +       supported. Instead, use the new [39]HTTP OPEN command.
41079 +
41080 +1.4. C-Kermit 9.0
41081 +
41082 +   The [40]\fsplit() function is incredibly handy, it can do almost
41083 +   anything, up to and including parsing a LISP program (the underlying
41084 +   code is the basis of the [41]S-Expression interpreter). But did you
41085 +   ever try to use it to parse (say) a Tab-Separated-List (TSV file) or
41086 +   Comma-Separated-List (CSV)? It works as expected as long as the data
41087 +   contains only 7-bit characters. But if your data contains (say) Spanish
41088 +   or German or Russian text written in an 8-bit character set such as ISO
41089 +   8859-1, every 8-bit character (any value 128-255) is treated as a break
41090 +   character. This is fixed in C-Kermit 9.0 by treating all 8-bit bytes as
41091 +   "include" characters rather than break characters, a total reversal of
41092 +   past behavior. I don't think it will affect anyone though, because if
41093 +   this had happened to anyone, I would have heard about it!
41094 +
41095 +   Since most standard 8-bit character sets have control characters in
41096 +   positions 128-160, it might have made sense to keep 128-160 in the
41097 +   break set, but with the proliferation of Microsoft Windows code pages,
41098 +   there is no telling which 8-bit character is likely to be some kind of
41099 +   text, e.g. "smart quotes" or East European or Turkish accented letters.
41100 +
41101 +2. THE C-KERMIT COMMAND PARSER
41102 +
41103 +   [ [42]Top ] [ [43]Contents ] [ [44]Next ] [ [45]Previous ]
41104 +
41105 +   Various command-related limits are shown in the following table, in
41106 +   which the sample values are for a "large memory model" build of
41107 +   C-Kermit, typical for modern platforms (Linux, Solaris, AIX, VMS, etc).
41108 +   You can see the values for your version of Kermit by giving the SHOW
41109 +   FEATURES command. The maximum length for a Kermit command (CMDBL) also
41110 +   determines the maximum length for a macro definition, since DEFINE is
41111 +   itself a command. The maximum length for a variable name is between 256
41112 +   and 4096 characters, depending on the platform; for array declarations
41113 +   and references, that includes the subscript.
41114 +
41115 +   Item Symbol Sample
41116 +   Value Definition
41117 +   Number of characters in a command CMDBL 32763 ckucmd.h
41118 +   Number of chars in a field of a command    ATMBL 10238 ckucmd.h
41119 +   Nesting level for command files MAXTAKE 54   ckuusr.h
41120 +   Nesting level for macros MACLEVEL 128 ckuusr.h
41121 +   Nesting level for FOR / WHILE loops FORDEPTH 32 ckuusr.h
41122 +   Number of macros MAC_MAX 16384 ckuusr.h
41123 +   Size of INPUT buffer INPBUFSIZ 4096 ckuusr.h
41124 +   Maximum files to match a wildcard MAXWLD    102400 ckcdeb.h
41125 +   Filespecs in MSEND command MSENDMAX 1024 ckuusr.h
41126 +   Length for GOTO target label LBLSIZ 50 ckuusr.h
41127 +   \fexecute() recursion depth limit CMDDEP 64 ckucmd.h
41128 +
41129 +   If you need to define a macro that is longer than CMDBL, you can break
41130 +   the macro up into sub-macros or rewrite the macro as a command file. In
41131 +   a pinch you can also redefine CMDBL and recompile C-Kermit. All of
41132 +   these numbers represent tradeoffs: the bigger the number, the more
41133 +   "powerful" Kermit in the corresponding area, but also the bigger the
41134 +   program image and possibly disk footprint, and the longer it takes to
41135 +   load and initialize.
41136 +
41137 +   In the interactive command parser:
41138 +
41139 +     * EMACS- or VI-style command line editing is not supported.
41140 +     * Editing keys are hardwired (Ctrl-U, Ctrl-W, etc).
41141 +
41142 +   If you interrupt C-Kermit before it has issued its first prompt, it
41143 +   will exit. This means that you cannot interrupt execution of the
41144 +   initialization file, or of an "application file" (file whose name is
41145 +   given as the first command-line argument), or of an alternative
41146 +   initialization file ("-y filename"), and get to the prompt. There is,
41147 +   however, one exception to this rule: you *can* interrupt commands --
41148 +   including TAKE commands -- given in the '-C "command list"'
41149 +   command-line argument and -- if there were no action commands among the
41150 +   command-line arguments -- you will be returned to the C-Kermit prompt.
41151 +   So, for example, if you want to start C-Kermit in such a way that it
41152 +   executes a command file before issuing its first prompt, and you also
41153 +   want to be able to interrupt the command file and get to the prompt,
41154 +   include a TAKE command for the desired command in the -C argument, for
41155 +   example:
41156 +
41157 +  kermit -C "take dial.scr"
41158 +
41159 +   At the command prompt, if you use the backslash (\) prefix to enter a
41160 +   control character, space, or question mark into a command literally,
41161 +   the backslash disappears and is replaced by the quoted character. If it
41162 +   was a control character, it is shown as a circumflex (^). This allows
41163 +   editing (backspace, delete, Ctrl-W) to work correctly even for control
41164 +   characters.
41165 +
41166 +   Priot to C-Kermit 8.0, the only way to include a comma literally in a
41167 +   macro definition -- as opposed to having it separate commands within
41168 +   the definition -- is to enter its ASCII value (44) in backslash
41169 +   notation, e.g.:
41170 +
41171 +  DEFINE ROWS RUN MODE CO80\{44}\%1
41172 +
41173 +   In C-Kermit 8.0 you can use constructions like this:
41174 +
41175 +  DEFINE ROWS RUN MODE "CO80,\%1"
41176 +
41177 +   If you quote special characters in a filename (e.g. in the SEND
41178 +   command), filename completion may seem to work incorrectly. For
41179 +   example, if you have a file whose name is a*b (the name really contains
41180 +   an asterisk), and you type "send a\\*<ESC>", the "b" does not appear,
41181 +   nor will Ctrl-R redisplay the completed name correctly. But internally
41182 +   the file name is recognized anyway.
41183 +
41184 +   Question-mark help does not work during execution of an ASKQ command.
41185 +   The question marks are simply accepted as text.
41186 +
41187 +   In OUTPUT commands only, \B sends a BREAK signal, \L sends a Long BREAK
41188 +   signal, and \N sends a NUL (ASCII 0). BREAK and Long BREAK are special
41189 +   signals, not characters, and NUL is a character that normally cannot be
41190 +   included in a C string, since it is the C string terminator. If you
41191 +   really want to output a backslash followed by a B, an L, or an N (as is
41192 +   needed to configure certain modems, etc), double the backslash, e.g.
41193 +   "output \\B". In C-Kermit 7.0 or later, you can disarm and re-arm the
41194 +   special OUTPUT-command escapes (\B, \L, and \N) with SET OUTPUT
41195 +   SPECIAL-ESCAPES { OFF, ON }.
41196 +
41197 +   When using the command-line processor ("kermit -l /dev/tty00 -b 19200",
41198 +   etc), note that in some cases the order of the command-line options
41199 +   makes a difference, contrary to the expectation that order of
41200 +   command-line options should not matter. For example, the -b option must
41201 +   be given after the -l option if it is to affect the device specified in
41202 +   the -l option.
41203 +
41204 +3. MULTIPLE SESSIONS
41205 +
41206 +   [ [46]Top ] [ [47]Contents ] [ [48]Next ] [ [49]Previous ]
41207 +
41208 +   C-Kermit 7.0 and earlier do not support multiple sessions. When you SET
41209 +   LINE (or SET PORT, same thing) to a new device, or SET HOST to a new
41210 +   host, the previous SET LINE device or network host connection is
41211 +   closed, resulting in hangup of the modem or termination of the network
41212 +   connection. In windowing environments like HP-VUE, NeXTSTEP, Windows,
41213 +   OS/2, etc, you can run separate copies of Kermit in different windows
41214 +   to achieve multiple sessions.
41215 +
41216 +   To achieve multiple sessions through a single serial port (e.g. when
41217 +   dialing up), you can install SLIP or PPP on your computer and then use
41218 +   C-Kermit's TCP/IP support over the SLIP or PPP connection, assuming you
41219 +   also have TCP/IP networking installed on your computer.
41220 +
41221 +   C-Kermit 8.0 has the same restriction on SET LINE and SET HOST
41222 +   sessions: only one regular session (dialout, Telnet, etc) can be open
41223 +   at a time. However, version 8.0 adds two new kinds of sessions: FTP and
41224 +   HTTP; one or both of these can be open at the same as a regular
41225 +   session.
41226 +
41227 +4. NETWORK CONNECTIONS
41228 +
41229 +   [ [50]Top ] [ [51]Contents ] [ [52]Next ] [ [53]Previous ]
41230 +
41231 +FTP Client Bugs
41232 +
41233 +   The Unix C-Kermit 8.0.206 FTP client had the following bugs at the time
41234 +   most of the 8.0.206 binaries were built for the C-Kermit 8.0 CDROM:
41235 +
41236 +    1. FTP MGET fails when directory segments contain wildcards, as in
41237 +       "ftp mget */data/*.dat". Work around by doing a separate MGET for
41238 +       each source directory.
41239 +    2. FTP MGET can fail or produce random side effects if you have a
41240 +       TMPDIR or CK_TMP environment variable definition in effect, or a
41241 +       SET TEMP-DIRECTORY value, longer than 7 characters. Work around by
41242 +       giving a SET TEMP-DIRECTORY command with a short value, such as
41243 +       "/tmp".
41244 +
41245 +   These two bugs are fixed in the source code that is included on the
41246 +   CDROM, and also in Kermit 95 2.1.1. You can tell if a C-Kermit 8.0.206
41247 +   binary has these fixes by typing SHOW VERSION; if it says "FTP Client,
41248 +   8.0.200, 24 Oct 2002" it has the fixes; if the edit number is less that
41249 +   200, it doesn't, in which case can build a new binary from the source
41250 +   code (or contact us and we'll try to get get one for you).
41251 +
41252 +Making TCP/IP Connections Can Take a Long Time
41253 +
41254 +   The most frequently asked question in many newsgroups is "Why does it
41255 +   take such a long time to make a Telnet connection to (or from) my
41256 +   (e.g.) Linux PC?" (this applies to Kermit as well as to regular Telnet
41257 +   clients):
41258 +
41259 +    1. Most Telnet servers perform reverse DNS lookups on the client for
41260 +       security and/or logging reasons. If the Telnet client's host cannot
41261 +       be found by the server's local DNS server, the DNS request goes out
41262 +       to the Internet at large, and this can take quite some time. The
41263 +       solution to this problem is to make sure that both client and host
41264 +       are registered in DNS.
41265 +    2. C-Kermit itself performs reverse DNS lookups unless you tell it not
41266 +       to. This is to allow C-Kermit to let you know which host it is
41267 +       actually connected to in case you have made a connection to a "host
41268 +       pool" (multihomed host). You can disable C-Kermit's reverse DNS
41269 +       lookup with SET TCP REVERSE-DNS-LOOKUP OFF.
41270 +    3. C-Kermit 7.0 and later strictly enforce Telnet protocol rules. One
41271 +       such rule is that certain negotiations must be responded to. If
41272 +       C-Kermit sends a such a negotiation and the host does not respond,
41273 +       C-Kermit waits a long time for the reply (in case the network is
41274 +       congested or the host is slow), but eventually will time out. To
41275 +       eliminate the waits (and therefore risk possible protocol
41276 +       mismatches -- or worse -- between Telnet client and server), tell
41277 +       C-Kermit to SET TELNET WAIT OFF (or include the /NOWAIT switch with
41278 +       the TELNET command).
41279 +
41280 +The Rlogin Client
41281 +
41282 +   In multiuser operating systems such as UNIX and VMS, TCP/IP Rlogin
41283 +   connections are available only to privileged users, since "login" is a
41284 +   privileged socket. Assuming you are allowed to use it in the first
41285 +   place, it is likely to behave differently depending on what type of
41286 +   host you are rlogging in to, due to technical reasons having to do with
41287 +   conflicting interpretations of RFC793 (Out-Of-Band Data) and Rlogin
41288 +   (RFC1122)... "Specifically, the TCP urgent pointer in BSD points to the
41289 +   byte after the urgent data byte, and an RFC-compliant TCP urgent
41290 +   pointer points to the urgent data byte. As a result, if an application
41291 +   sends urgent data from a BSD-compatible implementation to an
41292 +   [54]RFC-1122 compatible implementation then the receiver will read the
41293 +   wrong urgent data byte (it will read the byte located after the correct
41294 +   byte in the data stream as the urgent data byte)." Rlogin requires the
41295 +   use of OOB data while Telnet does not. Therefore, it is possible for
41296 +   Telnet to work between all systems while BSD and System V TCP/IP
41297 +   implementations are almost always a bad mix.
41298 +
41299 +The Telnet Client
41300 +
41301 +   On a TCP/IP TELNET connection, you should normally have PARITY set to
41302 +   NONE and (except in VMS C-Kermit) FLOW-CONTROL also set to NONE. If
41303 +   file transfer does not work with these settings (for example, because
41304 +   the remote TELNET server only gives a 7-bit data path), use SET PARITY
41305 +   SPACE. Do not use SET PARITY MARK, EVEN, or ODD on a TELNET connection
41306 +   -- it interferes with TELNET protocol.
41307 +
41308 +   If echoing does not work right after connecting to a network host or
41309 +   after dialing through a TCP/IP modem server, it probably means that the
41310 +   TELNET server on the far end of the connection is executing the TELNET
41311 +   protocol incorrectly. After initially connecting and discovering
41312 +   incorrect echoing (characters are echoed twice, or not at all), escape
41313 +   back, give the appropriate SET DUPLEX command (FULL or HALF), and then
41314 +   CONNECT again. For a consistently misbehaving connection, you can
41315 +   automate this process in a macro or TAKE file.
41316 +
41317 +   TELNET sessions are treated just like serial communications sessions as
41318 +   far as "terminal bytesize" and "command bytesize" are concerned. If you
41319 +   need to view and/or enter 8-bit characters during a TELNET session, you
41320 +   must tell C-Kermit to SET TERMINAL BYTESIZE 8, SET COMMAND BYTESIZE 8,
41321 +   and SET PARITY NONE.
41322 +
41323 +   If you SET TELNET DEBUG ON prior to making a connection, protocol
41324 +   negotiations will be displayed on your screen. You can also capture
41325 +   them in the debug log (along with everything else) and then extract
41326 +   them easily, since all Telnet negotiations lines begin with (uppercase)
41327 +   "TELNET".
41328 +
41329 +5. MODEMS AND DIALING
41330 +
41331 +   [ [55]Top ] [ [56]Contents ] [ [57]Next ] [ [58]Previous ]
41332 +
41333 +   External modems are recommended because:
41334 +
41335 +     * They don't need any special drivers.
41336 +     * They are less likely to interfere with normal operation of your
41337 +       computer.
41338 +     * You can use the lights and speaker to troubleshoot dialing.
41339 +     * You can share them among all types of computers.
41340 +     * You can easily turn them off and on when power-cycling seems
41341 +       warranted.
41342 +     * They are more likely to have manuals.
41343 +
41344 +   Modems can be used by C-Kermit only when they are visible as or through
41345 +   a regular serial port device. Certain modems can not be used in this
41346 +   normal way on many kinds of computers: Winmodems, RPI modems,
41347 +   Controllerless modems, the IBM Mwave, etc; all of these require special
41348 +   drivers that perform some, most, or all of the modem's functions in
41349 +   software. Such drivers are generally NOT available in UNIX or other
41350 +   non-Windows (or non-OS/2, in the case of the Mwave) platforms.
41351 +
41352 +   In order to dial a modem, C-Kermit must know its repertoire of commands
41353 +   and responses. Each modem make and model is likely to have a different
41354 +   repertoire. Since Kermit has no way of knowhing which kind of modem
41355 +   will be dialed, normally you have to tell it with a SET MODEM TYPE
41356 +   command, e.g.:
41357 +
41358 +  set modem type usrobotics
41359 +  set line /dev/cua0
41360 +  set speed 57600
41361 +  dial 7654321
41362 +
41363 +   In the early days, there was a wide variety of modems and command
41364 +   languages. Nowadays, almost every modem uses the Hayes AT command set
41365 +   (but with some differences in the details) and its startup
41366 +   configuration includes error correction, data compression, and hardware
41367 +   (RTS/CTS) flow control. As long as C-Kermit is capable of hardware flow
41368 +   control (as it is on many, but not all, the platforms where it runs,
41369 +   since some operating systems don't support it), the modem can be dailed
41370 +   immediately, without lengthy configuration dialogs, and in fact this is
41371 +   what SET MODEM TYPE GENERIC-HIGH-SPEED does. In C-Kermit 8.0,
41372 +   GENERIC-HIGH-SPEED has become the default modem type, so now it is
41373 +   usually possible to SET LINE, SET SPEED, and DIAL without having to
41374 +   identify your modem. If this doesn't work, of course, then you might
41375 +   have to fall back to the tradiational method: Give a SET MODEM TYPE for
41376 +   a specific modem first, then SET LINE, SET SPEED, and DIAL.
41377 +
41378 +   An important change in C-Kermit 6.0 is that when you give a SET MODEM
41379 +   TYPE command to tell Kermit what kind of modem you have, Kermit also
41380 +   sets a number of other modem-related parameters automatically from its
41381 +   internal modem database. Thus, the order in which you give
41382 +   modem-related commands is significant, whereas in prior releases they
41383 +   could be given in any order.
41384 +
41385 +   In particular, MODEM SPEED-MATCHING is set according to whether the
41386 +   modem is known to be capable of speed buffering. SET MODEM TYPE
41387 +   HAYES-2400 automatically turns SPEED-MATCHING ON, because when the
41388 +   Hayes 2400 reports a particular speed in its CONNECT message, that
41389 +   means its interface speed has changed to that speed, and C-Kermit's
41390 +   must change accordingly if it is to continue communicating. This might
41391 +   cause some confusion if you use "set modem type hayes" for dialing a
41392 +   more advanced type of modem.
41393 +
41394 +   The new default for flow control is "auto", meaning "do the right thing
41395 +   for each type of connection". So (for example) if your version of
41396 +   C-Kermit supports SET FLOW RTS/CTS and your modem also supports
41397 +   RTS/CTS, then Kermit automatically sets its flow control to RTS/CTS and
41398 +   set modem's flow control to RTS/CTS too before attempting to use the
41399 +   modem.
41400 +
41401 +   For these reasons, don't assume that "set modem type hayes" should be
41402 +   used for all modems that uses the Hayes AT command set. "set modem type
41403 +   hayes" really does mean Hayes 1200 or 2400, which in turn means no
41404 +   hardware flow control, and no speed buffering. This choice will rarely
41405 +   work with a modern high-speed modem.
41406 +
41407 +6. DIALING HINTS AND TIPS
41408 +
41409 +   [ [59]Top ] [ [60]Contents ] [ [61]Next ] [ [62]Previous ]
41410 +
41411 +   If you have a high-speed, error-correcting, data-compressing,
41412 +   speed-buffering modem, you should fix the modem's interface speed as
41413 +   high as possible, preferably (at least) four times higher than its
41414 +   maximum connection (modulation) speed to allow compression to work at
41415 +   full advantage. In this type of setup, you must also have an effective
41416 +   means of flow control enabled between C-Kermit and the modem,
41417 +   preferably hardware (RTS/CTS) flow control. On platforms that do not
41418 +   support hardware flow control, it is usually possible to select
41419 +   software flow control (Xon/Xoff), and C-Kermit will do its best to set
41420 +   the modem for local Xon/Xoff flow control too (but then, of course,
41421 +   Ctrl-S and Ctrl-Q characters can not be transmitted on the connection).
41422 +
41423 +   If you are having trouble dialing your modem, SET DIAL DISPLAY ON to
41424 +   watch the dialing interactions between C-Kermit and your modem. Consult
41425 +   Chapters 3-4 of [63]Using C-Kermit (2nd Ed) for modem-dialing
41426 +   troubleshooting instructions. The following sections offer some
41427 +   addtional hints and tips.
41428 +
41429 +6.1. Syntax
41430 +
41431 +   If you want to dial a number that starts with #, you'll need to quote
41432 +   the "#" character (as \# or \{35}), since it is also a comment
41433 +   introducer:
41434 +
41435 +  C-Kermit>dial #98765421-1-212-5551212   ; Looks like a comment
41436 +  ?You must specify a number to dial
41437 +  C-Kermit>dial \#98765421-1-212-5551212  ; Works OK
41438 +  C-Kermit>dial =#98765421-1-212-5551212  ; This works too
41439 +
41440 +   When using a dialing directory, remember what happens if a name is not
41441 +   found:
41442 +
41443 +  C-Kermit>dial xyzcorp
41444 +  Lookup: "xyzcorp" - not found - dialing as given
41445 +
41446 +   This normally does no harm, but some modems might behave strangely when
41447 +   given dial strings that contain certain letters. For example, a certain
41448 +   German modem treats any dial string that contains the letter "s" as a
41449 +   command to fetch a number from its internal list, and replies OK to the
41450 +   ATD command, which is normally not a valid response except for partial
41451 +   dialing. To avoid this situation, use:
41452 +
41453 +  lookup xyzcorp
41454 +  if success dial
41455 +
41456 +6.2. The Carrier Signal
41457 +
41458 +   Remember: In many C-Kermit implementations (depending on the underlying
41459 +   operating system -- mostly Windows, OS/2, and System-V-based UNIX
41460 +   versions, and in C-Kermit 7.0, also VMS), you can't CONNECT to a modem
41461 +   and type the modem's dialing command (like "ATDT7654321") manually,
41462 +   unless you first tell C-Kermit to:
41463 +
41464 +  SET CARRIER-WATCH OFF
41465 +
41466 +   This is because (in these implementations), the CONNECT command
41467 +   requires the modem's Carrier Detect (CD) signal to be on, but the CD
41468 +   signal doesn't come on until after dialing is complete. This
41469 +   requirement is what allows C-Kermit to pop back to its prompt
41470 +   automatically when the connection is hung up. See the description of
41471 +   SET CARRIER-WATCH in "Using C-Kermit".
41472 +
41473 +   Similarly, if your dialed connection drops when CARRIER-WATCH is set to
41474 +   AUTO or ON, you can't CONNECT back to the (now disconnected) screen to
41475 +   see what might have happened unless you first SET CARRIER-WATCH OFF.
41476 +   But sometimes not even SET CARRIER-WATCH OFF will help in this
41477 +   situation: certain platforms (for example Unixware 2.1), once carrier
41478 +   drops, won't let the application do i/o with the device any more. In
41479 +   that case, if you want to use the device again, you have to CLOSE it
41480 +   and OPEN it again. Or you can have Kermit do this for you automatically
41481 +   by telling it to SET CLOSE-ON-DISCONNECT ON.
41482 +
41483 +6.3. Dialing and Flow Control
41484 +
41485 +   Don't SET FLOW RTS/CTS if your modem is turned off, or if it is not
41486 +   presenting the CTS signal. Otherwise, the serial device driver can get
41487 +   stuck waiting for this signal to appear.
41488 +
41489 +   Most modern modems support RTS/CTS (if they support any hardware flow
41490 +   control at all), but some computers use different RS-232 circuits for
41491 +   the same purposes, e.g. DTR and CD, or DTR and CTS. In such cases, you
41492 +   might be able to make your computer work with your modem by
41493 +   appropriately cross-wiring the circuits in the cable connector, for
41494 +   example the computer's DTR to the modem's RTS, and modem's CD to the
41495 +   computer's CTS. HOWEVER, C-Kermit does not know you have done this. So
41496 +   if you have (say) SET FLOW DTR/CD, C-Kermit will make no attempt to
41497 +   tell the modem to use RTS/CTS. You probably did this yourself when you
41498 +   configured the modem.
41499 +
41500 +6.4. The Dial Timeout
41501 +
41502 +   If it takes your call longer to be completed than the timeout interval
41503 +   that C-Kermit calculates, you can use the SET DIAL TIMEOUT command to
41504 +   override C-Kermit's value. But beware: the modem has its own timeout
41505 +   for completing the call. If it is a Hayes-like modem, C-Kermit adjusts
41506 +   the modem's value too by setting register S7. But the maximum value for
41507 +   S7 might be smaller than the time you need! In that case, C-Kermit sets
41508 +   S7 to 0, 255, or other (modem-specific) value to signify "no timeout".
41509 +   If Kermit attempts to set register S7 to a value higher than your
41510 +   modem's maximum, the modem will say "ERROR" and you will get a "Failure
41511 +   to initialize modem" error. In that case, use SET DIAL TIMEOUT to
41512 +   override C-Kermit's calculation of the timeout value with the highest
41513 +   value that is legal for your modem, e.g. 60.
41514 +
41515 +6.5. Escape Sequence Guard Time
41516 +
41517 +   A "TIES" (Time-Independent Escape Sequence) modem does not require any
41518 +   guard time around its escape sequence. The following text:
41519 +
41520 +  +++ATH0
41521 +
41522 +   if sent through a TIES modem, for example because you were uploading
41523 +   this file through it, could pop the modem back into command mode and
41524 +   make it hang up the connection. Later versions of the Telebit T1600 and
41525 +   T3000 (version LA3.01E firmware and later), and all WorldBlazers, use
41526 +   TIES.
41527 +
41528 +   Although the probability of "+++" appearing in a Kermit packet is
41529 +   markedly lower than with most other protocols (see the [64]File
41530 +   Transfer section below), it can still happen under certain
41531 +   circumstances. It can also happen when using C-Kermit's TRANSMIT
41532 +   command. If you are using a Telebit TIES modem, you can change the
41533 +   modem's escape sequence to an otherwise little-used control character
41534 +   such as Ctrl-_ (Control-Underscore):
41535 +
41536 +  AT S2=31
41537 +
41538 +   A sequence of three consecutive Ctrl-_ characters will not appear in a
41539 +   Kermit packet unless you go to extraordinary lengths to defeat more
41540 +   than a few of Kermit's built-in safety mechanisms. And if you do this,
41541 +   then you should also turn off the modem's escape-sequence recognition
41542 +   altogether:
41543 +
41544 +  AT S48=0 S2=255
41545 +
41546 +   But when escape sequence recognition is turned off, "modem hangup"
41547 +   (<pause>+++<pause>ATH0<CR>) will not work, so you should also SET MODEM
41548 +   HANGUP RS232-SIGNAL (rather then MODEM-COMMAND).
41549 +
41550 +6.6. Adaptive Dialing
41551 +
41552 +   Some modems have a feature called adaptive dialing. When they are told
41553 +   to dial a number using Tone dialing, they check to make sure that
41554 +   dialtone has gone away after dialing the first digit. If it has not,
41555 +   the modem assumes the phone line does not accept Tone dialing and so
41556 +   switches to Pulse. When dialing out from a PBX, there is almost always
41557 +   a secondary dialtone. Typically you take the phone off-hook, get the
41558 +   PBX dialtone, dial "9" to get an outside line, and then get the phone
41559 +   company's dialtone. In a situation like this, you need to tell the
41560 +   modem to expect the secondary dialtone. On Hayes and compatible modems,
41561 +   this is done by putting a "W" in the dial string at the appropriate
41562 +   place. For example, to dial 9 for an outside line, and then 7654321,
41563 +   use ATDT9W7654321:
41564 +
41565 +  SET PBX-OUTSIDE-PREFIX 9W
41566 +
41567 +   (replace "9" with whatever your PBX's outside-line prefix is).
41568 +
41569 +6.7. The Busy Signal
41570 +
41571 +   Some phone companies are eliminating the busy signal. Instead, they
41572 +   issue a voice message such as "press 1 to automatically redial until
41573 +   the number answers, or...". Obviously this is a disaster for modem
41574 +   calls. If your service has this feature, there's nothing Kermit can do
41575 +   about it. Your modem will respond with NO CARRIER (after a long time)
41576 +   rather than BUSY (immediately), and Kermit will declare the call a
41577 +   failure, rather than trying to redial the same number.
41578 +
41579 +6.8. Hanging Up
41580 +
41581 +   There are two ways to hang up a modem: by turning off the serial port's
41582 +   DTR signal (SET MODEM HANGUP-METHOD RS232-SIGNAL) or sending the modem
41583 +   its escape sequence followed by its hangup command (SET MODEM
41584 +   HANGUP-METHOD MODEM-COMMAND). If one doesn't work, try the other. If
41585 +   the automatic hangup performed at the beginning of a DIAL command
41586 +   causes trouble, then SET DIAL HANGUP OFF.
41587 +
41588 +   The HANGUP command has no effect when C-Kermit is in remote mode. This
41589 +   is on purpose. If C-Kermit could hang up its own controlling terminal,
41590 +   this would (a) most likely leave behind zombie processes, and (b) pose
41591 +   a security risk.
41592 +
41593 +   If you DIAL a modem, disconnect, then SET HOST or TELNET, and then
41594 +   HANGUP, Kermit sends the modem's hangup command, such as "+++ATHO".
41595 +   There is no good way to avoid this, because this case can't reliably be
41596 +   distinguished from the case in which the user does SET HOST
41597 +   terminal-server, SET MODEM TYPE name, DIAL. In both cases we have a
41598 +   valid modem type selected and we have a network connection. If you want
41599 +   to DIAL and then later make a regular network connection, you will have
41600 +   to SET MODEM TYPE NONE or SET DIAL HANGUP OFF to avoid this phenomenon.
41601 +
41602 +7. TERMINAL SERVERS
41603 +
41604 +   [ [65]Top ] [ [66]Contents ] [ [67]Next ] [ [68]Previous ]
41605 +
41606 +   Watch out for terminal server's escape character -- usually a control
41607 +   character such as Ctrl-Circumflex (Ctrl-^). Don't unprefix it in
41608 +   Kermit!
41609 +
41610 +   Ciscos -- must often be told to "terminal download"... Cisco ASM models
41611 +   don't have hardware flow control in both directions.
41612 +
41613 +   Many terminal servers only give you a 7-bit connection, so if you can't
41614 +   make it 8-bit, tell Kermit to "set parity space".
41615 +
41616 +   The following story, regarding trouble transferring 8-bit files through
41617 +   a reverse terminal server, was contributed by an Annex terminal server
41618 +   user:
41619 +
41620 +     Using C-Kermit on an HP 9000 712/80 running the HP-UX 10.0 operating
41621 +     system. The HP was connected to a Xylogics Annex MICRO-ELS-UX R7.1 8
41622 +     port terminal server via ethernet. On the second port of the
41623 +     terminal server is an AT&T Paradyne 3810 modem, which is connected
41624 +     to a telephone line. There is a program which runs on the HP to
41625 +     establish a Telnet connection between a serial line on the Annex and
41626 +     a character special file on the HP (/dev file). This is an Annex
41627 +     specific program called rtelnet (reverse telnet) and is provided
41628 +     with the terminal server software. The rtelnet utility runs on top
41629 +     of the pseudo-terminal facility provided by UNIX. It creates
41630 +     host-originiated connections to devices attached ot Annex serial
41631 +     ports. There are several command line arguments to be specified with
41632 +     this program: the IP address of the terminal server, the number of
41633 +     the port to attach to, and the name of the pseudo-device to create.
41634 +     In addition to these there are options to tell rtelnet how to
41635 +     operate on the connect: -b requests negotiation for Telnet binary
41636 +     mode, -d turns on socket-leve debugging, -f enables "connect on the
41637 +     fly" mode, -r removes the device-name if it already exists, etc. The
41638 +     most important of these to be specified when using 8 data bits and
41639 +     no parity, as we found out, was the -t option. This creates a
41640 +     transparent TCP connection to the terminal server. Again, what we
41641 +     assumed to be happening was that the rtelnet program encountered a
41642 +     character sequence special to itself and then "eating" those kermit
41643 +     packets. I think this is all of the information I can give you on
41644 +     the configuration, short of the values associated with the port on
41645 +     the terminal server.
41646 +
41647 +   How to DIAL from a TCP/IP reverse terminal server (modem server):
41648 +
41649 +    1. (only if necessary) SET TELNET ECHO REMOTE
41650 +    2. SET HOST terminal-server-ip-name-or-address [ port ]
41651 +    3. SET MODEM TYPE modem-type
41652 +    4. (only if necessary) SET DIAL HANGUP OFF
41653 +    5. (for troubleshooting) SET DIAL DISPLAY ON
41654 +    6. DIAL phone-number
41655 +
41656 +   The order is important: SET HOST before SET MODEM TYPE. Since this is a
41657 +   Telnet connection, serial-port related commands such as SET SPEED, SET
41658 +   STOP-BITS, HANGUP (when MODEM HANGUP-METHOD is RS232), etc, have no
41659 +   effect. However, in C-Kermit 8.0, if the modem server supports
41660 +   [69]RFC-2217 Telnet Com-Port Control protocol, these commands do indeed
41661 +   take effect at the server's serial port.
41662 +
41663 +8. TERMINAL EMULATION
41664 +
41665 +   [ [70]Top ] [ [71]Contents ] [ [72]Next ] [ [73]Previous ]
41666 +
41667 +   Except for the Windows, OS/2, and Macintosh versions, C-Kermit does not
41668 +   emulate any kind of terminal. Rather, it acts as a "semitransparent
41669 +   pipe", passing the characters you type during a CONNECT session to the
41670 +   remote host, and sending the characters received from the remote host
41671 +   to your screen. Whatever is controlling your keyboard and screen
41672 +   provides the specific terminal emulation: a real terminal, a PC running
41673 +   a terminal emulator, etc, or (in the case of a self-contained
41674 +   workstation) your console driver, a terminal window, xterm, etc.
41675 +
41676 +   Kermit is semitrantsparent rather than fully transparent in the
41677 +   following ways:
41678 +
41679 +     * During a TELNET ("set host") session, C-Kermit itself executes the
41680 +       TELNET protocol and performs TELNET negotiations. (But it does not
41681 +       perform TN3270 protocol or any other type of 3270 terminal
41682 +       emulation.)
41683 +     * If you have changed your keyboard mapping using SET KEY, C-Kermit
41684 +       replaces the characters you type with the characters or strings
41685 +       they are mapped to.
41686 +     * If you SET your TERMINAL CHARACTER-SET to anything but TRANSPARENT,
41687 +       C-Kermit translates your keystrokes (after applying any SET KEY
41688 +       definitions) before transmitting them, and translates received
41689 +       characters before showing them on your screen.
41690 +     * If your remote and/or local TERMINAL CHARACTER-SET is an ISO 646
41691 +       7-bit national character set, such as German, French, Italian,
41692 +       Swedish, etc, or Short KOI used for Cyrillic, C-Kermit's CONNECT
41693 +       command automatically skips over ANSI escape sequences to avoid
41694 +       translating their characters. Only ANSI/ISO standard
41695 +       (VT100/200/300-like) 7-bit escape sequence formats are supported
41696 +       for this purpose, no proprietary schemes like H-P, Televideo,
41697 +       Tektronix, etc.
41698 +     * If your version of C-Kermit includes SET TERMINAL APC command, then
41699 +       C-Kermit's CONNECT command will handle APC escape sequences if
41700 +       TERMINAL APC is not set to OFF (which is the default).
41701 +
41702 +   You can make C-Kermit fully transparent by starting it with the -0
41703 +   (dash zero) command-line option.
41704 +
41705 +   If you are running C-Kermit under a console driver, or in a terminal
41706 +   window, that emulates the VT100, and use C-Kermit to log in to a VMS
41707 +   system, the console driver or terminal window (not Kermit) is supposed
41708 +   to reply to the "what are you?" query (ESC Z) from the VAX. If it
41709 +   doesn't, and you can't make it do so, then you can (a) live with the
41710 +   "unknown terminal" problem; (b) tell VMS to SET TERMINAL/DEVICE=VT100;
41711 +   (c) program a key using SET KEY to send the appropriate sequence and
41712 +   then punch the key at the right time; or (d) use the VMSLOGIN macro
41713 +   that is defined in CKERMIT.INI to do this for you automatically.
41714 +
41715 +   SET SESSION-LOG { TEXT, BINARY }, which is effective in UNIX and AOS/VS
41716 +   but not other C-Kermit versions, removes CR, DEL, NUL, XON, and XOFF
41717 +   characters (Using C-Kermit neglects to mention that XON and XOFF are
41718 +   removed). The TEXT-mode setting is ineffective during SCRIPT command
41719 +   execution, as well as on X.25 connections.
41720 +
41721 +9. KEY MAPPING
41722 +
41723 +   [ [74]Top ] [ [75]Contents ] [ [76]Next ] [ [77]Previous ]
41724 +
41725 +   Except in the terminal-emulating versions, C-Kermit's key mapping
41726 +   facilities are limited to normal "ASCII" keys, and cannot be used with
41727 +   function keys, arrow keys, arcane key combinations, etc. Since C-Kermit
41728 +   runs on such a wide variety of hardware platforms (including, for
41729 +   example, more than 360 different UNIX platforms), it is not possible
41730 +   for C-Kermit to support every conceivable keyboard under every release
41731 +   of every UNIX (or VMS, or ...) product on every different kind of
41732 +   computer possibly under all manner of different console drivers, even
41733 +   if it had the means to do so.
41734 +
41735 +   In technical terms, C-Kermit uses the read() function to read
41736 +   keystrokes, and read() returns a single byte (value 0 through 255).
41737 +   C-Kermit's SET KEY function applies to these single-byte codes.
41738 +   "Extended function" keys, such as F-keys, arrow keys, etc, usually
41739 +   return either a 2-byte "scan code" or else a character string (such as
41740 +   an escape sequence like "<ESC> O p"). In both cases, C-Kermit has no
41741 +   way to tell the difference between such multibyte key values, and the
41742 +   corresponding series of single-byte key values. This could only be done
41743 +   by accessing the keyboard at a much lower level in a highly
41744 +   platform-dependent manner, probably requiring tens of thousands of
41745 +   lines of code to support even a sampling of the most popular
41746 +   workstation / OS combinations.
41747 +
41748 +   However, most workstation console drivers (terminal emulation windows,
41749 +   etc) include their own key-mapping facility. For example in AIX, the
41750 +   AIXterm program (in whose window you would run C-Kermit) allows
41751 +   rebinding of the F1-F12 keys to arbitrary strings. The same is true of
41752 +   Xterm and DECterm windows, etc. Consult the technical documentation for
41753 +   your workstation or emulator. See sample Xterm (Xmodmap) mappings in
41754 +   the [78]Unix C-Kermit Hints and Tips document.
41755 +
41756 +   The SET KEY command (except in Kermit 95) does not allow a key
41757 +   definition to be (or contain) the NUL (\0) character.
41758 +
41759 +10. FILE TRANSFER
41760 +
41761 +   [ [79]Top ] [ [80]Contents ] [ [81]Next ] [ [82]Previous ]
41762 +
41763 +   C-Kermit 7.0 is the first release of C-Kermit to use fast (rather than
41764 +   robust and therefore slow) protocol defaults: long packets, sliding
41765 +   windows, control-character unprefixing, and streaming where possible.
41766 +   This makes most transfers (partner willing) dramatically faster "out of
41767 +   the box" but might break some combinations that worked before. If
41768 +   transfers with C-Kermit 7.0 or later fail where transfers worked with
41769 +   earlier C-Kermit versions, try the following (one at a time, in this
41770 +   order):
41771 +
41772 +    1. SET PREFIXING ALL: Disables control-character unprefixing.
41773 +    2. SET STREAMING OFF: Disables streaming.
41774 +    3. CAUTIOUS: Selects medium but cautious protocol settings.
41775 +    4. ROBUST: this command reverts to the most conservative protocol
41776 +       settings.
41777 +
41778 +   Execution of multiple file transfers by C-Kermit from a command file
41779 +   when in remote mode might exhibit long delays between each transfer. To
41780 +   avoid this, just include the command "SET DELAY 0" in your command file
41781 +   before any of the file-transfer commands.
41782 +
41783 +   File transfer failures can occur for all sorts of reasons, most of them
41784 +   listed in Chapter 10 of [83]Using C-Kermit. The following sections
41785 +   touch on some that aren't.
41786 +
41787 +   The [84]C-Kermit 7.0 Release Notes document SEND /COMMAND as taking an
41788 +   argument, but it doesn't. Instead of SEND /COMMAND:{some command}, use:
41789 +
41790 +SEND /COMMAND [ other switches such as /AS-NAME: ] command [ arguments... ]
41791 +
41792 +10.1. Laptops
41793 +
41794 +   Watch out for laptops and their assorted power-saver features; for
41795 +   example, a built-in modem's "auto timeout delay" hanging up the
41796 +   connection in the middle of a file transfer. Most modems, even if they
41797 +   have this feature, do not have it enabled by default. But if you
41798 +   experience otherwise inexplicable disconnections in the midst of your
41799 +   Kermit sessions, check the modem manual for such things as "idle
41800 +   timeout", "auto timeout", etc, and add the command to disable this
41801 +   feature to Kermit's init string for this modem.
41802 +
41803 +10.2. NFS
41804 +
41805 +   If uploading a large file to an NFS-mounted disk fails (or is painfully
41806 +   slow), try uploading it to a local disk (e.g. /tmp on Unix) and then
41807 +   copying to the NFS disk later.
41808 +
41809 +10.3. Modems
41810 +
41811 +   If you are dialing out and find that downloads work but uploads don't,
41812 +   try again with a lower serial-port speed. Case in point: dialing out on
41813 +   a certain PC from Linux at 115200 bps using a USR Courier 56K
41814 +   "V.Everything" external modem and RTS/CTS flow control. Downloads
41815 +   worked flawlessly, uploads stopped dead after the first few packets
41816 +   were sent. The modem lights showed constant retraining (ARQ light
41817 +   blinks slowly), and the CTS light was off 95% of the time, allowing
41818 +   nothing to get through. Reducing the serial port speed to 57600 bps
41819 +   made the problems go away. Evidently the PC in question has a very fast
41820 +   serial port, since dialing the same modem with a different PC at 115200
41821 +   bps works without incident.
41822 +
41823 +10.4. TCP/IP Connections
41824 +
41825 +   If you have trouble transferring files over a TCP/IP connection, tell
41826 +   Kermit to SET PARITY SPACE and try again. If that doesn't work, also
41827 +   try a shorter packet length or smaller window size (to compensate for
41828 +   certain well-known broken Telnet servers), and/or SET RELIABLE OFF.
41829 +
41830 +10.5. Multihop Connections
41831 +
41832 +   If you have a multihop connection, with the interior nodes in CONNECT
41833 +   mode (Kermit, Telnet, Rlogin, or any other), you can expect (a) file
41834 +   transfer to be slower, and (b) the connection to be less transparent
41835 +   (to control characters, perhaps to the 8th bit) than a more direct
41836 +   connection. C-Kermit 7.0 and later have a "-0" (dash-zero) command-line
41837 +   option to make it 100% transparent in cases where it is to be used in
41838 +   the middle.
41839 +
41840 +10.6. Recovery
41841 +
41842 +   The recovery feature (RESEND command) that was added in version 5A(190)
41843 +   works only for binary-mode transfers. In order for this feature to be
41844 +   useful at all, the default for SET FILE INCOMPLETE was changed from
41845 +   DISCARD to KEEP. Otherwise an interrupted transfer would leave no
41846 +   partial file behind unless you had remembered to change the default.
41847 +   But now you have to pay closer attention to Kermit's messages to know
41848 +   whether a transfer succeeded or failed -- previously, if it failed, the
41849 +   file would not show up on the receiving end at all; in 5A(190) and
41850 +   later, you'll get a partial file which could easily be mistaken for the
41851 +   complete file unless you change the default back to DISCARD or read the
41852 +   screen messages, or keep a transaction log.
41853 +
41854 +10.7. Filename Collisions
41855 +
41856 +   SET FILE COLLISION BACKUP is the default. This means:
41857 +
41858 +     * If you send the same file lots of times, there will be many backup
41859 +       files. There is no automatic mechanism within Kermit to delete
41860 +       them, no notion of a "version retention count", etc, but you can
41861 +       use the PURGE command to clean them up.
41862 +     * If a file arrives that has the same name as a directory, the file
41863 +       transfer fails because Kermit will not rename a directory. Send the
41864 +       file with another name, or use SET FILE COLLISION RENAME.
41865 +     * If the directory lacks write permission, the file transfer fails
41866 +       even if you have write access to the file that is being backed up;
41867 +       in that case, switch to SET FILE COLLISION OVERWRITE or APPEND, or
41868 +       send to a different directory.
41869 +
41870 +   SET FILE COLLISION UPDATE depends on the date/time stamp in the
41871 +   attribute packet. However, this is recorded in local time, not
41872 +   Universal Time (GMT), and there is no indication of time zone. The time
41873 +   is expressed to the precision of 1 second, but some file systems do not
41874 +   record with this precision -- for example, MS-DOS records the file
41875 +   date/time only to the nearest 2 seconds. This might cause update
41876 +   operations to send more files than necessary.
41877 +
41878 +   (This paragraph does NOT apply to UNIX, where, as of C-Kermit 7.0,
41879 +   C-Kermit pipes incoming mail and print material directly the mail or
41880 +   print program): When C-Kermit is receiving files from another Kermit
41881 +   program that has been given the MAIL or REMOTE PRINT command, C-Kermit
41882 +   follows the current filename collision action. This can be
41883 +   disconcerting if the action was (for example) BACKUP, because the
41884 +   existing file will be renamed, and the new file will be mailed (or
41885 +   printed) and then deleted. Kermit cannot temporarily change to RENAME
41886 +   because the file collision action occurs when the filename packet is
41887 +   received, and the PRINT or MAIL disposition only comes later, in the
41888 +   Attribute packet.
41889 +
41890 +   Watch out for SET FILE COLLISION RENAME, especially when used in
41891 +   conjunction with recovery. Recall that this option (which is NOT the
41892 +   default) renames the incoming file if a file already exists with the
41893 +   same name (the default is to rename the previously existing file, and
41894 +   store the incoming file with its own name). It is strongly recommended
41895 +   that you do not use SET FILE COLLISION RENAME if you ever intend to use
41896 +   the recovery feature:
41897 +
41898 +     * When the file is first received by C-Kermit, its name is changed if
41899 +       another file already has the same name. When you RESEND the same
41900 +       file after a failure, C-Kermit will probably try to append the
41901 +       re-sent portion to the wrong file.
41902 +     * Assuming that you get RESEND to work with FILE COLLISION RENAME,
41903 +       C-Kermit, when receiving the remainder of the file during a RESEND
41904 +       operation, will report back the wrong name. Nothing can be done
41905 +       about this because the name is reported back before the receiving
41906 +       Kermit program finds out that it is a recovery operation.
41907 +
41908 +   Also watch out for DISABLE DELETE, since this implicitly sets FILE
41909 +   COLLISION to RENAME. And note tht DELETE is DISABLEd automatically any
41910 +   time you Kermit is in local mode (i.e. it makes a connection). Also
41911 +   note that for purposes of DISABLE and ENABLE, "set host *" connections
41912 +   do not count as local mode even though, strictly speaking, they are.
41913 +
41914 +10.8. DOS Pathnames
41915 +
41916 +   When referring to foreign MS-DOS, Windows, Atari ST, OS/2, or other
41917 +   file specifications that contain backslash characters in a C-Kermit
41918 +   command, you might have to double each backslash, for example:
41919 +
41920 +  C-Kermit>get c:\\directory\\foo.txt
41921 +
41922 +   This is because backslash is used in C-Kermit commands for introducing
41923 +   special character codes, variables, functions, etc.
41924 +
41925 +10.9. Cancellation
41926 +
41927 +   If attempting to cancel local-mode file reception at a very early stage
41928 +   (i.e. before data packets are exchanged) with X or Z does not work, use
41929 +   E or Ctrl-C instead, or wait until the first data packets are sent.
41930 +
41931 +   If you cancel a transfer that is underway using X or Z, and a lot of
41932 +   window slots are in use, it might take a while for the cancellation to
41933 +   take effect, especially if you do this on the receiving end; that's
41934 +   because a lot of packets might already be on their way to you. In that
41935 +   case, just be patient and let Kermit "drain" them.
41936 +
41937 +   If C-Kermit is sending a file, remote-mode packet-mode breakout (three
41938 +   consecutive Ctrl-C's by default) is not effective until after C-Kermit
41939 +   sends its first packet. If C-Kermit is receiving a file or is in server
41940 +   mode, it is effective right away. In the former case, the SET DELAY
41941 +   value determines the earliest time at which you can break out of packet
41942 +   mode.
41943 +
41944 +10.10. Partner Peculiarities
41945 +
41946 +   When one or both partners is on an SCO operating system such as OSR5,
41947 +   you might issue the command:
41948 +
41949 +mapchan -n
41950 +
41951 +   to disable character-set conversion by the terminal driver. Similarly
41952 +   for AIX:
41953 +
41954 +setmaps -t NOMAP
41955 +
41956 +   When using C-Kermit to transfer files with the HP48SX calculator, you
41957 +   must SET FLOW NONE. The HP48SX does not support flow control, and
41958 +   evidently also becomes confused if you attempt to use it. You might
41959 +   also need to use SET SEND PAUSE 100 (or other number). For greater
41960 +   detail about transferring files the the HP-48, see:
41961 +
41962 +  [85]http://www.columbia.edu/kermit/hp48.html
41963 +
41964 +   Some communication programs have errors in their implementation of
41965 +   Kermit attribute packets. If you get an error message from your
41966 +   communication program like "Attribute error", tell C-Kermit to SET
41967 +   ATTRIBUTES OFF. Better yet, switch to a real Kermit program.
41968 +
41969 +   Some communication software claims to implement Kermit sliding windows,
41970 +   but does so incorrectly. If sliding window transfers fail, set
41971 +   C-Kermit's window size to the smallest one that works, for example, SET
41972 +   WINDOW 1.
41973 +
41974 +   For lots more detail about how to cope with defective Kermit partners,
41975 +   see:
41976 +
41977 +     * [86]Coping with Faulty Kermit Implementations (C-Kermit 7.0 and
41978 +       later).
41979 +     * [87]Coping with Broken Kermit Partners (C-Kermit 8.0 and later).
41980 +
41981 +   The UNIX version of C-Kermit discards carriage returns when receiving
41982 +   files in text mode. Thus, "bare" carriage returns (sometimes used to
41983 +   achieve overstriking) are lost.
41984 +
41985 +11. SCRIPT PROGRAMMING
41986 +
41987 +   [ [88]Top ] [ [89]Contents ] [ [90]Previous ]
41988 +
41989 +11.1. Comments Versus the SCRIPT Command
41990 +
41991 +   Remember that ";" and "#" introduce comments when (a) they are the
41992 +   first character on the line, or (b) they are preceded by at least one
41993 +   blank or tab within a line. Thus constructions like:
41994 +
41995 +  INPUT 5 ;
41996 +  SCRIPT ~0 #--#--#
41997 +
41998 +   must be coded using backslash notation to keep the data from being
41999 +   ignored:
42000 +
42001 +  INPUT 5 \59                   ; 59 is the decimal ASCII code for ";"
42002 +  SCRIPT ~0 \35--#--#           ; 43 is the decimal ASCII code for "#"
42003 +
42004 +   or, more simply:
42005 +
42006 +  INPUT 5 \;                    ; Just quote the semicolon
42007 +  SCRIPT ~0 \#--#--#            ; Just quote the "#"
42008 +
42009 +11.2. Alphabetic Case and the INPUT Command
42010 +
42011 +   INPUT and MINPUT caseless string comparisons do not work for non-ASCII
42012 +   (international) characters. Workaround: SET INPUT CASE OBSERVE. Even
42013 +   then, the "lexically less than" and "lexically greater than" operations
42014 +   (IF LLT, IF LGT) probably won't work as expected. The same is true for
42015 +   the case-conversion functions \Flower() and \Fupper(). C-Kermit does
42016 +   not know the collating sequence for different character sets and
42017 +   languages. (On the other hand, it might work depending on such items as
42018 +   how Kermit was linked, whether your operating supports "locales", etc)
42019 +
42020 +11.3. NUL (0) Characters in C-Kermit Commands
42021 +
42022 +   You can't include a NUL character (\0) in C-Kermit command text without
42023 +   terminating the character string in which it appears. For example:
42024 +
42025 +  echo In these brackets [\0] is a NUL
42026 +
42027 +   will echo "In these brackets [". This applies to ECHO, INPUT, OUTPUT,
42028 +   and all other commands (but you can represent NUL by "\N" in an OUTPUT
42029 +   string). This is because C-language strings are terminated internally
42030 +   by the NUL character, and it allows all of C-Kermit's string comparison
42031 +   and manipulation functions to work in the normal "C" way.
42032 +
42033 +   To illustrate:
42034 +
42035 +  INPUT 5 \0
42036 +
42037 +   is equivalent to:
42038 +
42039 +  INPUT 5
42040 +
42041 +   and:
42042 +
42043 +  INPUT 5 ABC\0DEF
42044 +
42045 +   is equivalent to:
42046 +
42047 +  INPUT 5 ABC
42048 +
42049 +   INPUT operations discard and ignore NUL characters that arrive from the
42050 +   communication device, meaning that they do not figure into matching
42051 +   operations (e.g. A<NUL>B matches AB); they are not deposited in the
42052 +   INPUT buffer (\v(input)); and they are not counted in \v(incount), with
42053 +   two exceptions:
42054 +
42055 +    1. An arriving NUL character restarts the INPUT SILENCE timer.
42056 +    2. An arriving NUL character terminates the INPUT command with the
42057 +       SUCCESS condition if the INPUT command was given an empty search
42058 +       string. In this case \v(incount) is set to 1.
42059 +
42060 +   Also, the \v(inchar) variable is null (completely empty) if the last
42061 +   INPUT character was NUL. That is, there is no way to tell only by
42062 +   looking at \v(inchar) the difference between a NUL that was INPUT and
42063 +   no INPUT at all. If the INPUT command succeeded but \v(inchar) is
42064 +   empty, then a NUL character was input. Also, \v(incount) will be set to
42065 +   1.
42066 +
42067 +   Here's a sample script fragment to read characters, possibly including
42068 +   NUL, from the communication connection and write them to a file:
42069 +
42070 +  while true {
42071 +      input 1                      ; read one byte
42072 +      if fail break                ; timed out or connection closed
42073 +      fwrite /char \%c \v(inchar)  ; record the byte
42074 +  }
42075 +
42076 +   This works because when \v(inchar) is NUL, that's equivalent to FWRITE
42077 +   /CHAR having no text argument at all, in which case it writes a NUL
42078 +   character.
42079 +
42080 +   \v(incount) and \v(inchar) are NOT affected by the CLEAR command.
42081 +
42082 +11.4. \ffiles() and \fnextfile() Peculiarities
42083 +
42084 +   The following script program:
42085 +
42086 +  for \%i 1 \ffiles(oofa.*) 1 {
42087 +      send \fnextfile()
42088 +  }
42089 +
42090 +   did not work as expected in C-Kermit 6.0 and earlier but does work in
42091 +   C-Kermit 7.0 and later.
42092 +
42093 +11.5. Commands That Have Only Local Effect
42094 +
42095 +   Certain settings are local to each command level, meaning that
42096 +   subordinate command levels (macros or command files) can change them
42097 +   without affecting their values at higher command levels. When a new
42098 +   command level is invoked, the value is inherited from the previous
42099 +   level. These settings are:
42100 +
42101 +  CASE
42102 +  COUNT and \v(count)
42103 +  INPUT CASE
42104 +  INPUT TIMEOUT
42105 +  MACRO ERROR
42106 +  QUIET
42107 +  TAKE ERROR
42108 +
42109 +   This arrangement allows CASE, TIMEOUT, and ERROR settings, which are
42110 +   used to control automatic exit from a command file or macro upon error,
42111 +   to be automatically restored when the command file or macro exits.
42112 +
42113 +   The COUNT variable follows this rule too, which permits nested SET
42114 +   COUNT / IF COUNT loops, as in this example in which the inner loop
42115 +   counts down from the current COUNT value of the outer loop (try it):
42116 +
42117 +  DEFINE INNER WHILE COUNT { WRITE SCREEN {   Inner:}, SHOW COUNT }
42118 +  SET COUNT 5
42119 +  WHILE COUNT { WRITE SCREEN Outer:, SHOW COUNT, DO INNER }
42120 +
42121 +   Keep in mind that an inferior command level cannot manipulate the COUNT
42122 +   value held by a higher level. For example:
42123 +
42124 +  DEFINE OOFA SHOW COUNT, IF COUNT GOTO LOOP
42125 +  SET COUNT 5
42126 +  :LOOP
42127 +  OOFA
42128 +  ECHO Done
42129 +
42130 +   results in an infinite loop; the COUNT value remains at 5 because it is
42131 +   never decremented at the same level at which it was set.
42132 +
42133 +11.6. Literal Braces in Function Calls
42134 +
42135 +   Since braces are used in function calls to indicate grouping, there is
42136 +   no way to pass literal braces to the function itself. Solution: Define
42137 +   a variable containing the string that has braces. Example:
42138 +
42139 +  define \%a ab{cd
42140 +  echo \fsubstring(\%a)
42141 +  ab{cd
42142 +
42143 +   If the string is to start with a leading brace and end with a closing
42144 +   brace, then double braces must appear around the string (which itself
42145 +   is enclosed in braces):
42146 +
42147 +  define \%a {{{foo}}}
42148 +  echo \fsubstring(\%a)
42149 +  {foo}
42150 +
42151 +   This also works for any other kind of string:
42152 +
42153 +  define \%a {{ab{cd}}
42154 +  echo \fsubstring(\%a)
42155 +  ab{cd
42156 +
42157 +11.7. Defining Variables on the C-Kermit Command Line
42158 +
42159 +   To define variables on the C-Kermit command line, use the -C
42160 +   command-line option with one or more DEFINE or ASSIGN commands. Note
42161 +   that the C-Kermit command line must cope with the quoting rules of your
42162 +   shell. Examples:
42163 +
42164 +  kermit -C "define \\%a foo, define phonenumber 7654321"
42165 +
42166 +   In this case we follow UNIX quoting rules by doubling the backslash.
42167 +   Once C-Kermit starts, the \%a and \m(phonenumber) variables are defined
42168 +   as indicated and can be used in the normal way.
42169 +
42170 +   In DOS or Windows or OS/2 the command would be:
42171 +
42172 +  kermit -C "define \%%a foo, define phonenumber 7654321"
42173 +
42174 +   Here we need to double the percent sign rather than the backslash
42175 +   because of DOS shell quoting rules.
42176 +
42177 +11.8. Per-Character Echo Check with the OUTPUT Command
42178 +
42179 +   Sometimes the OUTPUT command must be used to send commands or data to a
42180 +   device in "echoplex" mode, meaning that characters must be sent one at
42181 +   a time, and the next character can not be sent until the echo from the
42182 +   previous one has been received. For example, a certain PBX might have
42183 +   this characteristic. Let's say a Kermit script is used to program the
42184 +   PBX. If characters are sent too fast, they can be lost. It would seem
42185 +   that the command:
42186 +
42187 +  SET OUTPUT PACING milliseconds
42188 +
42189 +   could be used to take care of this, but the pacing interval is constant
42190 +   and must be set large enough to allow even the slowest echo to finish.
42191 +   If the script is large (an actual example is 14,000 lines long), this
42192 +   can cause it to take hours longer than it needs to.
42193 +
42194 +   Here is a macro you can use to OUTPUT a string in an Echoplex
42195 +   environment:
42196 +
42197 +  define XOUTPUT {
42198 +      local \%c \%i
42199 +      set output pacing 0
42200 +      for \%i 1 \flen(\%*) 1 {
42201 +          asg \%c \fsubstr(\%*,\%i,1)
42202 +          output \%c
42203 +          input 2 \%c
42204 +      }
42205 +  }
42206 +
42207 +   C-Kermit 7.0 or later is required.
42208 +
42209 +   It sends one character at a time and then waits up to 2 seconds for the
42210 +   character to be echoed back, but continues to the next character as
42211 +   soon as the echo appears, so no time is wasted. You can add an IF FAIL
42212 +   clause after the INPUT in case you want to do something special about
42213 +   failure to detect an echo within the timeout period. Obviously you can
42214 +   also change the 2-second limit, and adjust the script in any other
42215 +   desired way.
42216 +
42217 +11.9. Scripted File Transfer
42218 +
42219 +   Sometimes a user complains that when she makes a connection by hand,
42220 +   logs in, and transfers a file, there are no problems, but when she
42221 +   scripts the the exact same sequence, the file transfer always fails
42222 +   after a few packets. Here's a scenario where this can happen:
42223 +
42224 +    1. Upon logging in to the remote computer, it sends a "What Are You?"
42225 +       escape sequence.
42226 +    2. When you log in interactively, your terminal emulator sends the
42227 +       response. This is invisible to you; you don't know it's happening.
42228 +    3. When you script the login, and begin a file transfer immediately
42229 +       upon logging in, the host still sends the "What Are You?" sequence.
42230 +       Kermit's INPUT ECHO setting is ON by default, so the escape
42231 +       sequence passes through to the terminal, and the terminal sends its
42232 +       response. But by this time Kermit has already started the file
42233 +       transfer.
42234 +    4. By default, the local Kermit program examines the keyboard for
42235 +       interruption characters between every packet. The "What Are You"
42236 +       response is sitting in the keyboard buffer. Eventually Kermit will
42237 +       read a character such as "c" that is a valid interruption
42238 +       character, and the file transfer stops with "User cancelled".
42239 +
42240 +   The right way to handle this situation is to have your look for the
42241 +   "What Are You?" sequence and send the response itself, as described in
42242 +   Using C-Kermit, pp.429-431. Or you can work around it by telling the
42243 +   local Kermit to "set input echo off" and/or "set transfer interruption
42244 +   off".
42245 +
42246 +11.10. Hexadecimal arithmetic...
42247 +
42248 +   C-Kermit can do both integer and floating-point arithmetic, in both
42249 +   ordinary algebraic notation and in Lisp S-Expression notation. All
42250 +   arithmetic operators and functions operate only on decimal numbers. It
42251 +   is possible, however, to write scripts that operate on hexadecimal
42252 +   numbers. This is done by converting them to decimal prior to any
42253 +   arithmetic operations, and then converting them back to hexadecimal for
42254 +   display. Example:
42255 +
42256 +; EVALUATE is a command that evaluates an arithmetic expression.
42257 +; See HELP EVALUATE for details.  This is just for demonstration.
42258 +; Arithmetic expressions can be used in any context where a number
42259 +; can be used.  Also, the special notation:
42260 +;
42261 +; .\%a ::= expression
42262 +;
42263 +; evaluations the expression and assigns the result to the variable.
42264 +;
42265 +.\%a := fffe                ; Set variable to hex value
42266 +set eval old                ; See HELP EVAL
42267 +eval \fhex2n(\%a)           ; Show value of variable
42268 +eval \fhex2n(\%a) + 1       ; Show value of expression
42269 +eval \fhex2n(\%a) + 2       ; Show value of expression
42270 +.\%x ::= \fhex2n(\%a) + 1   ; Assign value of expression to variable
42271 +echo \fn2hex(\%x)           ; Display variable's value in hex
42272 +.\%x ::= \fhex2n(\%a) + 2   : Ditto
42273 +echo \fn2hex(\%x)
42274 +.\%x ::= \fhex2n(\%a) | \fhex2n(ffff)  ; Similarly for logical OR
42275 +echo \fn2hex(\%x)
42276 +.\%x ::= \fhex2n(\%a) & \fhex2n(ffff)  ; and logical AND
42277 +echo \fn2hex(\%x)
42278 +
42279 +   By the way, you might be tempted to use Kermit's \xnn notation to plug
42280 +   hex numbers into arithmetic expressions but this doesn't work. That
42281 +   notation is stricly for bytes (hex representation of character values),
42282 +   not for numbers.
42283 +
42284 +11.11. Other...
42285 +
42286 +   Escape sequences (or any strings that contain control characters) can't
42287 +   be used as labels, GOTO targets, or SWITCH cases.
42288 +
42289 +   [ [91]Top ] [ [92]Contents ] [ [93]C-Kermit Home ] [ [94]C-Kermit 8.0
42290 +   Overview ] [ [95]Kermit Home ]
42291 +     __________________________________________________________________
42292 +
42293 +   C-Kermit 8.0 Unix Hints and Tips / [96]The Kermit Project /
42294 +   [97]kermit@columbia.edu / 30 June 2011
42295 +
42296 +References
42297 +
42298 +   1. http://www.columbia.edu/
42299 +   2. mailto:kermit@columbia.edu
42300 +   3. http://www.columbia.edu/kermit/index.html
42301 +   4. http://www.columbia.edu/kermit/k95.html
42302 +   5. http://www.columbia.edu/kermit/ckermit.html
42303 +   6. http://www.columbia.edu/kermit/ckscripts.html
42304 +   7. http://www.columbia.edu/kermit/current.html
42305 +   8. http://www.columbia.edu/kermit/whatsnew.html
42306 +   9. http://www.columbia.edu/kermit/faq.html
42307 +  10. http://www.columbia.edu/kermit/support.html
42308 +  11. http://www.columbia.edu/kermit/ckcbwr.html
42309 +  12. http://www.columbia.edu/kermit/ckubwr.html
42310 +  13. http://www.columbia.edu/kermit/k95.html
42311 +  14. http://www.columbia.edu/kermit/ckermit.html
42312 +  15. http://www.columbia.edu/kermit/ckututor.html
42313 +  16. http://www.columbia.edu/kermit/ckcbwr.html#x0
42314 +  17. http://www.columbia.edu/kermit/ckcbwr.html#x1
42315 +  18. http://www.columbia.edu/kermit/ckcbwr.html#x2
42316 +  19. http://www.columbia.edu/kermit/ckcbwr.html#x3
42317 +  20. http://www.columbia.edu/kermit/ckcbwr.html#x4
42318 +  21. http://www.columbia.edu/kermit/ckcbwr.html#x5
42319 +  22. http://www.columbia.edu/kermit/ckcbwr.html#x6
42320 +  23. http://www.columbia.edu/kermit/ckcbwr.html#x7
42321 +  24. http://www.columbia.edu/kermit/ckcbwr.html#x8
42322 +  25. http://www.columbia.edu/kermit/ckcbwr.html#x9
42323 +  26. http://www.columbia.edu/kermit/ckcbwr.html#x10
42324 +  27. http://www.columbia.edu/kermit/ckcbwr.html#x11
42325 +  28. http://www.columbia.edu/kermit/ckcbwr.html#top
42326 +  29. http://www.columbia.edu/kermit/ckcbwr.html#contents
42327 +  30. http://www.columbia.edu/kermit/ckcbwr.html#x2
42328 +  31. http://www.columbia.edu/kermit/ckcbwr.html#top
42329 +  32. http://www.columbia.edu/kermit/ckcbwr.html#contents
42330 +  33. http://www.columbia.edu/kermit/ckcbwr.html#x2
42331 +  34. http://www.columbia.edu/kermit/ck60manual.html
42332 +  35. http://www.columbia.edu/kermit/ckermit2.html
42333 +  36. http://www.columbia.edu/kermit/ck60manual.html
42334 +  37. http://www.columbia.edu/kermit/ckermit80.html#x5
42335 +  38. http://www.columbia.edu/kermit/ckermit80.html
42336 +  39. http://www.columbia.edu/kermit/ckermit80.html#x2.2
42337 +  40. http://www.columbia.edu/kermit/ckermit80.html#x8.7.2
42338 +  41. http://www.columbia.edu/kermit/ckermit80.html#x9
42339 +  42. http://www.columbia.edu/kermit/ckcbwr.html#top
42340 +  43. http://www.columbia.edu/kermit/ckcbwr.html#contents
42341 +  44. http://www.columbia.edu/kermit/ckcbwr.html#x3
42342 +  45. http://www.columbia.edu/kermit/ckcbwr.html#x1
42343 +  46. http://www.columbia.edu/kermit/ckcbwr.html#top
42344 +  47. http://www.columbia.edu/kermit/ckcbwr.html#contents
42345 +  48. http://www.columbia.edu/kermit/ckcbwr.html#x4
42346 +  49. http://www.columbia.edu/kermit/ckcbwr.html#x2
42347 +  50. http://www.columbia.edu/kermit/ckcbwr.html#top
42348 +  51. http://www.columbia.edu/kermit/ckcbwr.html#contents
42349 +  52. http://www.columbia.edu/kermit/ckcbwr.html#x5
42350 +  53. http://www.columbia.edu/kermit/ckcbwr.html#x3
42351 +  54. ftp://ftp.isi.edu/in-notes/rfc1122.txt
42352 +  55. http://www.columbia.edu/kermit/ckcbwr.html#top
42353 +  56. http://www.columbia.edu/kermit/ckcbwr.html#contents
42354 +  57. http://www.columbia.edu/kermit/ckcbwr.html#x6
42355 +  58. http://www.columbia.edu/kermit/ckcbwr.html#x4
42356 +  59. http://www.columbia.edu/kermit/ckcbwr.html#top
42357 +  60. http://www.columbia.edu/kermit/ckcbwr.html#contents
42358 +  61. http://www.columbia.edu/kermit/ckcbwr.html#x7
42359 +  62. http://www.columbia.edu/kermit/ckcbwr.html#x5
42360 +  63. http://www.columbia.edu/kermit/ck60manual.html
42361 +  64. http://www.columbia.edu/kermit/ckcbwr.html#x10
42362 +  65. http://www.columbia.edu/kermit/ckcbwr.html#top
42363 +  66. http://www.columbia.edu/kermit/ckcbwr.html#contents
42364 +  67. http://www.columbia.edu/kermit/ckcbwr.html#x8
42365 +  68. http://www.columbia.edu/kermit/ckcbwr.html#x6
42366 +  69. ftp://ftp.isi.edu/in-notes/rfc2217.txt
42367 +  70. http://www.columbia.edu/kermit/ckcbwr.html#top
42368 +  71. http://www.columbia.edu/kermit/ckcbwr.html#contents
42369 +  72. http://www.columbia.edu/kermit/ckcbwr.html#x9
42370 +  73. http://www.columbia.edu/kermit/ckcbwr.html#x7
42371 +  74. http://www.columbia.edu/kermit/ckcbwr.html#top
42372 +  75. http://www.columbia.edu/kermit/ckcbwr.html#contents
42373 +  76. http://www.columbia.edu/kermit/ckcbwr.html#x10
42374 +  77. http://www.columbia.edu/kermit/ckcbwr.html#x8
42375 +  78. http://www.columbia.edu/kermit/ckubwr.html
42376 +  79. http://www.columbia.edu/kermit/ckcbwr.html#top
42377 +  80. http://www.columbia.edu/kermit/ckcbwr.html#contents
42378 +  81. http://www.columbia.edu/kermit/ckcbwr.html#x11
42379 +  82. http://www.columbia.edu/kermit/ckcbwr.html#x9
42380 +  83. http://www.columbia.edu/kermit/ck60manual.html
42381 +  84. http://www.columbia.edu/kermit/ckermi70.htm
42382 +  85. http://www.columbia.edu/kermit/hp48.html
42383 +  86. http://www.columbia.edu/kermit/ckermit70.html#x4.22
42384 +  87. http://www.columbia.edu/kermit/ckermit80.html#x15
42385 +  88. http://www.columbia.edu/kermit/ckcbwr.html#top
42386 +  89. http://www.columbia.edu/kermit/ckcbwr.html#contents
42387 +  90. http://www.columbia.edu/kermit/ckcbwr.html#x10
42388 +  91. http://www.columbia.edu/kermit/ckcbwr.html#top
42389 +  92. http://www.columbia.edu/kermit/ckcbwr.html#contents
42390 +  93. http://www.columbia.edu/kermit/ckermit.html
42391 +  94. http://www.columbia.edu/kermit/ck80.html
42392 +  95. http://www.columbia.edu/kermit/index.html
42393 +  96. http://www.columbia.edu/kermit/index.html
42394 +  97. mailto:kermit@columbia.edu
42395 --- /dev/null
42396 +++ ckermit-301/ckermod.ini
42397 @@ -0,0 +1,8 @@
42398 +; File CKERMOD.INI, Sample C-Kermit 7.0 customization file.
42399 +;
42400 +echo
42401 +echo The very long standard initialization file that was distributed
42402 +echo with C-Kermit 6, 7, and 8 is no longer recommended as "standard",
42403 +echo since its features were little used.  It is still available in
42404 +echo the C-Kermit distribution as ockermod.ini.
42405 +echo
42406 --- /dev/null
42407 +++ ckermit-301/ckermit80.txt
42408 @@ -0,0 +1,10258 @@
42409 +
42410 +   [1]The Columbia Crown The Kermit Project | Columbia University
42411 +   612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
42412 +   ...since 1981
42413 +   [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
42414 +   [10]Support
42415 +
42416 +C-Kermit 8.0 Update Notes
42417 +
42418 +   [ [11]Contents ] [ [12]C-Kermit ] [ [13]Kermit Home ]
42419 +
42420 +Second Supplement to [14]Using C-Kermit, 2nd Edition
42421 +
42422 +For C-Kermit 8.0
42423 +
42424 +   As of C-Kermit version: 8.0.211
42425 +   Date of C-Kermit release: 10 April 2003
42426 +   This file last updated: Mon Sep 13 08:52:36 2010
42427 +
42428 +     * IF YOU ARE READING A PLAIN-TEXT version of this document, note that
42429 +       it is a plain-text dump of a Web page. You can visit the original
42430 +       (and possibly more up-to-date) Web page here:
42431 +  [15]http://www.columbia.edu/kermit/ckermit80.html
42432 +
42433 +     * If you are reading the HTML version of this file with a GUI Web
42434 +       browser, the features added since C-Kermit 8.0.201 are shown in red
42435 +       if your browser and monitor permit. Features that were new to
42436 +       versions 8.0.200 and 201 are in black.
42437 +
42438 +Authors: Frank da Cruz and Christine M. Gianone
42439 +Address: The Kermit Project
42440 +         Columbia University
42441 +         612 West 115th Street
42442 +         New York NY 10025-7799
42443 +         USA
42444 +Fax:     +1 (212) 662-6442
42445 +E-Mail:  [16]kermit-support@columbia.edu
42446 +Web:     [17]http://www.columbia.edu/kermit/
42447 +Or:      [18]http://www.kermit-project.org/
42448 +Or:      [19]http://www.columbia.nyc.ny.us/kermit/
42449 +
42450 +NOTICES
42451 +
42452 +   This document:
42453 +          Copyright Â© 1997, 2002, Frank da Cruz and Christine M. Gianone.
42454 +          All rights reserved.
42455 +
42456 +   Kermit 95:
42457 +          Copyright Â© 1995, 2002, Trustees of Columbia University in the
42458 +          City of New York. All rights reserved.
42459 +
42460 +   C-Kermit:
42461 +          Copyright Â© 1985, 2002,
42462 +          Trustees of Columbia University in the City of New York. All
42463 +          rights reserved. See the C-Kermit [20]COPYING.TXT file or the
42464 +          copyright text in the [21]ckcmai.c module for disclaimer and
42465 +          permissions.
42466 +
42467 +   When Kerberos(TM) and/or SRP(TM) (Secure Remote Password) and/or
42468 +          SSL/TLS protocol are included:
42469 +          Portions Copyright Â© 1990, Massachusetts Institute of
42470 +          Technology.
42471 +          Portions Copyright Â© 1991, 1993 Regents of the University of
42472 +          California.
42473 +          Portions Copyright Â© 1991, 1992, 1993, 1994, 1995 by AT&T.
42474 +          Portions Copyright Â© 1997, Stanford University.
42475 +          Portions Copyright Â© 1995-1997, Eric Young <eay@cryptosoft.com>.
42476 +
42477 +   For the full text of the third-party copyright notices, see
42478 +   [22]Appendix V.
42479 +
42480 +WHAT IS IN THIS FILE
42481 +
42482 +   This file lists changes made to C-Kermit since version 7.0 was released
42483 +   in January 2000. Use this file as a supplement to:
42484 +
42485 +     * The second edition of [23]Using C-Kermit; and:
42486 +     * The [24]C-Kermit 7.0 Update Notes. Also available in plain-text
42487 +       form as [25]ckermit70.txt.
42488 +
42489 +   until the third edition of Using C-Kermit is published. We apologize
42490 +   for the scattered documentation and will consolidate it when we are
42491 +   able.
42492 +
42493 +ADDITIONAL FILES
42494 +
42495 +   Several other files accompany this new Kermit release:
42496 +
42497 +   [26]ckututor.html
42498 +          C-Kermit Tutorial (for Unix). Also distributed in Nroff form as
42499 +          [27]ckuker.nr, the Unix C-Kermit manual page.
42500 +
42501 +   [28]security.htm
42502 +          Discussion of Kermit's new authentication and encryption
42503 +          features, updated for C-Kermit 8.0.
42504 +
42505 +   [29]telnet.htm
42506 +          Detailed documentation of Kermit's Telnet client, updated for
42507 +          C-Kermit 8.0.
42508 +
42509 +   [30]ftpscripts.html
42510 +          Tutorial: Writing FTP automation scripts
42511 +
42512 +   [31]ckcbwr.html
42513 +          Platform-independent C-Kermit hints and tips. Also distributed
42514 +          in plain text form as [32]ckcbwr.txt
42515 +
42516 +   [33]ckubwr.html
42517 +          Unix-specific C-Kermit hints and tips. Also distributed in plain
42518 +          text form as [34]ckubwr.txt.
42519 +
42520 +   [35]ckvbwr.html
42521 +          VMS-specific C-Kermit hints and tips. Also distributed in plain
42522 +          text form as [36]ckvbwr.txt.
42523 +
42524 +   [37]ckuins.html
42525 +          Unix C-Kermit installation instructions. Also distributed in
42526 +          plain text form as [38]ckuins.txt.
42527 +
42528 +   [39]ckvins.html
42529 +          VMS C-Kermit installation instructions. Also distributed in
42530 +          plain text form as [40]ckvins.txt.
42531 +
42532 +   [41]ckccfg.html
42533 +          Compile-time configuration options. Also distributed in plain
42534 +          text form as [42]ckccfg.txt.
42535 +
42536 +   [43]ckcplm.html
42537 +          C-Kermit Program Logic Manual. Also distributed in plain text
42538 +          form as [44]ckcplm.txt.
42539 +
42540 +   [45]iksd.html
42541 +          Internet Kermit Service Aministrators Guide for Unix.
42542 +
42543 +   [46]skermit.html
42544 +          C-Kermit as an SSH Subsystem (SFTP server replacement).
42545 +
42546 +   [ [47]Top ] [ [48]C-Kermit ] [ [49]Kermit Home ]
42547 +
42548 +CONTENTS
42549 +
42550 +     [50]0. WHAT'S NEW
42551 +     [51]1. FIXES SINCE VERSION 7.0.196
42552 +     [52]2. SSH AND HTTP
42553 +         [53]2.1. SSH Connections
42554 +         [54]2.2. HTTP Connections
42555 +            [55]2.2.1. HTTP Command Switches
42556 +            [56]2.2.2. HTTP Action Commands
42557 +            [57]2.2.3. HTTP Headers
42558 +            [58]2.2.4. Secure HTTP Connections
42559 +            [59]2.2.5. HTTP Variables
42560 +            [60]2.2.6. The HTTP Command-Line Personality
42561 +     [61]3. THE BUILT-IN FTP CLIENT
42562 +         [62]3.1. Making and Managing FTP Connections
42563 +            [63]3.1.1. Kermit Command-Line Options for FTP
42564 +            [64]3.1.2. The FTP Command-Line Personality
42565 +            [65]3.1.3. The FTP URL Interpreter
42566 +            [66]3.1.4. Interactive FTP Session Establishment
42567 +         [67]3.2. Making Secure FTP Connections
42568 +         [68]3.3. Setting FTP Preferences
42569 +         [69]3.4. Managing Directories and Files
42570 +         [70]3.5. Uploading Files With FTP
42571 +            [71]3.5.1. FTP PUT Switches
42572 +            [72]3.5.2. Update Mode
42573 +            [73]3.5.3. Recovery
42574 +         [74]3.6. Downloading Files With FTP
42575 +            [75]3.6.1. FTP GET Switches
42576 +            [76]3.6.2. Filename Collisions
42577 +            [77]3.6.3. Recovery
42578 +         [78]3.7. Translating Character Sets
42579 +            [79]3.7.1. Character Sets and Uploading
42580 +            [80]3.7.2. Character Sets and Downloading
42581 +         [81]3.8. FTP Command Shortcuts
42582 +         [82]3.9. Dual Sessions
42583 +         [83]3.10. Automating FTP Sessions
42584 +            [84]3.10.1. FTP-Specific Variables and Functions
42585 +            [85]3.10.2. Examples
42586 +            [86]3.10.3. Automating Secure FTP Connections
42587 +         [87]3.11. Advanced FTP Protocol Features  [88]4. FILE SCANNING
42588 +    [89]5. FILE AND DIRECTORY NAMES CONTAINING SPACES
42589 +    [90]6. OTHER COMMAND PARSING IMPROVEMENTS
42590 +         [91]6.1. Grouping Macro Arguments
42591 +         [92]6.2. Directory and File Name Completion
42592 +         [93]6.3. Passing Arguments to Command Files
42593 +         [94]6.4. More-Prompting
42594 +         [95]6.5. Commas in Macro Definitions
42595 +         [96]6.6. Arrow Keys
42596 +    [97]7. NEW COMMANDS AND SWITCHES
42597 +    [98]8. SCRIPTING IMPROVEMENTS
42598 +         [99]8.1. Performance and Debugging
42599 +         [100]8.2. Using Macros as Numeric Variables
42600 +         [101]8.3. New IF Conditions
42601 +         [102]8.4. The ON_UNKNOWN_COMMAND and ON_CD Macros
42602 +         [103]8.5. The SHOW MACRO Command
42603 +         [104]8.6. Arrays
42604 +         [105]8.7. New or Improved Built-in Variables and Functions
42605 +         [106]8.8. The RETURN and END Commands
42606 +         [107]8.9. UNDEFINing Groups of Variables
42607 +         [108]8.10. The INPUT and MINPUT Commands
42608 +         [109]8.11. Learned Scripts
42609 +         [110]8.12. Pattern Matching
42610 +         [111]8.13. Dates and Times
42611 +         [112]8.14. Trapping Keyboard Interruption
42612 +    [113]9. S-EXPRESSIONS
42613 +         [114]9.1. What is an S-Expression?
42614 +         [115]9.2. Integer and Floating-Point-Arithmetic
42615 +         [116]9.3. How to Use S-Expressions
42616 +         [117]9.4. Summary of Built-in Constants and Operators
42617 +         [118]9.5. Variables
42618 +         [119]9.6. Assignments and Scope
42619 +         [120]9.7. Conditional Expressions
42620 +         [121]9.8. Extensibility
42621 +         [122]9.9. Examples
42622 +         [123]9.10. Differences from Algebraic Notation
42623 +         [124]9.11.Differences from Lisp
42624 +    [125]10. FILE TRANSFER
42625 +    [126]11. MODEMS AND DIALING
42626 +    [127]12. TERMINAL CONNECTION
42627 +    [128]13. CHARACTER SETS
42628 +    [129]14. DIALOUT FROM TELNET TERMINAL SERVERS
42629 +    [130]15. COPING WITH BROKEN KERMIT PARTNERS
42630 +    [131]16. NEW COMMAND-LINE OPTIONS
42631 +    [132]17. LOGS
42632 +
42633 +   [ [133]Top ] [ [134]C-Kermit ] [ [135]Kermit Home ]
42634 +
42635 +0. WHAT'S NEW
42636 +
42637 +   The Initialization and Customization Files
42638 +          C-Kermit 8.0 now supports specification of the initialization
42639 +          file name (path) in an environment variable, CKERMIT_INI. It
42640 +          also relies far less than before on the initialization for
42641 +          functioning. See [136]Section 5 of the Unix C-Kermit
42642 +          [137]installation instructions for details. As of version
42643 +          8.0.201, C-Kermit also executes your customization file (if you
42644 +          have one) even if the initialization file was not found.
42645 +          Previously, the customization file was executed by a TAKE
42646 +          command in the initialization file (and it still is, if an
42647 +          initialization is found).
42648 +
42649 +   Incompatible Changes
42650 +          As always, we do our best to avoid changes that break existing
42651 +          scripts. However, C-Kermit 8.0 does include a rather pervasive
42652 +          syntax change that might alter the behavior of scripts that
42653 +          depend on the previous behavior. As described in [138]Section 5,
42654 +          C-Kermit now accepts doublequotes in most contexts where you
42655 +          previously had to use braces to group multiple words into a
42656 +          single field, or to force inclusion of leading or trailing
42657 +          blanks. Most noticeably, in C-Kermit 7.0 and earlier:
42658 +
42659 +  echo {this is a string}
42660 +
42661 +          would print:
42662 +
42663 +  this is a string
42664 +
42665 +          whereas:
42666 +
42667 +  echo "this is a string"
42668 +
42669 +          printed:
42670 +
42671 +  "this is a string"
42672 +
42673 +          In C-Kermit 8.0, both print:
42674 +
42675 +  this is a string
42676 +
42677 +          To force the doublequotes to be treated as part of the string,
42678 +          use either of the following forms:
42679 +
42680 +  echo {"this is a string"}
42681 +  echo ""this is a string""
42682 +
42683 +          Similarly, to force braces to be treated as part of the string:
42684 +
42685 +  echo "{this is a string}"
42686 +  echo {{this is a string}}
42687 +
42688 +          Other incompatibilities:
42689 +
42690 +         1. Using the SET HOST command to make HTTP connections is no
42691 +            longer supported. Instead, use the new HTTP OPEN command,
42692 +            described in [139]Section 2.2.
42693 +
42694 +   C-Kermit 7.1 Alpha.01 (8 December 2000)
42695 +
42696 +     Its major new features are those listed in the [140]Table of
42697 +          Contents: the FTP client, file scanning, command parsing and
42698 +          scripting improvements, S-Expressions, and support for the
42699 +          Telnet Com Port Option, plus wider availability of the Kerberos,
42700 +          SSL/TLS, and SRP security options for secure Internet
42701 +          connections.
42702 +
42703 +   C-Kermit 7.1.199 Alpha.02 (4 January 2001)
42704 +
42705 +          + C-Kermit now accepts [141]FTP, TELNET, and IKSD URLs as its
42706 +            first command-line argument.
42707 +          + Character-set translation added to the FTP client for
42708 +            [142]filenames.
42709 +          + Optional [143]setting of date of incoming files by FTP [M]GET
42710 +            from the server date.
42711 +          + [144]FTP CHECK filename added to let FTP client check the
42712 +            existence of a file on the server.
42713 +          + [145]FTP GET /NAMELIST:filename added to get list of server
42714 +            filenames into a local file.
42715 +          + [146]FTP [M]PUT /SERVER-RENAME:template added to make server
42716 +            rename a file as indicated by the template after it has
42717 +            arrived completely.
42718 +          + FTP [M]GET /SERVER-RENAME:template added to make server rename
42719 +            a file as indicated by the template after it has been sent
42720 +            completely.
42721 +          + FTP [147]VDIRECTORY added for getting verbose directory
42722 +            listings from TOPS-20.
42723 +          + [148]FTP TYPE TENEX added for transferring 8-bit binary files
42724 +            with PDP-10s.
42725 +          + Added [149]automatic text/binary mode switching for FTP
42726 +            [M]GET, based on filename patterns (e.g. *.zip, *.gz, *.exe
42727 +            are binary; *.txt, *.c are text).
42728 +          + [150]SET SEND I-PACKETS OFF added for coping with Kermit
42729 +            servers that do not support I packets.
42730 +          + A new option was added to [151]\fword() and \fsplit() for
42731 +            parsing comma-separated lists that might contain empty
42732 +            elements.
42733 +          + Bug fixes including:
42734 +               o {} or "" could not be used as expected to represent the
42735 +                 empty string.
42736 +               o ,- on a line by itself in a macro definition caused
42737 +                 subsequent statements to be skipped.
42738 +               o FTP [M]GET didn't work right if path segments were
42739 +                 included in the filespec.
42740 +               o FTP MGET, if interrupted, did not clear its file list.
42741 +               o Various problems with FTP PUT /AS-NAME that nobody
42742 +                 noticed.
42743 +               o Some FTP messages and displays interfered with each
42744 +                 other.
42745 +               o Parsing of YESTERDAY, TODAY, and TOMORROW in date-time
42746 +                 fields was broken.
42747 +               o Automatic old-to-new dialing directory format conversion
42748 +                 was broken on VMS.
42749 +               o Various source-code portability problems fixed.
42750 +          + Improvement of various HELP and SHOW messages.
42751 +
42752 +   C-Kermit 7.1.199 Alpha.04 (1 April 2001)
42753 +
42754 +          + Big changes:
42755 +               o Changed default modem type from NONE to GENERIC.
42756 +               o Generic dialing now sends no init string at all.
42757 +               o Changed default terminal bytesize from 7 to 8.
42758 +          + New features:
42759 +               o SET SESSION-LOG TIMESTAMPED-TEXT for timestamped session
42760 +                 log.
42761 +          + New modem types:
42762 +               o Conexant modem family
42763 +               o Lucent VENUS chipset
42764 +               o PCTel V.90 chipset
42765 +               o Zoom V.90
42766 +               o Zoom V.92
42767 +          + FTP client:
42768 +               o FTP OPEN /PASSIVE and /ACTIVE switches added.
42769 +               o Now works with servers that that don't include path in
42770 +                 NLST response.
42771 +               o Fixed SEND /RECURSIVE not to follow symlinks (UNIX).
42772 +               o SET FTP VERBOSE-MODE default is now OFF instead of ON.
42773 +          + Kermit protocol:
42774 +               o Fixed what I hope is the last "Receive window full"
42775 +                 error.
42776 +               o SET PREFIXING or SET CONTROL PREFIX now automatically
42777 +                 sets CLEARCHANNEL OFF.
42778 +               o Fixed incorrect report of number of files transferred at
42779 +                 end of transfer.
42780 +               o Fixed SEND /RECURSIVE not to follow symlinks (UNIX).
42781 +          + UNIX:
42782 +               o HTTP and shadow passwords enabled for SCO 5.0.6.
42783 +               o Even with SET FILENAMES CONVERTED, spaces were still
42784 +                 accepted in incoming filenames; now they are converted to
42785 +                 underscores.
42786 +               o Added support for compile-time mktemp()/mkstemp()
42787 +                 selection.
42788 +          + VMS:
42789 +               o Session-log format for scripted sessions fixed.
42790 +          + Scripting:
42791 +               o Fixed \frdir() not to follow symlinks (UNIX).
42792 +               o Fixed \fday() not to dump core for dates prior to 17 Mar
42793 +                 1858.
42794 +          + General:
42795 +               o "Closing blah..." message upon exit could not be
42796 +                 surpressed.
42797 +               o Added /PAGE and /NOPAGE to DELETE switches.
42798 +               o Added GO response for DELETE /ASK (delete all the rest
42799 +                 without asking).
42800 +               o Added GO response to "more?" prompt (for multi-page
42801 +                 screen output).
42802 +               o Updated HELP texts.
42803 +
42804 +   C-Kermit 7.1.199 Beta.01 (10 May 2001)
42805 +
42806 +          + FTP client verbosity adjustments.
42807 +          + Bug with generic modem dialing pausing several secs fixed.
42808 +          + SET HOST /USER:, SET LOGIN USERID, etc, fixed when given no
42809 +            user ID.
42810 +          + A couple \v(dm_blah) dial modifier variables added.
42811 +          + "--version" command-line switch added.
42812 +          + Fixed NetBSD serial-port DTR handling.
42813 +          + Lots of syntax cleanups for Flexelint and gcc -Wall.
42814 +          + Fixed modem-type aliases to not take precedence over real
42815 +            names.
42816 +          + Fixed funny treatment of doublequotes by ECHO command.
42817 +          + Enabled SET SESSION-LOG for VMS and other non-UNIX platorms.
42818 +          + Fixed changing direction in command history buffer.
42819 +          + Fixed handling of IKSD URLs.
42820 +          + Made sure DELETE prints a message if it got any errors.
42821 +
42822 +   C-Kermit 8.0.200 Beta.02 (28 June 2001)
42823 +
42824 +          + Major version number increased from 7 to 8.
42825 +          + [152]SSH command.
42826 +          + More-consistent Kermit protocol defaults.
42827 +          + CONNECT idle timeout and action selection.
42828 +          + CONNECT status variable.
42829 +          + A way to allocate more space for filename lists.
42830 +          + Pseudoterminal handler fixed for late-model Linuxes.
42831 +          + Command-line option -dd for timestamped debug log.
42832 +          + Download directory now works for external protocols too.
42833 +          + GREP /COUNT:variable.
42834 +          + SET ATTRIBUTE RECORD-FORMAT { OFF, ON }.
42835 +          + Bug fixes.
42836 +
42837 +   C-Kermit 8.0.200 Beta.03 (9 Sep 2001)
42838 +
42839 +          + [153]HTTP 1.1 connections and scripting
42840 +          + [154]ON_CTRLC macro for trapping Ctrl-C in scripts
42841 +          + [155]Date-time parsing improvements, timezones, comparison,
42842 +            arithmetic
42843 +          + [156]Pattern-matching improvements
42844 +          + FTP improvements
42845 +          + SET EXIT HANGUP { ON, OFF }
42846 +          + SET FILE EOF { CTRL-Z, LENGTH }
42847 +          + ASK[Q] /TIMEOUT
42848 +          + Bug fixes
42849 +          + New platforms
42850 +
42851 +   C-Kermit 8.0.200 Beta.04 (16 Nov 2001)
42852 +
42853 +          + [157]New Unix man page
42854 +          + [158]New Unix installation instructions
42855 +          + SET TELOPT policies are now enforced on non-Telnet ports if
42856 +            the server begins Telnet negotiations.
42857 +          + SET TERMINAL IDLE-ACTION { TELNET-NOP, TELNET-AYT }.
42858 +          + UUCP lockfile creation race condition fixed.
42859 +          + Dialout, modem signals, hangup, hardware flow control, etc,
42860 +            tested extensively on many platforms, numerous problems fixed.
42861 +          + Improved hints when dialing fails.
42862 +          + SET STOP-BITS 2 can now be given without SET FLOW HARDWARE.
42863 +          + Major improvements in RFC 2217 Telnet Com-Port Control.
42864 +          + Improved ability to REDIAL a modem server port.
42865 +          + kermit -h now shows the command name in the usage usage
42866 +            string.
42867 +          + kermit -h now shows ALL command-line options.
42868 +          + kermit -s blah, where blah is a symlink, now works.
42869 +          + --noperms command-line option = SET ATTRIBUTE PERMISSIONS OFF.
42870 +          + HTTP and HTTPS URLs now supported on the command line.
42871 +          + An http command-line personality is now available.
42872 +          + Initialization file streamlined to load faster, anachronisms
42873 +            removed.
42874 +          + Updated NEWS, INTRO, HELP text, SHOW commands. In particular,
42875 +            see SHOW COMM, HELP SET LINE, HELP WAIT.
42876 +          + Date/time arithmetic routines converted from floating-point to
42877 +            integer arithmetic (internally) for greater accuracy and
42878 +            portability.
42879 +          + Quoted strings containing commas no longer break macro
42880 +            execution.
42881 +          + Dynamic Kermit file-transfer timeouts are now much more
42882 +            aggressive.
42883 +          + New "hot keys" to turn debug.log on/off during file transfer.
42884 +          + Improved hints when file transfer fails.
42885 +          + FTP CD orientation messages are now printed.
42886 +          + -R now accepted on the FTP command line to request Recursion.
42887 +          + -m allows Active or Passive mode to be chosen on the FTP
42888 +            command line.
42889 +          + -dd on the FTP command line creates a timestamped debug.log.
42890 +          + FTP command-line security options filled in.
42891 +          + Improved automatic text/binary mode switching for MGET.
42892 +          + Removed spurious error messages that sometimes occur during
42893 +            MGET.
42894 +          + DIRECTORY, GREP, TYPE, HEAD, and TAIL now have a /OUTPUT:file
42895 +            option.
42896 +          + TYPE /NUMBER adds line numbers.
42897 +          + CAT = TYPE /NOPAGE; MORE = TYPE /PAGE.
42898 +          + GETOK ?-help fixed.
42899 +          + \v(timestamp) (= "\v(ndate) \v(time)")
42900 +          + \v(hour) (hour of the day, 0-23)
42901 +          + \funix2dospath() converts a UNIX path (/) to a DOS one (\).
42902 +          + \fdos2unixpath() converts a DOS (Windows, OS/2) path to a UNIX
42903 +            one.
42904 +          + \fkeywordval() parses name=value pair, allows macro keyword
42905 +            parameters.
42906 +          + We now make every attempt to not write passwords to the
42907 +            debug.log.
42908 +          + New Certficate Authority certificates file, includes the
42909 +            Kermit Project at Columbia University so you can access our
42910 +            IKSD securely.
42911 +          + Secure targets improved and better documented in Unix
42912 +            makefile.
42913 +          + All Linux (libc and glibc) builds consolidated under "make
42914 +            linux".
42915 +          + HP-UX makefile targets now have consistent names.
42916 +          + New aix50 and aix51 targets added.
42917 +
42918 +   C-Kermit 8.0.200 Final (12 Dec 2001)
42919 +
42920 +          + Remote/local-mode confusion on some platforms introduced in
42921 +            Beta.04, fixed.
42922 +          + Many of the makefile targets adjusted, new ones added.
42923 +          + New "make install" target should please most people.
42924 +          + New command: SHOW IKSD.
42925 +          + FTP over TLS.
42926 +          + Last-minute touchups to text messages, HELP text, etc.
42927 +          + Enable modem-signal reading for SCO OSR5 and Unixware 7.
42928 +          + Special superfast TRANSMIT /BINARY /NOECHO /NOWAIT mode added.
42929 +          + Fixed PBX dialing in unmarked-area-code case.
42930 +          + Improved SHOW COMMUNICATIONS tells lockfile directory, typical
42931 +            dialout device name.
42932 +          + Some FTP OPEN command parsing problems fixed.
42933 +          + Some errors in date arithmetic fixed.
42934 +          + New command: SET TERMINAL AUTODOWNLOAD { ..., ERROR { STOP,
42935 +            CONTINUE } }
42936 +          + New command: HELP FIREWALL.
42937 +          + SET MODEM HANGUP-METHOD DTR added as synomym for RS232-SIGNAL
42938 +          + Support for secure URL protocols added: telnets:, ftps:,
42939 +            https:.
42940 +
42941 +   C-Kermit 8.0.201 (8 Feb 2002)
42942 +
42943 +          + Installability as an [159]SSH v2 Subsystem.
42944 +          + [160]SET LOCUS command.
42945 +          + [161]L-versions of CD, DIR, DELETE, MKDIR, etc, to force local
42946 +            execution.
42947 +          + [162]USER and ACCOUNT added as synonyms for FTP USER and FTP
42948 +            ACCOUNT.
42949 +          + [163]SHOW VARIABLES now accepts a list of variables.
42950 +          + Rudimentary support for [164]Caller ID when receiving phone
42951 +            calls.
42952 +          + Up/Down [165]Arrow-key navigation of command history buffer.
42953 +          + [166]Automatic execution of customization file if init file is
42954 +            missing.
42955 +
42956 +   C-Kermit 8.0.206 Beta.01 (11 Oct 2002)
42957 +
42958 +        New commands:
42959 +
42960 +               o ORIENTATION lists location-related variables and their
42961 +                 values.
42962 +               o KCD changes to special directories by their symbolic
42963 +                 names ("kcd ?" for a list).
42964 +               o SET CD HOME path to specify home directory for CD and KCD
42965 +                 commands.
42966 +               o CONTINUE given at top level is equivalent to END -- handy
42967 +                 when PROMPT'ed out of a script, to continue the script.
42968 +
42969 +        New switches or operands for existing commands:
42970 +
42971 +               o GETOK /TIMEOUT
42972 +               o ASK, ASKQ, GETOK /QUIET (suppresses error message on
42973 +                 timeout)
42974 +               o COPY /APPEND now allows concatenating multiple source
42975 +                 files into one dest file.
42976 +               o SET TCP { HTTP-PROXY, SOCKS-SERVER } /USER, /PASSWORD.
42977 +               o DIRECTORY command now accepts multiple filespecs, e.g.
42978 +                 "dir a b c".
42979 +
42980 +        SET QUIET ON now also applies to:
42981 +
42982 +               o SET HOST connection progress messages.
42983 +               o "Press the X or E key to cancel" file-transfer message.
42984 +               o REMOTE CD response.
42985 +               o REMOTE LOGIN response.
42986 +
42987 +        Improvements and new features:
42988 +
42989 +               o Numerous FTP client fixes and new features, listed below.
42990 +               o C-Kermit, when in remote mode at the end of a file
42991 +                 transfer, now prints a one-line "where" message. Control
42992 +                 with SET TRANSFER REPORT.
42993 +               o Unix makefile "install" target now creates an UNINSTALL
42994 +                 script.
42995 +               o Improved operation and performance on RFC 2217 Telnet
42996 +                 connections.
42997 +               o Improved CONNECT (interactive terminal connection)
42998 +                 performance.
42999 +               o HELP text updated for many commands.
43000 +
43001 +        New or fixed makefile targets:
43002 +
43003 +               o Solaris 9 (several variations)
43004 +               o Concurrent PowerMAX
43005 +               o Mac OS X 10.2
43006 +               o FreeBSD 1.0
43007 +               o FreeBSD 4.6, 5.0
43008 +               o AIX 5.2, 5.3
43009 +
43010 +        Bugs fixed (general):
43011 +
43012 +               o Failure to run in VMS Batch fixed.
43013 +               o LDIRECTORY fixed to run Kermit's built-in DIRECTORY
43014 +                 command rather than an external one.
43015 +               o Fixed Solaris and other SVORPOSIX builds to find out
43016 +                 their full hostnames rather than just the "uname -n"
43017 +                 name.
43018 +               o Fixed some problems matching strings that start with ".".
43019 +               o Fixed some problems matching pattern that contain {a,b,c}
43020 +                 lists.
43021 +               o Fixed erroneous reporting of text-mode reception as
43022 +                 binary when sender did not report the file size (cosmetic
43023 +                 only).
43024 +               o Many problems with SWITCH statements fixed.
43025 +               o Fixed SET OPTIONS DIRECTORY /DOTFILES to work for server
43026 +                 too.
43027 +               o Fixed DELETE to print an error message if the file was
43028 +                 not found.
43029 +               o Fixed SET CONTROL UNPREFIX ALL and SET PREFIXING NONE to
43030 +                 do the same thing.
43031 +               o Fixed bugs executing macros from within the ON_EXIT
43032 +                 macro.
43033 +               o \fday() and \fnday() fixed for dates prior to 17 Nov
43034 +                 1858.
43035 +               o Serial speed-changing bug in Linux fixed.
43036 +               o "Unbalanced braces" script parsing errors when using
43037 +                 \{number} fixed.
43038 +               o "if defined \v(name)" fixed to behave as described in the
43039 +                 book.
43040 +               o Fixed Problems caused by LOCAL variables whose names are
43041 +                 left substrings of macro names.
43042 +               o The INPUT command was fixed to honor the PARITY setting.
43043 +               o Fixed bug with COPY to existing file that is longer than
43044 +                 source file.
43045 +               o REINPUT command failed to strip braces/quotes around its
43046 +                 target string.
43047 +               o Network directory lookups didn't work for SSH
43048 +                 connections.
43049 +               o REMOTE SET { FILE, TRANSFER } CHARACTER-SET fixed.
43050 +               o Closed some holes whereby an incompletely received file
43051 +                 was not deleted when SET FILE INCOMPLETE is DISCARD, e.g.
43052 +                 when the Kermit is hung up upon.
43053 +               o SET XFER CHARACTER-SET TRANSPARENT fixed to do the same
43054 +                 as SET XFER TRANSLATION OFF.
43055 +               o SET HOST PTY (e.g. SSH) connection fixed to pass along
43056 +                 window-size changes.
43057 +               o C-Kermit search path for TAKE files was accidentally
43058 +                 disabled.
43059 +
43060 +        FTP client bugs fixed:
43061 +
43062 +               o Character set translation was broken on little-endian
43063 +                 (e.g. PC) architectures.
43064 +               o FTP PUT /SERVER-RENAME:, /RENAME-TO:, /MOVE-TO: switches
43065 +                 were sticky.
43066 +               o Make SET TRANSFER MODE MANUAL apply to FTP.
43067 +               o Make SET FILE INCOMPLETE { KEEP, DISCARD } apply to FTP.
43068 +               o FTP MGET /UPDATE handled equal times incorrectly.
43069 +               o FTP MGET /RECOVER fixed to ignore file dates, use only
43070 +                 size.
43071 +               o FTP MGET /RECOVER sometimes downloaded files it didn't
43072 +                 need to.
43073 +               o FTP downloads with TRANSFER DISPLAY BRIEF could give
43074 +                 misleading error messages.
43075 +               o FTP MGET temp file not deleted if FTP DEBUG set to OFF
43076 +                 after it was ON.
43077 +               o LOCUS not switched back when FTP connection is lost.
43078 +               o Set incoming file date even if it was not completely
43079 +                 received.
43080 +               o FTP MGET sent SIZE and MDTM commands even when it didn't
43081 +                 have to.
43082 +               o FTP MGET sent SIZE and MDTM commands even when it knew
43083 +                 they wouldn't work.
43084 +               o FTP MGET failed if no files were selected for download.
43085 +               o FTP MGET a* b* c* would fail to get any c*'s if no b*'s
43086 +                 existed.
43087 +               o Big problems canceling MGET with Ctrl-C.
43088 +               o Some extraneous LOCUS dialogs squelched.
43089 +               o Some inconsistencies in SET FTP FILENAMES AUTO fixed.
43090 +               o Fixed file-descriptor pileup after multiple MGETs when
43091 +                 using mkstemp().
43092 +               o Fixed "mget foo", where foo is a directory name.
43093 +
43094 +        FTP improvements:
43095 +
43096 +               o New [167]FTP protocol features added (FEAT, MLSD).
43097 +               o FTP MGET /RECURSIVE now works as expected if server
43098 +                 supports MLSD.
43099 +               o FTP MGET /DATES-DIFFER to download if local and remote
43100 +                 file dates differ.
43101 +               o FTP DATES default changed to ON.
43102 +               o FTP MPUT, MGET /EXCEPT now allows up to 64 patterns (up
43103 +                 from 8).
43104 +               o Top-level SITE and PASSIVE commands added for
43105 +                 convenience.
43106 +               o MGET /COLLISION:APPEND /AS-NAME:newfile *.* puts all
43107 +                 remote files into one local file.
43108 +               o SET FTP SERVER-TIME-OFFSET for when server has wrong
43109 +                 timezone set.
43110 +               o Allow for alternative server interpretations of [M]MPUT
43111 +                 /UNIQUE.
43112 +               o SET FTP ANONOMOUS-PASSWORD lets you specify the default
43113 +                 anonymous password.
43114 +               o Allow "GET /RECURSIVE path/file" to force local
43115 +                 subdirectory creation.
43116 +               o SET FTP DISPLAY is like SET TRANSFER DISPLAY but applies
43117 +                 only to FTP.
43118 +               o FTP { ENABLE, DISABLE } new-protocol-feature-name.
43119 +               o FTP MGET /NODOTFILES.
43120 +               o Debug log now records FTP commands and responses in
43121 +                 grep-able format.
43122 +
43123 +   [ [168]Top ] [ [169]Contents ] [ [170]C-Kermit ] [ [171]Kermit Home ]
43124 +
43125 +1. FIXES SINCE VERSION 7.0.196 First, the changes from 7.0.196 to 7.0.197...
43126 +Source and makefile tweaks to get successful builds on platforms that were
43127 +not available in time for the 7.0 release:
43128 +
43129 +     * 4.2BSD
43130 +     * 4.3BSD
43131 +     * AIX 4.3
43132 +     * AT&T 3B2 and 3B20
43133 +     * BeOS 4.5
43134 +     * CLIX
43135 +     * Interactive UNIX System V/386 R3.2 V4.1.1
43136 +     * OS-9/68000
43137 +     * OSF/1 1.3.
43138 +     * PS/2 AIX 1.2.1
43139 +     * SCO OSR5.0.x
43140 +     * SCO Xenix 2.3.4
43141 +     * SINIX 5.41/Intel
43142 +     * Stratus FTX
43143 +     * Stratus VOS
43144 +     * SunOS 4.1 with X.25
43145 +     * Ultrix 4.2
43146 +     * Unixware 2.0
43147 +
43148 +   There were no functional changes from 196 to 197.
43149 +
43150 +   Fixes applied after C-Kermit 7.0.197 was released:
43151 +
43152 +   Source code: Big flexelint and "gcc -Wall" audit and cleanup.
43153 +
43154 +   Configuration:
43155 +     * Solaris RTS/CTS (hardware flow control) didn't work.
43156 +     * BSDI RTS/CTS worked only in one direction.
43157 +     * FreeBSD 4.0 with ncurses 5.0 broke interactive command parsing.
43158 +     * QNX-32 build lacked -DBIGBUFOK so couldn't execute big macros.
43159 +
43160 +   Connections:
43161 +     * SET HOST /PTY didn't work on some platforms.
43162 +     * Broken SET HOST /USER:xxx /PASSWORD:yyy /ACCOUNT:zzz switches
43163 +       fixed.
43164 +     * Transparent printing was broken in Unix.
43165 +     * ANSWER 0 (wait forever) didn't work.
43166 +     * Some problems in Multitech modem command strings.
43167 +     * Spurious "?Sorry, can't condition console terminal" errors.
43168 +     * Disabling modem command strings by setting them to nothing broke
43169 +       dialing.
43170 +     * SET DIAL TIMEOUT value was usually ignored.
43171 +     * SET DIAL METHOD PULSE didn't work.
43172 +     * Certain modem commands, if changed, not refreshed if modem type
43173 +       changed.
43174 +     * SET SESSION-LOG command was missing from VMS.
43175 +     * VMS session log format fixed for scripts.
43176 +     * HANGUP by dropping DTR didn't work in NetBSD.
43177 +     * SET FLOW /AUTO versus SET FLOW confusion fixed.
43178 +     * Spurious secondary Solaris lockfile removed.
43179 +     * SCO OSR5 DTR On/Off hangup.
43180 +     * UUCP lockfile race condition.
43181 +
43182 +   Commands and scripts:
43183 +     * Missing CAUTIOUS and FAST commands restored.
43184 +     * Broken PTY command in late-model Linuxes fixed (API changed).
43185 +     * Fixed off-by-one error in command recall when switching direction.
43186 +     * Fixed recall of commands that contain '?'.
43187 +     * COPY /SWAP-BYTES didn't work on some architectures.
43188 +     * Various combinations of COPY switches didn't work.
43189 +     * Various problems with COPY or RENAME with a directory name as
43190 +       target.
43191 +     * SHIFT didn't decrement \v(argc) if used within IF, ELSE, or SWITCH
43192 +       block.
43193 +     * SHIFT didn't affect the \%* variable.
43194 +     * Divide by zero improperly handled in some \function()s.
43195 +     * Problems with RETURN from right-recursive functions.
43196 +     * FSEEK /LINE \%c LAST didn't work if already at end.
43197 +     * Some buffer vulnerabilities and potential memory leaks were
43198 +       discovered and fixed.
43199 +     * \frdirectory() fixed not to follow symbolic links.
43200 +     * SET EXIT WARNING OFF fixed to work when EXIT given in a script.
43201 +     * Missing DELETE and MKDIR error message fixed.
43202 +     * \fday() core dump for ancient dates fixed.
43203 +
43204 +   File transfer:
43205 +     * SEND /COMMAND was broken.
43206 +     * CRECEIVE was broken (but RECEIVE /COMMAND was OK).
43207 +     * Quoting wildcard chars in filenames didn't work.
43208 +     * Problems canceling streaming file transfers with X or Z.
43209 +     * Problems shifting between streaming and windowing file transfer.
43210 +     * Non-FULL file-transfer displays erroneously said STREAMING when
43211 +       not.
43212 +     * An active SEND-LIST prevented GET from working.
43213 +     * SET SERVER GET-PATH interpretation of relative names like "." was
43214 +       wrong.
43215 +     * The MAIL command was broken.
43216 +     * "kermit -s *" might have skipped some files.
43217 +     * Transaction log entries were not made for external protocol
43218 +       transfers.
43219 +     * File count report fixed to show number of files actually
43220 +       transferred.
43221 +     * Fixed filename conversion to convert spaces to underscores.
43222 +     * Made SET PREFIXING / SET CONTROL PREFIX also adjust CLEARCHANNEL.
43223 +     * More "Receive window full" errors fixed.
43224 +     * Broken terminal buffering after curses display in Solaris fixed.
43225 +     * SET FILE INCOMPLETE DISCARD did not work in all cases.
43226 +     * Packet log changed to reformat the start-of-packet character
43227 +       printably.
43228 +     * Dynamic timeouts could grow ridiculously large.
43229 +
43230 +   Character sets:
43231 +     * Hebrew-7 translations missed the letter Tav.
43232 +     * C1 area of CP1252 was ignored.
43233 +     * SET TRANSFER CHARACTER-SET TRANSPARENT could give garbage
43234 +       translations.
43235 +     * TRANSLATE might not work on Little Endian architectures.
43236 +     * Insufficient range checking in certain TRANSLATE operations.
43237 +
43238 +   The following bugs in C-Kermit 8.0.200 were fixed in 8.0.201:
43239 +
43240 +     * An obscure path through the code could cause the Unix version of
43241 +       C-Kermit to dump core during its startup sequence. This happened to
43242 +       only one person, but now it's fixed.
43243 +     * When C-Kermit 8.0 is in Kermit server mode and the client says "get
43244 +       blah", where blah (on the server) is a symlink rather than a real
43245 +       file, the server unreasonably refused to send the linked-to file.
43246 +     * When C-Kermit is an FTP client and says "get foo/bar" (i.e. a
43247 +       filename that includes one or more path segments), it failed to
43248 +       accept the incoming file (this happened only with GET, not MGET).
43249 +     * Array references should be case insensitive but only lowercase
43250 +       array letters were accepted.
43251 +     * SHOW VARIABLES dumped core on \v(sexpression) and \v(svalue).
43252 +     * Spurious refusals of remote directory listings if the remote
43253 +       server's date was set in the past.
43254 +     * In AIX, and maybe elsewhere too, Kermit's COPY command always
43255 +       failed with "Source and destination are the same file" when the
43256 +       destination file didn't exist.
43257 +     * The VMS version of C-Kermit did not work in Batch or when SPAWN'd.
43258 +       To compound the problem, it also pretty much ignored the -B and -z
43259 +       command-line options, whose purpose is to work around such
43260 +       problems.
43261 +     * C-Kermit 8.0 could not be built on IRIX 5.x.
43262 +     * The C-Kermit 8.0 build for QNX6 said it was an "(unknown version)".
43263 +
43264 +   Other fixes are listed in the [172]previous section.
43265 +
43266 +   [ [173]Top ] [ [174]Contents ] [ [175]C-Kermit ] [ [176]Kermit Home ]
43267 +
43268 +2. SSH AND HTTP
43269 +
43270 +2.1. SSH Connections
43271 +
43272 +     This section does not apply to [177]Kermit 95 2.0, which has its own
43273 +     built-in SSH client, which is documented [178]SEPARATELY.
43274 +
43275 +   On most UNIX platforms, C-Kermit can make SSH (Secure SHell) connection
43276 +   by running the external SSH command or program through its
43277 +   pseudoterminal interface. The command is:
43278 +
43279 +   SSH text
43280 +          Tells Kermit to start the external SSH client, passing the given
43281 +          text to it on the command line. Normally the text is just the
43282 +          hostname, but it can be anything else that is acceptable to the
43283 +          ssh client. If the command succeeds, the connection is made and
43284 +          Kermit automatically enters CONNECT (terminal) mode. You can use
43285 +          the SSH command to make a connection to any host that has an SSH
43286 +          server.
43287 +
43288 +   Kermit's SSH command gives you all the features of Kermit on an SSH
43289 +   connection: command language, file transfer, character-set translation,
43290 +   scripting, and all the rest. By default, C-Kermit invokes SSH with "-e
43291 +   none", which disables the ssh escape character and makes the connection
43292 +   transparent for purposes of file transfer. You can, however, change the
43293 +   SSH invocation to whatever else you might need (an explicit path,
43294 +   additional command-line arguments, etc) with:
43295 +
43296 +   SET SSH COMMAND text
43297 +          Specifies the system command that Kermit's SSH command should
43298 +          use to invoke the external SSH client. Use this command to
43299 +          supply a specific path or alternative name, or to include
43300 +          different or more command-line options.
43301 +
43302 +   In most cases, these connections work quite well. They can be scripted
43303 +   like any other connection, and file transfer goes as fast as, or faster
43304 +   than, on a regular Telnet connection. In some cases, however, the
43305 +   underlying pseudoterminal driver is a limiting factor, resulting in
43306 +   slow or failed file transfers. Sometimes you can work around such
43307 +   problems by reducing the Kermit packet length. Note that Kermit does
43308 +   not consider SSH connections to be reliable, so it does not offer to
43309 +   use streaming in Kermit protocol transfers (but you can force it with
43310 +   SET RELIABLE or SET STREAMING if you wish).
43311 +
43312 +   The SSH command is like the TELNET command: it enters CONNECT mode
43313 +   automatically when the connection is made. Therefore, to script an SSH
43314 +   connection, use:
43315 +
43316 +  set host /pty ssh -e none [ other-options ] host
43317 +  if fail ...
43318 +
43319 +   to make the connection.
43320 +
43321 +   Here's a sequence that can be used to make a connection to a given host
43322 +   using Telnet if the host accepts it, otherwise SSH:
43323 +
43324 +  if not defined \%1 exit 1 Usage: \%0 host
43325 +  set quiet on
43326 +  set host \%1 23 /telnet
43327 +  if fail {
43328 +      set host /pty ssh -l \m(user) -e none \%1
43329 +      if fail exit 1 \%1: Telnet and SSH both fail
43330 +      echo SSH connection to \%1 successful
43331 +  } else {
43332 +      echo Telnet connection to \%1 successful
43333 +  }
43334 +
43335 +   In SSH v2, it is possible to make an SSH connection direct to a Kermit
43336 +   server system if the host administrator has configured the SSH server
43337 +   to allow this; [179]CLICK HERE for details.
43338 +
43339 +   Since Kermit uses external ssh client software, and since there are
43340 +   different ssh clients (and different releases of each one), the exact
43341 +   command to be used to make an SSH/Kermit connection can vary. Here is
43342 +   the command for the OpenSSH 3.0.2p1 client:
43343 +
43344 +set host /pipe ssh -e none [ -l username ] -T -s hostname kermit
43345 +
43346 +   Example:
43347 +
43348 +set host /pipe ssh -e none -l olga -T -s hq.xyzcorp.com kermit
43349 +
43350 +   The SSH client might or might not prompt you for a password or other
43351 +   information before it makes the connection; this depends on your SSH
43352 +   configuration (your public and private keys, your authorized hosts
43353 +   file, etc). Here's a brief synopsis of the OpenSSH client command
43354 +   syntax ("man ssh" for details):
43355 +
43356 +   -e none
43357 +          This tells the SSH client to use no escape character. Since we
43358 +          will be transferring files across the connection, we don't want
43359 +          the connection to suddenly block because some character in the
43360 +          data.
43361 +
43362 +   -l username
43363 +          This is the username on the remote host. You can omit the -l
43364 +          option and its argument if your local and remote usernames are
43365 +          the same. If they are different, you must supply the remote
43366 +          username.
43367 +
43368 +   -T
43369 +          This tells the SSH client to tell the SSH server not to allocate
43370 +          a pseudoterminal. We are not making a terminal connection, we
43371 +          don't need a terminal, and in fact if a terminal were allocated
43372 +          on the remote end, the connection would not work.
43373 +
43374 +   -s ... kermit
43375 +          This tells the SSH client to tell the SSH server to start the
43376 +          specified subsystem ("kermit") once the connection is made. The
43377 +          subsystem name comes after the hostname.
43378 +
43379 +   hostname
43380 +          The IP host name or address of the desired host.
43381 +
43382 +   You might want to include other or additional ssh command-line options;
43383 +   "man ssh" explains what they are. Here are some examples for the
43384 +   OpenSSH 3.0.2p1 client:
43385 +
43386 +   -oClearAllForwardings yes
43387 +   -oForwardAgent no
43388 +   -oForwardX11 no
43389 +   -oFallbackToRsh no
43390 +          These ensure that a secure connection is used and that the
43391 +          connection used for file transfer is not also used for
43392 +          forwarding other things that might be specified in the
43393 +          ssh_config file.
43394 +
43395 +   -oProtocol 2
43396 +          (i.e. SSH v2) Ensures that the negotiated protocol supports
43397 +          subsystems.
43398 +
43399 +   Once you have an SSH connection to a Kermit server, it's just like any
43400 +   other connection to a Kermit server (and very similar to a connection
43401 +   to an FTP server). You give the client file transfer and management
43402 +   commands for the server, and the server executes them. Of course you
43403 +   can also give the client any other commands you wish.
43404 +
43405 +   [ [180]SSH Kermit Server Subsystem ] [ [181]Kermit 95 Built-in SSH
43406 +   Client ]
43407 +
43408 +2.2. HTTP Connections
43409 +
43410 +   Hypertext Transfer Protocol, or HTTP, is the application protocol of
43411 +   the World Wide Web (WWW), used between Web browsers (clients) and Web
43412 +   servers. It allows a client to get files from websites, upload files to
43413 +   websites, delete files from websites, get information about website
43414 +   directories and files, and interact with server-side CGI scripts.
43415 +   C-Kermit includes an HTTP client capable of both clear-text and secure
43416 +   HTTP connections, that can do all these tasks and can be automated
43417 +   through the Kermit scripting language.
43418 +
43419 +   Although C-Kermit 7.0 could make HTTP connections to Web servers, it
43420 +   could do so only when no other connection was open, and the procedure
43421 +   was somewhat awkward. C-Kermit 8.0 improves matters by:
43422 +
43423 +     * Allowing an HTTP connection to be open at the same time as a
43424 +       regular SET LINE or SET HOST connection, and also at the same time
43425 +       as an FTP connection ([182]Section 3);
43426 +     * Upgrading the HTTP protocol level from 1.0 to 1.1, thus allowing
43427 +       for persistent connections, in which a series of commands can be
43428 +       sent on the same connection, rather than only one as in HTTP 1.0
43429 +       (and C-Kermit 7.0);
43430 +     * Providing for "one-shot" URL-driven HTTP operations such as GET or
43431 +       PUT.
43432 +     * Providing a distinct HTTP command-line personality.
43433 +
43434 +   Persistent HTTP connections are managed with the following commands:
43435 +
43436 +   HTTP [ switches ] OPEN [ security-options ] host-or-url [ port ]
43437 +          Opens a persistent connection to the specified host (IP host
43438 +          name or address) on the specified port. If any switches
43439 +          (options, listed in the next section) are included, their values
43440 +          are saved and used for all subsequent HTTP action commands on
43441 +          the same connection. If no port is specified, HTTP (80) is used.
43442 +          A Uniform Resource Locator (URL, [183]RFC 1738) can be given
43443 +          instead of a hostname (or address) and port (but the URL can not
43444 +          include a directory/file path). The security options are
43445 +          explained [184]below. The HTTP OPEN command replaces the
43446 +          C-Kermit 7.0 SET HOST hostname HTTP command, which no longer
43447 +          works with HTTP GET and related commands.
43448 +
43449 +   HTTP CLOSE
43450 +          Closes any open HTTP connection and clears any saved switch
43451 +          values.
43452 +
43453 +   A URL starts with a protocol name, which must be http or https in this
43454 +   case; optionally includes a username and password; and must contain a
43455 +   host name or address:
43456 +
43457 +  protocol://[user[.password]]@host[:port][URI]
43458 +
43459 +   HTTP is Hypertext Transfer Protocol. HTTPS is the secure (SSL/TLS)
43460 +   version of HTTP. The TCP service port is derived from the protocol
43461 +   prefix (so normally the ":port" field is omitted). Thus the URL
43462 +   protocol name specifies a default TCP service port and the URL user and
43463 +   password fields can take the place of the /USER and /PASSWORD switches
43464 +   ([185]Section 2.2.1). The optional URI is a "compact string of
43465 +   characters for identifying an abstract or physical resource" ([186]RFC
43466 +   2396), such as a file. It must begin with a slash (/); if the URI is
43467 +   omitted, "/" is supplied. Examples:
43468 +
43469 +   http open http://www.columbia.edu/
43470 +          Equivalent to http open www.columbia.edu or http open
43471 +          www.columbia.edu http.
43472 +
43473 +   http open https://olga.secret@www1.xyzcorp.com/
43474 +          Equivalent to http /user:olga /pass:secret open www1.xyzcorp.com
43475 +          https.
43476 +
43477 +   Persistence is accomplished unilaterally by C-Kermit 8.0. An HTTP 1.0
43478 +   server closes the connection after each action. Although HTTP 1.1
43479 +   allows multiple actions on the same connection, an HTTP 1.1 server
43480 +   tends to close the connection if it is idle for more than a few
43481 +   seconds, to defend itself against denial-of-service attacks. But when
43482 +   you use Kermit's HTTP OPEN command to create a connection, Kermit
43483 +   reopens it automatically (if necessary) for each HTTP action until you
43484 +   close it with HTTP CLOSE, regardless of the server's HTTP protocol
43485 +   version, or how many times it closes the connection.
43486 +
43487 +   Firewalls can be negotiated through proxies with the following
43488 +   commands:
43489 +
43490 +   SET TCP HTTP-PROXY [ host[:port] ]
43491 +          If a host (by hostname or IP address) is specified, Kermit uses
43492 +          it as a proxy server when attempting outgoing TCP connections --
43493 +          not only HTTP connections, but all TCP/IP connections, Telnet
43494 +          and FTP included. This allows Kermit to adapt to the HTTP
43495 +          firewall penetration method (as opposed to other methods such as
43496 +          SOCKS4). If no hostname or ip-address is specified, any
43497 +          previously specified Proxy server is removed. If no port number
43498 +          is specified, the "http" service is used. This command must be
43499 +          given before the HTTP OPEN command if a proxy is to be used or
43500 +          canceled.
43501 +
43502 +   HTTP [ switches ] CONNECT host[:port]
43503 +          Instructs the HTTP server to act as a proxy, establishing a
43504 +          connection to the specified host (IP hostname or address) on the
43505 +          given port (80 = HTTP by default) and to redirect all data
43506 +          transmitted between Kermit and itself to the given host for the
43507 +          life of the connection. This command is to be used only for
43508 +          debugging HTTP proxy connections. If a proxy connection is
43509 +          required, instruct Kermit to use the proxy with the SET TCP
43510 +          HTTP-PROXY command.
43511 +
43512 +2.2.1. HTTP Command Switches
43513 +
43514 +   HTTP switches, like all other switches, are optional. When HTTP
43515 +   switches are included with the HTTP OPEN command, they apply
43516 +   automatically to this and all subsequent HTTP actions (GET, PUT, ...)
43517 +   on the same connection until an HTTP CLOSE command is given. So if you
43518 +   include switches (or the equivalent URL fields, such as user and
43519 +   password) in the HTTP OPEN command, you can omit them from subsequent
43520 +   commands on the same connection. If the connection has closed since
43521 +   your last command, it is automatically reopened with the same options.
43522 +
43523 +   If you include switches with an HTTP action command (such as GET or
43524 +   PUT), they apply only to that command.
43525 +
43526 +   /USER:name
43527 +          To be used in case a page requires a username for access. The
43528 +          username is sent with page requests. If it is given with the
43529 +          OPEN command it is saved until needed. If a username is included
43530 +          in a URL, it overrides the username given in the switch.
43531 +          CAUTION: Username and password (and all other information,
43532 +          including credit card numbers and other material that you might
43533 +          prefer to protect from public view) are sent across the network
43534 +          in clear text on regular HTTP connections, but authentication is
43535 +          performed securely on HTTPS connections.
43536 +
43537 +   /PASSWORD:text
43538 +          To be used in case a web page requires a password for access.
43539 +          The password is sent with page requests. If it is given with the
43540 +          OPEN command it is saved until needed. If a password is given in
43541 +          a URL, it overrides the one given here. CAUTION: (same as for
43542 +          /USER:).
43543 +
43544 +   /AGENT:user-agent
43545 +          Identifies the client to the server. Overrides the default agent
43546 +          string, which is "C-Kermit" (for C-Kermit) or "Kermit-95" (for
43547 +          Kermit 95).
43548 +
43549 +   /ARRAY:array-designator
43550 +          Tells Kermit to store the response headers in the given array,
43551 +          one line per element. The array need not be declared in advance.
43552 +          Example: /array:&a.
43553 +
43554 +   /TOSCREEN
43555 +          Tells Kermit to display any response text on the screen. It
43556 +          applies independently of the output file specification; thus it
43557 +          is possible to have the server response go to the screen, a
43558 +          file, both, or neither.
43559 +
43560 +   /HEADER:header-item(s)
43561 +          Used for specifying any optional headers to be sent with HTTP
43562 +          requests.
43563 +
43564 +  /HEADER:tag:value
43565 +
43566 +          To send more than one header, use braces for grouping:
43567 +
43568 +  /HEADER:{{tag:value}{tag:value}...}
43569 +
43570 +          For a list of valid tags and value formats see [187]RFC 2616,
43571 +          "Hypertext Transfer Protocol -- HTTP/1.1". A maximum of eight
43572 +          headers may be specified.
43573 +
43574 +2.2.2. HTTP Action Commands
43575 +
43576 +   HTTP actions can occur within a persistent connection, or they can be
43577 +   self-contained ("connectionless"). A persistent HTTP connection begins
43578 +   with an HTTP OPEN command, followed by zero or more HTTP action
43579 +   commands, and is terminated with an HTTP CLOSE command:
43580 +
43581 +  http open www.columbia.edu
43582 +  if failure stop 1 HTTP OPEN failed: \v(http_message)
43583 +  http get kermit/index.html
43584 +  if failure stop 1 HTTP GET failed: \v(http_message)
43585 +  (more actions possible here...)
43586 +  http close
43587 +
43588 +   A self-contained HTTP action occurs when a URL is given instead of a
43589 +   remote file name to an HTTP action command. In this case, Kermit makes
43590 +   the HTTP connection, takes the action, and then closes the connection.
43591 +   If an HTTP connection was already open, it is closed silently and
43592 +   automatically.
43593 +
43594 +  http get http://www.columbia.edu/kermit/index.html
43595 +
43596 +   Kermit's HTTP action commands are as follows. Switches may be included
43597 +   with any of these to override switch (or default) values given in the
43598 +   HTTP OPEN command.
43599 +
43600 +   HTTP [ switches ] GET remote-filename [ local-filename ]
43601 +          Retrieves the named file from the server specified in the most
43602 +          recent HTTP OPEN command for which a corresponding HTTP CLOSE
43603 +          command has not been given. The filename may not include
43604 +          wildcards (HTTP protocol does not support them). If no HTTP OPEN
43605 +          command is in effect, this form of the HTTP GET command fails.
43606 +          The default local filename is the same as the remote name, but
43607 +          with any pathname stripped. For example, the command http get
43608 +          kermit/index.html stores the file in the current local directory
43609 +          as index.html. If the /HEADERS: switch is included, information
43610 +          about the file is also stored in the specified array (explained
43611 +          in [188]Section 2.2.3). All files are transferred in binary
43612 +          mode. HTTP does not provide for record-format or character-set
43613 +          conversion.
43614 +
43615 +   HTTP [ switches ] GET url [ local-filename ]
43616 +          When HTTP GET is given a URL rather than a filename, Kermit
43617 +          opens a connection to the designated server (closing any
43618 +          previously open HTTP connection), gets the file, and then closes
43619 +          the connection. If the URL does not include a filename,
43620 +          index.html is supplied. This is the self-contained one-step
43621 +          "connectionless" method for getting a file from a Web server.
43622 +          The data is not interpreted; HTTP GET is like "lynx -source"
43623 +          rather than "lynx -dump".
43624 +
43625 +   In the remaining HTTP action commands, the distinction between a remote
43626 +   filename and a URL are the same as in the HTTP GET command.
43627 +
43628 +   HTTP [ switches ] HEAD remote-filename-or-url [ local-filename ]
43629 +          Like GET except without actually getting the file; instead it
43630 +          retrieves only the headers. If the /ARRAY: or /TOSCREEN switch
43631 +          is included, there is no default local output filename but you
43632 +          can still specify one. If neither of these switches is included,
43633 +          the default local filename is the same as the remote filename,
43634 +          but with any path stripped and with ".head" appended. The HEAD
43635 +          command can be used in a script with the /ARRAY: switch to
43636 +          retrieve information about the requested resource to determine
43637 +          whether the resource should actually be retrieved with a
43638 +          subsequent GET request.
43639 +
43640 +   HTTP [ switches ] INDEX remote-directory-or-url [ local-filename ]
43641 +          Asks the server to send a listing of the files in the given
43642 +          server directory. This command is not supported by most Web
43643 +          servers. Even when it is supported, there is no standard format
43644 +          for the listing.
43645 +
43646 +   HTTP [ switches ] POST [ /MIME-TYPE:type ] source-file
43647 +          remote-path-or-url [ result-file ]
43648 +          Sends data to a process running on the remote host; the result
43649 +          is usually an HTML file but could be anything. The data to be
43650 +          posted must be read from a local file (the source-file). If a
43651 +          result file is specified, Kermit stores the server's response in
43652 +          it.
43653 +
43654 +   HTTP [ switches ] PUT [ MIME-TYPE:type ] local-file [
43655 +          remote-file-or-url [ result-file ] ]
43656 +          Uploads a local file to the server. Only the name of a single
43657 +          file can be given; wildcards (and group transfers) are not
43658 +          supported by HTTP protocol. If no remote filename is given, the
43659 +          file is sent with the same name as the local file, but with any
43660 +          pathname stripped.
43661 +
43662 +   HTTP [ switches ] DELETE remote-file-or-url [ local-result-file ]
43663 +          Asks the server to delete the specified single file. If a result
43664 +          file is specified, it will contain any response data returned by
43665 +          the server.
43666 +
43667 +   Note the limitations of HTTP protocol compared to (say) FTP or Kermit.
43668 +   There is no command for changing directories, no standard way to get
43669 +   file or directory lists, no way to transfer file groups by using
43670 +   wildcard notation, etc, and therefore no good way to (say) fetch all
43671 +   pages, descend through subdirectories, perform automatic updates, etc.
43672 +   There is no assurrance a connection will stay open and, as noted, there
43673 +   is no provision for data conversion between unlike platforms. The
43674 +   data's MIME headers can be used for postprocessing.
43675 +
43676 +2.2.3. HTTP Headers
43677 +
43678 +   Each HTTP request and response contains a set of name/value pairs
43679 +   called headers. HTTP headers are specified in [189]RFC 2616. For
43680 +   example, an HTTP GET request for /index.html on www.columbia.edu
43681 +   contains the following headers:
43682 +
43683 +  GET /index.html HTTP/1.1
43684 +  Host: www.columbia.edu:80
43685 +  User-agent: C-Kermit 8.0
43686 +  Authorization: Basic base64-encoded-username-password
43687 +
43688 +   These might be followed by any others specified with a /HEADERS:
43689 +   switch:
43690 +
43691 +  Accept: image/gif, image/x-xbitmap, image/jpeg, *.*
43692 +  Accept-Encoding: gzip
43693 +  Accept-Language: en
43694 +  Accept-Charset: iso-8859-1,utf-8
43695 +  Cookie: cookie-data
43696 +
43697 +   The server sends back a short report about the file prior to sending
43698 +   the file contents. Example:
43699 +
43700 +  HTTP/1.1 200 OK
43701 +  Date: Fri, 24 Aug 2001 21:09:39 GMT
43702 +  Server: Apache/1.3.4 (Unix)
43703 +  Last-Modified: Mon, 06 Aug 2001 21:16:13 GMT
43704 +  ETag: "1fa137-10d7-3b6f091d"
43705 +  Accept-Ranges: bytes
43706 +  Content-Length: 4311
43707 +  Content-Type: text/html
43708 +
43709 +   If you want to have this information available to a Kermit script you
43710 +   can use the /ARRAY switch to have Kermit put it in array, one line per
43711 +   array element. Example:
43712 +
43713 +  set exit warning off
43714 +  http open www.columbia.edu
43715 +  if fail exit 1 Can't reach server
43716 +  http /array:&a get /index.html
43717 +  if fail exit 1 Can't get file
43718 +  echo Header lines: \fdim(&a)
43719 +  for \%i 1 \fdim(&a) 1 {
43720 +      echo \%i. \&a[\%i]
43721 +  }
43722 +
43723 +   Note that the "Date:" item is the current date and time; the
43724 +   "Last-Modifed:" item is the file's modification date and time. An
43725 +   example showing how to use this information is presented in
43726 +   [190]Section 8.13.7.
43727 +
43728 +2.2.4. Secure HTTP Connections
43729 +
43730 +   SSL/TLS (Secure Sockets Layer / Transport Layer Security) is the
43731 +   protocol used to secure HTTP, SMTP, and other Internet applications.
43732 +   See the [191]C-Kermit Reference Section 5.4 for an introduction to
43733 +   SSL/TLS. To make a secure HTTP connection, you need:
43734 +
43735 +    1. A secure client (a version of C-Kermit or Kermit 95 with SSL/TLS
43736 +       security built in). Type "check ssl" at the Kermit prompt to make
43737 +       sure you have it.
43738 +    2. A secure server to connect to.
43739 +    3. The CA Root Certificate used to authenticate the server to the
43740 +       client. (see [192]Section 15 of the security reference for an
43741 +       introduction to certificates).
43742 +
43743 +   And you must make a connection to the secure HTTP port: service name
43744 +   HTTPS, port number 443 (as opposed to service HTTP, port 80). You can
43745 +   also make secure connections to other ports by including the /TLS or
43746 +   /SSL switch with the HTTP OPEN command, if the host supports SSL/TLS on
43747 +   the given port:
43748 +
43749 +   The quality of the SSL/TLS connection depends on the cipher suite.
43750 +   There are several possibilities:
43751 +
43752 +   Anonymous cipher suite:
43753 +          If an anonymous cipher suite is negotiated, the connection is
43754 +          encrypted but there is no authentication. This connection is
43755 +          subject to a Man-In-The-Middle (MITM) attack.
43756 +
43757 +   X.509 certificate on the server:
43758 +          When you connect to certain secure servers, an X.509 certificate
43759 +          is returned. This certificate is issued to a special hostname,
43760 +          something like www1.xyzcorp.com or wwws.xyzcorp.com (rather than
43761 +          the normal www.xyzcorp.com). It is signed by the host's
43762 +          Certificate Authority (CA). If the host certificate is
43763 +          configured on the client, it can be used to verify the
43764 +          certificate received from the server. If the certificate it
43765 +          verified as authentic, a check is made to ensure it has not
43766 +          expired and it was issued to the host you were attempting to
43767 +          connect to. If you had asked to connect to (say) www.xyzcorp.com
43768 +          but were given a certificate for www1.xyzcorp.com, you would be
43769 +          prompted for permission to continue.
43770 +
43771 +          If the verification succeeded, the connection would be encrypted
43772 +          with one-way (server-to-client) authentication. This connection
43773 +          is not subject to a MITM attack.
43774 +
43775 +          If a username and password are transmitted over this connection,
43776 +          they are not subject to interception. However, the standard
43777 +          risks associated with passing the password to the host for
43778 +          verification apply; for example, if the host has been
43779 +          compromised, the password will be compromised.
43780 +
43781 +   X.509 client certificate:
43782 +          If a connection has been established with an X.509 server
43783 +          certificate, the server can ask the client to send a certificate
43784 +          of its own. This certificate must be verified against a CA Root
43785 +          certificate. The certificate itself (or subject info from the
43786 +          certificate) is used to determine the authorization for the
43787 +          client, and if successful, the username and password need not be
43788 +          sent to the server.
43789 +
43790 +   Kerberos 5:
43791 +          Instead of using X.509 certifcates, Kerberos 5 can be used to
43792 +          perform the authentication and key exchange. In this situation,
43793 +          there is mutual authentication between the client and server.
43794 +          The Kerberos 5 principal is used by the server to look up the
43795 +          appropriate authorization data. There is no need to send
43796 +          username and password.
43797 +
43798 +   An HTTP connection is made with the HTTP OPEN command:
43799 +
43800 +   HTTP [ switches ] OPEN [ { /SSL, /TLS } ] host [ port ]
43801 +          If /SSL or /TLS switches are included (these are synonyms), or
43802 +          if the service is HTTPS or the port is 443, a secure connection
43803 +          is attempted using the current authentication settings; see HELP
43804 +          SET AUTHENTICATION for details ([193]Section 6.2 of the security
43805 +          reference). If the no /SSL or /TLS switch is included but the
43806 +          port is 443 or the service is HTTPS, a secure connection is
43807 +          attempted. If an /SSL or /TLS switch is included but a port is
43808 +          not specified, an SSL/TLS connection is attempted on the default
43809 +          port (80).
43810 +
43811 +   Certificates are covered in the separate [194]Kermit Security Reference
43812 +   for C-Kermit 8.0. You should let Kermit know to verify certificates
43813 +   with the SET AUTHENTICATION TLS command. For example:
43814 +
43815 +   SET AUTHENTICATION TLS CRL-DIR directory
43816 +          Specifies a directory that contains certificate revocation files
43817 +          where each file is named by the hash of the certificate that has
43818 +          been revoked.
43819 +
43820 +   SET AUTHENTICATION TLS CRL-FILE filename
43821 +          Specifies a file that contains a list of certificate
43822 +          revocations.
43823 +
43824 +   SET AUTHENTICATION TLS VERIFY-DIR directory
43825 +          Specifies a directory that contains root CA certificate files
43826 +          used to verify the certificate chains presented by the peer.
43827 +          Each file is named by a hash of the certificate.
43828 +
43829 +   SET AUTHENTICATION TLS VERIFY-FILE filename
43830 +          Specifies a file that contains root CA certificates to be used
43831 +          for verifying certificate chains.
43832 +
43833 +   SET AUTHENTICATION TLS VERIFY OFF
43834 +          Tells Kermit not to require a certificate and accept any
43835 +          certificate that is presented regardless of whether it is valid.
43836 +
43837 +   There are many other options; see the security document for details.
43838 +
43839 +   Now suppose you need need to fetch the file denoted by the following
43840 +   URL:
43841 +
43842 +  https://myuserid:mypassword@wwws.xyzcorp.com/clients/info/secret.html
43843 +
43844 +   Once you have set up the handling of certificates as desired, you can
43845 +   use the following Kermit commands:
43846 +
43847 +  http /user:myuserid /password:mypassword open www1.xyzcorp.com https
43848 +  if success {
43849 +      http get /clients/info/secret.html
43850 +      http close
43851 +  }
43852 +
43853 +   As another example, let's say that you have a web form you need to
43854 +   populate with three fields: red,white and blue.
43855 +
43856 +  <FORM ACTION="http://www.xyzcorp.com/cgi-bin/form.cgi" METHOD="POST">
43857 +  <INPUT NAME="Red">
43858 +  <INPUT NAME="White">
43859 +  <INPUT NAME="Blue">
43860 +  </FORM>
43861 +
43862 +   You can handle this with the HTTP POST command. The data to be posted
43863 +   is stored in the local file data.txt.
43864 +
43865 +  Red=seven stripes&White=six stripes&Blue=fifty stars
43866 +
43867 +   and the response from the server will be stored into response.txt.
43868 +
43869 +  http open www.xyzcorp.com http
43870 +  if success {
43871 +    http /array:c post data.txt /cgi-bin/form.cgi response.txt
43872 +    http close
43873 +  }
43874 +
43875 +   In this scenario, the Common Gateway Interface (CGI) sends a response
43876 +   whether it succeeds or fails in a script-dependent manner. The script
43877 +   can either report success and enclose the response data; or it might
43878 +   send a 302 Found error which indicates that the "Location:" header
43879 +   should be used to determine the URL at which the data can be found.
43880 +
43881 +2.2.5. HTTP Variables
43882 +
43883 +   \v(http_code)
43884 +          The HTTP protocol code number of the most recent server reply,
43885 +          e.g. 404 for "not found".
43886 +
43887 +   \v(http_connected)
43888 +          1 when an HTTP connection is open, 0 when there is no HTTP
43889 +          connection.
43890 +
43891 +   \v(http_host)
43892 +          If an HTTP connection is open, the hostname:port, e.g.
43893 +          www.columbia.edu:80; otherwise, empty.
43894 +
43895 +   \v(http_message)
43896 +          Server error message, if any, from most recent HTTP command.
43897 +
43898 +   \v(http_security)
43899 +          A list of the security parameters and values for the current
43900 +          connection, if any. Empty if the connection is not to a secure
43901 +          server, or there is no connection.
43902 +
43903 +   To display all the HTTP variables at once, type SHOW VAR HTTP:
43904 +
43905 +  C-Kermit> http open www.columbia.edu
43906 +  C-Kermit> http get lkjlkjlkjlkj
43907 +  C-Kermit> sho var http
43908 +   \v(http_code) = 404
43909 +   \v(http_connected) = 1
43910 +   \v(http_host) = www.columbia.edu:80
43911 +   \v(http_message) = Not Found
43912 +   \v(http_security) = NULL
43913 +  C-Kermit>
43914 +
43915 +2.2.6. The HTTP Command-Line Personality
43916 +
43917 +   If you invoke C-Kermit with the name "http" or "https", you can use a
43918 +   special set of HTTP-specific command-line options. You can do this by
43919 +   creating a symbolic linke "http" or "https" to the C-Kermit 8.0
43920 +   executable, or by having a separate copy of it called "http" or
43921 +   "https". Here's the usage message ("http -h"):
43922 +
43923 +  Usage: ./http host [ options... ]
43924 +   -h             This message.
43925 +   -d             Debug to debug.log.
43926 +   -S             Stay (issue command prompt when done).
43927 +   -Y             Do not execute Kermit initialization file.
43928 +   -q             Quiet (suppress most messages).
43929 +   -u name        Username.
43930 +   -P password    Password.
43931 +   -g pathname    Get remote pathname.
43932 +   -p pathname    Put remote pathname.
43933 +   -H pathname    Head remote pathname.
43934 +   -l pathname    Local path for -g, -p, and -H.
43935 +   -z opt[=value] Security options...
43936 +      cert=file   Client certificate file
43937 +      certsok     Accept all certificates
43938 +      key=file    Client private key file
43939 +      secure      Use SSL
43940 +      verify=n    0 = none, 1 = peer , 2 = certificate required
43941 +
43942 +   The "host" argument is the name of a Web host, e.g. www.columbia.edu.
43943 +   The action options are -p, -g, and -H. If you give an action option,
43944 +   Kermit does the action and then exits. If you give a host without an
43945 +   action option, Kermit makes an HTTP connection to the host and then
43946 +   gives you the C-Kermit prompt. Here's a simple example that fetches a
43947 +   publicly readable Web page:
43948 +
43949 +  http www.columbia.edu -g kermit/index.html
43950 +
43951 +   If you need to access a website for which a username and password are
43952 +   required, you can supply them on the command line with -u and -P. If
43953 +   you include a username but omit the password, Kermit prompts you for
43954 +   it:
43955 +
43956 +  http www.columbia.edu -u olga -p kermit/index.html -l index.html
43957 +  Password:
43958 +
43959 +   Note that when PUT'ing files to websites, you have to supply both the
43960 +   -p (remote pathname) and -l (local path) options.
43961 +
43962 +   If your version of Kermit is built with SSL/TLS security, you can also
43963 +   use the -z option to make secure HTTP (https) connections.
43964 +
43965 +   Finally, as noted in [195]Section 16, you can also give a URL instead
43966 +   of a host name and options.
43967 +
43968 +   [ [196]Top ] [ [197]Contents ] [ [198]C-Kermit Home ] [ [199]Kermit
43969 +   Home ]
43970 +
43971 +3. KERMIT'S BUILT-IN FTP CLIENT
43972 +
43973 +     3.1.  [200]Making and Managing FTP Connections
43974 +     3.2.  [201]Making Secure FTP Connections
43975 +     3.3.  [202]Setting FTP Preferences
43976 +     3.4.  [203]Managing Directories and Files
43977 +     3.5.  [204]Uploading Files With FTP
43978 +     3.6.  [205]Downloading Files With FTP
43979 +     3.7.  [206]Translating Character Sets
43980 +     3.8.  [207]FTP Command Shortcuts
43981 +     3.9.  [208]Dual Sessions
43982 +     3.10. [209]Automating FTP Sessions
43983 +     3.11. [210]Advanced FTP Protocol Features
43984 +
43985 +   Earlier versions of C-Kermit and K95 included an FTP command, but it
43986 +   simply invoked an external FTP client. Now, by popular demand, Kermit
43987 +   includes its own built-in FTP client that offers the following
43988 +   advantages over traditional FTP clients (and its previous interface to
43989 +   them):
43990 +
43991 +     * Any of Kermit's built-in [211]security methods can be used to
43992 +       establish and conduct secure FTP sessions with [212]FTP servers
43993 +       that support these methods. (Security modules can be subject to
43994 +       export restrictions.)
43995 +     * Kermit's FTP client uses "passive mode" by default to avoid
43996 +       blockage by firewalls and network address translators. Of course
43997 +       active mode can be chosen too when needed.
43998 +     * [213]Character sets can be translated as part of the transfer
43999 +       process even when the FTP server does not support character-set
44000 +       translation, including to/from the new Internet standard
44001 +       international character set, [214]Unicode UTF-8. This includes both
44002 +       the file's name and (for text files only) its contents.
44003 +     * All of C-Kermit's [215]file-selection mechanisms are available:
44004 +       size, date, name patterns and lists, exception lists, etc.
44005 +     * [216]Atomic file movement capabilities are provided (delete, move,
44006 +       or rename files automatically after successful transfer).
44007 +     * The correct file type, "ascii" (i.e. text) or binary, is chosen
44008 +       automatically for each file (explained in [217]Section 4), and any
44009 +       mixture of text and binary files can be sent in a single operation,
44010 +       even across platforms.
44011 +     * Update mode ("don't bother transferring files that didn't change
44012 +       since last time") and recovery (resumption of an interrupted
44013 +       transfer from the point of failure) are available in both
44014 +       directions.
44015 +     * When uploading files from UNIX to UNIX, the file's permissions can
44016 +       be preserved if desired.
44017 +     * Recursive directory-tree PUTs are supported between any two
44018 +       platforms that have tree-structured file systems. Recursive GETs
44019 +       are supported between like platforms if the server cooperates and
44020 +       between like or unlike platforms if the server supports MLSD
44021 +       ([218]Section 3.11).
44022 +     * When receiving files, all of Kermit's file collision actions are
44023 +       available: backup, update, refuse, rename, etc.
44024 +     * Multi-file transfers can be interrupted on a per-file basis,
44025 +       automatically skipping to the next file.
44026 +     * FTP sessions are [219]fully scriptable.
44027 +     * An entire FTP session (connect, login, CD, upload or download,
44028 +       logout) can be specified on the command line without using a
44029 +       script.
44030 +     * All of Kermit's logging options and formats are available to keep
44031 +       an accurate and complete record of each connection and file
44032 +       transfer, and to aid in troubleshooting.
44033 +     * All of Kermit's file-transfer display options are available
44034 +       (fullscreen, brief, CRT, serial, none).
44035 +
44036 +   And best of all:
44037 +     * Kermit doesn't give you those annoying per-file prompts every time
44038 +       you start a multi-file transfer without remembering to give a
44039 +       "prompt" command first :-).
44040 +
44041 +   [ [220]Top ] [ [221]FTP Top ] [ [222]FTP Client Overview ] [ [223]FTP
44042 +   Script Tutorial ] [ [224]C-Kermit Home ] [ [225]Kermit Home ]
44043 +
44044 +3.1. Making and Managing FTP Connections
44045 +
44046 +   Each copy of Kermit can have one FTP connection open at a time. FTP
44047 +   connections are independent of regular terminal connections; a terminal
44048 +   connection (serial or network via SET LINE, DIAL, SET HOST, TELNET,
44049 +   etc) may be, but need not be, open at the same time as an FTP
44050 +   connection, and terminal connections can also be closed, and new
44051 +   connections opened, without interfering with the FTP connection (and
44052 +   vice versa). Thus, for example, Kermit can have an FTP connection and a
44053 +   TELNET connection open to the same host simultaneously, using the
44054 +   TELNET connection (e.g.) to send mail or take other desired actions as
44055 +   various FTP actions complete. Of course, each copy of Kermit can do
44056 +   only one thing at a time, so it can't (for example) transfer a file
44057 +   with FTP and another file with Kermit protocol simultaneously.
44058 +
44059 +   A Kermit FTP session can be established by [226]command-line options,
44060 +   by [227]URL, or by [228]interactive commands.
44061 +
44062 +3.1.1. Kermit Command-Line Options for FTP
44063 +
44064 +   The new command-line option '-9' (sorry, we're out of letters) can be
44065 +   used when starting C-Kermit, telling it to make an FTP connection:
44066 +
44067 +  kermit -9 hostname
44068 +
44069 +   or if a non-default FTP port is needed:
44070 +
44071 +  kermit -9 hostname:port
44072 +
44073 +   You can also specify the username on the command line with the -M ("My
44074 +   User ID") option that was already there for other connection types:
44075 +
44076 +  kermit -9 hostname -M olga
44077 +
44078 +   If you specify the username on the command line, Kermit uses it when
44079 +   making the connection and does not prompt you for it (but it does
44080 +   prompt you for the password if one is required).
44081 +
44082 +   Once the connection is made, you get the regular Kermit prompt, and can
44083 +   give interactive commands such as the ones described below. When you
44084 +   give a BYE command, Kermit closes the session and exits, just as a
44085 +   regular FTP client would do. If you don't want Kermit to exit when you
44086 +   give a BYE command, include the -S ("Stay") option on the command line.
44087 +
44088 +   Other Kermit command-line options that are not specific to non-FTP
44089 +   connections should affect the FTP session in the expected ways; for
44090 +   example, -i and -T force binary and text mode transfers, respectively.
44091 +
44092 +   File transfers can not be initiated on the "kermit -9" command line;
44093 +   for that you need to use Kermit's FTP personality (next section) or you
44094 +   can use URLs ([229]Section 3.1.3).
44095 +
44096 +3.1.2. The FTP Command-Line Personality
44097 +
44098 +   If you want to replace your regular FTP client with C-Kermit, you can
44099 +   make a link called "ftp" to the C-Kermit binary (or you can store a
44100 +   copy of the C-Kermit binary under the name "ftp"). When C-Kermit is
44101 +   invoked with a program name of "ftp" (or "FTP", case doesn't matter),
44102 +   it assumes the command-line personality of the regular FTP client:
44103 +
44104 +  ftp [ options ] hostname [ port ]
44105 +
44106 +   In this case the options are like those of a regular FTP client:
44107 +
44108 +  -d  Debug: enables debug messages and creates a debug.log file.
44109 +  -n  No autologin: Kermit should not send your user ID automatically.
44110 +  -t  Packet trace: accepted but is treated the same as -d.
44111 +  -v  Verbose: accepted but ignored (operation is verbose by default).
44112 +  -i  Not interactive: accepted but ignored.
44113 +
44114 +   and the hostname can also be a URL (explained in [230]Section 3.1.3).
44115 +   To specify a non-default TCP port for the FTP server, include the port
44116 +   number or name after the hostname.
44117 +
44118 +   There are also some bonus options that allow you to execute an entire
44119 +   FTP session from the shell command line, as long as you don't include
44120 +   the -n option. These are not available with regular FTP clients, and at
44121 +   least one of these options (-g) conflicts with UNIX ftp (where -g means
44122 +   "no globbing", which does not apply to Kermit), and some of them (like
44123 +   the options above) also conflict with regular Kermit command-line
44124 +   options:
44125 +
44126 +  -m mode      = "passive" (default) or "active"
44127 +  -Y            Don't execute the Kermit initialization file [1]
44128 +  -q            Quiet, suppresses all but error messages [1]
44129 +  -S            Stay, don't exit automatically [1]
44130 +  -A            Autologin anonymously [2]
44131 +  -u name       Username for autologin [2] (synonym: -M [1])
44132 +  -P password   Password for autologin (see cautions below) [2]
44133 +  -D directory  cd after autologin [2]
44134 +  -b            Binary mode [2]
44135 +  -a            Text ("ascii") mode [2] (synonym: -T [1])
44136 +  -R            Recursive (works with -p) [4]
44137 +  -p files      Files to put (upload) after autologin [2] (synonym: -s [1])
44138 +  -g files      Files to get (download) after autologin [3]
44139 +
44140 +   [1] Same as Kermit, not available in regular FTP clients.
44141 +   [2] Conflicts with Kermit, not available in regular FTP clients.
44142 +   [3] Same as Kermit, conflicts with regular FTP clients.
44143 +   [4] Conflicts with Kermit, available in some FTP clients.
44144 +
44145 +   Fancier options such as restart, character-set translation, filename
44146 +   collision selection, automatic move/rename/delete, etc, are not
44147 +   available from the command line; for these you can use the commands
44148 +   described in the following sections. The -R option might also work with
44149 +   -g (GET) but that depends on the server.
44150 +
44151 +   The following security options are also available, explained in
44152 +   [231]Section 3.2:
44153 +
44154 +  -k realm      Kerberos 4 realm [4]
44155 +  -f            Kerberos 5 credentials forwarding [4]
44156 +  -x            autoencryption mode [4]
44157 +  -c cipher     SRP cipher type [4]
44158 +  -H hash       SRP encryption hash [4]
44159 +  -z option     Security options [4]
44160 +
44161 +   If you include -A or specify a name of "anonymous" or "ftp", you are
44162 +   logged in anonymously and, in the absence of -P, Kermit automatically
44163 +   supplies a password of "user@host", where "user" is your local user ID,
44164 +   and "host" is the hostname of the computer where Kermit is running. If
44165 +   you do not include -p or -g, Kermit enters command mode so you can type
44166 +   commands or execute them from a script.
44167 +
44168 +   If you include -p or -g, Kermit attempts to transfer the specified
44169 +   files and then exits automatically at the end of the transfer unless
44170 +   you also included -S (Stay). It uses the "brief" file transfer display
44171 +   (one line per file) unless you include the -q option to suppress it.
44172 +
44173 +   When uploading files with -p, Kermit switches automatically between
44174 +   text and binary mode for each file.
44175 +
44176 +   When downloading, you can either specify a particular mode (text or
44177 +   binary) to be used for all the files, or you can let Kermit select the
44178 +   type for each file automatically, based on its name (see [232]Sections
44179 +   3.5 and [233]3.6 for greater detail). In UNIX be sure to quote any
44180 +   wildcard characters to prevent the shell from expanding them, as shown
44181 +   in the examples just below. Filename collisions are handled according
44182 +   Kermit's FILE COLLISION setting (if specified in your Kermit
44183 +   customization file; otherwise the default, which is BACKUP).
44184 +
44185 +   It should go without saying that the -P option should be used with
44186 +   caution. In addition to the well-known risks of transmitting plaintext
44187 +   passwords over the Internet, in this case the password also echos to
44188 +   the screen if you type it, and can be seen in ps and w listings that
44189 +   show the user's currently active command and command-line arguments.
44190 +   Thus command-line FTP sessions are most appropriate for secure or
44191 +   anonymous connections (those that do not require passwords).
44192 +
44193 +   Here's an example in which you download the latest C-Kermit "tarball"
44194 +   from the Columbia University FTP archive:
44195 +
44196 +  ftp -A kermit.columbia.edu -bg kermit/archives/ckermit.tar.gz
44197 +
44198 +   This assumes that "ftp" is a symbolic link to C-Kermit. It logs you in
44199 +   anonymously and gets the ckermit.tar.gz file in binary mode from the
44200 +   kermit/archives directory.
44201 +
44202 +   Here's a slightly more ambitious example that illustrates CD'ing to the
44203 +   desired server directory to get a group of files in text mode (in this
44204 +   case the C-Kermit source files):
44205 +
44206 +  ftp -A kermit.columbia.edu -D kermit/f -ag "ck[cuw]*.[cwh]" makefile
44207 +
44208 +   In this case we CD to the kermit/f directory so we don't have to
44209 +   include it in each file specification, and we quote the ck[cuw]*.[cwh]
44210 +   specification so the shell doesn't expand it, since we have to pass it
44211 +   as-is to the server. Note also that the quotes don't go around the
44212 +   entire file list; only around each file specification that needs to be
44213 +   quoted.
44214 +
44215 +   Here's one more example, that uploads a debug log file in binary mode
44216 +   to the Kermit incoming directory (as we might ask you to do when
44217 +   following up on a problem report):
44218 +
44219 +  ftp -A kermit.columbia.edu -D kermit/incoming -bp debug.log
44220 +
44221 +   In this case the -D option is required to tell the server where to put
44222 +   the incoming file.
44223 +
44224 +   Unless the -Y option is included, your Kermit initialization file
44225 +   (.mykermrc in UNIX, K95.INI in Windows) is executed before the command
44226 +   line options, so you can set any FTP-related preferences there, as
44227 +   described in the subsequent sections.
44228 +
44229 +3.1.3. The FTP URL Interpreter
44230 +
44231 +   If Kermit is invoked with either its regular personality (as "kermit")
44232 +          or its FTP personality (as "ftp"), you can also give a URL
44233 +          (Universal Resource Locator) instead of a hostname and options,
44234 +          with or without a username and password:
44235 +          ftp ftp://user:password@host/path
44236 +          ftp ftp://user@host/path
44237 +          ftp ftp://@host/path   (or ftp://:@host/path)
44238 +          ftp ftp://host/path
44239 +          kermit ftp://host/path
44240 +
44241 +   If the FTP personality is used, the service must be "ftp". In all
44242 +   cases, a hostname or address must be included. If a user is included
44243 +   but no password, you are prompted for the password. If a path
44244 +   (filename) is included:
44245 +     * If "@" is included without a user, Kermit prompts for the username
44246 +       and password.
44247 +     * If no user and no "@" are included, "anonymous" is used.
44248 +     * GET is assumed.
44249 +
44250 +   If no path (and no action options) are included, an interactive FTP
44251 +          session is started, as in this example:
44252 +          ftp ftp://kermit.columbia.edu
44253 +
44254 +   If a path is included, but a username is not included, "anonymous" is
44255 +   used and an appropriate user@host password is supplied automatically.
44256 +   If authentication is successful, Kermit attempts to GET the file
44257 +   indicated by the path or, if the path is the name of a directory, it
44258 +   asks the server for a directory listing. In both cases, Kermit
44259 +   disconnects from the server and exits after the operation is complete
44260 +   (unless you have included the -S option on the command line).
44261 +
44262 +   Here's an example that gets a listing of the Kermit directory at the
44263 +          Kermit ftp site:
44264 +          ftp ftp://kermit.columbia.edu/kermit/
44265 +
44266 +   This example gets the top-level READ.ME file from the same directory:
44267 +          ftp ftp://kermit.columbia.edu/kermit/READ.ME
44268 +
44269 +   Here's the same example, but requesting a text-mode transfer:
44270 +          ftp -T ftp://kermit.columbia.edu/kermit/READ.ME
44271 +          This illustrates that you can mix command-line options and URLs
44272 +          if you desire.
44273 +
44274 +   Here's an example that logs in as a (fictitious) real user to get a
44275 +          file:
44276 +          ftp ftp://olga@ftp.xyzcorp.com/resume.txt
44277 +          The password is not included, so Kermit prompts for it.
44278 +
44279 +   This scheme allows Kermit to be used as the FTP helper of other
44280 +   applications, such as Web browsers, with all its advantages over other
44281 +   FTP clients (especially the ones that are built in to most Web
44282 +   browsers), e.g. that it can be given wildcards, and it can pick text
44283 +   and binary mode automatically for each file.
44284 +
44285 +   HINT: suppose somebody sends you an FTP URL in email, or you see it in
44286 +   some text. If your terminal screen supports copy/paste, copy the url,
44287 +   and then at the shell prompt type "kermit", a space, and then paste the
44288 +   URL, e.g.:
44289 +
44290 +  $ kermit ftp://alpha.greenie.net/pub/mgetty/source/1.1/mgetty1.1.27-O
44291 +
44292 +   "$ is the shell prompt; the part you type is underlined, the rest is
44293 +   pasted in. Kermit does the rest.
44294 +
44295 +3.1.4. Interactive FTP Session Establishment
44296 +
44297 +   As you read this and the following sections, bear in mind that any
44298 +   command that can be given at the prompt can also be used in a script
44299 +   program. Kermit's script programming language is the same as its
44300 +   interactive command language. [234]CLICK HERE if you would like to
44301 +   learn a bit more about script writing.
44302 +
44303 +   An FTP session is established with the FTP OPEN command:
44304 +
44305 +   FTP [ OPEN ] [ { /SSL, /TLS } ] hostname [ switches ] [ port ]
44306 +          Opens an FTP connection to the given host on the given port and,
44307 +          if FTP AUTOLOGIN is ON, also logs you in to the server,
44308 +          prompting for username and password if necessary. If no port is
44309 +          specified, the regular FTP protocol port (21) is used. The OPEN
44310 +          keyword is optional (unless the hostname conflicts with one of
44311 +          the FTP command keywords, which you can list by typing "ftp ?").
44312 +
44313 +   The hostname can be an IP host name, numeric IP address, or if you have
44314 +   a network directory active (SET NETWORK DIRECTORY; see Chapter 6 of
44315 +   [235]Using C-Kermit), an entry name in the directory. In the latter
44316 +   case, if the given hostname matches exactly one entry, the associated
44317 +   name or address is used; if it matches more than one, Kermit cycles
44318 +   through them until one is found that can be opened; if it matches none,
44319 +   then the hostname is used as-is. If a directory is active but you want
44320 +   to bypass directory lookup, include an "=" sign at the beginning of the
44321 +   hostname, and/or use a numeric IP address.
44322 +
44323 +   When an FTP connection is opened, the default file-transfer mode is set
44324 +   to binary if the client and server platforms are alike (e.g. both of
44325 +   them are some kind of UNIX), and to text ("ascii") if they are not
44326 +   alike. This has no particular effect for uploading since Kermit
44327 +   automatically switches between text and binary mode for each file, but
44328 +   might be important for downloading. The connection is also set to
44329 +   Stream mode and File structure. Record- or page-oriented file transfers
44330 +   are not supported by C-Kermit's FTP client.
44331 +
44332 +   The optional FTP OPEN switches are:
44333 +
44334 +   /ANONYMOUS
44335 +          Logs you in anonymously, automatically supplying username
44336 +          "anonymous" and user@host as the password, based on your local
44337 +          user and host names.
44338 +
44339 +   /NOLOGIN
44340 +
44341 +          Overrides SET FTP AUTOLOGIN ON for this connection only.
44342 +
44343 +   /USER:name
44344 +          Uses the given username to log you in, thus avoiding the Name:
44345 +          prompt.
44346 +          Overrides SET FTP AUTOLOGIN OFF for this connection only.
44347 +
44348 +   /PASSWORD:text
44349 +          Uses the given text as your password, thus avoiding the
44350 +          Password: prompt. This switch is not recommended for use in
44351 +          script files, which would be a security risk.
44352 +
44353 +   /ACCOUNT:text
44354 +          Uses the given text as your account (or secondary password,
44355 +          depending on the requirements of the server; most servers do not
44356 +          require or accept an account name). If an account is not
44357 +          supplied, you are not prompted for one.
44358 +
44359 +   /PASSIVE
44360 +          Opens the connection in passive mode. Passive mode is the
44361 +          default in Kermit's FTP client, unlike in most others, since it
44362 +          works better through firewalls. The /PASSIVE and /ACTIVE
44363 +          switches apply only to the connection that is being opened, and
44364 +          do not affect the global FTP PASSIVE-MODE setting.
44365 +
44366 +   /ACTIVE
44367 +          Opens the connection in active mode. Use this switch if the
44368 +          server does not support passive mode, or use the command SET FTP
44369 +          PASSIVE-MODE OFF.
44370 +
44371 +   /NOINIT
44372 +          Added in C-Kermit 8.0.201.   Tells C-Kermit not to send REST,
44373 +          STRU, FEAT, and MODE commands to the server when the connection
44374 +          is opened, since these have been reported to cause confusion in
44375 +          certain servers.
44376 +
44377 +   When a username or password is missing, a prompt is issued at the
44378 +   controlling terminal and you must type the response; the response can
44379 +   not be scripted. Use the switches to avoid prompts, or one of the
44380 +   secure authentication methods described in the next section, or see
44381 +   [236]SET FTP AUTOLOGIN and the [237]FTP USER and similar commands
44382 +   described later in this section.
44383 +
44384 +   Examples:
44385 +
44386 +  ftp open kermit.columbia.edu /anonymous  ; Open and log in anonymously
44387 +  ftp kermit.columbia.edu /anonymous       ; The OPEN keyword can be omitted
44388 +  ftp xyzcorp.com                          ; Open and maybe prompt for username
44389 +  ftp xyzcorp.com /user:olga               ; Open and log in as olga
44390 +  ftp testing.abccorp.com 449              ; Specify a special TCP port number
44391 +  ftp testing.abccorp.com /user:olaf /password:secret 449
44392 +
44393 +   The FTP OPEN command succeeds if a connection was opened to the server
44394 +   (even if the given username and password were not valid) and fails
44395 +   otherwise (see [238]Section 3.8 for details).
44396 +
44397 +   When your FTP session is complete, you can terminate it as follows:
44398 +
44399 +   FTP BYE
44400 +          Closes the FTP connection if one was open. The FTP prefix can be
44401 +          omitted if no other connection is open at the same time (see
44402 +          [239]Section 3.8 for details). If a connection log is active, an
44403 +          FTP record is written to it. If Kermit was started with the -9
44404 +          command-line option or with its FTP command-line personality,
44405 +          and the -S (Stay) option was not given, AND there is no other
44406 +          active connection, the FTP BYE command also exits, just as it
44407 +          does on a regular FTP client. Synonyms: FTP CLOSE, FTP QUIT (but
44408 +          if the FTP prefix is omitted from QUIT, this becomes the regular
44409 +          Kermit QUIT command, which is equivalent to EXIT; i.e. it closes
44410 +          the connection and exits from Kermit).
44411 +
44412 +   The following commands can be used to achieve greater control over the
44413 +   connection and login process:
44414 +
44415 +   SET FTP ANONYMOUS-PASSWORD text
44416 +          Allows you to choose the password text to be sent automatically
44417 +          by Kermit when you open an FTP connection with the /ANONYMOUS
44418 +          switch.
44419 +
44420 +   SET FTP AUTOLOGIN { ON, OFF }
44421 +          If you give this command prior to opening an FTP connection, it
44422 +          controls whether Kermit tries to log you in automatically as
44423 +          part of the connection process. Normally ON, which means the
44424 +          username and password are sent automatically (and prompted for
44425 +          if they are not yet known). When OFF, FTP OPEN connects to the
44426 +          server without logging in. OFF is equivalent to the -n
44427 +          command-line option when using Kermit's FTP command-line
44428 +          personality.
44429 +
44430 +   FTP USER name [ password [ account ] ]
44431 +          Used to log in to an FTP server to which a connection has been
44432 +          made without autologin, or when autologin failed. If the
44433 +          password is furnished on the command line, it is used; otherwise
44434 +          you are prompted for a password. An account may also be
44435 +          furnished if required by the server; it is not required by
44436 +          Kermit and is not prompted for if omitted. Synonyms: USER, FTP
44437 +          LOGIN.
44438 +
44439 +   FTP ACCOUNT text
44440 +          Sends an account name to a server that supports accounts. If the
44441 +          server does not support accounts, an error response occurs. If
44442 +          the server does support accounts, the account is accepted if it
44443 +          is valid and rejected if it is not. The account might be used
44444 +          for charging purposes or it might be a secondary password, or it
44445 +          might be used for any other purpose, such as an access password
44446 +          for a particular disk. Servers that support accounts might or
44447 +          might not allow or require the account to be sent prior to
44448 +          login; usually it is sent after login, if at all. Synonym:
44449 +          ACCOUNT.
44450 +
44451 +   Example:
44452 +
44453 +set ftp autologin off                  ; One thing at a time please
44454 +ftp xyzcorp.com                        ; Try to make the connection
44455 +if fail exit 1 FTP connection failed   ; Check that it was made
44456 +ftp user olga secret                   ; Now log in to the server
44457 +if fail exit 1 FTP login failed        ; Check that it worked
44458 +ftp account 103896854                  ; Login OK - send account
44459 +if fail echo WARNING - FTP ACCT failed ; Warn if problem
44460 +...                                    ; (have session here)
44461 +bye                                    ; Log out and disconnect
44462 +
44463 +   The following commands are used to control or get information about the
44464 +   FTP connection. Any particular FTP server does not necessarily support
44465 +   all of them.
44466 +
44467 +   FTP RESET
44468 +          Terminates a user session but leaves the connection open,
44469 +          allowing a new login via FTP USER.
44470 +
44471 +   FTP IDLE [ number ]
44472 +          Most FTP servers automatically log you out and and disconnect
44473 +          your session if there has been no activity for a certain amount
44474 +          of time. Use this command to ask the server to set its idle
44475 +          limit to the given number of seconds. Omit the number to ask the
44476 +          server to inform you of its current idle limit.
44477 +
44478 +   FTP STATUS [ filename ]
44479 +          Asks the FTP server to send information about the current
44480 +          session. The result is a free-format report that might include
44481 +          server identification, username and login time, FTP protocol
44482 +          settings, and file-transfer statistics. If a filename is given,
44483 +          the server is supposed to send detailed information about the
44484 +          file.
44485 +
44486 +   FTP SYSTEM
44487 +          Asks the FTP server to identify its operating system (Listed in
44488 +          Internet Assigned Numbers, Operating System Names). Examples:
44489 +          UNIX, VMS, VM/CMS, WINDOWS-NT. Unfortunately many variations are
44490 +          allowed (e.g. LINUX-2.0, LINUX-2.2, FREEBSD, ULTRIX, etc,
44491 +          instead of UNIX; WINDOWS-NT-3, WINDOWS-NT-3.5, WINDOWS-NT-3.51,
44492 +          WINDOWS-NT-4, etc). The report might also include other
44493 +          information like "Type L8", "Type I", or "Type A", indicating
44494 +          the file-transfer mode.
44495 +
44496 +   FTP HELP [ keyword [ keyword [ ... ] ]
44497 +          Asks the server to list the commands it supports. The response
44498 +          is usually cryptic, listing FTP command mnemonics, not the
44499 +          commands used by the client (since the server has no way of
44500 +          knowing anything about the client's user interface). For
44501 +          example, the PUT command is STOR in FTP protocol. If a keyword
44502 +          is given, which should be an FTP protocol command,
44503 +          slightly-more- detailed help is given about the corresponding
44504 +          command (if the FTP server supports this feature). Examples:
44505 +          "ftp help", "ftp help stor".
44506 +
44507 +   FTP SITE text
44508 +          (Advanced) Sends an FTP SITE (site-specific) command. Usually
44509 +          this means that the FTP server is asked to run an external
44510 +          command with the given arguments. You might be able to find out
44511 +          what SITE commands are available by sending "ftp help site" to
44512 +          the server, but in general the availability of and response to
44513 +          SITE commands is (not surprisingly) site specific.
44514 +
44515 +   FTP QUOTE text
44516 +          (Advanced) Sends an FTP command in FTP protocol format. Use this
44517 +          command to send commands to the server that the FTP client might
44518 +          not know about.
44519 +
44520 +   SHOW FTP
44521 +          Lists client (Kermit) FTP settings and information. Also SHOW
44522 +          CONNECTION, SHOW COMMUNICATIONS.
44523 +
44524 +   HELP FTP [ keyword ]
44525 +          Asks Kermit to list and describe its built-in FTP commands.
44526 +
44527 +   HELP SET FTP [ keyword ]
44528 +          Asks Kermit to list and describe its built-in SET FTP commands.
44529 +
44530 +   [ [240]Top ] [ [241]FTP Top ] [ [242]C-Kermit Home ] [ [243]Kermit Home
44531 +   ]
44532 +
44533 +3.2. Making Secure FTP Connections
44534 +
44535 +   Also see: [244]Accessing IBM Information Exchange with Kermit.
44536 +
44537 +   In the previous section, you can see several examples of traditional
44538 +   insecure authentication: username and password sent across the network
44539 +   in clear text. Of course this is bad practice on at least two counts:
44540 +   (1) storing passwords in files (such as script files) gives access to
44541 +   the target systems to anybody who can obtain read access to your
44542 +   scripts; and (2) sending this information over the network leaves it
44543 +   open to interception by network sniffers or compromised hosts.
44544 +
44545 +   Because of the increasing need for security on the Internet, FTP
44546 +   servers are beginning to appear that offer secure forms of
44547 +   authentication, in which no information is sent over the network that
44548 +   would allow anyone who intercepts it to usurp your identity and gain
44549 +   your access rights.
44550 +
44551 +   Kermit provides an equivalent form of FTP security for each type of
44552 +   IETF standard security implemented in Telnet. These include
44553 +   GSSAPI-KERBEROS5, KERBEROS4, Secure Remote Password (SRP), and
44554 +   Transport Layer Security (SSL and TLS). It does not presently include
44555 +   SSL tunneling nor any form of SSH v1 or v2. When Kermit is built with
44556 +   the necessary libraries, secure FTP connections are attempted by
44557 +   default, in which all connections are authenticated and the command and
44558 +   data channels are private.
44559 +
44560 +   The use of authentication and encryption for FTP connections can be
44561 +   adjusted with the commands listed below, which are available only if
44562 +   your version of Kermit was built with the corresponding security
44563 +   options and libraries:
44564 +
44565 +   SET FTP AUTHTYPE { AUTOMATIC, GSSAPI-KRB5, KERBEROS4, SRP, SSL, TLS }
44566 +          Specifies an ordered list of authentication methods to be
44567 +          attempted when AUTOAUTHENTICATION is ON. The default list is:
44568 +          GSSAPI-KRB5, SRP, KERBEROS_V4, TLS, SSL. If none of the selected
44569 +          methods are supported by the server, an insecure login is used
44570 +          as a fallback. Note, by the way, that SSL or TLS can be used to
44571 +          secure an anonymous connection.
44572 +
44573 +   SET FTP AUTOAUTHENTICATION { ON, OFF }
44574 +          Tells whether authentication should be negotiated by the FTP
44575 +          OPEN command. Default is ON. Use SET FTP AUTOAUTHENTICATION OFF
44576 +          to force a clear-text, unencrypted connection to FTP servers
44577 +          (such as the one at the Kermit FTP site) that normally would try
44578 +          to negotiate secure authentication and encryption.
44579 +
44580 +   SET FTP AUTOENCRYPTION { ON, OFF }
44581 +          Tells whether encryption (privacy) should be negotiated by the
44582 +          FTP OPEN command, which can happen only if secure authentication
44583 +          is also negotiated. Default is ON.
44584 +
44585 +   SET FTP AUTOLOGIN { ON, OFF }
44586 +          Tells Kermit whether to try logging in automatically when you
44587 +          make an FTP connection, as opposed to letting you do it "by
44588 +          hand" with the FTP USER command.
44589 +
44590 +   SET FTP COMMAND-PROTECTION-LEVEL { CLEAR, CONFIDENTIAL, PRIVATE, SAFE }
44591 +          Determines the level of protection applied to the command
44592 +          channel:
44593 +
44594 +  CLEAR         Data is sent in plaintext and not protected against tampering.
44595 +  CONFIDENTIAL  Data is encrypted but not protected against tampering.
44596 +  PRIVATE       Data is encrypted and is protected against tampering.
44597 +  SAFE          Data is sent in plaintext but protected against tampering.
44598 +
44599 +          The default is PRIVATE.
44600 +
44601 +   SET FTP CREDENTIAL-FORWARDING { ON, OFF }
44602 +          Tells whether end-user credentials are to be forwarded to the
44603 +          server if supported by the authentication method (GSSAPI-KRB5
44604 +          only). This is often required to allow access to distributed
44605 +          file systems (e.g. AFS.)
44606 +
44607 +   SET FTP DATA-PROTECTION-LEVEL { CLEAR, CONFIDENTIAL, PRIVATE, SAFE }
44608 +          Tells what level of protection is applied to subsequent data
44609 +          channels. The meanings of the protection-level keywords are the
44610 +          same as for SET FTP COMMAND-PROTECTION-LEVEL. The default is
44611 +          PRIVATE.
44612 +
44613 +   SET FTP SRP CIPHER name
44614 +          Specifies the cipher to be used for encryption when SRP
44615 +          authentication is in use. The list of possible choices is
44616 +          computed based on the capabilities of the local SRP library and
44617 +          includes NONE plus zero or more of the following:
44618 +
44619 +  BLOWFISH_ECB        CAST5_ECB          DES_ECB          DES3_ECB
44620 +  BLOWFISH_CBC        CAST5_CBC          DES_CBC          DES3_CBC
44621 +  BLOWFISH_CFB64      CAST5_CFB64        DES_CFB64        DES3_CFB64
44622 +  BLOWFISH_OFB64      CAST5_OFB64        DES_OFB64        DES3_OFB64
44623 +
44624 +          The default is DES3_ECB.
44625 +
44626 +   SET FTP SRP HASH name
44627 +          Specifies the hash to be used for data protection when SRP
44628 +          authentication is in use. The choices are MD5 and SHA. The
44629 +          default is SHA.
44630 +
44631 +   Command-line options:
44632 +
44633 +   -k name
44634 +          Specifies the realm to be used with Kerberos 4 authentication (=
44635 +          SET AUTH K4 REALM name).
44636 +
44637 +   -f
44638 +          Enables forwarding of Kerberos 5 credentials to the host when
44639 +          using GSSAPI authentication (= SET AUTH K5 FORWARDABLE ON).
44640 +
44641 +   -x
44642 +          Enables autoencryption (= SET FTP AUTOENCRYPTION ON).
44643 +
44644 +   -c cipher
44645 +          Specifies the kind of cipher to be used for encryption with SRP
44646 +          authentication. Equivalent to SET FTP SRP CIPHER, with the same
44647 +          choices. If this option is not given, CAST5_CBC is used.
44648 +
44649 +   -H hash
44650 +          Specifies the hash to be used for encryption with SRP
44651 +          authentication. Equivalent to SET FTP SRP HASH, with the same
44652 +          choices. If this option is not given, SHA is used.
44653 +
44654 +   -z debug
44655 +          Turns on SSL/TLS debugging.
44656 +
44657 +   -z secure
44658 +          Requires secure connection.
44659 +
44660 +   -z certsok
44661 +          Says to accept all certificates without checking validity.
44662 +
44663 +   -z verify=n
44664 +          Sets certificate verification mode to the given number, n:
44665 +            0 = no verification
44666 +            1 = verify certificate if presented
44667 +            2 = require verification of certificate
44668 +
44669 +   -z cert=filename
44670 +          Specifies a file containing a client certificate to be presented
44671 +          to the FTP server.
44672 +
44673 +   -z key=filename
44674 +          Specifies a file containing a private key matching the client
44675 +          certificate.
44676 +
44677 +   -z !krb4
44678 +          (nokrb4) Disables the use of Kerberos 4.
44679 +
44680 +   -z !gss
44681 +   -z nogss
44682 +          Disables the use of GSSAPI - Kerberos 5.
44683 +
44684 +   -z !srp
44685 +   -z nosrp
44686 +          Disables use of SRP.
44687 +
44688 +   -z !ssl
44689 +   -z nossl
44690 +          Disables the use of SSL.
44691 +
44692 +   -z !tls
44693 +   -z notls
44694 +          Disables the use of TLS.
44695 +
44696 +   Caution: If your FTP connection is secured via AUTH TLS, it is not
44697 +   possible to interrupt a file transfer. This is a limitation of all
44698 +   known FTP servers that support AUTH TLS.
44699 +
44700 +   Note that when using certain security methods, such as SSL or TLS, you
44701 +   may be prompted to confirm or verify certain actions or conditions, for
44702 +   example, whether to accept self-signed certificates. This can interfere
44703 +   with unattended operation of scripts; see [245]Section 3.10.
44704 +
44705 +   [ [246]Top ] [ [247]FTP Top ] [ [248]C-Kermit Home ] [ [249]Kermit Home
44706 +   ]
44707 +
44708 +3.3. Setting FTP Preferences
44709 +
44710 +   FTP preferences can be set globally and persistently with the commands
44711 +   in the following sections; many of these can also be overridden on a
44712 +   per-command basis with switches that have the same name.
44713 +
44714 +3.3.1. Logs, Messages, and Other Feedback
44715 +
44716 +   You can control the amount of feedback received from your FTP session
44717 +   with the commands in this section. First, you can create a log of your
44718 +   FTP transfers with the following commands:
44719 +
44720 +   SET TRANSACTION-LOG { VERBOSE, FTP, BRIEF }
44721 +          Selects the log format. VERBOSE is the default, and is described
44722 +          in [250]the manual. FTP chooses a WU-FTPD format, the same as is
44723 +          used by the popular FTP server. BRIEF creates per-file records
44724 +          in comma-separated-list format. For greater detail, see
44725 +          [251]Section 4.17 of the [252]C-Kermit 7.0 Update Notes.
44726 +
44727 +   LOG TRANSACTIONS filename
44728 +          Records FTP (or Kermit, or any other protocol) uploads and
44729 +          downloads in the given file using the format selected by the
44730 +          most recent SET TRANSACTION-LOG command, if any, or else the
44731 +          default format.
44732 +
44733 +   FTP screen messages and displays are controlled by the following
44734 +   commands:
44735 +
44736 +   SET TRANSFER DISPLAY { FULLSCREEN, CRT, SERIAL, BRIEF, NONE, OFF }
44737 +          FTP transfers use Kermit's normal file-transfer display styles.
44738 +          Use this command to choose the desired format; the default on
44739 +          most platforms is FULLSCREEN. The display is automatically
44740 +          disabled if Kermit is running in the background or in batch.
44741 +          BRIEF is always used for command-line initiated transfers
44742 +          (unless suppressed by -q). While a file-transfer is in progress,
44743 +          you can interrupt it in the normal Kermit way by typing one of
44744 +          the following keys or key combinations:
44745 +            X - Cancel current file but go on to the next one (if any).
44746 +            Z - Cancel the entire transfer.   Ctrl-L or Ctrl-W - Refresh
44747 +          the file-transfer display (if any).
44748 +
44749 +   SET FTP DISPLAY { FULLSCREEN, CRT, SERIAL, BRIEF, NONE, OFF }
44750 +          Like SET TRANSFER DISPLAY, but applies only to FTP connections,
44751 +          and does not affect Kermit- or other protocol file transfers.
44752 +
44753 +   SET QUIET { ON, OFF }
44754 +          This command applies to Kermit in general, not just FTP. OFF by
44755 +          default; when ON, it surpresses most messages from most commands
44756 +          as well as the file-transfer display.
44757 +
44758 +   SET FTP PROGRESS-MESSAGES { ON, OFF }
44759 +          Tells whether Kermit should print locally-generated feedback
44760 +          messages for each non-file-transfer command. ON by default.
44761 +
44762 +   SET FTP VERBOSE-MODE { ON, OFF }
44763 +          Tells whether to display all responses from the FTP server. OFF
44764 +          by default. This shows all responses to all commands, except
44765 +          when the file-transfer display is active, and unless you have
44766 +          SET QUIET ON. When OFF, responses are shown only for commands
44767 +          such as FTP PWD whose purpose is to display a response.
44768 +
44769 +   SET FTP DEBUG { ON, OFF }
44770 +          Tells whether local client debugging information should be
44771 +          displayed. OFF by default. When ON, the commands that are sent
44772 +          to the server are shown, as well as its responses (even if
44773 +          VERBOSE-MODE is OFF), plus additional informational messages are
44774 +          printed regarding the progress of secure operations. Also, the
44775 +          temporary file created by the [253]MGET command is not deleted
44776 +          so you can see what's in it.
44777 +
44778 +   Set all of these to OFF when silent running is desired.
44779 +
44780 +3.3.2. Operational Preferences
44781 +
44782 +   FTP DISABLE new-protocol-feature-name
44783 +   FTP ENABLE new-protocol-feature-name
44784 +          Explained in [254]Section 3.11.
44785 +
44786 +   SET FTP AUTOLOGIN { ON, OFF }
44787 +          If you give this command prior to opening an FTP connection, it
44788 +          controls whether Kermit tries to log you in automatically as
44789 +          part of the connection process. Normally ON, which means the
44790 +          username and password are sent automatically (and prompted for
44791 +          if they are not yet known). When OFF, FTP OPEN connects to the
44792 +          server without logging in. OFF is equivalent to the -n
44793 +          command-line option when using Kermit's FTP command-line
44794 +          personality. See [255]Section 3.1.4 for usage.
44795 +
44796 +   SET FTP PASSIVE-MODE { ON, OFF }
44797 +          ON by default, to avoid random TCP port assignment for data
44798 +          connections, which can prevent FTP protocol from working through
44799 +          firewalls and network address translators (for more on these
44800 +          topics, see the [256]Kermit security reference. Set to OFF in
44801 +          case the FTP server does not support passive mode, or in case
44802 +          the client has problems with it (it has been observed, for
44803 +          example, that when using passive mode, the SCO XENIX 2.3.4
44804 +          TCP/IP stack hangs in the connect() call forever). Synonyms:
44805 +          PASSIVE [ ON ], PASSIVE OFF, PASV [ ON ], PASV OFF.
44806 +
44807 +   SET FTP SEND-PORT-COMMANDS { ON, OFF }
44808 +          This command determines whether the FTP client sends a new PORT
44809 +          command to the server when accepting incoming data connections
44810 +          (as when not using passive mode.) When PASSIVE-MODE is OFF and
44811 +          SET SEND-PORT is OFF, the port that was originally specified is
44812 +          reused. This is the default behavior for normal FTP clients but
44813 +          it is not compatible with many firewalls.
44814 +
44815 +   SET FTP CHARACTER-SET-TRANSLATION { ON, OFF }
44816 +          Whether to translate character sets when transferring files with
44817 +          FTP (explained in [257]Section 3.7). OFF by default.
44818 +
44819 +   SET FTP SERVER-CHARACTER-SET name
44820 +          Tells Kermit the character set used by the FTP server, UTF-8 by
44821 +          default ([258]Section 3.7).
44822 +
44823 +   SET FTP SERVER-TIME-OFFSET delta-time
44824 +          Tells Kermit to apply the given [259]delta time to file
44825 +          timestamps provided by the server for its files; for use when
44826 +          (for example) the server does not have its timezone set
44827 +          correctly.
44828 +
44829 +   SET FTP ERROR-ACTION { PROCEED, QUIT }
44830 +          When transferring a group of files with FTP, and an error occurs
44831 +          with one of the files, Kermit normally goes on the next file.
44832 +          Use SET FTP ERROR-ACTION to QUIT to make Kermit stop the
44833 +          transfer immediately and fail if an error occurs with any single
44834 +          file in the group. Example: you have given Kermit a list of
44835 +          files to send, and one of the files can not be found, or read
44836 +          permission is denied. Note that cancelling a file by typing 'X'
44837 +          during transfer is not considered an error (if you want to
44838 +          cancel the entire transfer, type 'Z' or Ctrl-C).
44839 +
44840 +   SET FTP PERMISSIONS { AUTO, ON, OFF }
44841 +          When uploading files with PUT or MPUT, this tells whether Kermit
44842 +          should send each file's permissions. The default is OFF, which
44843 +          means not to send permissions, in which case the uploaded file's
44844 +          permissions are set by the FTP server according to its own
44845 +          criteria. ON means to send them, AUTO means to send them only if
44846 +          the client (Kermit) and server are on like platforms (e.g. both
44847 +          UNIX). This command has no effect when downloading, since the
44848 +          FTP protocol does not include a way for the server to inform the
44849 +          client of a file's permissions. Also see [260]FTP PUT
44850 +          /PERMISSIONS. Note that setting permissions after uploading is
44851 +          likely to work (correctly or at all) only when the client and
44852 +          server platforms are alike (e.g. both of them are some form of
44853 +          UNIX). Also note that Windows files don't have permissions. Also
44854 +          see [261]FTP CHMOD.
44855 +
44856 +   SET FTP DATES { ON, OFF }
44857 +          When downloading files with GET or MGET, this tells whether
44858 +          Kermit should try to set the received file's date from the
44859 +          server's date. FTP DATES is ON by default. Note, however, that
44860 +          FTP protocol does not allow date preservation when uploading. So
44861 +          at best, SET FTP DATES ON can work only when downloading, and
44862 +          then only when the server agrees to furnish file dates.
44863 +
44864 +   SET FTP FILENAMES { AUTO, CONVERTED, LITERAL }
44865 +          When uploading (sending) files, this tells whether to convert
44866 +          outbound filenames to "common form". This means allowing only
44867 +          one period in a name, uppercasing any lowercase letters,
44868 +          replacing spaces by underscores, etc. AUTOMATIC is the default,
44869 +          meaning LITERAL when client and server are the same type of
44870 +          system (e.g. UNIX) and CONVERTED otherwise. Special case: if the
44871 +          setting is AUTOMATIC and the client is not UNIX and the server
44872 +          identifies itself as UNIX, Kermit uses a less-strict form of
44873 +          conversion, in which lowercase letters are not uppercased and
44874 +          the filename can contain any number of periods, but spaces are
44875 +          still converted to underscore. When receiving, conversion
44876 +          generally means to change all-uppercase names to lowercase and
44877 +          spaces to underscore.
44878 +
44879 +   SET FTP UNIQUE-SERVER-NAMES { ON, OFF }
44880 +          Applies only to uploads. Tells the server to create new, unique
44881 +          names for incoming files that have the same names as existing
44882 +          files. OFF by default, in which case the server overwrites
44883 +          existing files with new files of the same name. When ON, the
44884 +          server uses its own built-in method for creating new names for
44885 +          incoming files; for example, appending a period (.) and a number
44886 +          to the name. CAUTION: Use this option only if you do not need to
44887 +          refer to the file after it is uploaded, since FTP protocol
44888 +          provides no mechanism for the client to find out what name was
44889 +          assigned by the server.
44890 +
44891 +   SET FTP COLLISION { ... }
44892 +          When downloading, what to do if an incoming file has the same
44893 +          name as an existing file. Options are the same as for SET FILE
44894 +          COLLISION. If this command is not given, Kermit's regular FILE
44895 +          COLLISION setting is used. If this command is given, it
44896 +          overrides the FILE COLLISION setting for FTP transfers only. See
44897 +          [262]Section 3.6.2 for details.
44898 +
44899 +   SET FTP TYPE { TEXT, BINARY, TENEX }
44900 +          Changes the default transfer mode. When sending (uploading)
44901 +          files, this command has no effect unless you disable automatic
44902 +          text/binary mode switching ([263]Section 4) with SET FILE SCAN
44903 +          OFF or SET TRANSFER MODE MANUAL. When receiving (downloading)
44904 +          files, this command establishes the transfer mode to be used
44905 +          when a filename does not match any of Kermit's text or binary
44906 +          filename patterns, unless you use SET FTP GET-FILETYPE-SWITCHING
44907 +          or SET TRANSFER MODE MANUAL to disable automatic switching, in
44908 +          which case, this command establishes the transfer mode for all
44909 +          downloaded files. In all cases, however, the FTP TYPE can be
44910 +          overridden in any GET or PUT command by including a /TEXT
44911 +          (/ASCII), /BINARY, or /TENEX switch. The FTP TYPE is independent
44912 +          of the Kermit FILE TYPE setting. TENEX is used for sending 8-bit
44913 +          binary files to 36-bit platforms such as TOPS-10, TOPS-20, and
44914 +          TENEX, and getting them back again. Synonym: ASCII = TEXT. Note:
44915 +          there is also an FTP TYPE command, which does what SET FTP TYPE
44916 +          does but also sends a TYPE command to the server immediately if
44917 +          the given type is different from the current one.
44918 +
44919 +   If you want want specific FTP preference settings to be in effect for
44920 +   all your Kermit FTP sessions, put the desired SET FTP commands in your
44921 +   Kermit customization file (~/.mykermrc in UNIX, K95CUSTOM.INI in
44922 +   Windows).
44923 +
44924 +   [ [264]Top ] [ [265]FTP Top ] [ [266]C-Kermit Home ] [ [267]Kermit Home
44925 +   ]
44926 +
44927 +3.4. Managing Directories and Files
44928 +
44929 +   In Kermit, commands for directory and file management can refer to:
44930 +
44931 +     * The local computer
44932 +     * A remote computer when you have a connection to a Kermit server or
44933 +       IKSD.
44934 +     * A remote computer when you have a connection to an FTP server.
44935 +
44936 +   (There can also be an HTTP connection, but the commands in this section
44937 +   don't apply to HTTP connections.)
44938 +
44939 +   Thus in general, each such command comes in three forms:
44940 +
44941 +    1. With no prefix in C-Kermit 8.0.200, it refers to the local computer
44942 +       (CD, DIR, etc). In C-Kermit 8.0.201 and later, however, the "locus"
44943 +       switches to automatically to the remote FTP server when you make an
44944 +       FTP connection (see the SET LOCUS description [268]Section 7); thus
44945 +       C-Kermit 8.0.201 acts almost exactly like a regular FTP client when
44946 +       it has an FTP connection, yet still acts like itself on other kinds
44947 +       of connections.
44948 +    2. With the REMOTE prefix, it is for a Kermit server (REMOTE CD,
44949 +       REMOTE DIR).
44950 +    3. With the FTP prefix, it's for an FTP server (FTP CD, FTP DIR).
44951 +    4. Also see [269]Section 3.8, which explains "R-commands" and
44952 +       "L-commands".
44953 +
44954 +   Kermit's FTP file and directory management commands are as follows.
44955 +   When an R-command is included in the Synonyms list, be sure to read
44956 +   [270]Section 3.8 about rules for use of R-commands.
44957 +
44958 +   FTP CD [ directory ]
44959 +          Tells the FTP server to change its default (working) directory
44960 +          to the one given, which usually must be expressed in the syntax
44961 +          of the server platform (UNIX, VMS, etc). If the directory is not
44962 +          specified, the result depends on the FTP server -- it might
44963 +          complain that the command is illegal, or it might change to your
44964 +          original login directory. Synonyms: FTP CWD (Change Wording
44965 +          Directory); RCD.
44966 +
44967 +   FTP CDUP
44968 +          Tells the FTP server to change its default (working) directory
44969 +          to the parent directory of its current one (equivalent to
44970 +          "cd .." in UNIX, or "cd [-]" in VMS). Synonyms: RCDUP, FTP UP.
44971 +
44972 +   FTP PWD
44973 +          Asks the FTP server to report ("print") its current working
44974 +          directory. Synonym: RPWD.
44975 +
44976 +   FTP MKDIR directory
44977 +          Asks the FTP server to create the directory whose name is given.
44978 +          In general, the name must be in the syntax of the server's file
44979 +          system, and it must be either absolute (a full pathname) or
44980 +          relative to the server's current (working) directory. This
44981 +          command fails if the directory can't be created for any reason,
44982 +          including that it exists already. Synonym: RMKDIR.
44983 +
44984 +   FTP RMDIR directory
44985 +          Asks the FTP server to remove the directory whose name is given.
44986 +          The rules are the same as for MKDIR, plus in most cases, the
44987 +          server will not remove any directory unless it is empty.
44988 +          Synonym: RRMDIR.
44989 +
44990 +   FTP DIRECTORY [ filespec ] [ redirectors ]
44991 +          Tells the FTP server to send a directory listing of the
44992 +          specified files. If no filespec is given, the server lists all
44993 +          files in its current working directory. The results are in
44994 +          whatever format the server chooses to send them. You can use
44995 +          UNIX-like redirectors to send the listing to a file or a
44996 +          pipeline, exactly as with the regular Kermit client/server
44997 +          REMOTE DIRECTORY command ([271]Using C-Kermit, Chapter 11).
44998 +          Synonym: RDIRECTORY. Examples:
44999 +
45000 +    ftp dir                           ; Show listing of all files on screen
45001 +    ftp dir *.txt                     ; List *.txt files on screen
45002 +    ftp dir *.txt > somefile          ; Put listing in somefile
45003 +    ftp dir *.txt >> somefile         ; Append listing to somefile
45004 +    ftp dir *.txt | sort > somefile   ; Put sorted listing in somefile
45005 +    ftp dir | more                    ; Runs list through "more"
45006 +    ftp dir | sort | more             ; Runs list through "sort" and "more"
45007 +
45008 +   FTP VDIRECTORY [ filespec ] [ redirectors ]
45009 +          "Verbose" directory. This is an alternative FTP DIRECTORY
45010 +          command primarily for use with DECSYSTEM-20 (TOPS-20) FTP
45011 +          servers, which send only filenames when given a DIRECTORY
45012 +          command; the VDIRECTORY command makes them also send file sizes,
45013 +          dates, and attributes.
45014 +
45015 +   FTP CHECK filespec
45016 +          Asks the FTP server whether the given file exists or, if the
45017 +          filespec contains wildcards, if any files match, and this
45018 +          command succeeds or fails accordingly.
45019 +
45020 +   FTP MODTIME filename
45021 +          Asks the FTP server, via the not-yet-standard FTP MDTM command,
45022 +          to send the modification date and time of the given file. The
45023 +          response should be a numeric string in the format:
45024 +          yyyymmddhhmmssxxxxx... where yyyy is the year, mm is the month,
45025 +          dd is the day, hh is the hour (0-23), mm is the minute, ss is
45026 +          the second, and xxx... is the optional fraction of the second (0
45027 +          or more digits). The date and time is expressed in UTC (GMT,
45028 +          Zulu, Zero-Meridian). The result is available programmatically
45029 +          in the [272]\v(ftp_message) variable, and is understandable by
45030 +          Kermit's date-time switches and functions. For example, suppose
45031 +          we want to upload all local files that are newer than a
45032 +          particular file on the server:
45033 +
45034 +  C-Kermit> ftp modtime signpost
45035 +  C-Kermit> echo \v(ftp_message)
45036 +  20010807113542.014
45037 +  C-Kermit> ftp mput /after:\v(ftp_message)GMT *
45038 +
45039 +          Note that we must append "GMT" to the date-time string to let
45040 +          the /AFTER switch know the time is GMT rather than local.
45041 +
45042 +   FTP SIZE filename
45043 +          Asks the FTP server to send the size (in bytes) of the given
45044 +          file. The result might vary depending on whether the current FTP
45045 +          TYPE is binary or text ("ascii"). For a reliable byte count, do
45046 +          FTP TYPE BINARY first. The result is available programmatically
45047 +          in the [273]\v(ftp_message) variable.
45048 +
45049 +   FTP CHMOD permissions filename
45050 +          Tells the FTP server to set the permissions (protection) of the
45051 +          given file to the ones given. The permissions and filename must
45052 +          be given in whatever syntax is required by the server. Example
45053 +          (for a UNIX-based FTP server):
45054 +
45055 +  ftp chmod 664 oofa.txt
45056 +
45057 +          Not all servers support this command. For non-UNIX-based
45058 +          servers, you might need to use FTP QUOTE or FTP SITE and the
45059 +          appropriate platform-specific FTP server command.
45060 +
45061 +   FTP UMASK [ number ]
45062 +          This command is probably specific to UNIX-based servers; it sets
45063 +          the UNIX "umask", which is the default permissions mask for new
45064 +          (in this case, incoming) files. Crudely put, the UNIX umask is
45065 +          an octal representation of a binary number in in which a 1 bit
45066 +          stands for a permission bit that must be 0, and a 0 bit stands
45067 +          for a permission bit that can be 0 or 1 depending on other
45068 +          factors, such as the permissions of the parent directory.
45069 +          Example: "umask 007" requires that new files are created without
45070 +          read/write/execute world permission. If the number is not
45071 +          specified, the server's current umask is reported.
45072 +
45073 +   FTP RENAME filename newname
45074 +          Asks the FTP server to rename the file whose name is "filename"
45075 +          to "newname". Works only for one file; can not be used with
45076 +          wildcards. The server's interpretation of "newname" can vary (in
45077 +          some cases it must be a filename, in others perhaps it can also
45078 +          be a directory name, in which case if the filename denote a
45079 +          regular file, the file might be moved to the given directory).
45080 +          Some servers might allow files to be renamed ("moved") between
45081 +          physical disks or partitions, others might not. Synonym:
45082 +          RRENAME.
45083 +
45084 +   FTP DELETE [ switches ] filespec [ filespec [ ... ] ]
45085 +          Tells the FTP server to delete the file or files listed. Each
45086 +          file specification may, but need not, contain wildcard
45087 +          characters to match multiple files. File specifications and
45088 +          wildcard syntax must be those of the server. Any file
45089 +          specifications that contain spaces must be enclosed in braces or
45090 +          doublequotes. FTP DELETE switches are:
45091 +
45092 + /ERROR-ACTION:  /FILENAMES:     /NOBACKUPFILES  /QUIET
45093 + /EXCEPT:        /LARGER-THAN:   /NODOTFILES     /NOPAGE
45094 + /PAGE           /RECURSIVE      /SMALLER-THAN:
45095 +
45096 +          When used with FTP DELETE, the /RECURSIVE switch deletes files
45097 +          but not directories, and furthermore depends on the server
45098 +          providing recursive file lists, which is not the normal
45099 +          behavior. For further details, see the decriptions of these
45100 +          switches in [274]Section 3.6. Synonyms: FTP MDELETE (Kermit
45101 +          makes no distinction between DELETE and MDELETE); RDELETE.
45102 +
45103 +   FTP TYPE { TEXT, BINARY, TENEX }
45104 +          Tells the FTP server to change its file-transfer type to the one
45105 +          given, immediately. See [275]SET FTP TYPE for details.
45106 +
45107 +   [ [276]Top ] [ [277]FTP Top ] [ [278]C-Kermit Home ] [ [279]Kermit Home
45108 +   ]
45109 +
45110 +3.5. Uploading Files With FTP
45111 +
45112 +   Uploading means sending files from the client (Kermit) to the FTP
45113 +   server. The basic command for uploading files with FTP is PUT:
45114 +
45115 +   FTP PUT [ switches ] [ filespec [ as-name ] ]
45116 +          Uploads (sends) the file or files that match the file
45117 +          specification, which may include wildcards, to the server. If no
45118 +          filespec is given, the names of files to send are taken from the
45119 +          /LISTFILE: file, if any, otherwise from the SEND-LIST, if any.
45120 +          Unless you go out of your way to prevent it, Kermit determines
45121 +          the transfer mode (text or binary) for each file automatically,
45122 +          and switches automatically on a per-file basis. If an as-name is
45123 +          given, the file is sent under that name instead of its own (if
45124 +          an as-name is given with a wildcard filespec, the result is a
45125 +          bit more complicated, and is explained later in this section).
45126 +
45127 +   Unlike normal FTP clients, Kermit does not prompt you by default (or at
45128 +   all) for each file; it just sends them, just as it does with Kermit
45129 +   protocol. The filespec can be a literal filename or a Kermit pattern,
45130 +   described in:
45131 +
45132 +  [280]http://www.columbia.edu/kermit/ckermit70.html#x4.9
45133 +
45134 +   Kermit patterns are equivalent to C-Shell patterns and provide a fair
45135 +   amount of flexibility in selecting which files to send, which is
45136 +   augmented by the file-selection switches presented in [281]Section
45137 +   3.5.1.
45138 +
45139 +   FTP MPUT [ switches ] filespec [ filespec [ ... ] ]
45140 +          FTP MPUT is just like FTP PUT except it allows you to give more
45141 +          than one file specification, and it does not allow an as-name in
45142 +          the file list. However, as-names can be given to either PUT or
45143 +          MPUT with the /AS-NAME: switch.
45144 +
45145 +   If a PUT or MPUT command results in one file being uploaded, it
45146 +   succeeds if the file is uploaded completely and fails otherwise. If
45147 +   more than one file is selected for upload, success or failure depends
45148 +   on the [282]FTP ERROR-ACTION setting; if it is PROCEED (the default
45149 +   setting), then the [M]PUT command succeeds if at least one of the files
45150 +   was completely uploaded, and fails otherwise, If FTP ERROR-ACTION is
45151 +   QUIT, the [M]PUT command succeeds if all selected files were uploaded
45152 +   successfully, and fails if any file failed.
45153 +
45154 +   FTP uploads may be interrupted just like Kermit uploads. While the
45155 +   transfer is in progress, type:
45156 +
45157 +  X to interrupt the current file and go on to the next file.
45158 +  Z to cancel the current file and all remaining files.
45159 +  ^C (Control-C): Like Z, but might act more quickly.
45160 +
45161 +   MPUT may be used as in regular FTP clients, but it is not required to
45162 +   send multiple files; in Kermit it is required only if you want to give
45163 +   multiple file specifications. Examples:
45164 +
45165 +  ftp put oofa.txt               ; Send a single file oofa.txt
45166 +  ftp put oofa.txt budget.txt    ; Send single file oofa.txt as budget.txt
45167 +  ftp put *.txt                  ; Send all *.txt files
45168 +  ftp mput *.txt                 ; Send all *.txt files (same as "put *.txt")
45169 +  ftp mput *.txt foo.bar         ; Send all *.txt files plus foo.bar
45170 +
45171 +   The distinction between PUT and MPUT is important only when more than
45172 +   one filespec is given, just like the distinction between Kermit SEND
45173 +   and MSEND:
45174 +
45175 +  ftp put oofa.txt budget.txt    ; Send oofa.txt AS budget.txt
45176 +  ftp mput oofa.txt budget.txt   ; Send oofa.txt AND budget.txt
45177 +
45178 +   If the source file specification includes any path segments, for
45179 +   example:
45180 +
45181 +  put /tmp/oofa.txt
45182 +  put subdir/another/andanother/oofa.txt
45183 +
45184 +   the path portion is stripped from the filename that is sent to the
45185 +   server. However, if an as-name contains a path, it is retained.
45186 +   Examples:
45187 +
45188 +  ftp put /usr/doc/oofa.txt      ; Send as "oofa.txt".
45189 +  ftp put oofa.txt /tmp/oofa.txt ; Send as "/tmp/oofa.txt"
45190 +
45191 +   The latter example sends the file oofa.txt from your current local
45192 +   directory to the server's /tmp directory. This works only if the server
45193 +   uses the same directory notation that you used in the as-name AND the
45194 +   given directory already exists on the server AND if you have write
45195 +   access to it.
45196 +
45197 +   Use caution when uploading from a case-sensitive file system, such as
45198 +   UNIX, to a file system that is not case sensitive, such as Windows or
45199 +   VMS. If you have two files in UNIX, AA and aa and upload both of them,
45200 +   the second one will overwrite the first. The only way around this
45201 +   provided by FTP protocol is its "unique server names" feature (SET FTP
45202 +   UNIQUE-SERVER-NAMES or the /UNIQUE switch described below).
45203 +
45204 +3.5.1. FTP PUT Switches
45205 +
45206 +   FTP PUT and MPUT are similar in format and behavior to the regular
45207 +   Kermit SEND and MSEND commands, and they allow most of the same
45208 +   optional switches:
45209 +
45210 +C-Kermit>ftp put ? Filename, or switch, one of the following:
45211 + /after:                 /larger-than:           /rename-to:
45212 + /array:                 /listfile:              /server-character-set:
45213 + /as-name:               /local-character-set:   /server-rename-to:
45214 + /before:                /move-to:               /simulate
45215 + /binary                 /nobackupfiles          /smaller-than:
45216 + /command                /nodotfiles             /tenex
45217 + /delete                 /nofollowlinks          /text
45218 + /dotfiles               /not-after:             /transparent
45219 + /error-action:          /not-before:            /type:
45220 + /except:                /permissions:           /update
45221 + /filenames:             /quiet                  /unique-server-names
45222 + /filter:                /recover
45223 + /followlinks            /recursive
45224 +
45225 +   Since most of these switches are common to Kermit's SEND and MSEND
45226 +   commands, they described only briefly here. For greater detail see:
45227 +
45228 +     [283]http://www.columbia.edu/kermit/ckermit70.html#x1.5 (explanation
45229 +   of switches)
45230 +     [284]http://www.columbia.edu/kermit/ckermit70.html#x4.7
45231 +   (file-transfer switches)
45232 +
45233 +   First the file-selection switches:
45234 +
45235 +   /AFTER:date-time
45236 +   /BEFORE:date-time
45237 +   /NOT-AFTER:date-time
45238 +   /NOT-BEFORE:date-time
45239 +          Only send those files modified on or after or before the given
45240 +          date and time. These switches can be combined to select files
45241 +          modified between two date/times. Various date-time formats are
45242 +          accepted; if the date-time contains spaces, it must be enclosed
45243 +          in braces or doublequotes. See
45244 +          [285]http://www.columbia.edu/kermit/ckermit70.html#x1.6 and
45245 +          [286]Section 8.13 of this document for details about date-time
45246 +          formats. Examples:
45247 +
45248 +  ftp put /after:{1 jan 2000 0:00:00} *
45249 +  ftp put /after:-5days *
45250 +
45251 +   /LARGER-THAN:number
45252 +   /SMALLER-THAN:number
45253 +          Only send files larger (smaller) than the given number of bytes
45254 +          (octets). These switches can be combined to select files in a
45255 +          certain size range.
45256 +
45257 +   /TYPE:{TEXT,BINARY}
45258 +          Only send files that are the given type, which is determined for
45259 +          each file just before sending it by file scanning. BINARY
45260 +          includes TENEX; if you have included a /TENEX switch, or
45261 +          previously given a [SET] FTP TYPE TENEX command, binary files
45262 +          are sent in TENEX, rather than BINARY mode.
45263 +
45264 +   /[NO]DOTFILES
45265 +          [Don't] include files whose names begin with dot (.). By
45266 +          default, such files are not included unless your filespec
45267 +          explicitly mentions them.
45268 +
45269 +   /NOBACKUPFILES
45270 +          Don't include files whose names end with .~nnn~, where nnn is a
45271 +          number, e.g. oofa.txt.~27~. These are backup files created by
45272 +          Kermit, EMACS, and other applications. By default, backup files
45273 +          are included.
45274 +
45275 +   /NOFOLLOWLINKS
45276 +          (UNIX only) Skip over symbolic links rather than following them
45277 +          (default). This applies to wildcard and/or recursive [M]PUTs; if
45278 +          a single filename is given, and it happens to be a symbolic
45279 +          link, the file it points to is sent.
45280 +
45281 +   /FOLLOWLINKS
45282 +          (UNIX only) Always follow (resolve) symbolic links, even in
45283 +          wildcard or recursive [M]PUTs. Use with caution. Watch out for
45284 +          circular links, endless loops, etc.
45285 +
45286 +   /EXCEPT:pattern
45287 +          Exception list -- don't send files whose names match the given
45288 +          pattern. See [287]Section 1.5.4 of the [288]C-Kermit 7.0 Update
45289 +          Notes for details. If you want to exclude a directory from a
45290 +          recursive [M]PUT, use /EXCEPT:{dirname/*}.
45291 +
45292 +   /RECURSIVE
45293 +          Sends the desired files from the current (or given) directory,
45294 +          plus all directories beneath it, including empty directories,
45295 +          replicating the directory structure on the server. No special
45296 +          capabilities are required in the server, but of course your
45297 +          login ID on the server must have the appropriate access and
45298 +          permission to create directories. Recursive PUTs work not only
45299 +          between like platforms (e.g. UNIX to UNIX) but also between
45300 +          unlike ones (e.g. UNIX to VMS or Windows), in which case
45301 +          text-file format differences are handled by Kermit's automatic
45302 +          text/binary mode switching ([289]Section 4) and character-set
45303 +          translation ([290]Section 3.7). Synonym: /SUBDIRECTORIES.
45304 +
45305 +   /UPDATE
45306 +          Send only files that have changed since last time ([291]Section
45307 +          3.5.2).
45308 +
45309 +   /ARRAY:arrayname
45310 +          The "file" to be sent is an array, or a segment of one, rather
45311 +          than a real file. In this case the other selection switches
45312 +          don't apply. The array contents are sent in text mode, and each
45313 +          array element is treated as a line. Example:
45314 +
45315 +  ftp put /as-name:array.txt /array:&a
45316 +
45317 +          (or, to send a segment of the array, /array:&a[100:199]). If you
45318 +          don't include an /AS-NAME, a name of "_array_x_" is used (where
45319 +          x is the array letter). If you include this switch, most other
45320 +          switches are meaningless and ignored.
45321 +
45322 +   /COMMAND
45323 +          The "file" to be sent is the standard output of a command,
45324 +          rather than a real file. It is sent in text or binary mode
45325 +          according to the prevailing FTP TYPE, which can be overridden
45326 +          with a /TEXT or /BINARY switch. Example: Example:
45327 +
45328 +  ftp put /command /as-name:{userlist} {finger | sort -r}
45329 +
45330 +   /LISTFILE:filename
45331 +          Tells Kermit to obtain the list of files to be sent from the
45332 +          file whose name is given. This file must contain one file
45333 +          specification (which may be wild) per line. If the list includes
45334 +          files from different directories, such as a recursive listing of
45335 +          a directory tree, the paths are recreated on the server (if
45336 +          possible) if you include the /RECURSIVE switch; otherwise all
45337 +          the files are sent to the current directory on the server.
45338 +
45339 +   Now the other switches:
45340 +
45341 +   /AS-NAME:text
45342 +          If a single file is being sent, send it with the given text as
45343 +          its name. If multiple files are being sent, the text must be a
45344 +          template that includes variables such as \v(filename),
45345 +          \v(filenumber), \v(ntime), to allow dynamic creation of each
45346 +          name. The same applies to the as-name field of the FTP PUT
45347 +          command. If this switch is not included (and an as-name is not
45348 +          included as the second filename to PUT), each file is sent with
45349 +          its own name.
45350 +
45351 +   /BINARY
45352 +   /TEXT
45353 +   /TENEX
45354 +          Forces this upload to take place in the given mode, regardless
45355 +          of the current FTP TYPE setting, and without automatic
45356 +          text/binary switching. /ASCII is a synonym for /TEXT.
45357 +
45358 +   /FILTER:command
45359 +          Specifies that the file(s) is/are to be passed through the given
45360 +          command or pipeline on their way to the server. Example:
45361 +
45362 +  ftp put /binary /filter:{gzip -c \v(filename)} /as-name:\v(filename).gz *
45363 +
45364 +   /TRANSPARENT
45365 +   /LOCAL-CHARACTER-SET:name
45366 +   /SERVER-CHARACTER-SET:name
45367 +          Character-set translation for text files, explained in
45368 +          [292]Section 3.7.
45369 +
45370 +   /ERROR-ACTION:{PROCEED,QUIT}
45371 +          Overrides the prevailing [293]FTP ERROR-ACTION for the duration
45372 +          of this PUT or MPUT command only.
45373 +
45374 +   /RECOVER
45375 +          Resume an interrupted transfer where from the point of
45376 +          interruption (explained in [294]Section 3.5.2). Synonym:
45377 +          /RESTART.
45378 +
45379 +   /DELETE
45380 +          Tells Kermit to delete each source file immediately after, and
45381 +          only if, it has been uploaded completely and successfully. This,
45382 +          in effect, moves the file from the client to the server.
45383 +
45384 +   /MOVE-TO:directory
45385 +          Tells Kermit to move each source file to the named local
45386 +          directory after, and only if, it has been uploaded completely
45387 +          and successfully.
45388 +
45389 +   /RENAME-TO:template
45390 +          Tells Kermit to rename each (local) source file according to the
45391 +          given template after, and only if, it has been uploaded
45392 +          completely and successfully. The template works as in /AS-NAME.
45393 +
45394 +   /SERVER-RENAME-TO:template
45395 +          Tells Kermit to ask the server to rename each file according to
45396 +          the given template as soon as, and only if, it has been received
45397 +          completely and successfully. The template works as in /AS-NAME.
45398 +          Requires write and rename access on the server, so doesn't
45399 +          usually work with (e.g.) anonymous uploads to public incoming
45400 +          areas where the permissions don't allow renaming. Examples:
45401 +
45402 +        ftp mput /server-rename:\v(filename).ok *
45403 +                Appends ".ok" to each filename on the server when it's
45404 +                finished uploading.
45405 +
45406 +        ftp mput /as-name:\v(filename).tmp /server-rename:\v(filename) *
45407 +                This is the reverse of the previous example; it uses a
45408 +                temporary name while uploading is in progress and reverts
45409 +                the file to its real name when uploading is complete.
45410 +
45411 +        ftp mput /as-name:\v(filename)
45412 +                /server-rename:../final/\v(filename) *
45413 +                Moves the file from the working directory to a final
45414 +                directory when the upload is complete, but in this case
45415 +                you have to know the pathname syntax of the server. If the
45416 +                rename fails, the [M]PUT command fails according to the
45417 +                [295]FTP ERROR-ACTION selection.
45418 +
45419 +   /FILENAMES:{AUTOMATIC,CONVERTED,LITERAL}
45420 +          Overrides the [296]FTP FILENAMES setting for this upload only.
45421 +
45422 +   /PERMISSIONS:{ON,OFF}
45423 +          Overrides the [297]FTP PERMISSIONS setting for this upload only.
45424 +
45425 +   /UNIQUE
45426 +          Tells Kermit to tell the server to give [298]unique names to
45427 +          incoming files that would otherwise overwrite existing files
45428 +          that have the same name. This switch conflicts with /UPDATE,
45429 +          /RECOVER, /PERMISSIONS, and /SERVER-RENAME since the client has
45430 +          no way of knowing the name assigned by the server.
45431 +
45432 +   /QUIET
45433 +          Don't display file-transfer progress or statistics.
45434 +
45435 +   /SIMULATE
45436 +          Shows which files would be sent without actually sending them.
45437 +          Useful (for example) with /UPDATE (next section). The results
45438 +          are shown in the file-transfer display (if it is not disabled)
45439 +          and in the transaction log (if one is active). Hint: use SET
45440 +          TRANSFER DISPLAY BRIEF.
45441 +
45442 +3.5.2. Update Mode
45443 +
45444 +   When you include the /UPDATE switch, this means to skip sending any
45445 +   file that already exists on the server if the local file's modification
45446 +   date/time is not later than that of the corresponding file on the
45447 +   server. Here is a typical application for update mode: Suppose that on
45448 +   Computer A, you maintain a large set of files (say, a collection of Web
45449 +   pages and graphics images, or the source files for a software
45450 +   application), and you need to keep a parallel copy on another Computer,
45451 +   B. Of course you could upload the entire collection every day:
45452 +
45453 +  cd source-directory
45454 +  ftp computerb.xyzcorp.com
45455 +  ( authentication details... )
45456 +  ftp cd target-directory
45457 +  ftp put [ switches ] *
45458 +
45459 +   But if the total size is large or the network slow, this would be
45460 +   unnecessarily time-consuming. Worse, if other users or sites had to
45461 +   update whenever new files appeared in B's directory, this would cause
45462 +   them unnecessary work. By including the /UPDATE switch:
45463 +
45464 +  ftp put /update [ other-switches ] *
45465 +
45466 +   only those files that changed since last time are uploaded. Here's how
45467 +   it works. For each local file that is selected for uploading:
45468 +
45469 +     * The remote filename is determined in the normal way, according to
45470 +       the [299]FTP FILENAMES setting, /FILENAMES switch, or the as-name,
45471 +       if any.
45472 +     * Kermit sends an MDTM (modification time) command for the
45473 +       corresponding remote filename to the server.
45474 +     * If the server does not understand the MDTM command, the file is
45475 +       sent.
45476 +     * If the server can't find a file with the given name, the file is
45477 +       sent.
45478 +     * If the local file's modification time is later than that of the
45479 +       remote file, the file is sent.
45480 +     * Otherwise -- the remote file exists but its modification time is
45481 +       equal to or earlier than that of the local file -- the file is
45482 +       skipped.
45483 +
45484 +   All time comparisons take place in Coordinated Universal Time
45485 +   (UTC)([300]1), also known as GMT or Zulu time: Timezone 0; standard
45486 +   time, without daylight savings.
45487 +
45488 +     WARNING: Some FTP servers, such as Novell NWFTPD.NLM, ignore or
45489 +     misimplement the FTP specification and send local time rather than
45490 +     UTC.
45491 +
45492 +   Update mode is useful only when always used in the same direction. When
45493 +   you upload (PUT) a file with FTP, the destination file receives the
45494 +   current timestamp on the server's computer, not the original file's
45495 +   timestamp ([301]2). If you try to FTP PUT /UPDATE the same file again,
45496 +   it will be skipped (as expected) since the remote copy is newer.
45497 +   However, if you try to FTP GET /UPDATE the same file ([302]Section
45498 +   3.6), it will be transferred for the same reason.
45499 +
45500 +   To check the availability of PUT /UPDATE on a particular connection,
45501 +   issue an FTP MODTIME command for a file that is known to exist on the
45502 +   server. If it succeeds, PUT /UPDATE should work and in that case, you
45503 +   can run a procedure like the one above every day: the first time, it
45504 +   sends all the files; after that, it sends only the ones that changed.
45505 +   If a transaction log is active, a notation is included for any files
45506 +   that are skipped.
45507 +
45508 +   Notes:
45509 +    1. Why is Coordinated Universal Time abbreviated UTC? From the
45510 +       [303]National Institute of Standards and Technology FAQ: "In 1970
45511 +       the Coordinated Universal Time system was devised by an
45512 +       international advisory group of technical experts within the
45513 +       International Telecommunication Union (ITU). The ITU felt it was
45514 +       best to designate a single abbreviation for use in all languages in
45515 +       order to minimize confusion. Since unanimous agreement could not be
45516 +       achieved on using either the English word order, CUT, or the French
45517 +       word order, TUC, the acronym UTC was chosen as a compromise."
45518 +    2. The Kermit FTP client is unusual in that, when downloading only, it
45519 +       can set the received file's date from the file's date on the
45520 +       server, but this should not affect the update feature. When
45521 +       uploading to an FTP server, however, there is no mechanism for the
45522 +       client to set the date of the uploaded file on the server.
45523 +
45524 +3.5.3 Recovery
45525 +
45526 +   Suppose that while you are uploading a large file over a slow
45527 +   connection, the connection is lost before the entire file is
45528 +   transferred. With most FTP clients, you would have to start over, thus
45529 +   resending the portion of the file that was sent already, and that is
45530 +   already on the server. But Kermit's /RECOVER switch (Synonym: /RESTART)
45531 +   lets you continue an interrupted transfer from the point of failure,
45532 +   thus transferring only the part that wasn't sent already. The
45533 +   prerequisites for recovery are:
45534 +
45535 +     * The transfer must be in BINARY mode, or else the client and server
45536 +       must reside on like systems (e.g. both on some form of UNIX).
45537 +     * The FTP server must support the SIZE command.
45538 +
45539 +   Here's how it works. When you include the /RECOVER switch:
45540 +
45541 +     * Kermit checks for conflicting switches, such as /UPDATE and
45542 +       /UNIQUE; if /RECOVER is given with these switches an error occurs.
45543 +       If /RECOVER is given in other circumstances where it could serve no
45544 +       useful purpose (e.g. with arrays, pipes, or filters), it is
45545 +       ignored.
45546 +
45547 +   If the switch is accepted, then for each selected file:
45548 +
45549 +     * If it is not binary (determined by scanning) and the client and
45550 +       server are not on like platforms, recovery is canceled (the entire
45551 +       file is sent). Otherwise:
45552 +     * A SIZE command is sent for the file (using its remote name). If the
45553 +       reply indicates the file was not found, or the SIZE command was not
45554 +       understood, or any other kind of error, recovery is canceled.
45555 +       Otherwise:
45556 +     * A MDTM (modification time) command is sent for the file. If a valid
45557 +       reply is received, and the modification time of the local file is
45558 +       later than that of the remote file, recovery is canceled.
45559 +       Otherwise:
45560 +     * If the sizes of the two files are identical, the file is not sent.
45561 +       Otherwise:
45562 +     * Kermit seeks to the recovery spot in the local file, tells the
45563 +       server to APPEND the data which is about to arrive to the remote
45564 +       file, and then sends the data starting at the recovery point.
45565 +
45566 +   To safeguard file integrity, recovery is not attempted unless all the
45567 +   preconditions are met. For the widest possible usefulness, APPEND is
45568 +   used rather than RESTART. For stream transfers (the only kind that
45569 +   Kermit supports) the results are the same.
45570 +
45571 +   By design, the /RECOVER switch can be included with any FTP PUT or MPUT
45572 +   command, even if it specifies a group of files. This allows you to
45573 +   resume an interrupted batch transfer from where it left off. The files
45574 +   that were already completely sent are skipped, the file that was
45575 +   interrupted is recovered, and the remaining files are uploaded.
45576 +
45577 +   By the way, it doesn't matter how the original partial file was
45578 +   uploaded -- FTP, Kermit, Zmodem, etc: as long as the preconditions are
45579 +   met, it can be recovered with FTP PUT /RECOVER, or for that matter also
45580 +   using Kermit protocol and SEND /RECOVER.
45581 +
45582 +   A word of caution, however, when the original upload was in text mode
45583 +   with character-set translation ([304]Section 3.7):
45584 +
45585 +     * If the original upload involved a translation from one single-byte
45586 +       character set to another (e.g. Code Page 850 to Latin-1), recovery
45587 +       is safe if you specify the same translations for the recovery. If
45588 +       you don't, the resulting file will contain a mixture of character
45589 +       sets.
45590 +     * If the original upload involved a translation that changed the size
45591 +       of the file (e.g. from an alphabetic Code Page or Latin Alphabet to
45592 +       Unicode, or vice versa), recovery is NOT safe, even if you specify
45593 +       the same translations.
45594 +
45595 +   Kermit has no way of knowing anything about the previous upload. As a
45596 +   safeguard, an error occurs if you include /RECOVER and also specify a
45597 +   character-set of UCS2 or UTF8, since recovery can't possibly work in
45598 +   that situation. Otherwise, it's up to you to avoid unsafe recovery
45599 +   operations.
45600 +
45601 +   [ [305]Top ] [ [306]FTP Top ] [ [307]C-Kermit Home ] [ [308]Kermit Home
45602 +   ]
45603 +
45604 +3.6. Downloading Files With FTP
45605 +
45606 +   Although uploading files with Kermit's FTP client is just as easy and
45607 +   flexible as sending files with Kermit protocol, the same is not always
45608 +   true for downloading because FTP servers lack some of the capabilities
45609 +   of a Kermit server:
45610 +
45611 +     * If you want to get more than one file, you have to use MGET, not
45612 +       GET, since the underlying FTP protocol is different in the two
45613 +       cases. Kermit can't "autodetect" which one you mean, as it can with
45614 +       PUT and MPUT, since it can't be expected to know the wildcard
45615 +       syntax of the remote platform and/or FTP server (the same is true
45616 +       for all other FTP clients). To complicate matters, FTP protocol now
45617 +       includes two underlying mechanisms (NLST and MLSD) for
45618 +       accomplishing MGET operations and, as explained in [309]Section
45619 +       3.11, the two behave differently.
45620 +     * Automatic text-binary mode switching is not done by the server. It
45621 +       can be done by the client (Kermit), but in this case it is not
45622 +       based on a file scan (since there is no way for Kermit prescan a
45623 +       server file), but rather on the filename, using C-Kermit 7.0
45624 +       [310]filename patterns.
45625 +     * Some options that are available with FTP PUT can not be used with
45626 +       FTP [M]GET or don't work the same way:
45627 +         /PERMISSIONS (FTP protocol has no mechanism for this).
45628 +         /[NOT-]BEFORE, /[NOT-]AFTER (because of the timezone problem).
45629 +         /RECOVER works only in binary mode.   /RECURSIVE has limited
45630 +       utility.
45631 +
45632 +   The commands for downloading are:
45633 +
45634 +   SET FILE DOWNLOAD-DIRECTORY [ directory ]
45635 +          As with Kermit transfers, this command, if given, tells C-Kermit
45636 +          where to store incoming files in the absence of a specific
45637 +          as-name. If not given, incoming files are stored as indicated by
45638 +          the as-name, if any, otherwise in the current directory, just as
45639 +          with Kermit transfers. The more verbose transfer display formats
45640 +          give the full pathname of each received file, and, in case you
45641 +          have trouble finding a downloaded file afterwards, its full path
45642 +          is also listed in the transaction log (if you kept one), and you
45643 +          can also ask Kermit where it went with the [311]WHERE command.
45644 +
45645 +   SET FTP GET-FILETYPE-SWITCHING { ON, OFF }
45646 +          ON by default, causing Kermit to switch automatically into text
45647 +          or binary mode for each file based on whether its name matches a
45648 +          text pattern or binary pattern. Set this OFF, or use a /TEXT,
45649 +          /BINARY, or /TENEX switch to defeat this feature. Use SHOW
45650 +          PATTERNS to see the current pattern list.
45651 +
45652 +   [ FTP ] GET [ switches ] filename [ as-name ]
45653 +          Asks the server to send the given file, and if it comes, stores
45654 +          it locally under the given as-name, if any, otherwise under its
45655 +          original name (modified according to the selected filename
45656 +          conversion option), in your download directory, if you have
45657 +          specified one, otherwise in the directory indicated in the
45658 +          as-name, if any, otherwise in your current directory. If you
45659 +          accidentally use a wildcard in the filename ("get *.txt") the
45660 +          server will reply with a message like "File not found" (unless
45661 +          there is a file whose name actually is "*.txt"). If FTP
45662 +          GET-FILETYPE-SWITCHING is ON, and in the absence of any GET
45663 +          switches to override it, the file is transferred in binary mode
45664 +          if it matches any of Kermit's binary name patterns, and in text
45665 +          mode if it matches any of Kermit's text name patterns, and in
45666 +          the prevailing FTP TYPE if it matches none of these patterns.
45667 +
45668 +   [ FTP ] MGET [ switches ] filespec [ filespec [ filespec [ ... ] ] ]
45669 +          Like GET, but for multiple files. One or more file
45670 +          specifications can be given, and any or all (or none) of them
45671 +          can contain wildcards or can be directory names. The file list
45672 +          may not include an as-name, but you can still give one with the
45673 +          /AS-NAME: switch.
45674 +
45675 +   In both the FTP GET and MGET commands, any filenames that contain
45676 +   spaces must be enclosed in braces or doublequotes (see [312]Section 5
45677 +   for details).
45678 +
45679 +   FTP downloads may be interrupted just like Kermit transfers. While the
45680 +   transfer is in progress, type:
45681 +
45682 +     * X to interrupt the current file and go on to the next file.
45683 +     * Z (or Control-C) to cancel the current file and all remaining
45684 +       files.
45685 +
45686 +   Before proceeding, a brief word about temporary files. In FTP protocol,
45687 +   the MGET command works by requesting a file list from the server, and
45688 +   then (internally) issuing a GET command (FTP RETR protocol directive)
45689 +   for each file. The file list returned by the server can be any size at
45690 +   all, so in case it is huge, we don't store it in memory; instead we put
45691 +   it in a temporary file. For troubleshooting purposes, you should be
45692 +   aware of two points:
45693 +
45694 +    1. The location of the temporary file is chosen according the TMP or
45695 +       TEMP environment variables. If neither of these variables is
45696 +       defined, you might need to define it. In case there is not enough
45697 +       space on the indicated disk or partition for the server's file
45698 +       list, you might need to either clean up the temporary area, or
45699 +       redefine the environment variable to indicate a different area that
45700 +       has sufficient space.
45701 +    2. If you want to look at the list yourself, use SET FTP DEBUG ON.
45702 +       This tells Kermit to (a) give you the full pathname of the
45703 +       temporary file at the end of each MGET command, and (b) not to
45704 +       delete it, as it normally does.
45705 +
45706 +3.6.1. FTP GET Switches
45707 +
45708 +   The following switches are available with FTP GET and MGET:
45709 +
45710 +   /TEXT
45711 +          Specifies a text-mode transfer. Overrides the global FTP TYPE
45712 +          setting and filename pattern-matching for the duration of the
45713 +          current command only, All files are downloaded in text mode.
45714 +          Synonym: /ASCII.
45715 +
45716 +   /BINARY
45717 +          Specifies a binary-mode transfer. Overrides the global FTP TYPE
45718 +          setting and filename pattern-matching for the duration of the
45719 +          current command only. All files are downloaded in binary mode.
45720 +
45721 +   /TENEX
45722 +          Like /BINARY but specifies a special binary transfer mode to be
45723 +          used when getting 8-bit binary files from a 36-bit platform such
45724 +          as TOPS-10, TOPS-20, or TENEX. All files are downloaded in the
45725 +          special binary mode.
45726 +
45727 +   /RECOVER
45728 +          This instructs Kermit to try to recover an incomplete download
45729 +          from the point of failure. Works only in binary mode, and only
45730 +          if the server supports the (not-yet-standard) FTP "REST"
45731 +          directive. See [313]Section 3.6.3 for details. Synonym:
45732 +          /RESTART.
45733 +
45734 +   /FILENAMES:{CONVERTED,LITERAL}
45735 +          Overrides the [314]FTP FILENAMES (filename conversion) setting
45736 +          for this download only, forcing incoming filenames to be either
45737 +          converted or taken literally.
45738 +
45739 +   /AS-NAME:text
45740 +          For GET, this is equivalent to giving an as-name after the
45741 +          filename. For MGET, this is the only way to specify alternative
45742 +          names for the incoming files. With MGET, the /AS-NAME text
45743 +          should (must) contain a Kermit variable, usually \v(filename) or
45744 +          \v(filenumber). Example:
45745 +
45746 +  mget /text /as-name:\v(filename).new *.c
45747 +
45748 +          This gets all ".c" files and stores them with "
45749 +
45750 +          .new" appended to their names. See the [315]C-Kermit 7.0 Update
45751 +          Notes for details.
45752 +
45753 +   /COMMAND
45754 +          This specifies that the incoming file is to be written to the
45755 +          standard input of a command, rather than to a file. The command
45756 +          name is the as-name from the GET command or the /AS-NAME
45757 +          argument. If you need to refer to the incoming file's name in
45758 +          the command, use \v(filename). See the description of the
45759 +          regular Kermit [316]GET /COMMAND command for details and
45760 +          examples.
45761 +
45762 +   /QUIET
45763 +          Transfers the files quietly; don't put up a file-transfer
45764 +          display.
45765 +
45766 +   /ERROR-ACTION:{QUIT,PROCEED}
45767 +          This switch affects only MGET. If an error occurs with a
45768 +          particular file, this tells whether to go on to the next file
45769 +          (PROCEED) or to stop right away and fail (QUIT). The default is
45770 +          PROCEED.
45771 +
45772 +   The file selection switches are:
45773 +
45774 +   /EXCEPT:{pattern} or /EXCEPT:{{pattern}{pattern}{...}}
45775 +          Exception list for MGET; skip downloading any file whose name
45776 +          matches any of the given patterns (when using the second format,
45777 +          up to 64 patterns may be specified). [317]CLICK HERE for syntax
45778 +          details.
45779 +
45780 +   /SMALLER-THAN:number
45781 +          Download only files whose size is smaller than the given number
45782 +          of bytes (octets). Requires that the FTP server support the SIZE
45783 +          or MLSD directive.
45784 +
45785 +   /LARGER-THAN:number
45786 +          Download only files whose size is greater than the given number
45787 +          of bytes. Requires that the FTP server support the SIZE or MLSD
45788 +          directive.
45789 +
45790 +   /NOBACKUPFILES
45791 +          During MGET, don't download any files whose names end with
45792 +          backup suffixes (.~n~ where n is a number).
45793 +
45794 +   /NODOTFILES
45795 +          During MGET, don't download any files whose names begin with
45796 +          period (.). Equivalent to /EXCEPT:{.*}.
45797 +
45798 +   /LISTFILE:local-filename
45799 +          The given file contains a list of files to GET, one per line.
45800 +          Filenames in the listfile can contain wildcard characters in the
45801 +          syntax of the server. There is no limit on the number of lines
45802 +          in the listfile.
45803 +
45804 +   /NAMELIST:local-filename
45805 +          If this switch is given, then instead of actually retrieving the
45806 +          selected files, the GET command retrieves a list of the names of
45807 +          the files that would be retrieved, and places it in the
45808 +          specified file. The resulting file is an ordinary text file,
45809 +          with one filename per line, suitable for reading by a person, or
45810 +          processing by a computer program, including Kermit itself (FOPEN
45811 +          / FREAD / FWRITE / FCLOSE), and as /FILELIST: file. If the
45812 +          filename is omitted or given as "-" (dash, hyphen), the list
45813 +          goes to the screen. NOTE: if you want a copy of the complete
45814 +          list sent by the server, use SET FTP DEBUG ON, perform an MGET,
45815 +          and the temporary file containing the list will be kept rather
45816 +          than deleted (and Kermit tells you its name).
45817 +
45818 +   /UPDATE, /COLLISION:keyword
45819 +          Explained in [318]Section 3.6.2.
45820 +
45821 +   /RECURSIVE
45822 +          This means to try to download an entire directory tree, rather
45823 +          than just files from a particular directory. In fact, FTP
45824 +          protocol does not provide a method to request a recursive
45825 +          download (unless the server supports MLSD; see [319]Section
45826 +          3.11), so this works only if the FTP server does it anyway,
45827 +          without being asked, as some do. In this case, Kermit detects
45828 +          that names in the returned file list contain directory
45829 +          separators, and therefore attempts to create the needed
45830 +          directories as the files arrive. But this can work only if the
45831 +          server is on the same kind of platform as the client, so the
45832 +          pathname syntax can be recognized, and also because the server
45833 +          does not switch between text and binary mode, which would be
45834 +          vital for cross-platform transfers. Use with caution. Synonym:
45835 +          /SUBDIRECTORIES.
45836 +
45837 +          Even when the server does not provide recursive file lists,
45838 +          [M]GET /RECURSIVE forces Kermit to replicate any directory
45839 +          structure implied or expressed by the server's file list. For
45840 +          example:
45841 +
45842 +  get somepath/somefile
45843 +
45844 +          Gets the file named somefile from the server's somepath
45845 +          directory and puts it Kermit's current (or download) directory,
45846 +          whereas:
45847 +
45848 +  get /recursive somepath/somefile
45849 +
45850 +          creates the path locally and then puts the file in it. Similarly
45851 +          for MGET:
45852 +
45853 +  mget */data/*
45854 +
45855 +          downloads all the files in all the data subdirectories of all
45856 +          the subdirectories of the server's current directory and stores
45857 +          them locally in Kermit's current (or download) directory,
45858 +          whereas:
45859 +
45860 +  mget /recursive */data/*
45861 +
45862 +          re-creates the server's directory structure locally.
45863 +
45864 +   The FTP protocol does not include explicit mechanisms for recursion, so
45865 +   Kermit builds upon what is available. Although an Internet draft
45866 +   describes a mechanism ("MLSD") that would allow protocol-driven
45867 +   recursion, similar to Kermit's File Attribute packets (circa 1984), it
45868 +   has not yet attained RFC or standard status, and servers are not yet
45869 +   widely available that offer this feature. In the meantime, the
45870 +   effectiveness of MGET /RECURSIVE depends on the FTP server
45871 +   implementation. If the server returns a recursive list in response to
45872 +   the standard NLST command (whose behavior is ill-defined), Kermit's FTP
45873 +   MGET /RECURSIVE command uses it to re-create the remote directory tree
45874 +   locally. If the server supports MLSD, C-Kermit 8.0.206 and Kermit 95
45875 +   2.1 and later are able to sense it automatically and use it, as
45876 +   described below in [320]Section 3.11.
45877 +
45878 +   The /BEFORE:, /AFTER:, /NOT-BEFORE:, and /NOT-AFTER: switches are not
45879 +   available for downloading because of the confusion with timezones.
45880 +   Would the given times be in the local timezone, the server's timezone,
45881 +   or GMT? The FTP server's directory listings show its own local times
45882 +   but since we don't know what timezone the server is in, there's no way
45883 +   to reconcile our local times with the server's. Similarly, /PERMISSIONS
45884 +   can't be preserved in downloads because FTP protocol provides no means
45885 +   of querying the server for a file's permission.
45886 +
45887 +   Source-file disposition switches:
45888 +
45889 +   /DELETE
45890 +          Each file that is downloaded successfully is to be deleted from
45891 +          the server. Requires the appropriate file access rights on the
45892 +          server.
45893 +
45894 +   /SERVER-RENAME-TO:template
45895 +          Asks the server to rename each (remote) source file immediately
45896 +          after, and only if, it is sent correctly. See [321]PUT
45897 +          /SERVER-RENAME-TO: for details.
45898 +
45899 +   Destination-file disposition switches:
45900 +
45901 +   /TO-SCREEN
45902 +          Displays the incoming file on the screen rather than storing it
45903 +          on disk. If this switch is given, the /RENAME-TO and /MOVE-TO
45904 +          switches are ignored, the file-transfer display is suppressed,
45905 +          and the given file(s) is/are shown on the screen. Can be used
45906 +          with /FILTER, e.g.
45907 +
45908 +  get /text /to-screen /filter:more oofa.txt
45909 +
45910 +          In fact, you should always use /TO-SCREEN with /FILTER or
45911 +          /COMMAND when the command would result in displaying the
45912 +          incoming file on the screen; otherwise C-Kermit would have no
45913 +          way of knowing to suppress its file transfer display (since it
45914 +          can't be expected to know what the command or filter does).
45915 +
45916 +   /RENAME-TO:template
45917 +          Each file that is downloaded is to be renamed as indicated if
45918 +          and only if it was received completely and without error. The
45919 +          template can be literal text or can contain variables that are
45920 +          evaluated for each file. For MGET, the text must contain
45921 +          variables; for GET it can be a literal string. The \v(filename)
45922 +          variable contains the name of the current file, so:
45923 +
45924 +  ftp mget /rename-to:\v(filename).ok *
45925 +
45926 +          causes each file that is successfully downloaded to have ".ok"
45927 +          appended to its name. For details see [322]Section 4.1 of the
45928 +          [323]C-Kermit 7.0 Update Notes.
45929 +
45930 +   /MOVE-TO:text
45931 +          Just like /RENAME-TO:, except the text denotes the name of a
45932 +          directory to which successfully downloaded files are to be
45933 +          moved. If the directory does not exist, it is created.
45934 +
45935 +   The file transfer display does not show the /MOVE-TO or /RENAME-TO
45936 +   value, since the incoming file has not yet been moved or renamed.
45937 +
45938 +3.6.2. Filename Collisions
45939 +
45940 +   What should happen if an incoming file has the same name as an existing
45941 +   file in the same directory? By default, Kermit's FILE COLLISION setting
45942 +   applies: BACKUP, RENAME, UPDATE, DISCARD, etc, as described in
45943 +   [324]Using C-Kermit. Kermit's default FILE COLLISION setting is BACKUP
45944 +   (rename the existing file and store the incoming file under its own
45945 +   name) and therefore this is also the default FTP collision action.
45946 +
45947 +   The name under which an incoming file is to be stored is determined as
45948 +   follows:
45949 +
45950 +     * If an as-name was given, the as-name is used. Otherwise:
45951 +     * If the client and server platforms are alike or [325]FTP FILENAMES
45952 +       is set to LITERAL (or the /FILENAMES:LITERAL switch was given for
45953 +       this download), the incoming filename is used literally. Otherwise:
45954 +     * The incoming filename is converted to a form that is friendly to
45955 +       the local platform. For UNIX, for example, incoming filenames that
45956 +       are all uppercase (as they might be from, say, VMS or an IBM
45957 +       mainframe) are converted to lowercase.
45958 +
45959 +   If the resulting name coincides with the name of a local file that
45960 +   already exists, we have a filename collision. Collisions are handled
45961 +   according to the currently selected collision action:
45962 +
45963 +   SET FTP COLLISION { BACKUP, RENAME, UPDATE, DISCARD, APPEND, OVERWRITE
45964 +          }
45965 +          This establishes a filename collision for FTP, separate from the
45966 +          Kermit one. The initial FTP collision setting is inherited from
45967 +          Kermit's FILE COLLISION setting when the first FTP command is
45968 +          given, but subsequent changes to Kermit's FILE COLLISION setting
45969 +          do not affect the FTP COLLISION setting. SHOW FTP tells the
45970 +          current FTP COLLISION setting.
45971 +
45972 +   FTP GET /COLLISION:{BACKUP,RENAME,UPDATE,DISCARD,APPEND,OVERWRITE}
45973 +          Overrides the current FTP COLLISION action for this download
45974 +          only.
45975 +
45976 +   FTP GET /UPDATE
45977 +          This is equivalent to GET /COLLISION:UPDATE, and is included for
45978 +          symmetry with PUT /UPDATE
45979 +
45980 +   FTP GET /UPDATE and /COLLISION:UPDATE mean to download only those files
45981 +   whose modification dates on the server are later than those on the
45982 +   client. Date-time comparisons are done in Coordinated Universal Time
45983 +   (UTC, GMT, ZULU). The command:
45984 +
45985 +     FTP MGET /COLLISION:APPEND /AS-NAME:newfilename *.*
45986 +
45987 +   Downloads all matching remote files into a single local file (in
45988 +   whatever order the server sends them).
45989 +
45990 +3.6.3. Recovery
45991 +
45992 +   Recovery is available for downloads too, but there are some differences
45993 +   from the uploading case described in [326]Section 3.5.3:
45994 +
45995 +     * The transfer must be in BINARY mode. It can not be in text mode,
45996 +       even if the FTP server is on the same kind of platform as Kermit,
45997 +       and even if there is no character-set translation. The original
45998 +       download must also have been in binary mode.
45999 +     * The FTP server must support the REST ("restart") directive.
46000 +       Unfortunately, this is not a standard command; at this writing, it
46001 +       is described only in an Internet Draft, not an RFC or Internet
46002 +       Standard, but nevertheless it is found in several popular FTP
46003 +       servers, such as [327]ProFTPD.
46004 +
46005 +   Here's how download recovery works:
46006 +
46007 +     * Kermit checks for conflicting switches, such as /UPDATE, /COMMAND,
46008 +       or /FILTER. If /RECOVER is given with these switches an error
46009 +       occurs.
46010 +     * The prevailing transfer mode (SET FTP TYPE) must be BINARY. If it
46011 +       is not, the /BINARY switch must have been included with the FTP
46012 +       [M]GET command.
46013 +
46014 +   If the /RECOVER switch is accepted, then for each selected file:
46015 +
46016 +     * A SIZE command is sent for the file (using its remote name). If the
46017 +       reply indicates the file was not found, or the SIZE command was not
46018 +       understood, or any other kind of error, recovery is canceled (i.e.
46019 +       the entire file is downloaded).
46020 +     * If the sizes of the two files are identical, the file is not sent.
46021 +       Otherwise:
46022 +     * Kermit sends the REST directive to the server, indicating the size
46023 +       of the local file. If the server responds affirmatively, Kermit
46024 +       opens the local file in append mode and appends the incoming data
46025 +       to it. Otherwise, recovery is canceled and the entire file is
46026 +       downloaded.
46027 +
46028 +   The /RECOVER switch can be included with any FTP GET or MGET command,
46029 +   even if it specifies a group of files. This lets you resume an
46030 +   interrupted batch transfer from where it left off. The files that were
46031 +   already completely sent are skipped, the file that was interrupted is
46032 +   recovered, and the remaining files are uploaded. BUT... unlike with
46033 +   uploading, where this can be done with any mixture of text and binary
46034 +   files, when downloading, it can only be done if all the files are
46035 +   binary.
46036 +
46037 +   It doesn't matter how the original partial file was downloaded -- FTP,
46038 +   Kermit, HTTP, Zmodem, etc: as long as the preconditions are met, it can
46039 +   be recovered with FTP [M]GET /RECOVER, or for that matter also with GET
46040 +   /RECOVER (using Kermit protocol).
46041 +
46042 +   [ [328]Top ] [ [329]FTP Top ] [ [330]C-Kermit Home ] [ [331]Kermit Home
46043 +   ]
46044 +
46045 +3.7. Translating Character Sets
46046 +
46047 +   A possibly unique feature of Kermit's FTP client is its ability to
46048 +   convert character sets when transferring files in text mode,
46049 +   independent of the capabilites of the FTP server, as well as to
46050 +   translate the character sets of filenames regardless of transfer mode.
46051 +   For compatibility with existing FTP clients, and because there is a
46052 +   certain performance penalty, Kermit won't do this unless you ask for
46053 +   it. If you enable this feature, you need to inform Kermit of the
46054 +   character set (to be) used on the server and in some cases (explained
46055 +   below) also the local file character set. This discussion assumes you
46056 +   know a bit about character sets (as you must if you have to use them);
46057 +   see Chapter 16 of [332]Using C-Kermit for a detailed treatment. The
46058 +   Kermit commands for FTP character-set conversion are:
46059 +
46060 +   SET FTP CHARACTER-SET-TRANSLATION { ON, OFF }
46061 +          Whether to translate character sets when transferring text files
46062 +          with FTP. OFF by default. Set this to ON to enable character-set
46063 +          translation for subsequent FTP uploads and downloads.
46064 +
46065 +   SET FTP SERVER-CHARACTER-SET [333]name
46066 +          Text character set (to be) used by the server. Most FTP servers
46067 +          are ignorant of character sets, so all translations are done
46068 +          unilaterally by Kermit's FTP client. This means that when
46069 +          downloading files, you must know in advance the character-set
46070 +          used in the files you are downloading (and in their names). When
46071 +          uploading, you must specify the character-set to which local
46072 +          filenames and text-file contents are to be translated for
46073 +          transmission to the server. If you SET FTP
46074 +          CHARACTER-SET-TRANSLATION ON but do not specify an FTP
46075 +          SERVER-CHARACTER-SET, [334]UTF8 is used, since this is the new
46076 +          Internet standard international character set; it is upwards
46077 +          compatible with ASCII and it encompasses most written languages
46078 +          and therefore does not favor any particular group of people, as
46079 +          any other default would do. If you SET FTP SERVER-CHARACTER-SET
46080 +          to something (anything) when FTP CHARACTER-SET TRANSLATION is
46081 +          OFF, this also sets the latter ON.
46082 +
46083 +   SET FILE CHARACTER-SET [335]name
46084 +          This is the regular Kermit (non-FTP-specific) command for
46085 +          identifying the character set (to be) used in local text files
46086 +          and filenames.
46087 +
46088 +   TO REITERATE: If you SET FTP CHARACTER-SET TRANSLATION ON but do not
46089 +   specify an FTP SERVER-CHARACTER-SET, outbound text files are converted
46090 +   to UTF-8 and inbound text files are assumed to be UTF-8. If this is not
46091 +   appropriate, be sure to also specify the desired FTP
46092 +   SERVER-CHARACTER-SET.
46093 +
46094 +   You can use "special" (non-ASCII) characters in filenames in all the
46095 +   client / server file management commands (FTP MKDIR, RMDIR, DIRECTORY,
46096 +   VDIRECTORY, DELETE, etc), and also in file-transfer commands. When
46097 +   giving commands such as FTP DIR (RDIR) and FTP PWD (RPWD), the reply is
46098 +   translated too, so you can read it. In this example, the client and
46099 +   server use entirely different codes to represent the special characters
46100 +   of German:
46101 +
46102 +  C-Kermit> ftp xyzcorp.de /anonymous
46103 +  C-Kermit> set ftp server-character-set latin1
46104 +  C-Kermit> set file character-set german
46105 +  C-Kermit> rcd Städte
46106 +  C-Kermit> rpwd
46107 +  "/pub/ftp/Städte is current directory"
46108 +  C-Kermit> rdir
46109 +  -rw-rw----  1 olaf     54018 Jan  6 17:58 Adenbüttel.txt
46110 +  -rw-rw----  1 ursula     373 Jan  5 15:19 Aßlar.txt
46111 +  -rw-rw----  1 gisbert    482 Jan  5 15:20 Blowatz.txt
46112 +  -rw-rw----  1 gudrun     124 Jan  5 15:19 Böblingen.txt
46113 +  -rw-rw----  1 olga     14348 Jan  7 14:23 Köln.txt
46114 +
46115 +   When the client and server file systems use different character sets,
46116 +   you should take care to use only those characters that the two sets
46117 +   share in common when creating filenames or text-file contents. For
46118 +   example, PC code pages contain a lot line- and box-drawing characters,
46119 +   and sometimes "smart quotes", etc, that are not found in ISO standard
46120 +   8-bit character sets. You should be especially careful to avoid using
46121 +   such characters in filenames.
46122 +
46123 +   [ [336]C-Kermit Character Sets ]
46124 +
46125 +3.7.1. Character Sets and Uploading
46126 +
46127 +   Kermit's PUT and MPUT commands include full file-scanning capabilities,
46128 +   as described in [337]Section 4. Thus if FTP CHARACTER-SET-TRANSLATION
46129 +   is ON and your character-set associations are set up appropriately,
46130 +   Kermit automatically switches on a per-file basis between text and
46131 +   binary mode, and for each text file between your chosen 7-bit text
46132 +   character set (e.g. ASCII or ISO 646 German), 8-bit text (e.g. Latin-1
46133 +   or Japanese EUC), UCS-2, and UTF-8, and converts each of these
46134 +   automatically to the server character-set, and furthermore
46135 +   automatically differentiates between the Little and Big Endian forms of
46136 +   UCS-2, always sending in Big Endian form.
46137 +
46138 +     WARNING: It is not advisable to use UCS-2 (or any Unicode
46139 +     transformation other than UTF-8) "on the wire", i.e. as a server
46140 +     character set. Most FTP servers are not able to cope with it, since
46141 +     it contains lots of 0 (NUL) characters. If you do use it, Kermit
46142 +     does not translate filenames to or from UCS-2, for reasons well
46143 +     known to C programmers (for example, UNIX APIs assume filename
46144 +     strings are NUL-terminated). [338]UTF-8 is the preferred (and
46145 +     standard) Unicode format for the Internet.
46146 +
46147 +   FTP character-set translations differ from the regular Kermit ones by
46148 +   not restricting translations to a file-character-set /
46149 +   transfer-character-set pair. You can have Kermit's FTP client translate
46150 +   between any pair of character sets it knows about. You can see the list
46151 +   of supported character sets by typing either of the following:
46152 +
46153 +  set ftp server-character-set ?
46154 +  set file character-set ?
46155 +
46156 +   A typical list looks like this ([339]CLICK HERE for an explanation of
46157 +   the names):
46158 +
46159 +  C-Kermit>set file char ? One of the following:
46160 +   ascii            cp869-greek       hebrew-7         mazovia-pc
46161 +   british          cyrillic-iso      hebrew-iso       next-multinational
46162 +   bulgaria-pc      danish            hp-roman8        norwegian
46163 +   canadian-french  dec-kanji         hungarian        portuguese
46164 +   cp1250           dec-multinational iso2022jp-kanji  shift-jis-kanji
46165 +   cp1251-cyrillic  dg-international  italian          short-koi
46166 +   cp1252           dutch             jis7-kanji       spanish
46167 +   cp437            elot927-greek     koi8             swedish
46168 +   cp850            elot928-greek     koi8r            swiss
46169 +   cp852            euc-jp            koi8u            ucs2
46170 +   cp855-cyrillic   finnish           latin1-iso       utf8
46171 +   cp858            french            latin2-iso
46172 +   cp862-hebrew     german            latin9-iso
46173 +   cp866-cyrillic   greek-iso         macintosh-latin
46174 +  C-Kermit>
46175 +
46176 +   Thus you can translate not only between private sets (like PC code
46177 +   pages) and standard ones (like Latin-1) as in Kermit protocol, but also
46178 +   between any given pair of private sets (e.g. CP852 and Mazovia). All
46179 +   conversions go through Unicode as the intermediate character set,
46180 +   resulting in a minimum of character loss, since Unicode is a superset
46181 +   of all other character sets known to Kermit.
46182 +
46183 +   In addition to the SET commands listed above, the FTP PUT and MPUT
46184 +   commands include switches that apply only to the current command:
46185 +
46186 +   /LOCAL-CHARACTER-SET:name
46187 +   /SERVER-CHARACTER-SET:name
46188 +          Use these switches to force a particular translation. These
46189 +          switches override the global FTP CHARACTER-SET-TRANSLATION and
46190 +          SERVER-CHARACTER-SET settings and also character-set
46191 +          differentiation by file scanning for the duration of the PUT or
46192 +          MPUT command. The file scan is still performed, however, to
46193 +          determine whether the file is text or binary; thus these
46194 +          switches do not affect binary files unless you also include the
46195 +          /TEXT switch to force all files to be treated as text.
46196 +
46197 +   In other words, if you include one or both of these switches with a PUT
46198 +   or MPUT command, they are used. Similarly, the /TRANSPARENT switch
46199 +   disables character-set translation for the PUT or MPUT command despite
46200 +   the prevailing FTP CHARACTER-SET-TRANSLATION and SERVER-CHARACTER-SET
46201 +   settings.
46202 +
46203 +   When uploading, the FILE CHARACTER-SET setting is ignored unless you
46204 +   have forced Kermit not to [340]scan local files by including a /TEXT or
46205 +   /BINARY switch with your [M]PUT command, or by disabling automatic
46206 +   text/binary switching in some other way.
46207 +
46208 +   Examples:
46209 +
46210 +    1. Suppose you have a CP852 (East European) text file that you want to
46211 +       upload and store in ISO Latin Alphabet 2 encoding:
46212 +  ftp put /local-char:cp852 /server-char:latin2 magyar.txt
46213 +
46214 +    2. Suppose you always want your text files converted to Latin-2 when
46215 +       uploading with FTP. Then put:
46216 +  set ftp server-character-set latin2
46217 +
46218 +       in your Kermit customization file, and then you can omit the
46219 +       /SERVER-CHARACTER-SET: switch from your FTP PUT commands:
46220 +  ftp put /local-char:cp852 magyar.txt
46221 +
46222 +    3. Now suppose that all the text files on your PC are written in
46223 +       Hungarian, but they have a variety of encodings, and you don't want
46224 +       to have to include the /LOCAL-CHARACTER-SET: switch on every FTP
46225 +       PUT command, or (more to the point) you want to be able to send a
46226 +       mixture of these files all at once. Put these commands in your
46227 +       Kermit customization file:
46228 +  set ftp server-character-set latin2            ; ISO 8859-2
46229 +  set file default 7-bit-character-set hungarian ; ISO 646 Hungarian
46230 +  set file default 8-bit-character-set cp852     ; PC East European Code Page
46231 +
46232 +       and now PUT and MPUT will automatically detect and switch among ISO
46233 +       646 Hungarian, Code Page 852, UTF-8, and UCS-2 encodings,
46234 +       translating each one to Latin-2 for uploading:
46235 +  ftp put *.txt
46236 +
46237 +   And since binary files are also detected automatically, the latter can
46238 +   be simplified to:
46239 +
46240 +  ftp put *
46241 +
46242 +   even when "*" matches a diverse collection of binary and text files,
46243 +   because translations are skipped automatically for binary files.
46244 +
46245 +3.7.2. Character Sets and Downloading
46246 +
46247 +   The commands and switches are the same as for uploading, but automatic
46248 +   character-set switching works differently, since Kermit can't scan the
46249 +   server files in advance. Instead, the transfer mode (text or binary) is
46250 +   based on the filenames; each name is compared with Kermit's list of
46251 +   text name patterns and binary name patterns. If the name matches a
46252 +   binary pattern (for example, if the filename is oofa.tar.gz and one of
46253 +   the filename patterns is "*.gz"), the file is downloaded in binary
46254 +   mode; otherwise if it matches a text pattern (e.g. oofa.txt matches
46255 +   "*.txt"), it is transferred in text ("ascii") mode. Otherwise, it is
46256 +   transferred in the prevailing FTP TYPE.
46257 +
46258 +   In C-Kermit 8.0, the pattern lists used with FTP GET are not the same
46259 +   lists used with Kermit transfers, and can not be viewed with SHOW
46260 +   PATTERNS, nor adjusted with ADD and REMOVE TEXT-PATTERNS and
46261 +   BINARY-PATTERNS, or SET FILE TEXT-PATTERNS and BINARY-PATTERNS.
46262 +   Configuration of the FTP patterns list will be added in a future
46263 +   release.
46264 +
46265 +   Examples:
46266 +
46267 +   get /server-char:latin1 /local-char:cp850 Grüße.txt
46268 +          In this command, the filename contains special characters, which
46269 +          you enter using whatever character set your local computer uses,
46270 +          in this case PC Code Page 850 (cp850). The command tells Kermit
46271 +          (in case it didn't know already from its FILE CHARACTER-SET
46272 +          setting) that the local character set is cp850 and the server's
46273 +          character-set is ISO 8859-1 Latin Alphabet 1 (latin1). Kermit
46274 +          translates the filename from cp850 to latin1 and sends the
46275 +          latin1 name to the server. Since it's a text file (matches
46276 +          "*.txt"), its contents are translated to cp850 on arrival, and
46277 +          it is saved with a cp850 name.
46278 +
46279 +   mget /text /server:latin1 /local:utf8 *.txt
46280 +          This command:
46281 +
46282 +          + Tells C-Kermit that the server's files are encoded in ISO
46283 +            8859-1 Latin Alphabet 1.
46284 +          + Tells C-Kermit to translate the incoming files into Unicode
46285 +            UTF-8 for storage.
46286 +          + Asks the server to send all ".txt" files in text mode.
46287 +
46288 +   mget /server:latin1 /local:utf8 *
46289 +          Tells Kermit to get all files from the server's directory,
46290 +          switching between text and binary mode based on the filename.
46291 +          The names of all the files are translated (to UTF-8 in this
46292 +          case), but contents are translated (also to UTF-8) only for text
46293 +          files.
46294 +
46295 +   Note that any pair of 8-bit character sets is likely to have some
46296 +   incompatibilities. Any characters in the source file that do not have
46297 +   equivalents in the destination file's character set are converted to
46298 +   question marks. This applies to both filenames and to text file
46299 +   contents.
46300 +
46301 +   Also note that the server's ability to accept special characters in
46302 +   filenames depends on the particular server. For example:
46303 +
46304 +  get Grüße.txt
46305 +
46306 +   works with WU-FTPD, but:
46307 +
46308 +  mget Grüß*.txt
46309 +
46310 +   does not.
46311 +
46312 +3.7.3. RFC2640
46313 +
46314 +   [341]RFC2640, July 1999, specifies a method by which the FTP client and
46315 +   server can negotiate the use of UTF8. However, RFC2640-capable servers
46316 +   are rare to nonexistent at this writing, and in any case you don't need
46317 +   them to be able to transfer text in UTF8. C-Kermit lets you upload and
46318 +   download text files in any character set it knows about, converting to
46319 +   or from any other character set it knows about, without the knowledge,
46320 +   permission, or cooperation of the server, and regardless of its
46321 +   capabilities.
46322 +
46323 +   [ [342]Top ] [ [343]FTP Top ] [ [344]C-Kermit Home ] [ [345]Kermit Home
46324 +   ]
46325 +
46326 +3.8. FTP Command Shortcuts
46327 +
46328 +   C-Kermit's FTP client coexists with other C-Kermit functions by
46329 +   requiring the "ftp" prefix for each FTP-related command: FTP OPEN, FTP
46330 +   GET, FTP BYE, and so on. For interactive use, however, this can be
46331 +   rather awkward and sometimes surprising, for example when a GET command
46332 +   starts a Kermit GET rather than an FTP GET. In fact, many Kermit
46333 +   commands might just as easily apply to an FTP connection: GET, PUT
46334 +   (SEND), BYE, and CLOSE. The following command lets you choose how these
46335 +   commands are interpreted:
46336 +
46337 +   SET GET-PUT-REMOTE { AUTO, KERMIT, FTP }
46338 +          Controls the orientation of GET, PUT, REMOTE and other
46339 +          file-transfer and client/server commands that might apply to
46340 +          either Kermit or FTP. The default setting is AUTO, meaning that
46341 +          these commands apply to FTP if an FTP connection is open, and to
46342 +          Kermit otherwise. KERMIT means they always apply to Kermit, FTP
46343 +          means they always apply to FTP.
46344 +
46345 +   Here is a complete list of affected commands:
46346 +
46347 + Kermit Command               FTP Equivalent
46348 +  (none)                       FTP [ OPEN ]
46349 +  LOGIN                        FTP USER
46350 +  LOGOUT                       FTP RESET
46351 +  BYE                          FTP BYE
46352 +  FINISH                       FTP BYE
46353 +  CLOSE                        FTP BYE
46354 +  HANGUP                       FTP BYE
46355 +  BINARY                       FTP TYPE BINARY
46356 +  TEXT (or ASCII)              FTP TYPE ASCII
46357 +  SEND (or PUT)                FTP PUT
46358 +  MSEND (or MPUT)              FTP MPUT
46359 +  RESEND                       FTP PUT /RECOVER
46360 +  CSEND                        FTP PUT /COMMAND
46361 +  GET                          FTP GET
46362 +  MGET                         FTP MGET
46363 +  REGET                        FTP GET /RECOVER
46364 +  REMOTE HELP      (RHELP)     FTP HELP
46365 +  REMOTE CD        (RCD)       FTP CD (CWD)
46366 +  REMOTE PWD       (RPWD)      FTP PWD
46367 +  REMOTE DIRECTORY (RDIR)      FTP DIRECTORY
46368 +  REMOTE DELETE    (RDEL)      FTP DELETE
46369 +  REMOTE MKDIR     (RMKDIR)    FTP MKDIR
46370 +  REMOTE RMDIR     (RRMDIR)    FTP RMDIR
46371 +  REMOTE RENAME    (RRENAME)   FTP RENAME
46372 +  REMOTE TYPE      (RTYPE)     FTP TYPE
46373 +  REMOTE EXIT      (REXIT)     FTP BYE
46374 +
46375 +   The commands in the right-hand column always access FTP. The commands
46376 +   in the left column can access either Kermit protocol or FTP:
46377 +
46378 +     * When GET-PUT-REMOTE is set to KERMIT, or to AUTO when there is no
46379 +       FTP connection, the commands in the left-hand column access Kermit
46380 +       protocol, and those right-hand column are required for FTP.
46381 +     * When GET-PUT-REMOTE is set to FTP, or to AUTO when there is an
46382 +       active FTP connection, the commands in the left-hand column access
46383 +       the FTP connection and can not be used to access Kermit protocol.
46384 +       In this case, if you want to be able to use both Kermit protocol
46385 +       and the FTP connection, you must SET GET-PUT-REMOTE KERMIT, and
46386 +       then use the FTP commands in the right-hand column to access the
46387 +       FTP connection.
46388 +
46389 +   Note that file-management commands such as DIRECTORY, DELETE, CD, PWD,
46390 +   MKDIR, RMDIR, HELP, RENAME, COPY, TYPE, and so on, always apply
46391 +   locally, no matter what kind of connection you have. This is the
46392 +   opposite of most FTP clients, where these commands are intended for the
46393 +   server, and require an "L" prefix for local execution (e.g. "dir" gets
46394 +   a directory listing from the server, "ldir" gets a local directory
46395 +   listing). To illustrate with the CD command and a typical UNIX FTP
46396 +   client:
46397 +
46398 + Client   Server      Change Local Directory     Change Remote Directory
46399 +  FTP      FTP         lcd                        cd (cwd)
46400 +  Kermit   Kermit      cd                         rcd, remote cd
46401 +  Kermit   FTP         cd                         ftp cd, rcd, remote cd
46402 +
46403 +   Also note that not all REMOTE commands are useful with FTP, since FTP
46404 +   servers do not offer the corresponding functions. These include:
46405 +
46406 +     * REMOTE ASSIGN  - FTP servers don't have variables
46407 +     * REMOTE COPY    - FTP servers don't copy files
46408 +     * REMOTE HOST    - FTP servers don't execute host (shell) commands
46409 +     * REMOTE KERMIT  - FTP servers don't execute Kermit commands
46410 +     * REMOTE PRINT   - FTP servers don't print files
46411 +     * REMOTE QUERY   - FTP servers don't have variables
46412 +     * REMOTE SET     - FTP servers don't have Kermit settings
46413 +     * REMOTE WHO     - FTP servers don't send user lists
46414 +
46415 +   Finally note that command shortcuts do not apply to the HELP command.
46416 +   For help about an FTP command, use (for example) "help ftp delete", not
46417 +   "help delete" or "help rdelete".
46418 +
46419 +   [ [346]Top ] [ [347]FTP Top ] [ [348]C-Kermit Home ] [ [349]Kermit Home
46420 +   ]
46421 +
46422 +3.9. Dual Sessions
46423 +
46424 +   You can have an FTP session open at the same time as a regular Kermit
46425 +   SET LINE or SET HOST (terminal) session. In this case, the default SET
46426 +   GET-PUT-REMOTE AUTO setting should ensure that all "two-faced" commands
46427 +   like GET, PUT, REMOTE, HANGUP, BYE, etc, apply to the Kermit session,
46428 +   and all commands for the FTP session must include the FTP prefix. To be
46429 +   absolutely certain, you can use SET GET-PUT-REMOTE KERMIT.
46430 +
46431 +  ftp foo.bar.baz.com
46432 +  if fail ...
46433 +  (log in)
46434 +  set host foo.bar.baz.com
46435 +  if fail ...
46436 +  (log in)
46437 +
46438 +   Now you have both an FTP and Telnet connection to the same host (of
46439 +   course they could also be to different hosts, and you could also have a
46440 +   direct or dialed serial connection instead of a Telnet connection). Now
46441 +   assuming you have a Kermit server on the far end of the Kermit
46442 +   connection:
46443 +
46444 +  rcd incoming      ; Changes Kermit server's directory (= REMOTE CD)
46445 +  ftp cd incoming   ; Changes FTP server's directory
46446 +  put oofa.txt      ; Sends a file on the Kermit connection
46447 +  ftp put oofa.txt  ; Sends a file on the FTP connection
46448 +  bye               ; Shuts down the Kermit connection
46449 +  ftp bye           ; Shuts down the FTP connection
46450 +
46451 +   Note that PUT and SEND are synonyms for both FTP and Kermit
46452 +   connections.
46453 +
46454 +   You can also establish dual sessions on the Kermit command line:
46455 +
46456 +  kermit -j host1 -9 host2
46457 +
46458 +   This makes a Telnet connection to host1 and an FTP connection to host2.
46459 +
46460 +   [ [350]Top ] [ [351]FTP Top ] [ [352]C-Kermit Home ] [ [353]Kermit Home
46461 +   ]
46462 +
46463 +3.10. Automating FTP Sessions
46464 +
46465 +   Most of Kermit's scripting features can be used to make and control FTP
46466 +   sessions: FOR and WHILE loops, IF-ELSE and SWITCH constructions,
46467 +   variables, arrays, built-in functions, and all the rest. You can't use
46468 +   INPUT, MINPUT, OUTPUT, CLEAR, or SCRIPT on an FTP session, but these
46469 +   are not needed since the FTP protocol is well defined.
46470 +
46471 +   [354]CLICK HERE for an FTP scripting tutorial.
46472 +
46473 +3.10.1. FTP-Specific Variables and Functions
46474 +
46475 +   The following variable tells whether an FTP connection is open:
46476 +
46477 +   \v(ftp_connected)
46478 +          1 if there is an active FTP connection, 0 if there isn't.
46479 +
46480 +   The FTP OPEN command sets:
46481 +
46482 +   \v(ftp_host)
46483 +          The host to which the most recent FTP connection was made.
46484 +
46485 +   \v(ftp_security)
46486 +          The security method negotiated for the current FTP session. The
46487 +          value is "NULL" when no security is used. Other possibilities
46488 +          are GSSAPI, KERBEROS_V4, SSL, TLS, and SRP. Also see
46489 +          \v(authname), \v(authstate), and \v(authtype). See [355]3.2.
46490 +          Making Secure FTP Connections.
46491 +
46492 +   \v(ftp_server)
46493 +          The OS type (UNIX, VMS, etc) of the FTP server host.
46494 +
46495 +   The FTP USER command (or FTP OPEN /USER:, or FTP with automatic login)
46496 +   sets:
46497 +
46498 +   \v(ftp_loggedin)
46499 +          1 if you are logged in to an FTP server, 0 if you are not.
46500 +
46501 +   The current COMMAND-PROTECTION-LEVEL and DATA-PROTECTION-LEVEL values
46502 +   are reflected in:
46503 +
46504 +   \v(ftp_cpl)
46505 +   \v(ftp_dpl)
46506 +          The values are "clear", "confidential", "safe" or "private". See
46507 +          [356]3.2. Making Secure FTP Connections.
46508 +
46509 +   The FTP GET-PUT-REMOTE setting is reflected in:
46510 +
46511 +   \v(ftp_getputremote)
46512 +          The values are "auto", "ftp", or "kermit".
46513 +
46514 +   Every FTP command sets the \v(success) variable, as well as the
46515 +   following two FTP-specific variables:
46516 +
46517 +   \v(ftp_code)
46518 +          The standardized numeric FTP protocol code from the server's
46519 +          response to the last client command, a 3-digit decimal number
46520 +          defined in [357]RFC959. Briefly:
46521 +
46522 +          1xx = Positive Preliminary Reply
46523 +          2xx = Positive Completion Reply
46524 +          3xx = Positive Intermediate Reply
46525 +          4xx = Transient Negative Completion Reply
46526 +          5xx = Permanent Negative Completion Reply
46527 +
46528 +   \v(ftp_message)
46529 +          The text message, if any, from the server's response to the last
46530 +          client command. If the most recent response had multiple lines,
46531 +          this variable has only the final line. These messages are not
46532 +          standardized and vary in format and content from server to
46533 +          server. Synonym: \v(ftp_msg).
46534 +
46535 +   FTP file transfers set the regular Kermit transfer status variables:
46536 +
46537 +  \v(cps)         Characters per second of most recent transfer.
46538 +  \v(filespec)    File specification used in most recent transfer.
46539 +  \v(fsize)       Size of file most recently transferred.
46540 +  \v(tfsize)      Total size of file group most recently transferred.
46541 +  \v(xferstatus)  Status of most recent transfer (0 = success, 1 = failure).
46542 +  \v(tftime)      Elapsed time of most recent transfer, in seconds.
46543 +
46544 +   During an FTP transfer, the per-file variables are:
46545 +
46546 +  \v(filename)    Name of current file.
46547 +  \v(filenumber)  Ordinal file number in group (1, 2, 3, ...)
46548 +
46549 +3.10.2. Examples
46550 +
46551 +   Let's begin with a simple example showing how to log in, send some
46552 +   files, and log out:
46553 +
46554 +  define error if fail { ftp bye, stop 1 Error: \%1 }
46555 +  set transact brief
46556 +  log t
46557 +  ftp ftp.xyzcorp.com /anonymous
46558 +  if fail stop 1 Connection failed
46559 +  if not \v(ftp_loggedin) stop 1 Login failed
46560 +  ftp cd incoming
46561 +  error {ftp cd}
46562 +  cd upload
46563 +  error {local cd}
46564 +  ftp put /delete *
46565 +  error {put}
46566 +  ftp bye
46567 +
46568 +   First we define an error handling macro to be used after the connection
46569 +   is made. Then we set up a brief-format transaction log to keep a record
46570 +   of our file transfers. Then we make a connection to the host and log in
46571 +   anonymously. The "if fail" command checks whether the connection was
46572 +   made. The "if not" command checks whether login was successful.
46573 +   Obviously the script should not continue unless both tests succeed.
46574 +
46575 +   Next we change to the server's 'incoming' directory and to our own
46576 +   'upload' directory, and send all the files that are in it (they can be
46577 +   any mixture of text and binary files), deleting each source file
46578 +   automatically after it is successfully uploaded. Each of these
46579 +   operations is checked with the ERROR macro, which prevents the script
46580 +   from continuing past a failure.
46581 +
46582 +   Finally we close the FTP session with the "bye" command.
46583 +
46584 +   Just like any other Kermit script, this one can be used in many ways:
46585 +
46586 +     * It can be stored in a file, and Kermit can be told to TAKE the
46587 +       file.
46588 +     * In UNIX, it can be a "[358]kerbang" script and therefore run
46589 +       directly from the shell prompt or as a cron job.
46590 +
46591 +   We could have used command shortcuts like "rcd", "put", and "bye", but
46592 +   since they can be ambiguous under certain circumstances, it is better
46593 +   to avoid them in scripts; they are intended mainly for convenience
46594 +   during interactive use. However, if you wish to use the shortcuts in a
46595 +   script, you can do it this way (error handling omitted for brevity):
46596 +
46597 +  local \%t                       ; Declare a local temporary veriable
46598 +  assign \%t \v(ftp_getputremote) ; Save current FTP GET-PUT-REMOTE setting
46599 +  set ftp get-put-remote ftp      ; Choose FTP orientation
46600 +  ftp xyzcorp.com /anonymous      ; Open an FTP connection
46601 +  get oofa.txt                    ; GET a file
46602 +  put foo.bar                     ; PUT a file
46603 +  rdel yesterday.log              ; Delete a file on the server
46604 +  bye                             ; Log out and disconnect from server.
46605 +  set ftp get-put-remote \%t      ; Restore previous GET-PUT-REMOTE setting
46606 +
46607 +   Of course, FTP scripts can also be written as macros. This lets you
46608 +   pass parameters such as hostnames, usernames, and filenames to them:
46609 +
46610 +  define doftpget {
46611 +      if < \v(argc) 4 end 1 Usage: \%0 host user remotefile [ localfile ]
46612 +      ftp \%1 /user:\%2
46613 +      if fail end 1 FTP OPEN \%1 failed
46614 +      if not \v(ftp_loggedin) end 1 FTP LOGIN failed
46615 +      ftp get {\%3} {\%4}
46616 +      if fail end 1 FTP GET \%3 failed
46617 +      ftp bye
46618 +  }
46619 +
46620 +   Add this definition to your Kermit customization file, and it will
46621 +   always be available when you start Kermit. This macro lets you download
46622 +   a file with FTP by giving a single command, e.g.:
46623 +
46624 +  doftpget xyzcorp.com anonymous oofa.txt
46625 +
46626 +3.10.3. Automating Secure FTP Sessions
46627 +
46628 +   Often when making secure connections, you are prompted interactively
46629 +   for certain information or permission to proceed. These prompts can
46630 +   stop an automated procedure. To avoid them, you must give the
46631 +   appropriate commands to disable them, and/or supply the prompted-for
46632 +   information beforehand. Here are a few hints:
46633 +
46634 +     * Make sure that SET TAKE ERROR and SET MACRO ERROR are both OFF.
46635 +       This is the default, but in case you have set either one of these
46636 +       ON in your script or initialization file, this makes the script
46637 +       halt on any kind of error. Normally you would want to check each
46638 +       operation for success or failure and take appropriate action.
46639 +     * On SSL and TLS connections, you may be asked whether it is OK to
46640 +       proceed with a connection to server that presents a self-signed
46641 +       certificate. You can use the SET AUTHENTICATION SSL (or TLS) VERIFY
46642 +       or SET AUTH SSL (or TLS) CERTS-OK commands to avoid this prompt by
46643 +       not requesting a certificate from the peer.
46644 +     * (More to be added...)
46645 +
46646 +   [ [359]Top ] [ [360]FTP Top ] [ [361]FTP Script Tutorial ] [
46647 +   [362]C-Kermit Home ] [ [363]Kermit Home ]
46648 +
46649 +3.11. Advanced FTP Protocol Features
46650 +
46651 +   The remainder of the FTP documention (through the end of Section 3) is
46652 +   new to C-Kermit 8.0.206, but we leave it in black to prevent headaches.
46653 +   Except for titles.
46654 +     * [364]TERMINOLOGY
46655 +     * [365]FEATURE NEGOTIATION
46656 +     * [366]USING MGET: NLST VERSUS MLSD
46657 +     * [367]EXAMPLES
46658 +     * [368]REFERENCES
46659 +
46660 +   The new releases of [369]C-Kermit (8.0.206) and [370]Kermit 95 (2.1)
46661 +   support new FTP protocol features from RFC 2389 as well as most of
46662 +   what's in the Elz and Hethmon Extensions to FTP Internet Draft (see
46663 +   [371]References). Some of these features, such as SIZE (request a
46664 +   file's size), MDTM (request file's modification time), and REST
46665 +   (restart interrupted transfer) have been widely implemented in FTP
46666 +   clients and servers for years (as well as in the initial release of the
46667 +   Kermit FTP clients). Others such as FEAT and MLSD are rarely seen and
46668 +   are new to the upcoming Kermit releases. TVFS (Trivial Virtual File
46669 +   Store) is supported implicitly, and the UTF-8 character-set is already
46670 +   fully supported at the protocol and data-interchange level.
46671 +
46672 +   For Kermit users, the main benefit of the new FTP protocol extensions
46673 +   is the ability to do recursive downloads. But the extensions also
46674 +   introduce complications and tradeoffs that you should be aware of. Of
46675 +   course Kermit tries to "do the right thing" automatically in every case
46676 +   for backwards compatibility. But (as noted later) some cases are
46677 +   inherently ambiguous and/or can result in nasty surprises, and for
46678 +   those situations new commands and switches are available to give you
46679 +   precise control over Kermit's behavior, in case the defaults don't
46680 +   produce the desired results.
46681 +
46682 +3.11.1. Terminology
46683 +
46684 +   Command-line FTP clients such as Kermit (as well as the traditional FTP
46685 +   programs found on Unix, VMS, ..., even Windows) have commands like PUT,
46686 +   MPUT, GET, MGET, and BYE, which they convert into zero or more FTP
46687 +   protocol commands, such as NLST, RETR, QUIT. For clarity, we'll use
46688 +   "command" to refer to commands given by the user to the FTP client, and
46689 +   "directive" for FTP protocol commands sent by the FTP client to the FTP
46690 +   server.
46691 +
46692 +3.11.2. Feature Negotiation
46693 +
46694 +   New FTP protocol features are negotiated by the client sending a FEAT
46695 +   directive and the server responding with a list of (new) features it
46696 +   supports, or else with an error indication if it does not support the
46697 +   FEAT directive at all, in which case the client has to guess which new
46698 +   features it supports (Kermit guesses that it supports SIZE and MDTM but
46699 +   not MLST). Note that the MLST feature includes MLSD, which is not
46700 +   listed separately as a feature.
46701 +
46702 +   Guessing is nice when it works, but sometimes it doesn't, and some FTP
46703 +   servers become confused when you send them a directive they don't
46704 +   understand, or they do something you didn't want, sometimes to the
46705 +   point of closing the connection. For this reason, Kermit lets you
46706 +   override default or negotiated features with the following new
46707 +   commands:
46708 +
46709 +   FTP { ENABLE, DISABLE } FEAT
46710 +          Enables or disables the automatic sending of a FEAT directive
46711 +          upon connection to an FTP server. Note that FTP [ OPEN ] /NOINIT
46712 +            also inhibits sending the FEAT directive (and several others)
46713 +          for the connection being OPEN'd, but without necessarily
46714 +          disabling FEAT for subsequent connections in the same Kermit
46715 +          instance. FEAT is ENABLED by default, in which case many FTP
46716 +          servers are likely to reply:
46717 +
46718 +500 'FEAT': command not understood
46719 +
46720 +          which is normally harmless (but you never know). (In C-Kermit
46721 +          8.0.208, this error message is suppressed unless you SET FTP
46722 +          DEBUG ON.)
46723 +
46724 +   FTP ENABLE { MDTM, MLST, SIZE }
46725 +          Enables the given directive for implicit use by the FTP GET and
46726 +          MGET commands in case it has been disabled or erroneously
46727 +          omitted by the server in its FEAT response. Note: MLSD can be
46728 +          used in the FTP ENABLE and DISABLE commands as a synonym for
46729 +          MLST. YOU MUST GIVE THIS COMMAND AFTER MAKING THE FTP
46730 +          CONNECTION.
46731 +
46732 +   FTP DISABLE { MDTM, MLST, SIZE }
46733 +          Disables implicit use of the given directive by GET or MGET in
46734 +          case it causes problems; for example, because it makes multifile
46735 +          downloads take too long or the server announces it erroneously
46736 +          or misimplements it. Use DISABLE FEAT before making a connection
46737 +          to prevent Kermit from sending the FEAT directive as part of its
46738 +          initial sequence. Note that disabling FEAT, SIZE, or MDTM does
46739 +          not prevent you from executing explicit FTP FEATURES, FTP SIZE,
46740 +          or FTP MODTIME commands. Also note that disabling SIZE prevents
46741 +          PUT /RESTART (recovery of interrupted uploads) from working. YOU
46742 +          MUST GIVE THIS COMMAND AFTER MAKING THE FTP CONNECTION.
46743 +
46744 +   To enable or disable more than one feature, use multiple FTP ENABLE or
46745 +   FTP DISABLE commands. The SHOW FTP command shows which features are
46746 +   currently enabled and disabled.
46747 +
46748 +   FTP FEATURES
46749 +          This command sends a FEAT directive to the server. In case you
46750 +          have been disabling and enabling different features, this
46751 +          resynchronizes Kermit's feature list with the server's. If the
46752 +          server does not support the FEAT directive, Kermit's feature
46753 +          list is not changed.
46754 +
46755 +   FTP OPTIONS directive
46756 +          Informational only: the server tells what options, if any, it
46757 +          supports for the given directive, e.g. MLST. Fails if the server
46758 +          does not support the OPTS directive or if the directive for
46759 +          which options are requested is not valid. The directive is
46760 +          case-insensitive.
46761 +
46762 +   FTP SIZE filename
46763 +          Sends a SIZE directive to the server for the given file. The
46764 +          filename must not contain wildcards. The server responds with an
46765 +          error if the file can't be found, is not accessible, or the SIZE
46766 +          directive is not supported, otherwise with the length of the
46767 +          file in bytes, which Kermit displays and also makes available to
46768 +          you in its \v(ftp_message) variable. If the directive is
46769 +          successful, Kermit (re-)enables it for internal use by the GET
46770 +          and MGET directives on this connection.
46771 +
46772 +   FTP MODTIME filename
46773 +          Works just like the SIZE directive except it sends an MDTM
46774 +          directive. Upon success, the server sends modification date-time
46775 +          string, which Kermit interprets for you and also makes available
46776 +          in its \v(ftp_message) variable.
46777 +
46778 +   Whenever a SIZE or MDTM directive is sent implicitly and rejected by
46779 +   the server because it is unknown, Kermit automatically disables it.
46780 +
46781 +3.11.3. Using MGET: NLST versus MLSD
46782 +
46783 +   When you give an MGET command to an FTP client, it sends a request to
46784 +   the FTP server for a list of files, and then upon successful receipt of
46785 +   the list, goes through it and issues a RETR (retrieve) directive for
46786 +   each file on the list (or possibly only for selected files).
46787 +
46788 +   With the new FTP protocol extensions, now there are two ways to get the
46789 +   list of files: the NLST directive, which has been part of FTP protocol
46790 +   since the beginning, and the new MLSD directive, which is new and not
46791 +   yet widely implemented. When NLST is used and you give a command like
46792 +   "mget *.txt", the FTP client sends:
46793 +
46794 +NLST *.txt
46795 +
46796 +   and the server sends back a list of the files whose names match, e.g.
46797 +
46798 +foo.txt
46799 +bar.txt
46800 +baz.txt
46801 +
46802 +   Then when downloading each file, the client sends SIZE (if it wants
46803 +   have a percent-done display) and MDTM (if it wants to set the
46804 +   downloaded file's timestamp to match that of the original), as well as
46805 +   RETR (to retrieve the file).
46806 +
46807 +   But when MLSD is used, the client is not supposed to send the filename
46808 +   or wildcard to the server; instead it sends an MLSD directive with no
46809 +   argument (or the name of a directory), and the server sends back a list
46810 +   of all the files in the current or given directory; then the client
46811 +   goes through the list and checks each file to see if it matches the
46812 +   given pattern, the rationale being that the user knows only the local
46813 +   conventions for wildcards and not necessarily the server's conventions.
46814 +   So with NLST the server interprets wildcards; with MLSD the client
46815 +   does.
46816 +
46817 +     The interpretation of NLST wildcards by the server is not
46818 +     necessarily required or even envisioned by the FTP protocol
46819 +     definition (RFC 959), but in practice most clients and servers work
46820 +     this way.
46821 +
46822 +   The principal advantage of MLSD is that instead of sending back a
46823 +   simple list of filenames, it sends back a kind of database in which
46824 +   each entry contains a filename together with information about the
46825 +   file: type, size, timestamp, and so on; for example:
46826 +
46827 +size=0;type=dir;perm=el;modify=20020409191530; bin
46828 +size=3919312;type=file;perm=r;modify=20000310140400; bar.txt
46829 +size=6686176;type=file;perm=r;modify=20001215181000; baz.txt
46830 +size=3820092;type=file;perm=r;modify=20000310140300; foo.txt
46831 +size=27439;type=file;perm=r;modify=20020923151312; foo.zip
46832 +(etc etc...)
46833 +
46834 +   (If the format of the file list were the only difference between NLST
46835 +   and MLSD, the discussion would be finished: it would always be better
46836 +   to use MLSD when available, and the MGET user interface would need no
46837 +   changes. But there's a lot more to MLSD than the file-list format; read
46838 +   on...)
46839 +
46840 +   The client learns whether the server supports MLSD in FEAT exchange.
46841 +   But the fact that the server supports MLSD doesn't mean the client
46842 +   should always use it. It is better to use MLSD:
46843 +
46844 +     * On connections where the server imposes a time penalty for every
46845 +       command, e.g. the Red Hat Rawhide server. With MLSD, the client
46846 +       needs to send only one command (RETR) per file, whereas NLST
46847 +       requires three (SIZE, RETR, and MDTM). Suppose there is a 30-second
46848 +       delay for each command and 1000 files are to be fetched; in that
46849 +       case, MLSD saves 60,000 seconds = 1000 minutes = 16 hours and 40
46850 +       minutes.
46851 +     * For recursive downloads since there is no dependable way to
46852 +       download directory trees with NLST.
46853 +
46854 +   But it is better to use NLST:
46855 +
46856 +     * If you want only a couple short files out of a large directory. In
46857 +       this case, NLST is the better choice since the server sends a list
46858 +       of only the files you want, not a list of (say) a million files,
46859 +       which can make a big difference on slow connections. For example,
46860 +       suppose your wildcard matches three files of 1K each, but the
46861 +       million-file listing is 80MB long, and your connection is through a
46862 +       modem. The overhead of using MLSD is practically infinite.
46863 +     * If the server supports wildcarding features not known to the
46864 +       client, but that can be used to achieve desirable effects otherwise
46865 +       unobtainable, such as "[dir...]*.txt" in VMS or AOS/VS "except"
46866 +       clauses.
46867 +     * If you have been given a wildcard string by an FTP site
46868 +       administrator for fetching a specific group of files out of a
46869 +       larger directory, e.g. "mget ck[cuw]*.[cwh] makefile", that is
46870 +       expected to work with any client (an FTP site administrator can't
46871 +       be expected to know the wildcard syntax of every FTP client).
46872 +
46873 +   But when using MLSD there are complications:
46874 +
46875 +     * MLSD wants either a blank argument (meaning the current directory)
46876 +       or else the name of a specific directory. The client must not send
46877 +       it a wildcard or a filename.
46878 +     * But if the user's command is "mget xxx", how does the client know
46879 +       whether to send "xxx" in the MLSD directive? It might be the name
46880 +       of a directory on on the server, in which case it should be sent,
46881 +       or it might be the name of a file on the server (or a wildcard), in
46882 +       which case it must not be sent. Since the client knows its own
46883 +       wildcard syntax, then in most cases it would be right to send
46884 +       "MLSD" with no argument if xxx is wild, and to send "MLSD xxx" if
46885 +       it is not.
46886 +     * But suppose the server's file system allows filename characters
46887 +       that correspond with the client's wildcard syntax? For example:
46888 +       "[abc]" could be either a valid VMS directory name or a wildcard
46889 +       pattern used by the FTP client. What should the client do with
46890 +       "mget [abc]"? In this case there must be a way for the user to
46891 +       force sending the MGET argument as the MLSD argument.
46892 +     * If "xxx" is a regular file in the server's current directory, "mget
46893 +       xxx" works with NLST but not with MLSD.
46894 +
46895 +   To further complicate matters, NLST can (in theory) work just like
46896 +   MLSD: if sent with a blank argument or a directory name, it is supposed
46897 +   to return a complete list of files in the current or given directory,
46898 +   which the client can match locally against some pattern. It is not
46899 +   known if any FTP server or client does this but nevertheless, it should
46900 +   be possible since this behavior can be inferred from RFC 959.
46901 +
46902 +   In view of these considerations, and given the need to preserve the
46903 +   traditional FTP client command structure and behavior so the software
46904 +   will be usable by most people:
46905 +
46906 +    1. The MGET command should produce the expected result in the common
46907 +       cases, regardless of whether NLST or MLSD is used underneath.
46908 +    2. For anomalous cases, the user needs a way to control whether the
46909 +       MGET argument is sent to the server or kept for local use.
46910 +    3. At the same time, the user might need a way to send a directory
46911 +       name to the server, independent of any wildcard pattern.
46912 +    4. The user needs a way to force NLST or MLSD for a given MGET
46913 +       command.
46914 +
46915 +   By default, Kermit's MGET command uses MLSD if MLST is reported by the
46916 +   server in its FEAT list. When MLSD is used, the filespec is sent to the
46917 +   server if it is not wild (according to Kermit's own definition of
46918 +   "wild" since it can't possibly know the server's definition). If the
46919 +   filespec is wild it is held for local use to select files from the list
46920 +   returned by the server. If MLST is not reported by the server or is
46921 +   disabled, Kermit sends the MGET filespec with the NLST directive.
46922 +
46923 +   The default behavior can be overridden globally with FTP DISABLE MLST,
46924 +   which forces Kermit to use NLST to get file lists. And then for
46925 +   situations in which MLSD is enabled, the following MGET switches can be
46926 +   used to override the defaults for a specific MGET operation:
46927 +
46928 +   /NLST
46929 +          Forces the client to send NLST. Example:
46930 +
46931 +mget /nlst foo.*
46932 +
46933 +   /MLSD
46934 +          Forces the client to send MLSD (even if MLST is disabled).
46935 +          Example:
46936 +
46937 +mget /mlsd foo.*
46938 +
46939 +   /MATCH:pattern
46940 +          When this switch is given, it forces the client to hold the
46941 +          pattern for local use against the returned file list. If a
46942 +          remote filespec is also given (e.g. the "blah" in "mget
46943 +          /match:*.txt blah"), then it is sent as the NLST or MLSD
46944 +          argument, presumably to specify the directory whose files are to
46945 +          be listed. When the /MATCH switch is not given, the MGET
46946 +          filespec is sent to the server if the directive is NLST or if
46947 +          the filespec is not wild. Examples:
46948 +
46949 +  Command:                   With NLST:     With MLSD:
46950 +    mget                      NLST           MLSD
46951 +    mget *.txt                NLST *.txt     MLSD
46952 +    mget foo                  NLST foo       MLSD foo
46953 +    mget /match:*.txt         NLST           MLSD
46954 +    mget /match:*.txt foo     NLST foo       MLSD foo
46955 +
46956 +   In other words, the pattern is always intepreted locally unless MGET
46957 +   uses NLST and no /MATCH switch was given.
46958 +
46959 +3.11.4. Examples
46960 +
46961 +3.11.4.1. Downloading a Single File
46962 +
46963 +   There are no choices here, just use the FTP GET command. Kermit always
46964 +   sends the RETR directive, and possibly SIZE and/or MDTM. The small
46965 +   advantage of using MLST in this case is outweighed by the risk and
46966 +   effort of coding a special case.
46967 +
46968 +3.11.4.2. Downloading a Group of Files from a Single Directory
46969 +
46970 +   This case presents tradeoffs, especially on slow connections:
46971 +
46972 +     * For downloading all or most of the files in a directory, MLSD is
46973 +       better because it eliminates the need to send SIZE and MDTM for
46974 +       each file. No special actions are required in this case; Kermit
46975 +       uses MLSD automatically if the server supports it (unless you have
46976 +       disabled it).
46977 +     * For a small number of files from a large directory, NLST is better
46978 +       because it bypasses downloading of a potentially huge file list
46979 +       prior to the files themselves. If you have a connection to a server
46980 +       that supports MLSD, use the /NLST switch to force NLST:
46981 +
46982 +mget /nlst t[1234].h
46983 +
46984 +     * If the server supports MLSD but does not support separate SIZE or
46985 +       MDTM directives, and you need the size and/or timestamp
46986 +       information, MLSD is better; no special actions required.
46987 +     * If the server supports MLSD but does not support the "size" and
46988 +       "modify" facts, but it does support the SIZE or MDTM directives,
46989 +       and you need the size and/or timestamp information, NLST is better.
46990 +
46991 +3.11.4.3. Downloading a Directory Tree
46992 +
46993 +   MLSD is the only choice for recursive downloads; they rarely, if ever,
46994 +   work with NLST (the few cases where they do work rely on extra-protocol
46995 +   "secret" notations for the NLST argument). No special actions are
46996 +   required to force MLSD when the server supports it, unless you have
46997 +   disabled it. Examples:
46998 +
46999 +   MGET /RECURSIVE
47000 +          This tells the server to send all files and directories in the
47001 +          tree rooted at its current directory.
47002 +
47003 +   MGET /RECURSIVE *.txt
47004 +          This tells the server to send all *.txt files in the tree rooted
47005 +          at its current directory.
47006 +
47007 +   MGET /MLSD /RECURSIVE *.txt
47008 +          Same as the previous example but forces Kermit to send MLSD in
47009 +          case it was disabled, or in case the server is known to support
47010 +          it even though it did not announce it in its FEAT listing.
47011 +
47012 +   MGET /RECURSIVE /MATCH:*.zip archives
47013 +          Tells the server to send all ZIP files in the tree rooted at its
47014 +          "archives" directory.
47015 +
47016 +   MGET /RECURSIVE /MATCH:* [abc]
47017 +          The server is running on VMS and you want it to send all the
47018 +          files in the directory tree rooted at [ABC]. But since "[abc]"
47019 +          looks just like a wildcard, you have to include a /MATCH: switch
47020 +          to force Kermit to send "[abc]" as the MLSD argument.
47021 +
47022 +   In all cases in which the /RECURSIVE switch is included, the server's
47023 +   tree is duplicated locally.
47024 +
47025 +     Although MLSD allows recursion and NLST does not, the MLSD
47026 +     specification places a heavy burden on the client; the obvious,
47027 +     straightforward, and elegant implementation (depth-first, the one
47028 +     that Kermit currently uses) requires as many open temporary files as
47029 +     the server's directory tree is deep, and therefore client resource
47030 +     exhaustion -- e.g. exceeding the maximum number of open files -- is
47031 +     a danger. Unfortunately MLSD was not designed with recursion in
47032 +     mind. (Breadth-first traversal could be problematic due to lack of
47033 +     sufficient navigation information.)
47034 +
47035 +   Of course all of Kermit's other MGET switches can be used too, e.g. for
47036 +   finer-grained file selection (by date, size, etc), for moving or
47037 +   renaming files as they arrive, to override Kermit's automatic per-file
47038 +   text/binary mode switching, to pass the incoming files through a
47039 +   filter, to convert text-file character sets, and so on.
47040 +
47041 +3.11.4.4. NLST/MLSD Summary Table
47042 +
47043 +   Here's a table summarizing MGET behavior when the server supports both
47044 +   NLST and MLSD. /NLST and /MLSD switches are included for clarity to
47045 +   indicate which protocol is being used, and the expected effects. In
47046 +   practice you can omit the /NLST and /MLSD switches and the Kermit
47047 +   client chooses the appropriate or desired protocol as described above.
47048 +   Sample commands presume a Unix file system on the server, but of course
47049 +   the server can have any file system or syntax at all.
47050 +
47051 +   User's Command FTP Sends Remarks
47052 +   mget /nlst NLST Gets a list of all the files in the server's current
47053 +   and downloads each file. The list includes names only, so Kermit also
47054 +   must send SIZE and MDTM directives if size and timestamp information is
47055 +   required (this is always true of NLST). Sending NLST without an
47056 +   argument is allowed by the RFC959 NLST definition and by the Kermit FTP
47057 +   client, but might not work with other clients, and also might not work
47058 +   with every server.
47059 +   mget /nlst foo NLST foo If "foo" is a directory, this gets a list of
47060 +   all the files from the server's "foo" directory and downloads each
47061 +   file; otherwise this downloads the file named "foo" (if any) from the
47062 +   server's current directory.
47063 +   mget /nlst *.txt NLST *.txt Gets a list of the files in the server's
47064 +   current directory whose names match the pattern *.txt, and then
47065 +   downloads each file from the list. Because we are using NLST, we send
47066 +   the filespec (*.txt) to the server and the server interprets any
47067 +   wildcards.
47068 +   mget /nlst foo/*.txt NLST foo/*.txt  Gets a list of the files in the
47069 +   server's "foo" directory whose names match the pattern *.txt, and then
47070 +   downloads each file from the list (server interprets wildcards).
47071 +   mget /nlst /match:*.txt NLST Gets a list of all the files in the
47072 +   server's current directory and then downloads each one whose name
47073 +   matches the pattern *.txt (client interprets wildcards).
47074 +   mget /nlst /match:*.txt foo  NLST foo Gets a list of all the files in
47075 +   the server's "foo" directory and then downloads each one whose name
47076 +   matches the pattern *.txt (client interprets wildcards).
47077 +   mget /mlsd MLSD Gets a list of all the files from the server's current
47078 +   directory and then downloads each one. The list might include size and
47079 +   timestamp information, in which case Kermit does not need to send SIZE
47080 +   and MDTM directives for each file (this is always true of MLSD).
47081 +   mget /mlsd foo MLSD foo Gets a list of all the files from the server's
47082 +   "foo" directory (where the string "foo" does not contain wildcards) and
47083 +   then downloads each one. If "foo" is a regular file and not a
47084 +   directory, this command is supposed to fail, but some servers have been
47085 +   observed that send the file.
47086 +   mget /mlsd *.txt MLSD Gets a list of all the files from the server's
47087 +   current directory and then downloads only the ones whose names match
47088 +   the pattern "*.txt". Because we are using MLSD and the MGET filespec is
47089 +   wild, we do not send the filespec to the server, but treat it as though
47090 +   it had been given in a /MATCH: switch and use it locally to match the
47091 +   names in the list.
47092 +   mget /mlsd foo/*.txt MLSD This one won't work because MLSD requires
47093 +   that the notions of server directory and filename-matching pattern be
47094 +   separated. However, the client, which can't be expected to know the
47095 +   server's file-system syntax, winds up sending a request that the server
47096 +   will (or should) reject.
47097 +   mget /mlsd /match:*.txt MLSD Gets a list of all the files from the
47098 +   server's current directory and then downloads only the ones whose names
47099 +   match the pattern "*.txt" (client interprets wildcards).
47100 +   mget /mlsd /match:*.txt foo MLSD foo If "foo" is a directory on the
47101 +   server, this gets a list of all the files from the server's "foo"
47102 +   directory and then downloads only the ones whose names match the
47103 +   pattern "*.txt" (client interprets wildcards). This leaves the server
47104 +   CD'd to the "foo" directory; there's no way the client can restore the
47105 +   server's original directory because MLSD doesn't give that information,
47106 +   and since the client can not be expected to know the server's
47107 +   file-system syntax, it would not be safe to guess. If "foo" is a
47108 +   regular file, MLSD fails.
47109 +   mget /mlsd foo bar MLSD This one is problematic. You're supposed to be
47110 +   able to give MGET a list a filespecs; in this case we name two
47111 +   directories. The client must change the server's directory to "foo" to
47112 +   get the list of files, and then the files themselves. But then it has
47113 +   no way to return to the server's previous directory in order to do the
47114 +   same for "bar", as explained in the previous example.
47115 +   mget /mlsd /match:* [abc] MLSD [abc] Including a /MATCH: switch forces
47116 +   [abc] to be sent to the server even though the client would normally
47117 +   think it was a wildcard and hold it for local interpretation. In this
47118 +   example, [abc] might be a VMS directory name.
47119 +   mget /mlsd /match:* t*.h MLSD t*.h Contrary to the MLSD specification,
47120 +   some MLSD-capable FTP servers do interpret wildcards. This form of the
47121 +   MGET command can be used to force a wildcard to be sent to the server
47122 +   for interpretation.
47123 +
47124 +   When MLSD is used implicitly (that is, without an /MLSD switch given to
47125 +   force the use of MLSD) and an MGET command such as "mget foo/*.txt"
47126 +   fails, Kermit automatically falls back to NLST and tries again.
47127 +
47128 +3.11.5. References
47129 +
47130 +    1. Postel, J., and J. Reynolds, File Transfer Protocol (FTP), RFC 959,
47131 +       October 1985: [372]ftp://ftp.isi.edu/in-notes/rfc959.txt.
47132 +    2. Hethmon, P, and R. Elz, Feature negotiation mechanism for the File
47133 +       Transfer Protocol, RFC 2389, August 1998:
47134 +       [373]ftp://ftp.isi.edu/in-notes/rfc2389.txt.
47135 +    3. Elz, R, and P. Hethmon, Extensions to FTP, Internet Draft
47136 +       draft-ietf-ftpext-mlst-16.txt, September 2002:
47137 +       [374]http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.
47138 +       txt.
47139 +    4. [375]The Kermit FTP Client (overview).
47140 +
47141 +   [ [376]Top ] [ [377]FTP Top ] [ [378]C-Kermit Home ] [ [379]Kermit Home
47142 +   ]
47143 +
47144 +4. FILE SCANNING
47145 +
47146 +   A new feature called file scanning is used in various contexts to
47147 +   determine if a file is text or binary, and if it is text, what kind of
47148 +   text. The overhead of file scanning is surprisingly tolerable, usually
47149 +   about a quarter second per file. File scanning is now used instead of
47150 +   filename patterns unless you SET FILE SCAN OFF, which restores the
47151 +   previous behavior.
47152 +
47153 +   The primary benefit of file scanning is in file transfer. For all
47154 +   practical purposes, now you can stop worrying about whether a file
47155 +   should be sent in binary or text mode, or about sending mixtures of
47156 +   text and binary files in a single operation, or configuring and
47157 +   fine-tuning your lists of binary-file and text-file name patterns: now
47158 +   it all just works.
47159 +
47160 +   File scanning is done by the file sender, which determines the type of
47161 +   each file before it sends it and informs the receiver (Kermit or FTP
47162 +   server) of the type. File scanning is NOT done by the receiver, because
47163 +   it is the sender's responsibility to determine each file's type, send
47164 +   the file in the right mode, and inform the receiver of the mode. If
47165 +   both transfer partners are capable of this (or any other) form of
47166 +   automatic text/binary mode switching, then files can be sent in both
47167 +   directions with no worries about corruption due to inappropriate
47168 +   transfer mode. (As noted in [380]Section 3, FTP servers don't do this,
47169 +   so this discussion does not apply when using Kermit to download from an
47170 +   FTP server.)
47171 +
47172 +   The rest of this section is mainly for the curious. If you don't read
47173 +   it and simply accept all defaults, every file you send should go in the
47174 +   appropriate mode automatically. As always, however, for character-set
47175 +   translation to work for 7- and 8-bit character-set files, the
47176 +   appropriate SET FILE CHARACTER-SET command(s) must have been executed
47177 +   to identify their encoding (Kermit's default file character-set is
47178 +   neutral ASCII except on platforms like HP-UX or DG/UX, where the
47179 +   default file character-set is known). And of course, receiving is
47180 +   another matter -- obviously the other Kermit must also send each file
47181 +   in the appropriate mode.
47182 +
47183 +   Scanning is more reliable than filename patterns simply because
47184 +   filenames are not reliable indicators of the file's contents. Classic
47185 +   examples include ".doc" files, which are binary if Microsoft Word
47186 +   documents but text on most other platforms, and ".com" files, which are
47187 +   binary on DOS and Windows but text on VMS. Anyway, nobody knows the
47188 +   naming conventions (if any) of all the applications (and persons!) on
47189 +   your computer. Scanning, on the other hand, determines each file's type
47190 +   by inspecting its contents rather than just looking at its name.
47191 +
47192 +   Also, file patterns -- even when they work as intended -- categorize
47193 +   each file only as text or binary, whereas file scanning can make finer
47194 +   distinctions:
47195 +
47196 +   BINARY
47197 +          Binary data, not to be converted in any way. Examples include
47198 +          binary machine code (executable programs), graphics images (GIF,
47199 +          JPG, etc), compressed files (Z, GZ, etc), archives and packages
47200 +          (ZIP, TAR, RPM, etc), object files and libraries (OBJ, DLL,
47201 +          etc).
47202 +
47203 +   7-BIT TEXT
47204 +          Text encoded in a 7-bit character set such as ASCII or one of
47205 +          the ISO 646 national versions. Kermit has no way to tell which
47206 +          character is used, only that it's 7-bit text. Typical examples
47207 +          include program source code, README files, Perl or Kermit
47208 +          scripts, plain-text email, HTML, TeX, and various textual
47209 +          encodings of binary files: Hex, Base64, etc. When sending such
47210 +          files, the FILE DEFAULT 7BIT-CHARACTER-SET is used as the file
47211 +          character-set, and then the appropriate transfer character set
47212 +          is chosen from the associations list (ASSOCIATE, SHOW
47213 +          ASSOCIATIONS).
47214 +
47215 +   8-BIT TEXT
47216 +          Text encoded in an 8-bit character set such as Latin-1, Latin-2,
47217 +          Latin/Hebrew, Latin/Cyrillic, KOI8, HP-Roman8, JIS X 0208, Code
47218 +          Page 437, or Code Page 1252. Again, Kermit has no way of knowing
47219 +          which particular set is in use, only that it's 8-bit text. When
47220 +          sending such files, the FILE DEFAULT 8BIT-CHARACTER-SET is used
47221 +          as the file character-set, and then the appropriate transfer
47222 +          character set is chosen from the associations list.
47223 +
47224 +   UCS2 TEXT
47225 +          Unicode in its basic form, 16 bits (2 octets) per character.
47226 +          When sending such files, UCS2 is the file character-set and the
47227 +          byte order is identified automatically; the appropriate transfer
47228 +          character set is chosen from the associations list. Normally
47229 +          this would be UTF8. UTF-16 is not supported yet; Kermit's
47230 +          Unicode translations are restricted to Plane 0, the Base
47231 +          Multilingual Plane (BMP).
47232 +
47233 +   UTF8 TEXT
47234 +          Unicode in its 8-bit transformation format. When sending such
47235 +          files, UTF8 is the file character-set; the appropriate transfer
47236 +          character set is chosen from the associations list, normally
47237 +          UCS2 or UTF8.
47238 +
47239 +   File scanning is available in UNIX C-Kermit, in K-95, and to a limited
47240 +   extent, in VMS C-Kermit (full scanning is problematic in VMS because
47241 +   even plain-text files might contain binary record-format information).
47242 +   The relevant commands are:
47243 +
47244 +   SET TRANSFER MODE { AUTOMATIC, MANUAL }
47245 +          Tells whether the file-transfer mode (text or binary) should be
47246 +          set by automatic or "manual" means. AUTOMATIC is the default,
47247 +          which allows any of the automatic methods that are enabled to do
47248 +          their jobs: FILE SCAN, FILE PATTERNS, peer recognition, etc.
47249 +          MANUAL lets you control the transfer mode with the SET FILE TYPE
47250 +          commands. As always, /TEXT and /BINARY switches on your
47251 +          file-transfer commands override all other methods; if you give
47252 +          one of these switches, scanning is not done. SHOW TRANSFER
47253 +          displays the current TRANSFER MODE setting.
47254 +
47255 +   SET FILE SCAN { ON [ number ], OFF }
47256 +          Turns this feature on and off. It's ON by default. When OFF, the
47257 +          previous rules apply (SET FILE PATTERNS, etc). When ON is given,
47258 +          you can also specify a number of bytes to be scanned. The
47259 +          default is 49152 (= 48K). If a negative number is given, the
47260 +          entire file is scanned, no matter how big, for maximum certainty
47261 +          (for example, a PostScript file that appears to be plain text
47262 +          might include an embedded graphic past the normal scanning
47263 +          limit). SHOW FILE displays the current FILE SCAN setting.
47264 +
47265 +   SET FILE DEFAULT 7BIT-CHARACTER-SET name
47266 +          Tells the 7-bit character-set to use if scanning identifies a
47267 +          7-bit text file, e.g. GERMAN. SHOW FILE displays the current SET
47268 +          FILE DEFAULT settings. So does SHOW CHARACTER-SETS.
47269 +
47270 +   SET FILE DEFAULT 8BIT-CHARACTER-SET name
47271 +          Tells the 8-bit character-set to use if scanning identifies an
47272 +          8-bit text file, e.g. LATIN1. SHOW FILE and SHOW CHARACTER-SET
47273 +          display this.
47274 +
47275 +   ASSOCIATE FILE-CHARACTER-SET fcs tcs
47276 +          When sending files and a file character-set (fcs) is identified
47277 +          by scanning, this tells C-Kermit which transfer character-set
47278 +          (tcs) to translate it to. It also allows C-Kermit to set the
47279 +          appropriate transfer character-set automatically whenever you
47280 +          give a SET FILE CHARACTER-SET command.
47281 +
47282 +   ASSOCIATE TRANSFER-CHARACTER-SET tcs fcs
47283 +          When receiving files and a file arrives whose transfer
47284 +          character-set (tcs) is announced by the sender, this command
47285 +          tells C-Kermit which file character-set (fcs) to translate it
47286 +          to. It also allows C-Kermit to set the appropriate file
47287 +          character-set whenever you give a SET TRANSFER CHARACTER-SET
47288 +          command.
47289 +
47290 +   SET FILE CHARACTER-SET name
47291 +          When given for a 7-bit set, also sets FILE DEFAULT
47292 +          7BIT-CHARACTER-SET to the same set. When given for an 8-bit set,
47293 +          also sets FILE DEFAULT 8BIT-CHARACTER-SET to the same set. If an
47294 +          ASSOCIATE FILE-CHARACTER-SET command has been given for this
47295 +          set, also sets the corresponding transfer character-set.
47296 +
47297 +   DIRECTORY /XFERMODE [ filespec ]
47298 +          Performs a file scan of the given files, listing the result for
47299 +          each file. If FILE SCAN is OFF but PATTERNS are ON, the result
47300 +          shown according to the current FILE TEXT-PATTERNS and
47301 +          BINARY-PATTERNS, and are restricted to (B) and (T). When FILE
47302 +          SCAN is ON, the results are:
47303 +
47304 +  (B)          Binary
47305 +  (T)(7BIT)    Text: 7-bit
47306 +  (T)(8BIT)    Text: 8-bit
47307 +  (T)(UTF8)    Text: Unicode UTF8
47308 +  (T)(UCS2BE)  Text: Unicode UCS2 Big Endian
47309 +  (T)(UCS2LE)  Text: Unicode UCS2 Little Endian
47310 +
47311 +          So you can use DIR /XFER to get a preview of how each file in a
47312 +          selected group will be transferred. Everything to the right of
47313 +          the (B) or (T) is new. If FILE SCAN is OFF, you only get the (B)
47314 +          or (T) as before.
47315 +
47316 +          Note: Big and Little Endian refer to the ordering of bytes
47317 +          within a computer word. Big Endian architecture is standard and
47318 +          is used on most non-PC computers. Little Endian architecture is
47319 +          used on PCs.
47320 +
47321 +   To illustrate file-transfer with scanning, suppose you have a directory
47322 +   containing a mixture of text and binary files, and each text file can
47323 +   be 7-bit German ISO 646, 8-bit Latin-1, or Unicode in any of the
47324 +   following forms: UCS2 Little Endian, UCS2 Big Endian, or UTF8
47325 +   ([381]UTF-16 is not supported yet). Assuming all the built-in defaults
47326 +   are in effect, the following three commands do the job:
47327 +
47328 +  set file char german   ; This sets the default for 7-bit text files
47329 +  set file char latin1   ; This sets the default for 8-bit text files
47330 +  send *
47331 +
47332 +   Each file is sent in the appropriate mode (text or binary), with text
47333 +   files converted to the appropriate transfer character-set and labeled
47334 +   so the receiver can convert them according to its own local
47335 +   conventions.
47336 +
47337 +   By the way, what if you want to inhibit character-set translation but
47338 +   still allow automatic text/binary mode switching? Previously, you could
47339 +   simply SET TRANSFER CHARACTER-SET TRANSPARENT. But now with file
47340 +   scanning, the file and transfer character-sets are set automatically
47341 +   per file. A new command was added for this purpose:
47342 +
47343 +   SET TRANSFER TRANSLATION { ON, OFF }
47344 +          Enables and disables file-transfer character-set translation. It
47345 +          is enabled by default.
47346 +
47347 +   When TRANSFER TRANSLATION is OFF but FILE SCAN is ON, files are still
47348 +   scanned to see if they are text or binary, but no character-set
47349 +   translation is done when they text: only the normal record-format
47350 +   conversion.
47351 +
47352 +   Like all SET commands, SET TRANSFER TRANSLATION is global and
47353 +   persistent. You can also force a particular file-transfer command
47354 +   (SEND, MSEND, GET, RECEIVE, TRANSMIT, etc) to not translate without
47355 +   affecting the global translation settings by including the new
47356 +   /TRANSPARENT switch, e.g.
47357 +
47358 +  send /transparent oofa.txt
47359 +
47360 +   As of C-Kermit 8.0.206, SET TRANSFER CHARACTER-SET TRANSPARENT implies
47361 +   SET TRANSFER TRANSLATION OFF.
47362 +
47363 +   File scanning is also used in the TYPE command. The source file type
47364 +   and character set are determined as above, and then the file is
47365 +   automatically converted to your display character-set, line by line. In
47366 +   Kermit 95, the display character-set is Unicode, perhaps converted to
47367 +   your current console code page; in other versions of C-Kermit, it is
47368 +   your current file character-set. Thus if you have the following set
47369 +   appriately:
47370 +
47371 +  SET FILE CHARACTER-SET (necessary in Unix but not K95)
47372 +  SET FILE DEFAULT 7BIT CHARACTER-SET
47373 +  SET FILE DEFAULT 8BIT CHARACTER-SET
47374 +
47375 +   then you should be able to TYPE any text file and see something
47376 +   reasonable. For example, in Unix, if your DEFAULT 7BIT-CHARACTER-SET is
47377 +   ITALIAN and your DEFAULT 8BIT-CHARACTER-SET is LATIN1, and your FILE
47378 +   CHARACTER-SET is LATIN1, you can TYPE an Italian ISO 646 file, a
47379 +   Latin-1 file, or any kind of Unicode file, and have it translated
47380 +   automatically to Latin-1 for your display.
47381 +
47382 +   In the GUI version of Kermit 95, you can see mixtures of many different
47383 +   scripts if the file is UTF8 or UCS2: Roman, Cyrillic, Hebrew, Greek,
47384 +   Armenian, Georgian, etc, all on the same screen at once.
47385 +
47386 +   File scanning also adds a new criterion for file selection, i.e. to
47387 +   select only text (or binary) files. Several commands now include a new
47388 +   switch, /TYPE:{BINARY,TEXT,ALL}. BINARY means select only binary
47389 +   regular files (not directories). TEXT means select only text files. ALL
47390 +   means don't scan; select all files. Examples:
47391 +
47392 +   SEND /TYPE:BINARY *.*
47393 +          Sends only binary files, skipping over text files.
47394 +
47395 +   NOTE: File scanning is NOT done when using external protocols (because
47396 +   the external protocol programs, such as sz, are processing each file,
47397 +   not Kermit).
47398 +
47399 +   DIRECTORY /TYPE:TEXT
47400 +          Lists only text files but not binary files.
47401 +
47402 +   DELETE /TYPE:BINARY foo.*
47403 +          Deletes all foo.* files that are regular binary files but does
47404 +          not delete any text files.
47405 +
47406 +   CHMOD /TYPE:BINARY 775 *
47407 +          (UNIX) Changes the permissions of all binary files to 775.
47408 +
47409 +   When FILE SCAN is OFF and FILE PATTERNS are ON, behavior is as before
47410 +   with PATTERNS ON, but with some improvements:
47411 +
47412 +     * Pathnames are now stripped prior to pattern matching.
47413 +     * Backup suffixes (like .~3~) are stripped prior to pattern matching.
47414 +
47415 +   [ [382]Top ] [ [383]Contents ] [ [384]C-Kermit Home ] [ [385]Kermit
47416 +   Home ]
47417 +
47418 +5. FILE AND DIRECTORY NAMES CONTAINING SPACES
47419 +
47420 +   Prior to the introduction of the graphical user interface (GUI), it was
47421 +   inconceivable that file or directory names could contain spaces,
47422 +   because space is a field delimiter in all command languages. GUIs,
47423 +   however, use dialog boxes for filenames, so there is never any question
47424 +   of distinguishing a filename from adjacent fields -- because there are
47425 +   no adjacent fields -- and therefore it has become quite common on
47426 +   computers that have GUIs to have file and directory names composed of
47427 +   multiple words. Of course this poses problems for command shells and
47428 +   other text-oriented programs.
47429 +
47430 +   Most command shells address these problems by allowing such names to be
47431 +   enclosed in doublequotes, e.g.:
47432 +
47433 +  cd "c:\Program Files"
47434 +
47435 +   C-Kermit previously used braces for this:
47436 +
47437 +  cd {c:\Program Files}
47438 +
47439 +   which was not what most people expected. And even when braces were
47440 +   used, Kermit had difficulties with completion, file menus, and so
47441 +   forth, within braced fields.
47442 +
47443 +   C-Kermit 8.0 allows either doublequotes or braces to be used for
47444 +   grouping:
47445 +
47446 +  send "this file"
47447 +  send {this file}
47448 +  rename "this file" "that file"
47449 +  rename {this file} "that file"
47450 +  rename "this file" {that file}
47451 +  cd {Program Files}
47452 +  cd "Program Files"
47453 +
47454 +   Note that the doublequotes or brackets must enclose the whole file or
47455 +   directory specification:
47456 +
47457 +  "c:\My Directory"
47458 +
47459 +   not:
47460 +
47461 +  c:\"My Directory"
47462 +
47463 +   In C-Kermit 8.0, you can also use completion on these filenames, in
47464 +   which case Kermit supplies the quotes (or braces) automatically.
47465 +   Example (in which the current directory contains only one file whose
47466 +   name starts with "th" and its full name is "this file" (without the
47467 +   quotes, but with the space)):
47468 +
47469 +  cat th<Tab>
47470 +
47471 +   Kermit repaints the filename field like this:
47472 +
47473 +  cat "this file"
47474 +
47475 +   That is, it backspaces over the original "th" and then writes the
47476 +   filename in doublequotes.
47477 +
47478 +   If completion is only partial, Kermit still supplies the quotes, but in
47479 +   this case also beeps. To continue the filename, you must first
47480 +   backspace over the closing quote. The closing quote is supplied in this
47481 +   case to make sure that you can see the spaces, especially if they are
47482 +   trailing. For example, if the current directory contains two files
47483 +   whose names start with "th", and their fill names are "this file" and
47484 +   "this other file":
47485 +
47486 +  cat th<Tab>
47487 +
47488 +   Kermit prints:
47489 +
47490 +  cat "this "<Beep>
47491 +
47492 +   If it didn't print the closing quote, you would probably wonder why it
47493 +   was beeping.
47494 +
47495 +   Also, if you begin a filename field with a doublequote or opening
47496 +   brace, now you can use completion or get ?-help; this was never
47497 +   possible before.
47498 +
47499 + C-Kermit>type "thi? Input file specification, one of the following:
47500 +   this file        this other file
47501 + C-Kermit>type "thi_
47502 +
47503 +   [ [386]Top ] [ [387]Contents ] [ [388]C-Kermit Home ] [ [389]Kermit
47504 +   Home ]
47505 +
47506 +6. OTHER COMMAND PARSING IMPROVEMENTS
47507 +
47508 +6.1. Grouping Macro Arguments
47509 +
47510 +   Doublequotes now can be used in macro invocations to group arguments
47511 +   containing spaces, where previously only braces could be used:
47512 +
47513 +  define xx show args
47514 +  xx one "this is two" three
47515 +
47516 +   Result:
47517 +
47518 +  Macro arguments at level 0 (\v(argc) = 4):
47519 +   \%0 = xx
47520 +   \%1 = one
47521 +   \%2 = this is two
47522 +   \%3 = three
47523 +
47524 +   Also, you can now quote braces and quotes in macro args (this didn't
47525 +   work before). Examples:
47526 +
47527 +  xx "{"  ; The argument is a single left brace
47528 +  xx {"}  ; The argument is a doublequote character
47529 +
47530 +   In case this new behavior interferes with your scripts, you can restore
47531 +   the previous behavior with:
47532 +
47533 +  SET COMMAND DOUBLEQUOTING OFF
47534 +
47535 +6.2. Directory and File Name Completion
47536 +
47537 +   C-Kermit 8.0 also includes better completion for directory names, e.g.
47538 +   in the CD command. If the name typed so far uniquely matches a
47539 +   directory name, it is completed (as before), but now if the directory
47540 +   contains any subdirectories, completion is partial (allowing you to
47541 +   supply additional path segments without backspacing); otherwise it is
47542 +   complete.
47543 +
47544 +   Completion has also been improved for file and directory names that
47545 +   contain not only spaces (as described above) but also "metacharacters"
47546 +   such as asterisk (*) and tilde (~): now the field is repainted if
47547 +   necessary. For example, if the current directory contains only one file
47548 +   whose name contains "blah", then in:
47549 +
47550 +  type *blah<Tab>
47551 +
47552 +   "*blah" is replaced by the filename. In earlier releases, the part
47553 +   typed so far was left on the command line (and in the history buffer),
47554 +   so even when the original command worked, the recalled version would
47555 +   not. Similarly for ~ (the nearly-universal Unix notation for username):
47556 +
47557 +  type ~olga/x<Tab>
47558 +
47559 +   is repainted as (e.g.):
47560 +
47561 +  type /users/home/olga/x(Beep)
47562 +
47563 +   Speaking of command history, the new SHOW HISTORY command shows your
47564 +   command history and recall buffer. SAVE COMMAND HISTORY saves it into a
47565 +   file of your choice.
47566 +
47567 +6.3. Passing Arguments to Command Files
47568 +
47569 +   The method for passing arguments to command files has been improved.
47570 +   Prior to C-Kermit 7.0 there was no provision for doing this. In
47571 +   C-Kermit 7.0, the TAKE command was changed to allow arguments to be
47572 +   given after the filename:
47573 +
47574 +  take commandfile arg1 arg2 ...
47575 +
47576 +   This was accomplished by replacing the current \%1, \%2, etc, with the
47577 +   given arguments, since a new set of macro argument variables is created
47578 +   only when a macro is executed, not a command file. It is much more
47579 +   intuitive, however, if arguments to command files worked like those to
47580 +   macros: the command file sees the arguments as its own \%1, \%2, etc,
47581 +   but the caller's variables are not disturbed. C-Kermit 8.0 accomplishes
47582 +   this by automatically creating an intermediate temporary macro to start
47583 +   the command file (if any arguments were given), thus creating a new
47584 +   level of arguments as expected.
47585 +
47586 +6.4. More-Prompting
47587 +
47588 +   The familiar --more?-- prompt that appears at the end of each screenful
47589 +   of command-response output now accepts a new answer: G (Go) meaning
47590 +   "show all the rest without pausing and asking me any more questions". P
47591 +   (Proceed) is a synonym for G.
47592 +
47593 +6.5. Commas in Macro Definitions
47594 +
47595 +   As noted in the [390]C-Kermit manual, comma is used to separate
47596 +   commands in a macro definition. Even when the macro is defined on
47597 +   multiple lines using curly-brace block-structure notation without
47598 +   commas, the definition is still stored internally as a comma-separated
47599 +   list of commands. Therefore special tricks are needed to include a
47600 +   comma in a command. The classic example is:
47601 +
47602 +  define foo {
47603 +      (some command)
47604 +      if fail echo Sorry, blah failed...
47605 +  }
47606 +
47607 +   This would result in Kermit trying to execute a "blah" command. This
47608 +   could always be handled by enclosing the text in braces:
47609 +
47610 +  define foo {
47611 +      (some command)
47612 +      if fail echo {Sorry, blah failed...}
47613 +  }
47614 +
47615 +   but doublequotes (more intuitive) should have worked too. Now they do:
47616 +
47617 +  define foo {
47618 +      (some command)
47619 +      if fail echo "Sorry, blah failed..."
47620 +  }
47621 +
47622 +6.6. Arrow Keys
47623 +
47624 +   As of version 8.0.201, C-Kermit on most platforms lets you access the
47625 +   command history buffer with arrow keys, just as you always could with
47626 +   control characters. The restrictions are:
47627 +
47628 +    1. Only Up and Down arrow keys are accepted.
47629 +    2. Only 7-bit ANSI arrow-key sequences are understood (ESC followed by
47630 +       [ or uppercase letter O, followed by uppercase letter A or (up) B
47631 +       (down).
47632 +
47633 +   This change was made to facilitate command recall in Linux-based PDAs
47634 +   that don't have a Control key, or at least not one that's easily (or
47635 +   always) accessible, such as the Sharp Zaurus SL5500.
47636 +
47637 +   [ [391]Top ] [ [392]Contents ] [ [393]C-Kermit Home ] [ [394]Kermit
47638 +   Home ]
47639 +
47640 +7. NEW COMMANDS AND SWITCHES
47641 +
47642 +   See [395]Section 4 for more about file scanning and the /TYPE: switch.
47643 +
47644 +   ASK[Q] [ /TIMEOUT:number /QUIET /DEFAULT:text ] variable [ prompt ]
47645 +          The new optional /TIMEOUT: switch for ASK and ASKQ causes the
47646 +          command to time out and and fail if no response is given within
47647 +          the specified number of seconds, 1 or greater (0 or less means
47648 +          no timeout, wait forever). This works just like SET ASK-TIMER,
47649 +          except its effect is local to the ASK command with which it is
47650 +          given and it does not disturb the global ask timer setting. The
47651 +          new /QUIET switch tells Kermit not to print an error message if
47652 +          the ASK or ASKQ command times out waiting for a response.
47653 +
47654 +          Version 8.0.211 adds the /DEFAULT:text switch for ASK-Class
47655 +          commands (ASK, ASKQ, and GETOK). This lets you supply a default
47656 +          answer in case the user supplies an empty answer or the
47657 +          /TIMEOUT: switch was included and the time limit expired without
47658 +          an answer. In both these cases, the command succeeds.
47659 +
47660 +   CAT filename
47661 +          Equivalent to TYPE /NOPAGE.
47662 +
47663 +   CDUP
47664 +          Changes Kermit's local working directory to the parent of the
47665 +          current one. Equivalent to "cd .." in UNIX or Windows, "cd [-]"
47666 +          in VMS, "cd ^" in AOS/VS, etc; in other words, it's a
47667 +          platform-independent way of moving one level up in a directory
47668 +          tree.
47669 +
47670 +   CHMOD [ switches ] permission files
47671 +          UNIX only. Sets file permissions for one or more files or
47672 +          directories. The permission must be given as an octal number,
47673 +          e.g. 664, 755. Switches: /DIRECTORIES, /FILES, /NOLIST, /PAGE,
47674 +          /DOTFILES, /LIST, /NOPAGE, /RECURSIVE, /TYPE:{TEXT,BINARY,ALL},
47675 +          /SIMULATE. The /TYPE: switch allows selection of only text or
47676 +          binary files. For example, if you have a mixture of source files
47677 +          and executables, you can use "chmod /files /type:text 664" to
47678 +          give owner/group read/write and world read permission to the
47679 +          text files, and "chmod /files /type:binary 775" to give the same
47680 +          plus execute permission to the executables. Use /SIMULATE to see
47681 +          which files would be affected, without actually changing their
47682 +          permissions.
47683 +
47684 +   CLEAR KEYBOARD-BUFFER
47685 +          Flushes any as-yet unread characters from the keyboard input
47686 +          buffer. Useful for flushing typeahead in scripts.
47687 +
47688 +   CONTINUE
47689 +          When given at an interactive command prompt that was reached by
47690 +          issuing a PROMPT command (described in this section) from a
47691 +          script, this command returns to the script, continuing its
47692 +          execution at the command after the PROMPT command. In this
47693 +          context, CONTINUE is simply a more-intuitive synonym for END.
47694 +
47695 +   COPY, RENAME, and TRANSLATE
47696 +          These commands now work on file groups if the target filename is
47697 +          a directory, e.g. "copy oofa.* ..", "rename * ~olga/tmp/"
47698 +
47699 +   COPY /APPEND source destination
47700 +          The source file specification can now include wildcards, in
47701 +          which case all of the source files that match will go into the
47702 +          destination file in alphabetical order by name.
47703 +
47704 +   DELETE /ASK
47705 +          Asks permission to delete each file before deleting it. In
47706 +          C-Kermit 7.0, the answers were "yes" (or "ok") and "no".
47707 +          C-Kermit 8.0 adds "go" (meaning, delete all the rest without
47708 +          asking) and "quit" (cancel the DELETE command and return to the
47709 +          prompt).
47710 +
47711 +   DELETE /DIRECTORIES
47712 +          Deletes not only files but also directories.
47713 +
47714 +   DELETE /RECURSIVE
47715 +          Deletes all files that match the given file specification in the
47716 +          current (or given) directory and all directories beneath it.
47717 +
47718 +   DELETE /SUMMARY
47719 +          Prints only the number of files deleted and total size freed,
47720 +          without listing each file.
47721 +
47722 +   DELETE /TREE
47723 +          Shorthand for DELETE /RECURSIVE /DIRECTORIES /DOTFILES/.
47724 +          Equivalent to Windows DELTREE or Unix "rm -Rf". If no file
47725 +          specification is given, the contents of the current directory,
47726 +          plus all of its subdirectories and their contents, are deleted.
47727 +
47728 +   DELETE /TYPE:BINARY
47729 +          Delete only regular binary files (requires FILE SCAN ON).
47730 +
47731 +   DELETE /TYPE:TEXT
47732 +          Delete only regular text files (requires FILE SCAN ON).
47733 +
47734 +   DIRECTORY [ switches ] [ filespec [ filespec [ filespec ... ] ] ]
47735 +          The DIRECTORY command now accepts more than one file
47736 +          specification; e.g. "directory moon.txt sun.doc stars.*".
47737 +
47738 +   DIRECTORY /NORECURSIVE xxx
47739 +          If xxx is a directory name, forces listing of the directory
47740 +          itself rather than its contents.
47741 +
47742 +   DIRECTORY /FOLLOWLINKS xxx
47743 +          (UNIX only) Tells the DIRECTORY command to follow symbolic
47744 +          links. This not the default because it can cause endless loops.
47745 +
47746 +   DIRECTORY /NOFOLLOWLINKS xxx
47747 +          (UNIX only) Tells the DIRECTORY command not to follow symbolic
47748 +          links, but rather, merely to list them. This is the default.
47749 +
47750 +   DIRECTORY /OUTPUT:filename
47751 +          Sends the results of the DIRECTORY command to the given file.
47752 +
47753 +   DIRECTORY /SUMMARY
47754 +          Prints only the number of directories and files and the total
47755 +          size, without listing each file.
47756 +
47757 +   DIRECTORY /TYPE:{TEXT,BINARY}
47758 +          Shows only files of the selected type, based on file scan.
47759 +
47760 +   DIRECTORY /XFERMODE
47761 +          Now shows results of file scan (see [396]Section 4).
47762 +
47763 +   FOPEN [ switches ] channel filename
47764 +
47765 +          As of version 8.0.211, FOPEN allows /dev/tty as a filename in
47766 +          Unix-based operating systems.
47767 +
47768 +   FREAD /TRIM
47769 +          (8.0.211) Trims any trailing blanks or tabs from the item (such
47770 +          as a line of text) that it has read.
47771 +
47772 +   FREAD /UNTABIFY
47773 +          (8.0.211) Converts Horizontal Tab characters to the appropriate
47774 +          number of spaces, based on VT100-like tab stops (1,9,17,25,...).
47775 +
47776 +   GREP [ switches ] pattern files
47777 +          Similar to Unix grep command: displays file lines that match the
47778 +          given [397]pattern. Switches:
47779 +
47780 +        /COUNT[:variable]
47781 +                Don't show the matching lines, just tell how many lines
47782 +                match. If a variable name is specified, the count is
47783 +                stored in the given variable.
47784 +
47785 +        /DOTFILES
47786 +                Include files whose names begin with dot.
47787 +
47788 +        /LINENUMBERS
47789 +                Show line numbers of matching lines.
47790 +
47791 +        /NAMEONLY
47792 +                only list the names of files that contain matching lines,
47793 +                but not the lines themselves.
47794 +
47795 +        /NOBACKUP
47796 +                Skip backup files.
47797 +
47798 +        /NOCASE
47799 +                Ignore alphabetic case while pattern matching.
47800 +
47801 +        /NODOTFILES
47802 +                skip files whose names start with dot (period).
47803 +
47804 +        /NOLIST
47805 +                Suppress output but set SUCCESS or FAILURE according to
47806 +                search result.
47807 +
47808 +        /NOMATCH
47809 +                Look for lines that do not match the pattern.
47810 +
47811 +        /NOPAGE
47812 +                Don't pause between screens of output.
47813 +
47814 +        /OUTPUT:filename
47815 +                Write results into the given file.
47816 +
47817 +        /PAGE
47818 +                Pause between screens of output.
47819 +
47820 +        /RECURSIVE
47821 +                Search files in subdirectories too.
47822 +
47823 +        /TYPE:{TEXT,BINARY}
47824 +                Search only files of the specified type.
47825 +
47826 +          Synonyms: FIND, SEARCH.
47827 +
47828 +   GETOK /TIMEOUT:n /QUIET /DEFAULT:text
47829 +          The new /QUIET switch instructs GETOK, when given a timeout, not
47830 +          to print an error message if it times out. As of 8.0.211, a
47831 +          default answer can be supplied (see ASK).
47832 +
47833 +   HEAD [ switches ] filename
47834 +          Equivalent to TYPE /HEAD [ other-switches ] filename.
47835 +
47836 +   HELP DATE
47837 +          Explains date-time formats, including timezone notation and
47838 +          delta times.
47839 +
47840 +   HELP FIREWALLS
47841 +          Explains the firewall negotiation capabilities of your version
47842 +          of Kermit.
47843 +
47844 +   KCD [ symbolic-directory-name ]
47845 +          Changes Kermit's working directory to the named symbolic
47846 +          directory, such as such as exedir, inidir, startup, download, or
47847 +          and home. Type "kcd ?" for a list of symbolic directory names
47848 +          known to your copy of Kermit, or give the new ORIENTATION
47849 +          command for a more detailed explanation. If you give a KCD
47850 +          command without a directory name, Kermit returns to its "home"
47851 +          directory, which is determined in some way that depends on the
47852 +          underlying operating system, but which you can redefine with the
47853 +          (new) SET CD HOME command. Your home directory is shown by SHOW
47854 +          CD and it's also the value of the \v(home) variable.
47855 +
47856 +   LICENSE
47857 +          Displays the C-Kermit license.
47858 +
47859 +   L-commands
47860 +          When Kermit has a connection to a Kermit or FTP server, file
47861 +          managment commands such as CD, DIRECTORY, and DELETE might be
47862 +          intended for the local computer or the remote server. C-Kermit
47863 +          8.0.200 and earlier always executes these commands on the local
47864 +          computer. If you want them executed by the remote server, you
47865 +          have to prefix them with REMOTE (e.g. REMOTE CD) or use special
47866 +          R-command aliases (e.g. RCD = REMOTE CD, RDIR = REMOTE DIR,
47867 +          etc). But this feels unnatural to FTP users, who expect
47868 +          unprefixed file management commands to be executed by the remote
47869 +          server, rather than locally. C-Kermit 8.0.201 adds automatic
47870 +          locus switching to present an FTP-like interface for FTP
47871 +          connections and the normal Kermit interface for Kermit
47872 +          connections, and a SET LOCUS command (described below) to
47873 +          control whether or how this is done. For when LOCUS is REMOTE, a
47874 +          new set of commands was added for local management: LCD (Local
47875 +          CD), LDIR (Local DIR), etc. These are described below under SET
47876 +          LOCUS.
47877 +
47878 +   MORE filename
47879 +          Equivalent to TYPE /PAGE.
47880 +
47881 +   ORIENTATION
47882 +          Displays symbolic directory names and the corresponding variable
47883 +          names and values. The symbolic names, such as exedir, inidir,
47884 +          startup, download, and home, can be used as arguments to the new
47885 +          KCD command.
47886 +
47887 +   PROMPT [ text ]
47888 +          For use in a macro or command file: enters interactive command
47889 +          mode within the current context ([398]Section 8.1). If the
47890 +          optional text is included, the prompt is set to it. The text can
47891 +          include variables, functions, etc, as in the SET PROMPT command.
47892 +          They are evaluated each time the prompt is printed. Unlike the
47893 +          SET PROMPT command, the text argument applies only to the
47894 +          current command level. Thus you can have different prompts at
47895 +          different levels.
47896 +
47897 +   REMOTE SET MATCH { DOTFILE, FIFO } { ON, OFF }
47898 +          Allows the client to tell the server whether wildcards sent to
47899 +          the server should match dot files (files whose names begin with
47900 +          period) or FIFOs (named pipes). See SET MATCH.
47901 +
47902 +   SET ATTRIBUTE RECORD-FORMAT { ON, OFF }
47903 +          Allows control of the Kermit's Record-Format attribute. Set this
47904 +          to OFF in case incoming file are refused due to unknown or
47905 +          invalid record formats if you want to accept the file anyway
47906 +          (and, perhaps, postprocess it to fix its record format).
47907 +
47908 +   SET CD HOME [ directory ]
47909 +          Specifies the target directory for the CD and KCD commands, when
47910 +          they are given without an argument, and also sets the value of
47911 +          the \v(home) variable.
47912 +
47913 +   SET EXIT HANGUP { OFF, ON }
47914 +          Normally ON, meaning that when Kermit exits, it also explicitly
47915 +          hangs up the current SET LINE / SET PORT serial port according
47916 +          to the current SET MODEM TYPE and SET MODEM HANGUP METHOD, and
47917 +          closes the port device if it was opened by Kermit in the first
47918 +          place (as opposed to inherited). SET EXIT HANGUP OFF tells
47919 +          Kermit not to do this. This can't prevent the operating system
47920 +          from closing the device when Kermit exits (and it's a "last
47921 +          close") but if the port or modem have been conditioned to
47922 +          somehow ignore the close and keep the connection open, at least
47923 +          Kermit itself won't do anything explicit to hang it up or close
47924 +          it.
47925 +
47926 +   SET FILE EOF { CTRL-Z, LENGTH }
47927 +          Specifies the end-of-file detection method to be used by
47928 +          C-Kermit when sending and receiving text files, and in the TYPE
47929 +          and similar text-file oriented commands. The normal and default
47930 +          method is LENGTH. You can specify CTRL-Z when handling CP/M or
47931 +          MS-DOS format text files, in which a Ctrl-Z (ASCII 26) character
47932 +          within the file marks the end of the file.
47933 +
47934 +   SET FILE LISTSIZE number
47935 +          Allocates space for the given number of filenames to be filled
47936 +          in by the wildcard expander. The current number is shown by SHOW
47937 +          FILE. If you give a command that includes a filename containing
47938 +          a wildcard (such as "*") that matches more files that Kermit's
47939 +          list has room for, you can adjust the list size with this
47940 +          command.
47941 +
47942 +   SET FILE STRINGSPACE number
47943 +          Allocates space for the given amount of filename strings for use
47944 +          by the wildcard expander. The current number is shown by SHOW
47945 +          FILE. The number is the total number of bytes of all the file
47946 +          specifications that match the given wildcard.
47947 +
47948 +     If you need to process a bigger list of files than your computer has
47949 +     memory for, you might be able use an external file list. The Kermit
47950 +     SEND and the FTP PUT and GET commands accept a /LISTFILE: switch,
47951 +     which gives the name of a file that contains the list of files to be
47952 +     transferred. Example for UNIX:
47953 +
47954 +  !find . -print | grep / > /tmp/names
47955 +  ftp put /update /recursive /listfile:/tmp/names
47956 +
47957 +   SET LOCUS { AUTO, LOCAL, REMOTE }
47958 +          Added in C-Kermit 8.0.201.   Sets the locus for unprefixed file
47959 +          management commands such as CD, DIRECTORY, MKDIR, etc. When
47960 +          LOCUS is LOCAL these commands act locally and a REMOTE (or R)
47961 +          prefix (e.g. REMOTE CD, RCD, RDIR) is required to send file
47962 +          management commands to a remote server. When LOCUS is REMOTE, an
47963 +          L prefix is required to issue local file management commands
47964 +          (e.g. LCD, LDIR). The word LOCAL can't be used as a prefix since
47965 +          it is already used for declaring local variables. LOCUS applies
47966 +          to all types of connections, and thus is orthogonal to SET
47967 +          GET-PUT-REMOTE, which selects between Kermit and FTP for remote
47968 +          file-transfer and management commands. The default LOCUS is
47969 +          AUTO, which means we switch to REMOTE whenever an FTP connection
47970 +          is made, and to LOCAL whenever a non-FTP connection is made, and
47971 +          switch back accordingly whenever a connnection is closed. So by
47972 +          default, Kermit behaves in its traditional manner unless you
47973 +          make an FTP connection, in which case it acts like a regular FTP
47974 +          client (but better :-)   LOCUS applies to the following
47975 +          commands:
47976 +
47977 +  Unprefixed    Remote       Local        Description
47978 +   CD (CWD)      RCD          LCD          Change (Working) Directory
47979 +   CDUP          RCDUP        LCDUP        CD Up
47980 +   PWD           RPWD         LPWD         Print Working Directory
47981 +   DIRECTORY     RDIR         LDIR         Request a directory listinga
47982 +   DELETE        RDEL         LDEL         Delete (a) file(s)
47983 +   RENEME        RREN         LREN         Rename a file
47984 +   MKDIR         RMKDIR       LMKDIR       Create a directory
47985 +   RMDIR         RRMDIR       LRMDIR       Remove a directory
47986 +
47987 +   SET MATCH { DOTFILE, FIFO } { ON, OFF }
47988 +          Whether C-Kermit filename patterns (wildcards) should match
47989 +          filenames that start with dot (period), or (Unix only) FIFOs
47990 +          (named pipes). The defaults are to skip dotfiles in Unix but
47991 +          match them elsewhere, and to skip FIFOs. Applies to both
47992 +          interactive use and to server mode, when the server receives
47993 +          wildcards, e.g. in a GET command. Also see REMOTE SET MATCH.
47994 +
47995 +   SET OPTIONS DIRECTORY /DOTFILES
47996 +          Now works for server listings too (UNIX only). Give this command
47997 +          prior to having Kermit enter server mode, and then it will show
47998 +          files whose names begin with dot (period) when sent a REMOTE
47999 +          DIRECTORY command.
48000 +
48001 +   SET QUIET ON
48002 +          (as well as the -q command-line option) Now applies also to:
48003 +
48004 +          + SET HOST connection progress messages.
48005 +          + "Press the X or E key to cancel" file-transfer message.
48006 +          + REMOTE CD response.
48007 +          + REMOTE LOGIN response.
48008 +
48009 +   SET RECEIVE PERMISSIONS { ON, OFF }
48010 +          Tells C-Kermit whether to set the permissions of incoming files
48011 +          (received with Kermit protocol) from the permissions supplied in
48012 +          the file's Attribute packet (if any). Normally ON. Also see SET
48013 +          SEND PERMISSIONS.
48014 +
48015 +   SET ROOT directory
48016 +          Like UNIX chroot, without requiring privilege. Sets the root for
48017 +          file access, does not allow reference to or creation of files
48018 +          outside the root, and can't be undone.
48019 +
48020 +   SET SEND PERMISSIONS { ON, OFF }
48021 +          Tells C-Kermit whether to include file permissions in the
48022 +          attributes it includes with each file when sending with Kermit
48023 +          protocol. Also see SET RECEIVE PERMISSIONS.
48024 +
48025 +   SET TCP { HTTP-PROXY, SOCKS-SERVER } /USER:name /PASSWORD:text
48026 +          These commands now allow specification of username and password.
48027 +
48028 +   SET TERMINAL . . .
48029 +          (See [399]Section 12.)
48030 +
48031 +   SET TRANSFER MESSAGE [ text ]
48032 +          Sets an initial text message to be displayed in the
48033 +          file-transfer display. The transfer message is automatically
48034 +          deleted once used, so must be set each time a message a desired.
48035 +          Any variables in the message are evaluated at the time the SET
48036 +          command is given. If the optional text is omitted, any transfer
48037 +          message that is currently set is removed. Synonym: SET XFER MSG.
48038 +          SHOW TRANSFER displays it if it has been set but not yet used.
48039 +
48040 +   SHOW COMMUNICATIONS
48041 +          In C-Kermit 8.0, SHOW COMMUNICATIONS, when given in remote mode
48042 +          (i.e. before any connection has been established), tells the
48043 +          typical dialout device name for the particular platform on which
48044 +          it's running (e.g. TXA0: for VMS, or /dev/cua0p0 for HP-UX). On
48045 +          Unix platforms, it also tells the name of the lockfile
48046 +          directory. This way, you have an idea of what the SET LINE
48047 +          device name should look like, and if the SET LINE command fails,
48048 +          you know the name of the directory or device that is protected
48049 +          against you.
48050 +
48051 +   SHOW VARIABLES [ name [ name [ ... ] ] ]
48052 +          In C-Kermit 8.0.201 you can request values of a list of built-in
48053 +          (\v(xxx)) variables. Each name is a pattern, as before, but now
48054 +          it a free pattern rather than an anchored one (explained in
48055 +          [400]Section 8.12) so now "show var date time" shows the values
48056 +          of all variables whose names include the strings "date" or
48057 +          "time".
48058 +
48059 +   TAIL [ switches ] filename
48060 +          Equivalent to TYPE /TAIL [ other-switches ] filename.
48061 +
48062 +   TRANSMIT /NOECHO [ other switches ] filename
48063 +          The /NOECHO switch is equivalent to giving the command SET
48064 +          TRANSMIT ECHO OFF prior to the TRANSMIT command, except the
48065 +          switch affects only the command with which it was given and does
48066 +          not affect the prevailing global setting.
48067 +
48068 +   TRANSMIT /NOWAIT [ other switches ] filename
48069 +          The /NOWAIT switch is equivalent to giving the command SET
48070 +          TRANSMIT PROMPT 0 prior to the TRANSMIT command, except the
48071 +          switch affects only the command with which it was given and does
48072 +          not affect the prevailing global setting.
48073 +
48074 +   TRANSMIT /NOWAIT /NOECHO /BINARY [ other switches ] filename
48075 +          When the TRANSMIT command is given with the /NOWAIT, /NOECHO,
48076 +          and /BINARY switches, this activates a special "blast the whole
48077 +          file out the communications connection all at once" mode that
48078 +          Kermit didn't have prior to version 8.0. There has been
48079 +          increasing demand for this type of transmission with the advent
48080 +          of devices that expect image (e.g. .JPG) or sound (e.g. .MP3)
48081 +          files as raw input. The obvious question is: how does the
48082 +          receiving device know when it has the whole file? This depends
48083 +          on the device, of course; usually after a certain amount of time
48084 +          elapses with nothing arriving, or else when Kermit hangs up or
48085 +          closes the connection.
48086 +
48087 +   TYPE /CHARACTER-SET:name
48088 +          Allows you to specify the character set in which the file to be
48089 +          typed is encoded.
48090 +
48091 +   TYPE /NUMBER
48092 +          Adds line numbers.
48093 +
48094 +   TYPE /OUTPUT:filename
48095 +          Sends the results of the TYPE command to the given file.
48096 +
48097 +   TYPE /TRANSLATE-TO:name
48098 +          Used in conjunction with TYPE /CHARACTER-SET:xxx; allows you to
48099 +          specify the character set in which the file is to be displayed.
48100 +
48101 +   TYPE /TRANSPARENT
48102 +          Used to disable character-set translation in the TYPE command,
48103 +          which otherwise can take place automatically based on file
48104 +          scanning, even when /CHARACTER-SET and /TRANSLATE-TO switches
48105 +          are not given.
48106 +
48107 +   VOID text
48108 +          Parses the text, evaluating any backslash items in it (such as
48109 +          function calls) but doesn't do anything further, except possibly
48110 +          printing error messages. Useful for invoking functions that have
48111 +          side effects without using or printing their direct results,
48112 +          e.g. "void \fsplit(\%a,&a)".
48113 +
48114 +Symbolic Links in UNIX
48115 +
48116 +   The UNIX versions of C-Kermit have had /FOLLOWLINKS and /NOFOLLOWLINKS
48117 +   switches added to several commands to control the treatment of symbolic
48118 +   links. Different commands deal differently with symbolic links:
48119 +
48120 +   Kermit SEND, FTP MPUT
48121 +          /NOFOLLOWLINKS is the default, which means symbolic links are
48122 +          skipped entirely. The alternative, /FOLLOWLINKS, should be used
48123 +          with caution, since an innocent link might point to a whole file
48124 +          system, or it might cause a loop. There is no way in Kermit or
48125 +          FTP protocol to send the link itself. We either skip them or
48126 +          follow them; we can't duplicate them.
48127 +
48128 +   DIRECTORY
48129 +          /NOFOLLOWLINKS is the default, which means the DIRECTORY command
48130 +          lists symbolic links in a way that shows they are links, but it
48131 +          does not follow them. The alternative, /FOLLOWLINKS, follows
48132 +          links and gives information about the linked-to directories and
48133 +          files.
48134 +
48135 +   DELETE, RMDIR
48136 +          The DELETE command does not have link-specific switches. DELETE
48137 +          never follows links. If you tell Kermit to delete a symbolic
48138 +          link, it deletes the link itself, not the linked-to file. Ditto
48139 +          for RMDIR.
48140 +
48141 +   COPY
48142 +          The COPY command behaves just like the UNIX cp command; it
48143 +          always follows links.
48144 +
48145 +   RENAME
48146 +          The RENAME command behaves just like the UNIX mv command; it
48147 +          operates on links directly rather than following.
48148 +
48149 +   [ [401]Top ] [ [402]Contents ] [ [403]C-Kermit Home ] [ [404]Kermit
48150 +   Home ]
48151 +
48152 +8. OTHER SCRIPTING IMPROVEMENTS
48153 +
48154 +8.1. Performance and Debugging
48155 +
48156 +   A command cache for frequently used commands plus some related
48157 +   optimizations increases the speed of compute-bound scripts by anywhere
48158 +   from 50% to 1000%.
48159 +
48160 +   The new PROMPT command can be used to set breakpoints for debugging
48161 +   scripts. If executed in a command file or macro, it gives you an
48162 +   interactive command prompt in the current context of the script, with
48163 +   all its variables, arguments, command stack, etc, available for
48164 +   examination or change, and the ability to resume the script at any
48165 +   point (END resumes it, Ctrl-C or STOP cancels it and returns to top
48166 +   level).
48167 +
48168 +   The new Ctrl-C trapping feature ([405]Section 8.14) lets you intercept
48169 +   interruption of scripts. This can be used in combination with the
48170 +   PROMPT command to debug scripts. Example:
48171 +
48172 +define ON_CTRLC {
48173 +    echo INTERRUPTED BY CTRL-C...
48174 +    echo The command stack has not yet been rolled back:
48175 +    show stack
48176 +    echo Type Ctrl-C again or use the END command to return to top level.
48177 +    prompt Debug>
48178 +}
48179 +
48180 +   Adding this ON_CTRL definition to your script lets you interrupt it at
48181 +   any point and get prompt that is issued at the current command level,
48182 +   so you can query local variables, etc.
48183 +
48184 +   [ [406]Top ] [ [407]Contents ] [ [408]C-Kermit Home ] [ [409]Kermit
48185 +   Home ]
48186 +
48187 +8.2. Using Macros as Numeric Variables
48188 +
48189 +   A macro is a way to assign a value to a name, and then use the name to
48190 +   refer to the value. Macros are used in two ways in Kermit: as
48191 +   "subroutines" or functions composed of Kermit commands, which are
48192 +   executed, or as variables to hold arbitrary values -- text, numbers,
48193 +   filenames, etc.
48194 +
48195 +   When a macro is to be executed, its name is given as if it were a
48196 +   C-Kermit command, optionally preceded by the word "do". When a macro is
48197 +   used as a variable, it must be "escaped" with \m(xxx) (or equivalent
48198 +   function, e.g. \s(xxx), \:(xxx), \fdefinition(xxx)), where xxx is the
48199 +   macro name, for example:
48200 +
48201 +  define filename /usr/olga/oofa.txt
48202 +  send \m(filename)
48203 +
48204 +   Of course variables can also hold numbers:
48205 +
48206 +  define size 17
48207 +  declare \&a[\m(size)]
48208 +  ...
48209 +  define index 3
48210 +  if ( == \m(index) 3 ) echo The third value is: \&a[\m(index)]
48211 +  evaluate index (\m(index) * 4)
48212 +  if ( > \m(index) \m(size) ) echo Out of range!
48213 +
48214 +   But these are contexts in which only numbers are valid. C-Kermit 8.0
48215 +   has been changed to treat non-escaped non-numeric items in strictly
48216 +   numeric contexts as macro names. So it is now possible (but not
48217 +   required) to omit the \m(...) notation and just use the macro name in
48218 +   these contexts:
48219 +
48220 +  define size 17
48221 +  declare \&a[size]
48222 +  ...
48223 +  define index 3
48224 +  if ( == index 3 ) echo The third value is: \&a[index]
48225 +  evaluate index (index * 4)
48226 +  if ( > index size ) echo Out of range!
48227 +
48228 +   This is especially nice for loops that deal with arrays. Here, for
48229 +   example, is a loop that reverses the order of the elements in an array.
48230 +   Whereas formerly it was necessary to write:
48231 +
48232 +  .\%n ::= \fdim(&a)
48233 +  for \%i 1 \%n/2 1 {
48234 +      .tmp := \&a[\%n-\%i+1]
48235 +      .\&a[\%n-\%i+1] := \&a[\%i]
48236 +      .\&a[\%i] := \m(tmp)
48237 +  }
48238 +
48239 +   Recoding this to use macro names "i" and "n" instead of the backslash
48240 +   variables \%i and \%n, we have:
48241 +
48242 +  .n ::= \fdim(&a)
48243 +  for i 1 n/2 1 {
48244 +      .tmp := \&a[n-i+1]
48245 +      .\&a[n-i+1] := \&a[i]
48246 +      .\&a[i] := \m(tmp)
48247 +  }
48248 +
48249 +   which reduces the backslash count to less than half. The final
48250 +   statement in the loop could be written ".\&a[i] ::= tmp" if the array
48251 +   contained only numbers (since ::= indicates arithmetic expression
48252 +   evaluation).
48253 +
48254 +   Also, now you can use floating-point numbers in integer contexts (such
48255 +   as array subscripts), in which case they are truncated to an integer
48256 +   value (i.e. the fractional part is discarded).
48257 +
48258 +   Examples of numeric contexts include:
48259 +
48260 +     * Array subscripts.
48261 +     * Any numeric function argument.
48262 +     * Right-hand side of ::= assignments.
48263 +     * EVALUATE command or \fevaluate() function expression.
48264 +     * The INCREMENT or DECREMENT by-value.
48265 +     * IF =, >, <, !=, >=, and <= comparands.
48266 +     * The IF number construct.
48267 +     * FOR-loop variables.
48268 +     * STOP, END, and EXIT status codes.
48269 +     * The INPUT timeout value.
48270 +     * PAUSE, WAIT, SLEEP, MSLEEP intervals.
48271 +     * The SHIFT argument.
48272 +     * Numeric switch arguments, e.g. TYPE /WIDTH:number, SEND
48273 +       /LARGER:number.
48274 +     * SCREEN MOVE-TO row and column number.
48275 +     * Various SET DIAL parameters (timeout, retry limit, etc).
48276 +     * Various SET SEND or RECEIVE parameters (packet length, window size,
48277 +       etc).
48278 +     * Various other SET parameters.
48279 +
48280 +   and:
48281 +
48282 +     * S-Expressions (explained in [410]Section 9).
48283 +
48284 +   Macro names used in numeric contexts must not include mathematical
48285 +   operators. Although it is legal to create a macro called "foo+bar", in
48286 +   a numeric context this would be taken as the sum of the values of "foo"
48287 +   and "bar". Any such conflict can be avoided, of course, by enclosing
48288 +   the macro name in \m(...).
48289 +
48290 +   [ [411]Top ] [ [412]Contents ] [ [413]C-Kermit Home ] [ [414]Kermit
48291 +   Home ]
48292 +
48293 +8.3. New IF Conditions
48294 +
48295 +   Several new IF conditions are available:
48296 +
48297 +   IF DECLARED arrayname
48298 +          Explained in [415]Section 8.6.
48299 +
48300 +   IF KBHIT
48301 +          Allows a script to test whether a key was pressed without
48302 +          actually trying to read it.
48303 +
48304 +   IF KERBANG (Unix only)
48305 +          True if Kermit was started from a Kerbang script. This is useful
48306 +          for knowing how to interpret the \&@[] and \&_[] argument vector
48307 +          arrays, and under what conditions to exit.
48308 +
48309 +   IF INTEGER n
48310 +          This is just a synonym for IF NUMERIC, which is true if n
48311 +          contains only digits (or, if n is a variable, its value contains
48312 +          only digits).
48313 +
48314 +   By contrast, IF FLOAT n succeeds if n is a floating-point number OR an
48315 +   integer (or a variable with floating-point or integer value).
48316 +   Therefore, IF FLOAT should be used whenever any kind of number is
48317 +   acceptable, whereas IF INTEGER (or IF NUMERIC) when only an integer can
48318 +   be used.
48319 +
48320 +   [ [416]Top ] [ [417]Contents ] [ [418]C-Kermit Home ] [ [419]Kermit
48321 +   Home ]
48322 +
48323 +8.4. The ON_UNKNOWN_COMMAND Macro
48324 +
48325 +   The new ON_UNKNOWN_COMMAND macro, if defined, is executed whenever you
48326 +   give a command that is not known to C-Kermit; any operands are passed
48327 +   as arguments. Here are some sample definitions:
48328 +
48329 +  DEF ON_UNKNOWN_COMMAND telnet \%1 ; Treat unknown commands as hostnames
48330 +  DEF ON_UNKNOWN_COMMAND dial \%1   ; Treat unknown commands phone numbers
48331 +  DEF ON_UNKNOWN_COMMAND take \%1   ; Treat unknown commands as filenames
48332 +  DEF ON_UNKNOWN_COMMAND !\%*       ; Treat unknown commands as shell commands
48333 +
48334 +   The ON_CD macro, if defined, is executed whenever Kermit is given a CD
48335 +   (change directory) command (8.0.211). Upon entry to this macro, the
48336 +   directory has already changed and the new directory string is available
48337 +   in the \v(directory) variable, and also as the first argument (\%1).
48338 +
48339 +   [ [420]Top ] [ [421]Contents ] [ [422]C-Kermit Home ] [ [423]Kermit
48340 +   Home ]
48341 +
48342 +8.5. The SHOW MACRO Command
48343 +
48344 +   The SHOW MACRO command has been changed to accept more than one macro
48345 +   name:
48346 +
48347 +  (setq a 1 b 2 c 3)
48348 +  show mac a b c
48349 +  a = 1
48350 +  b = 2
48351 +  c = 3
48352 +
48353 +   An exact match is required for each name (except that case doesn't
48354 +   matter). If you include wildcard characters, however, a pattern match
48355 +   is performed:
48356 +
48357 +  show mac [a-c]*x
48358 +
48359 +   shows all macros whose names start with a, b, or c, and end with x.
48360 +
48361 +   [ [424]Top ] [ [425]Contents ] [ [426]C-Kermit Home ] [ [427]Kermit
48362 +   Home ]
48363 +
48364 +8.6. Arrays
48365 +
48366 +   A clarification regarding references to array names (as opposed to
48367 +   array elements): You can use array-name "abbreviations" like &a only in
48368 +   contexts that expect array names, like ARRAY commands or array-name
48369 +   function arguments such as the second argument of \fsplit(). In a LOCAL
48370 +   statement, however, you have to write \&a[], since "local &a" might
48371 +   refer to a macro named "&a".
48372 +
48373 +   In function arguments, however, you MUST use the abbreviated form:
48374 +   \fsplit(\%a,&a) or \fsplit(\%a,&a[]). If you include the backslash (as
48375 +   in "\fsplit(\%a,\&a[])") a parse error occurs.
48376 +
48377 +   Here are the new array-related commands:
48378 +
48379 +   IF DECLARED arrayname
48380 +          Allows a script to test whether an array has been declared. The
48381 +          arrayname can be a non-array backslash variable such as \%1 or
48382 +          \m(name), in which case it is evaluated first, and the result is
48383 +          treated as the array name. Otherwise, arrayname is treated as in
48384 +          the ARRAY commands: it can be a, &a, &a[], \&a, \&a[], \&a[3],
48385 +          \&a[3:9], etc, with the appropriate results in each case.
48386 +          Synonym: IF DCL.
48387 +
48388 +   UNDECLARE arrayname
48389 +          UNDECLARE is a new top-level command to undeclare an array.
48390 +          Previously this could only be done with "declare \&a[0]" (i.e.
48391 +          re-declare the array with a dimension of 0).
48392 +
48393 +   ARRAY LINK linkname arrayname
48394 +          Creates a symbolic link from the array named by linkname (which
48395 +          must be the name of an array that is not yet declared in the
48396 +          current context) to the array named by arrayname (which must the
48397 +          name of a currently declared array that is not itself a link, or
48398 +          a variable containing the name of such an array). The two names
48399 +          indicate the same array: if you change an array element, the
48400 +          change is reflected in the link too, and vice versa. If you
48401 +          undeclare the link, the real array is unaffected. If you
48402 +          undeclare the real array, all links to it disappear. If you
48403 +          resize an array (directly or through a link), all links to it
48404 +          are updated automatically.
48405 +
48406 +   Array links let you pass array names as arguments to macros. For
48407 +   example, suppose you had a program that needed to uppercase all the
48408 +   elements of different arrays at different times. You could write a
48409 +   macro to do this, with the array name as an argument. But without array
48410 +   links, there would be no way to refer to the argument array within the
48411 +   macro. Array links make it easy:
48412 +
48413 +  define arrayupper {
48414 +      local \&e[] \%i
48415 +      array link \&e[] \%1
48416 +      for i 1 \fdim(&e) 1 { .\&e[i] := \fupper(\&e[i]) }
48417 +  }
48418 +  declare \&a[] = these are some words
48419 +  arrayupper &a
48420 +  show array &a
48421 +
48422 +   The macro declares the array link LOCAL, which means it doesn't
48423 +   conflict with any array of the same name that might exist outside the
48424 +   macro, and that the link is destroyed automatically when the macro
48425 +   exits. This works, by the way, even if the link name and the macro
48426 +   argument name are the same, as long as the link is declared LOCAL.
48427 +
48428 +   As noted, you can't make a link to a nonexistent array. So when writing
48429 +   a macro whose job is to create an array whose name is passed as an
48430 +   argument, you must declare the array first (the size doesn't matter as
48431 +   long as it's greater than 0). Example:
48432 +
48433 +  define tryme {                ; Demonstration macro
48434 +      local \&e[]               ; We only need this inside the macro
48435 +      array link \&e[] \%1      ; Make local link
48436 +      shift                     ; Shift argument list
48437 +      void \fsplit(\%*,&e)      ; Split remainder of arg list into array
48438 +  }
48439 +  declare \&a[1]                ; Declare target array in advance
48440 +  tryme &a here are some words  ; Invoke the macro with array name and words
48441 +  show array a                  ; See the results
48442 +
48443 +   One final improvement allows the macro itself to declare the array
48444 +   (this was not possible in earlier Kermit releases): if the array name
48445 +   in the DECLARE command is a variable (and not an array name), or
48446 +   includes variables, the resulting value is used as the array name. So:
48447 +
48448 +  define tryme {                ; Demonstration macro
48449 +      declare \%1[1]            ; Preliminary declaration for target array
48450 +      local \&e[]               ; We only need this inside the macro
48451 +      array link \&e[] \%1      ; Make local link
48452 +      shift                     ; Shift argument list
48453 +      void \fsplit(\%*,&e)      ; Split remainder of arg list into array
48454 +  }
48455 +  tryme &a here are some words  ; Invoke the macro with array name and words
48456 +  show array a                  ; See the results
48457 +
48458 +   The SHOW ARRAY command now indicates whether an array name is a link.
48459 +
48460 +   Also see the descriptions of [428]\fjoin() and [429]\fsplit(), plus
48461 +   [430]Section 8.10 on the MINPUT command, which shows how an entire
48462 +   array (or segment of it) can be used as the MINPUT target list.
48463 +
48464 +   [ [431]Top ] [ [432]Contents ] [ [433]C-Kermit Home ] [ [434]Kermit
48465 +   Home ]
48466 +
48467 +8.7. New or Improved Built-in Variables and Functions
48468 +
48469 +   The following new built-in variables are available:
48470 +
48471 +  \v(buildid)       A date string like "20000808" indicating when C-Kermit was b
48472 +uilt.
48473 +  \v(ftime)         Current time, secs since midnight, including fraction of sec
48474 +ond.
48475 +  \v(iprompt)       The current SET PROMPT value
48476 +  \v(sexp)          The most recent S-Expression (see [435]Section 9)
48477 +  \v(sdepth)        The current S-Expression invocation depth ([436]Section 9)
48478 +  \v(svalue)        The value of the most recent S-Expression ([437]Section 9)
48479 +
48480 +  \v(ftp_code)      Most recent FTP response code ([438]Section 3)
48481 +  \v(ftp_connected) FTP connection status ([439]Section 3)
48482 +  \v(ftp_cpl)       FTP Command Protection Level ([440]Section 3.2)
48483 +  \v(ftp_dpl)       FTP Data Protection Level ([441]Section 3.2)
48484 +  \v(ftp_getputremote) The current SET GET-PUT-REMOTE setting ([442]Section 3.8)
48485 +
48486 +  \v(ftp_host)      Name or IP address of FTP server ([443]Section 3)
48487 +  \v(ftp_loggedin)  FTP login status ([444]Section 3)
48488 +  \v(ftp_message)   Most recent FTP response message ([445]Section 3)
48489 +  \v(ftp_security)  FTP Security method ([446]Section 3.2)
48490 +  \v(ftp_server)    OS type of FTP server ([447]Section 3)
48491 +
48492 +  \v(http_code)       Most recent HTTP response code
48493 +  \v(http_connected)  HTTP connection status
48494 +  \v(http_host)       Name or IP address of HTTP server
48495 +  \v(http_message)    Most recent HTTP response message
48496 +  \v(http_security)   TLS cipher used to secure the HTTP session
48497 +
48498 +  \v(hour)            Hour of the day, 0 to 23.
48499 +  \v(timestamp)       Equivalent to "\v(ndate) \v(time)".
48500 +
48501 +  \v(log_debug)       Current debug log file, if any.
48502 +  \v(log_packet)      Current packet log file, if any.
48503 +  \v(log_session)     Current session log file, if any.
48504 +  \v(log_transaction) Current transaction log file, if any.
48505 +  \v(log_connection)  Current connection log file, if any.
48506 +
48507 +   The following new or improved built-in functions are available:
48508 +
48509 +  \fcmdstack()            Allows programmatic access to the command stack.
48510 +  \fcvtdate()             [448]Section 8.13, format options added
48511 +  \fdelta2secs()          [449]Section 8.13
48512 +  \fdostounixpath(s1)     Converts a DOS filename to Unix format.
48513 +  \fsplit()               Now allows grouping/nesting in source string.
48514 +  \fword()                Allows the same grouping and nesting.
48515 +  \fjoin(&a,s1,n1,n2)     Copies an array into a single string.
48516 +  \fsubstitute(s1,s2,s3)  Substitutes characters within a string.
48517 +  \freplace()             Has new 4th "occurrence" argument.
48518 +  \fsexpression()         Evaluates an S-Expression (explained in [450]Section 9
48519 +).
48520 +  \ftrim(), \fltrim()     Now trim CR and LF by default, as well as SP and Tab.
48521 +  \funixtodospath(s1)     Converts a Unix filename to DOS format.
48522 +  \fkeywordval(s1,c1)     Assigns values to keywords (macros) (explained below).
48523 +
48524 +   Most functions that have "2" in their names to stand for the word "to"
48525 +   can now also be written with "to", e.g. "\fdelta2secs(),"
48526 +   \fdeltatosecs()."
48527 +
48528 +   \funtabify(string)
48529 +          (New to 8.0.211) Replaces Horizontal Tab characters in the given
48530 +          string with spaces based on VT100-like tab stops.
48531 +
48532 +   \fverify(s1,s2,n)
48533 +          As of version 8.0.211, returns -1 if s2 is an empty string.
48534 +          Previously it returned 0, making \fverify(abc,\%a) look as if
48535 +          \%a was a string combosed of a's, b's, and/or c's when in fact
48536 +          it contained nothing.
48537 +
48538 +   \fcode(string)
48539 +          As of version 8.0.211, returns 0 if string is empty or missing.
48540 +          Previously it returned the empty string, which made it unsafe to
48541 +          use in arithmetic or boolean expressions.
48542 +
48543 +   \v(inscale)
48544 +          New to version 8.0.211, its value is the INPUT SCALE-FACTOR
48545 +          ([451]Section 8.10), default 1.0.
48546 +
48547 +8.7.1. The \fkeywordval() Function
48548 +
48549 +   \fkeywordval(s1,c1) is new to C-Kermit 8.0. Given a string s1 of the
48550 +   form "name=value", it creates a macro with the given name and assigns
48551 +   it the given value. If no value appears after the equal sign, any
48552 +   existing macro of the given name is undefined. Blanks are automatically
48553 +   trimmed from around the name and value. The optional c1 parameter is
48554 +   the assignment operator character, equal sign (=) by default. This
48555 +   function is handy for processing keyword parameters or any other form
48556 +   of parameter-value pair. Suppose, for example, you want to write a
48557 +   macro that accepts keyword parameters rather than positional ones:
48558 +
48559 +  define MYDIAL {
48560 +      local \%i modem hangup method device speed number
48561 +      def number 5551234          ; Assign default parameter values
48562 +      def speed 57600
48563 +      def modem usrobotics
48564 +      def hangup rs232
48565 +      def method tone
48566 +      def country 1
48567 +      for \%i 1 \v(argc)-1 1 {    ; Parse any keyword parameters...
48568 +          if not \fkeywordval(\&_[\%i]) end 1 Bad parameter: "\&_[\%i]"
48569 +      }
48570 +      set dial country \m(country)
48571 +      set modem type \m(modem)
48572 +      set modem hang \m(hangup)
48573 +      set dial method \m(tone)
48574 +      set line \m(device)
48575 +      if fail stop 1
48576 +      set speed \m(speed)
48577 +      if fail stop 1
48578 +      show comm
48579 +      set dial display on
48580 +      dial \m(number)
48581 +      if success connect
48582 +  }
48583 +
48584 +   In this example, all the defaults are set up inside the macro, and
48585 +   therefore it can be invoked with no parameters at all. But if you want
48586 +   to have the macro dial a different number, you can supply it as
48587 +   follows:
48588 +
48589 +  mydial number=7654321
48590 +
48591 +   You can supply any number of keyword parameters, and you can give them
48592 +   in any order:
48593 +
48594 +  mydial number=7654321 hangup=modem speed=115200
48595 +
48596 +8.7.2. The \fsplit(), \fjoin(), and \fword() Functions
48597 +
48598 +   \fjoin(&a,s1,n1,n2) is also new; it creates a string from an array (or
48599 +   a piece of one). &a is the name of the array (a range specifier can be
48600 +   included); s1 is a character or string to separate each element in the
48601 +   result string (can be omitted, in which case the elements are not
48602 +   separated at all), and n1 is a grouping mask, explained below. If s1 is
48603 +   empty or not specified, the array elements are separated with spaces.
48604 +   If you want the elements concatenated with no separator, include a
48605 +   nonzero n2 argument. Given the array:
48606 +
48607 +  declare \&a[] = 0 1 2 3 4 5 6 7 8 9
48608 +
48609 +   you can get effects like this:
48610 +
48611 +  \fjoin(&a)      0 1 2 3 4 5 6 7 8 9
48612 +  \fjoin(&a,:)    0:1:2:3:4:5:6:7:8:9
48613 +  \fjoin(&a,{,})  0,1,2,3,4,5,6,7,8,9
48614 +  \fjoin(&a,...)  0...1...2...3...4...5...6...7...8...9
48615 +  \fjoin(&a,,,1)  0123456789
48616 +
48617 +   \fsplit(), \fword(), \fstripb(), and \fjoin() accept a "grouping mask"
48618 +   argument, n1, which is a number from 0 to 63, in which:
48619 +
48620 +   1 = "" doublequotes
48621 +   2 = {} braces
48622 +   4 = '' singlequotes
48623 +   8 = () parentheses
48624 +  16 = [] square brackets
48625 +  32 = <> angle brackets
48626 +
48627 +   These can be OR'd (added) together to make any number 0-63 (-1 is
48628 +   treated the same as 63, 0 means no grouping). If a bit is on, the
48629 +   corresponding kind of grouping is selected. (If more than 1 bit is set
48630 +   for \fjoin(), only the lowest-order one is used.)
48631 +
48632 +   If you include the same character in the grouping mask and the include
48633 +   list, the grouping mask takes precedence. Example:
48634 +
48635 +  def \%a  a "b c d" e
48636 +  \fsplit(\%a,&a[],,,-1)  = 3  <-- doublequote used for grouping
48637 +  \fsplit(\%a,&a[],,",-1) = 3  <-- doublequote still used for grouping
48638 +
48639 +   Nesting of matched left and right grouping characters (parentheses,
48640 +   braces, and brackets, but not quotes) is recognized. Example:
48641 +
48642 +  def \%a a (b c <d e [f g {h i} j k] l m> n o) p
48643 +  \fsplit(\%a,&a,,,0)  = 16 (no grouping)
48644 +  \fsplit(\%a,&a,,,2)  = 15 (braces only)
48645 +  \fsplit(\%a,&a,,,16) = 11 (square brackets only)
48646 +  \fsplit(\%a,&a,,,32) =  7 (angle brackets only)
48647 +  \fsplit(\%a,&a,,,63) =  3 (all)
48648 +  \fsplit(\%a,&a,,,-1) =  3 (all)
48649 +
48650 +   \fsplit() and \fjoin() are "reciprocal" functions. You can split a
48651 +   string up into an array and join it back into a new string that is
48652 +   equivalent, as long as \fsplit() and \fjoin() are given equivalent
48653 +   grouping masks, except that the type of braces might change. Example:
48654 +
48655 +  def \%a a {b c [d e] f g} "h i" j <k l> m
48656 +  echo STRING=[\%a]
48657 +  echo WORDS=\fsplit(\%a,&a,,,-1)
48658 +  show array a
48659 +  asg \%b \fjoin(&a,{ },2)
48660 +  echo JOIN  =[\%b]
48661 +  echo WORDS=\fsplit(\%b,&b,,,-1)
48662 +  show array b
48663 +
48664 +   The arrays a and b are identical. The strings a and b are as follows:
48665 +
48666 +  \%a: a {b c [d e] f g} "h i" j <k l> m
48667 +  \%b: a {b c [d e] f g} {h i} j {k l} m
48668 +
48669 +   It is possible to quote separator grouping characters with backslash to
48670 +   override their grouping function. And of course to include backslash
48671 +   itself in the string, it must be quoted too. Furthermore, each
48672 +   backslash must be doubled, so the command parser will still pass one
48673 +   backslash to \fsplit() for each two that it sees. Here are some
48674 +   examples using \fsplit() with a grouping mask of 8 (treat parentheses
48675 +   as grouping characters).
48676 +
48677 +  String                  Result
48678 +    a b c d e f             6
48679 +    a b\\ c d e f           5
48680 +    a b (c d e) f           4
48681 +    a b \\(c d e\\) f       6
48682 +    a b \\\\(c d e\\\\) f   7
48683 +
48684 +   \fsplit() has also been changed to create its array (if one is given)
48685 +   each time it is called, so now it can be conveniently called in a loop
48686 +   without having to redeclare the array each time.
48687 +
48688 +   Incidentally... Sometimes you might want to invoke \fsplit() in a
48689 +   situation where you don't care about its return value, e.g. when you
48690 +   just want to fill the array. Now you can "call" \fsplit() or any other
48691 +   function with the new [452]VOID command:
48692 +
48693 +  void \fsplit(\%a,&a)
48694 +
48695 +   \fsplit() and \fjoin() also accept a new, optional 6th argument, an
48696 +   options flag, a number that can specify a number of options. So far
48697 +   there is just one option, whose value is 1:
48698 +
48699 +   separator-flag
48700 +          Normally separators are collapsed. So, for example,
48701 +
48702 +  \fword(Three        little          words,2)
48703 +
48704 +          returns "little" (the second word). Space is a separator, but
48705 +          there are multiple spaces between each word. If the value 1 is
48706 +          included in the option flag, however, each separator counts. If
48707 +          two separators are adjacent, an empty word is produced between
48708 +          them. This is useful for parsing (e.g.) comma-separated lists
48709 +          exported from databases or spreadsheets.
48710 +
48711 +8.7.3. The \fcmdstack() Function
48712 +
48713 +   The new \fcmdstack() function gives access to the command stack:
48714 +
48715 +   \fcmdstack(n1,n2)
48716 +          Arguments: n1 is the command stack level. If omitted, the
48717 +          current level, \v(cmdlevel), is used. n2 is a function code
48718 +          specifying the desired type of information:
48719 +
48720 +  0 (default) = name of object at level n1.
48721 +  1 (nonzero) = object type (0 = prompt; 1 = command file; 2 = macro).
48722 +
48723 +          The default for n2 is 0.
48724 +
48725 +   The name associated with prompt is "(prompt)". Here's a loop that can
48726 +   be included in a macro or command file to show the stack (similar to
48727 +   what the SHOW STACK command does):
48728 +
48729 +  for \%i \v(cmdlevel) 0 -1 {
48730 +      echo \%i. [\fcmdstack(\%i,1)] \fcmdstack(\%i,0)
48731 +  }
48732 +
48733 +   In this connection, note that \v(cmdfile) always indicates the most
48734 +   recently invoked active command file (if any), even if that file is
48735 +   executing a macro. Similarly, \v(macro) indicates the most recently
48736 +   invoked macro (if any), even if the current command source is not a
48737 +   macro. The name of the "caller" of the currently executing object
48738 +   (command file or macro) is:
48739 +
48740 +  \fcmdstack(\v(cmdlevel)-1)
48741 +
48742 +   and its type is:
48743 +
48744 +  \fcmdstack(\v(cmdlevel)-1,1)
48745 +
48746 +   To find the name of the macro that invoked the currently executing
48747 +   object, even if one or more intermediate command files (or prompting
48748 +   levels) are involved, use a loop like this:
48749 +
48750 +  for \%i \v(cmdlevel)-1 0 -1 {
48751 +      if = \fcmdstack(\%i,1) 2 echo CALLER = \fcmdstack(\%i,0)
48752 +  }
48753 +
48754 +   Of course if you make a macro to do this, the macro must account for
48755 +   its own additional level:
48756 +
48757 +  define CALLER {
48758 +      for \%i \v(cmdlevel)-2 0 -1 {
48759 +          if = \fcmdstack(\%i,1) 2 return \fcmdstack(\%i,0)
48760 +      }
48761 +      return "(none)"
48762 +  }
48763 +
48764 +   The built-in variable \v(cmdsource) gives the current command source as
48765 +   a word ("prompt", "file", or "macro").
48766 +
48767 +8.7.4. The VOID Command
48768 +
48769 +   VOID is like ECHO in that all functions and variables in its argument
48770 +   text are evaluated. but it doesn't print anything (except possibly an
48771 +   error message if a function was invocation contained or resulted in any
48772 +   errors). VOID sets FAILURE if it encounters any errors, SUCCESS
48773 +   otherwise.
48774 +
48775 +   [ [453]Top ] [ [454]Contents ] [ [455]C-Kermit Home ] [ [456]Kermit
48776 +   Home ]
48777 +
48778 +8.8. The RETURN and END Commands
48779 +
48780 +   The execution of a macro is terminated in any of the following ways:
48781 +
48782 +     * With an END [ number [ message ] ] command. If a number is given,
48783 +       the macro succeeds if the number is 0, and fails if it is not zero;
48784 +       if a number is not given, the macro succeeds.
48785 +     * With a STOP command, which works just like END except it peels back
48786 +       the command stack all the way to top level.
48787 +     * With a RETURN [ text ] command, in which case the macro always
48788 +       succeeds.
48789 +     * By running out of commands to execute, in which case the macro
48790 +       succeeds or fails according the most recently executed command that
48791 +       sets success or failure.
48792 +
48793 +   The same considerations apply to command files invoked by the TAKE
48794 +   command.
48795 +
48796 +   If a macro does not execute any commands that set success or failure,
48797 +   then invoking the macro does not change the current SUCCESS/FAILURE
48798 +   status. It follows, then, that the mere invocation of a macro does not
48799 +   change the SUCCESS/FAILURE status either. This makes it possible to
48800 +   write macros to react to the status of other commands (or macros), for
48801 +   example:
48802 +
48803 +  define CHKLINE {
48804 +      if success end 0
48805 +      stop 1 SET LINE failed - please try another device.
48806 +  }
48807 +  set modem type usrobotics
48808 +  set line /dev/cua0
48809 +  chkline
48810 +  set speed 57600
48811 +  dial 7654321
48812 +
48813 +   By the way, none of this is news. But it was not explicitly documented
48814 +   before, and C-Kermit 7.0 and earlier did not always handle the RETURN
48815 +   statement as it should have.
48816 +
48817 +   [ [457]Top ] [ [458]Contents ] [ [459]C-Kermit Home ] [ [460]Kermit
48818 +   Home ]
48819 +
48820 +8.9. UNDEFINing Groups of Variables
48821 +
48822 +   The UNDEFINE command, which previously accepted one variable name, now
48823 +   accepts a list of them, and also accepts wildcard notation to allow
48824 +   deletion of variables that match a given pattern.
48825 +
48826 +   UNDEFINE [ switches ] name [ name [ name [ ... ] ] ]
48827 +          Undefines the variables whose names are given. Up to 64 names
48828 +          may be given in one UNDEFINE command.
48829 +
48830 +   If you omit the switches and include only one name, the UNDEFINE
48831 +   command works as before.
48832 +
48833 +   Switches include:
48834 +
48835 +   /MATCHING
48836 +          Specifies that the names given are to treated as patterns rather
48837 +          than literal variable names. Note: pattern matching can't be
48838 +          used with array references; use the ARRAY command to manipulate
48839 +          arrays and subarrays.
48840 +
48841 +   /LIST
48842 +          List the name of each variable to be undefined, and whether it
48843 +          was undefined successfully ("ok" or "error"), plus a summary
48844 +          count at the end.
48845 +
48846 +   /SIMULATE
48847 +          List the names of the variables that would be deleted without
48848 +          actually deleting them. Implies /LIST.
48849 +
48850 +   The UNDEFINE command fails if there were any errors and succeeds
48851 +   otherwise.
48852 +
48853 +   The new _UNDEFINE command is like UNDEFINE, except the names are
48854 +   assumed to be variable names themselves, which contain the names (or
48855 +   parts of them) of the variables to be undefined. For example, if you
48856 +   have the following definitions:
48857 +
48858 +  define \%a foo
48859 +  define foo This is some text
48860 +
48861 +   then:
48862 +
48863 +  undef \%a
48864 +
48865 +   undefines the variable \%a, but:
48866 +
48867 +  _undef \%a
48868 +
48869 +   undefines the macro foo.
48870 +
48871 +   Normal Kermit patterns are used for matching; metacharacters include
48872 +   asterisk, question mark, braces, and square brackets. Thus, when using
48873 +   the /MATCHING switch, if the names of the macros you want to undefine
48874 +   contain any of these characters, you must quote them with backslash to
48875 +   force them to be taken literally. Also note that \%* is not the name of
48876 +   a variable; it is a special notation used within a macro for "all my
48877 +   arguments". The command "undef /match \%*" deletes all \%x variables,
48878 +   where x is 0..9 and a..z. Use "undef /match \%[0-9]" to delete macro
48879 +   argument variables or "undef /match \%[i-n]" to delete a range of \%x
48880 +   variables.
48881 +
48882 +   [ [461]Top ] [ [462]Contents ] [ [463]C-Kermit Home ] [ [464]Kermit
48883 +   Home ]
48884 +
48885 +8.10. The INPUT and MINPUT Commands
48886 +
48887 +   As of C-Kermit 8.0.211, the INPUT and MINPUT commands accept a switch:
48888 +
48889 +   [M]INPUT /NOMATCH timeout
48890 +          The /NOMATCH switch allows INPUT or MINPUT to read incoming
48891 +          material for the specified amount of time, without attempting to
48892 +          match it with any text or patterns. When this switch is
48893 +          included, the [M]INPUT command succeeds when the timeout
48894 +          interval expires, with \v(instatus) set to 1, meaning "timed
48895 +          out", or fails upon interruption or i/o error.
48896 +
48897 +   Also in version 8.0.211, there is a new way to apply a scale factor to
48898 +   [M]INPUT timeouts:
48899 +
48900 +   SET INPUT SCALE-FACTOR floating-point-number
48901 +          This scales all [M]INPUT timeouts by the given factor, allowing
48902 +          time-sensitive scripts to be adjusted to changing conditions
48903 +          such as congested networks or different-speed modems without
48904 +          having to change each INPUT-class command. This affects only
48905 +          those timeouts that are given in seconds, not as wall-clock
48906 +          times. Although the scale factor can have a fractional part, the
48907 +          INPUT timeout is still an integer. The new built-in variable
48908 +          \v(inscale) tells the current INPUT SCALE-FACTOR.
48909 +
48910 +   The MINPUT command can be used to search the incoming data stream for
48911 +   several targets simultaneously. For example:
48912 +
48913 +  MINPUT 8 one two three
48914 +
48915 +   waits up to 8 seconds for one of the words "one", "two", or "three" to
48916 +   arrive. Words can be grouped to indicate targets that contain spaces:
48917 +
48918 +  MINPUT 8 nineteeen twenty "twenty one"
48919 +
48920 +   And of course you can also use variables in place of (or as part of)
48921 +   the target names:
48922 +
48923 +  MINPUT 8 \%a \&x[3] \m(foo)
48924 +
48925 +   Until now you had to know the number of targets in advance when writing
48926 +   the MINPUT statement. Each of the examples above has exactly three
48927 +   targets.
48928 +
48929 +   But suppose your script needs to look for a variable number of targets.
48930 +   For this you can use arrays and \fjoin(), described in [465]Section
48931 +   8.7. Any number of \fjoin() invocations can be included in the MINPUT
48932 +   target list, and each one is expanded into the appropriate number of
48933 +   separate targets each time the MINPUT command is executed. Example:
48934 +
48935 +  declare \&a[10] = one two three
48936 +  minput 10 foo \fjoin(&a) bar
48937 +
48938 +   This declares an array of ten elements, and assigns values to the first
48939 +   three of them. The MINPUT command looks for these three (as well as the
48940 +   words "foo" and "bar"). Later, if you assign additional elements to the
48941 +   array, the same MINPUT command also looks for the new elements.
48942 +
48943 +   If an array element contains spaces, each word becomes a separate
48944 +   target. To create one target per array element, use \fjoin()'s grouping
48945 +   feature:
48946 +
48947 +  dcl \&a[] = {aaa bbb} {ccc ddd} {xxx yyy zzz}
48948 +
48949 +  minput 10 \fjoin(&a)     <-- 7 targets
48950 +  minput 10 \fjoin(&a,,2)  <-- 3 targets
48951 +
48952 +   [ [466]Top ] [ [467]Contents ] [ [468]C-Kermit Home ] [ [469]Kermit
48953 +   Home ]
48954 +
48955 +8.11. Learned Scripts
48956 +
48957 +   C-Kermit now includes a simple script recorder that monitors your
48958 +   commands, plus your actions during CONNECT mode, and automatically
48959 +   generates a script program that mimics what it observed. You should
48960 +   think of this feature as a script-writing ASSISTANT since, as you will
48961 +   see [470]later in this section, the result generally needs some editing
48962 +   to make it both secure and flexible. The script recorder is controlled
48963 +   by the new LEARN command:
48964 +
48965 +   LEARN [ /ON /OFF /CLOSE ] [ filename ]
48966 +          If you give a filename, the file is opened for subsequent
48967 +          recording. The /ON switch enables recording to the current file
48968 +          (if any); /OFF disables recording. /CLOSE closes the current
48969 +          script recording file (if any). If you give a filename without
48970 +          any switches, /ON is assumed.
48971 +
48972 +   The /OFF and /ON switches let you turn recording off and on during a
48973 +   session without closing the file.
48974 +
48975 +   When recording:
48976 +
48977 +     * All commands that you type (or recall) at the prompt are recorded
48978 +       in the file except:
48979 +          + LEARN commands are not recorded.
48980 +          + The CONNECT command is not recorded.
48981 +          + The TELNET command is converted to SET HOST /NETWORK:TCP.
48982 +     * Commands obtained from macros or command files are not recorded.
48983 +     * During CONNECT:
48984 +          + Every line you type is converted to an OUTPUT command.
48985 +          + The last prompt before any line you type becomes an INPUT
48986 +            command.
48987 +          + Timeouts are calculated automatically for each INPUT command.
48988 +          + A PAUSE command is inserted before each OUTPUT command just to
48989 +            be safe.
48990 +
48991 +   Thus the script recorder is inherently line-oriented. It can't be used
48992 +   to script character-oriented interactions like typing Space to a
48993 +   "More?" prompt or editing a text file with VI or EMACS.
48994 +
48995 +   But it has advantages too; for example it takes control characters into
48996 +   account that might not be visible to you otherwise, and it
48997 +   automatically converts control characters in both the input and output
48998 +   streams to the appropriate notation. It can tell, for example that the
48999 +   "$ " prompt on the left margin in UNIX is really {\{13}\{10}$ },
49000 +   whereas in VMS it might be {\{13}\{10}\{13}$ }. These sequences are
49001 +   detected and recorded automatically.
49002 +
49003 +   A learned script should execute correctly when you give a TAKE command
49004 +   for it. However, it is usually appropriate to edit the script a bit.
49005 +   The most important change would be to remove any passwords from it. For
49006 +   example, if the script contains:
49007 +
49008 +  INPUT 9 {\{13}\{10}Password: }
49009 +  IF FAIL STOP 1 INPUT timeout
49010 +  PAUSE 1
49011 +  OUTPUT bigsecret\{13}
49012 +
49013 +   you should replace this by something like:
49014 +
49015 +  INPUT 9 {\{13}\{10}Password: }
49016 +  IF FAIL STOP 1 INPUT timeout
49017 +  ASKQ pswd Please type your password:
49018 +  PAUSE 1
49019 +  OUTPUT \m(pswd)\{13}
49020 +
49021 +   The LEARN command can't do this for you since it knows nothing about
49022 +   "content"; it only knows about lines and can't be expected to parse or
49023 +   understand them -- after all, the Password prompt might be in some
49024 +   other language. So remember: if you use the LEARN command to record a
49025 +   login script, be sure edit the resulting file to remove any passwords.
49026 +   Also be sure to delete any backup copies your editor or OS might have
49027 +   made of the file.
49028 +
49029 +   Other manual adjustments might also be appropriate:
49030 +
49031 +     * If the target of an INPUT command can vary, you can replace the
49032 +       INPUT command with MINPUT and the appropriate target list, and/or
49033 +       the target with a \fpattern(). For example, suppose you are dialing
49034 +       a number that can be answered by any one of 100 terminal servers,
49035 +       whose prompts are ts-00>, ts-01>, ts-02>, ... ts-99>. The script
49036 +       records a particular one of these, but you want it to work for all
49037 +       of them, so change (e.g.):
49038 +  INPUT 10 ts-23>  ; or whatever
49039 +
49040 +       to:
49041 +  INPUT 10 \fpattern(ts-[0-9][0-9]>)
49042 +
49043 +     * The INPUT timeout values are conservative, but they are based only
49044 +       on a single observation; you might need to tune them.
49045 +     * The PAUSE commands might not be necessary, or the PAUSE interval
49046 +       might need adjustment.
49047 +     * In case you made typographical errors during recording, they are
49048 +       incorporated in your script; you can edit them out if you want to.
49049 +
49050 +   Here is a sample script generated by Kermit ("learn vms.ksc") in which
49051 +   a Telnet connection is made to a VMS computer, the user logs in, starts
49052 +   Kermit on VMS, sends it a file, and then logs out:
49053 +
49054 +  ; Scriptfile: vms.ksc
49055 +  ; Directory:  /usr/olga
49056 +  ; Recorded:   20001124 15:21:23
49057 +
49058 +  SET HOST /NETWORK:TCP vms.xyzcorp.com
49059 +  IF FAIL STOP 1 Connection failed
49060 +
49061 +  INPUT 7 {\{13}\{10}\{13}Username: }
49062 +  IF FAIL STOP 1 INPUT timeout
49063 +  PAUSE 1
49064 +  OUTPUT olga\{13}
49065 +  INPUT 3 {\{13}\{10}\{13}Password: }
49066 +  IF FAIL STOP 1 INPUT timeout
49067 +  PAUSE 1
49068 +  OUTPUT secret\{13}
49069 +  INPUT 18 {\{13}\{10}\{13}$ }
49070 +  IF FAIL STOP 1 INPUT timeout
49071 +  PAUSE 1
49072 +  OUTPUT set default [.incoming]\{13}
49073 +  INPUT 12 {\{13}\{10}\{13}$ }
49074 +  IF FAIL STOP 1 INPUT timeout
49075 +  PAUSE 1
49076 +  OUTPUT kermit\{13}
49077 +  INPUT 15 {\{13}\{10}\{13}ALTO:[OLGA.INCOMING] C-Kermit>}
49078 +  IF FAIL STOP 1 INPUT timeout
49079 +  PAUSE 1
49080 +  OUTPUT receive\{13}
49081 +  send myfile.txt
49082 +
49083 +  INPUT 18 {\{13}\{10}\{13}ALTO:[OLGA.INCOMING] C-Kermit>}
49084 +  IF FAIL STOP 1 INPUT timeout
49085 +  PAUSE 1
49086 +  OUTPUT exit\{13}
49087 +  INPUT 6 {\{13}\{10}\{13}$ }
49088 +  IF FAIL STOP 1 INPUT timeout
49089 +  PAUSE 1
49090 +  OUTPUT logout\{13}
49091 +  close
49092 +  exit
49093 +
49094 +   The commands generated by Kermit during CONNECT (INPUT, IF FAIL, PAUSE,
49095 +   and OUTPUT) have uppercase keywords; the commands typed by the user are
49096 +   in whatever form the user typed them (in this case, lowercase).
49097 +
49098 +   [ [471]Top ] [ [472]Contents ] [ [473]C-Kermit Home ] [ [474]Kermit
49099 +   Home ]
49100 +
49101 +8.12. Pattern Matching
49102 +
49103 +   A pattern is a character string that is used to match other strings.
49104 +   Patterns can contain metacharacters that represent special actions like
49105 +   "match any single character", "match zero or more characters", "match
49106 +   any single character from a list", and so on. The best known
49107 +   application of patterns is in file specifications that contain
49108 +   wildcards, as in "send *.txt", meaning "send all files whose names end
49109 +   with .txt".
49110 +
49111 +   Patterns are also used in increasingly many other ways, to the extent
49112 +   it is useful to point out certain important distinctions in the ways in
49113 +   which they are used:
49114 +
49115 +   Anchored Patterns
49116 +          If an anchored pattern does not begin with "*", it must match
49117 +          the beginning of the string, and if it does not end with "*", it
49118 +          must match the end of the string. For example, the anchored
49119 +          pattern "abc" matches only the string "abc", not "abcde" or
49120 +          "xyzabc" or "abcabc". The anchored pattern "abc*" matches any
49121 +          string that starts with "abc"; the anchored pattern "*abc"
49122 +          matches any string that ends with "abc"; the anchored pattern
49123 +          "*abc*" matches any string that contains "abc" (including any
49124 +          that start and/or end with it).
49125 +
49126 +   Floating Patterns
49127 +          A floating pattern matches any string that contains a substring
49128 +          that matches the pattern. In other words, a floating pattern has
49129 +          an implied "*" at the beginning and end. You can anchor a
49130 +          floating pattern to the beginning by starting it with "^", and
49131 +          you can anchor it to the end by ending it with "$" (see examples
49132 +          below).
49133 +
49134 +   Wildcards
49135 +          A wildcard is an anchored pattern that has the additional
49136 +          property that "*" does not match directory separators.
49137 +
49138 +   This terminology lets us describe Kermit's commands with a bit more
49139 +   precision. When a pattern is used for matching filenames, it is a
49140 +   wildcard, except in the TEXT-PATTERNS and BINARY-PATTERNS lists and
49141 +   /EXCEPT: clauses, in which case directory separators are not
49142 +   significant (for example, a BINARY-PATTERN of "*.exe" matches any file
49143 +   whose name ends in .exe, no matter how deeply it might be buried in
49144 +   subdirectories). When Kermit parses a file specification directly,
49145 +   however, it uses the strict wildcard definition. For example, "send
49146 +   a*b" sends all files whose names start with "a" and end with "b" in the
49147 +   current directory, and not any files whose names end with "b" that
49148 +   happen to be in subdirectories whose names start with "a". And as
49149 +   noted, wildcards are anchored, so "delete foo" deletes the file named
49150 +   "foo", and not all files whose names happen to contain "foo".
49151 +
49152 +   Most other patterns are anchored. For example:
49153 +
49154 +  if match abc bc ...
49155 +
49156 +   does not succeed (and you would be surprised if it did!). In fact, the
49157 +   only floating patterns are the ones used by commands or functions that
49158 +   search for patterns in files, arrays, or strings. These include:
49159 +
49160 +     * The GREP and TYPE /MATCH commands.
49161 +     * The \fsearch(), \frsearch(), and \farraylook() functions.
49162 +
49163 +   Thus these are the only contexts in which explicit anchors ("^" and
49164 +   "$") may be used:
49165 +
49166 +   grep abc *.txt
49167 +          Prints all lines containing "abc" in all files whose names end
49168 +          with ".txt".
49169 +
49170 +   grep ^abc *.txt
49171 +          Prints all lines that start with "abc" in all ".txt" files.
49172 +
49173 +   grep abc$ *.txt
49174 +          Prints all lines that end with "abc" in all ".txt" files.
49175 +
49176 +   grep ^a*z$ *.txt
49177 +          Prints all lines that start with "a" and end with "z" in all
49178 +          ".txt" files.
49179 +
49180 +   Similarly for TYPE /PAGE, /fsearch(), /frsearch(), and \farraylook().
49181 +
49182 +   Here is a brief summary of anchored and floating pattern equivalences:
49183 +
49184 +  Anchored   Floating
49185 +    abc       ^abc$
49186 +    *abc      abc$
49187 +    abc*      ^abc
49188 +    *abc*     abc
49189 +
49190 +   [ [475]Top ] [ [476]Contents ] [ [477]C-Kermit Home ] [ [478]Kermit
49191 +   Home ]
49192 +
49193 +8.13. Dates and Times
49194 +
49195 +   C-Kermit's comprehension of date-time formats is considerably expanded
49196 +   in version 8.0. Any command that reads dates, including the DATE
49197 +   command itself, or any switch, such as the /BEFORE: and /AFTER:
49198 +   switches, or any function such as \fcvtdate(), now can understand dates
49199 +   and times expressed in any ISO 8601 format, in Unix "asctime" format,
49200 +   in FTP MDTM format, and in practically any format used in RFC 822 or
49201 +   RFC 2822 electronic mail, with or without timezones, and in a great
49202 +   many other formats as well. HELP DATE briefly summarizes the acceptable
49203 +   date-time formats.
49204 +
49205 +   Furthermore, C-Kermit 8.0 includes a new and easy-to-use form of
49206 +   date-time arithmetic, in which any date or time can be combined with a
49207 +   "delta time", to add or subtract the desired time interval (years,
49208 +   months, weeks, days, hours, minutes, seconds) to/from the given date.
49209 +   And new functions are available to compare dates and to compute their
49210 +   differences.
49211 +
49212 +   As you can imagine, all this requires quite a bit of "syntax". The
49213 +   basic format is:
49214 +
49215 +  [ date ] [ time ] [ delta ]
49216 +
49217 +   Each field is optional, but in most cases (depending on the context)
49218 +   there must be at least one field. If a date is given, it must come
49219 +   first. If no date is given, the current date is assumed. If no time is
49220 +   given, an appropriate time is supplied depending on whether a date was
49221 +   supplied. If no delta is given, no arithmetic is done. If a delta is
49222 +   given without a date or time, the current date and time are used as the
49223 +   base.
49224 +
49225 +   Date-time-delta fields are likely to contain spaces (although they need
49226 +   not; space-free forms are always available). Therefore, in most
49227 +   contexts -- and notably as switch arguments -- date-time information
49228 +   must be enclosed in braces or doublequotes, for example:
49229 +
49230 +  send /after:"8-Aug-2001 12:00 UTC" *.txt
49231 +
49232 +   Kermit's standard internal format for dates and times is:
49233 +
49234 +  yyyymmdd hh:mm:ss
49235 +
49236 +   for example:
49237 +
49238 +  20010208 10:28:01
49239 +
49240 +   Date-times can always be given in this format. yyyy is the 4-digit
49241 +   year, mm is the two-digit month (1-12; supply leading zero for
49242 +   Jan-Sep), dd is the 2-digit day (leading zero for 1-9), hh is the hour
49243 +   (0-23), mm the minute (0-59), ss the second (0-59), each with leading
49244 +   zero if less than the field width. The date and time can be separated
49245 +   by a space, an underscore, a colon, or the letter T. The time is in
49246 +   24-hour format. Thus the various quantites are at the following fixed
49247 +   positions:
49248 +
49249 +Position  Contents
49250 +   1-4    Year   (4 digits, 0000-9999)
49251 +   5-6    Month  (2 digits, 1-12)
49252 +   7-8    Day    (2 digits, 1-31)
49253 +   9      Date-Time Separator (space, :, _, or the letter T)
49254 +  10-11   Hour   (2 digits, 0-23)
49255 +  12      Hour-Minute Separator (colon)
49256 +  13-14   Minute (2 digits, 0-59)
49257 +  15      Minute-Second Separator (colon)
49258 +  16-17   Second (2 digits, 0-59)
49259 +
49260 +   Example:
49261 +
49262 +  19800526 13:07:12  26 May 1980, 13:07:12 (1:07:12PM)
49263 +
49264 +   This is the format produced by the DATE command and by any function
49265 +   that returns a date-time. It is suitable for lexical comparison and
49266 +   sorting, and for use as a date-time in any Kermit command. When this
49267 +   format is given as input to a command or function, various date-time
49268 +   separators (as noted) are accepted:
49269 +
49270 +  19800526 13:07:12  26 May 1980, 13:07:12 (1:07:12PM)
49271 +  20010208_10:28:35  2 February 2001, 10:28:35 AM
49272 +  18580101:12:00:00  1 January 1858, noon
49273 +  20110208T00:00:00  2 February 2011, midnight
49274 +
49275 +   Certain other special date-time formats that are encountered on
49276 +   computer networks are recognized:
49277 +
49278 +   Asctime Format
49279 +          This is a fixed format used by Unix, named after Unix's
49280 +          asctime() ("ASCII time") function. It is always exactly 24
49281 +          characters long. Example: Fri Aug 10 16:38:01 2001
49282 +
49283 +   Asctime with Timezone
49284 +          This is like Asctime format, but includes a 3-character timezone
49285 +          between the time and year. It is exactly 28 characters long.
49286 +          Example: Fri Aug 10 16:38:01 GMT 2001
49287 +
49288 +   E-Mail Format
49289 +          E-mail date-time formats are defined in [479]RFC 2822 with a
49290 +          fair amount of flexibility and options. The following examples
49291 +          are typical of e-mails and HTTP (web-page) headers:
49292 +
49293 +  Sat, 14 Jul 2001 11:49:29                (No timezone)
49294 +  Fri, 24 Mar 2000 14:19:59 EST            (Symbolic timezone)
49295 +  Tue, 26 Jun 2001 10:19:45 -0400 (EDT)    (GMT Offset + comment)
49296 +
49297 +   FTP MDTM Format
49298 +          This is the date-time format supplied by FTP servers that
49299 +          support the (not yet standard but widely used nevertheless) MDTM
49300 +          command, by which the FTP client asks for a file's modification
49301 +          time:
49302 +
49303 +  yyyymmddhhmmss[.ffff]
49304 +
49305 +          where yyyy is the 4-digit year, mm is the 2-digit month, and so
49306 +          on, exactly 14 digits long. An optional fractional part
49307 +          (fraction of second) may also be included, separated by a
49308 +          decimal point (period). Kermit rounds to the nearest second.
49309 +          Example:
49310 +
49311 +  20020208102835.515                       (8 February 2002 10:28:36 AM)
49312 +
49313 +8.13.1. The Date
49314 +
49315 +   The date, if given, must precede the time and/or delta, and can be in
49316 +   many, many formats. For starters, you can use several symbolic date
49317 +   names in place of actual dates:
49318 +
49319 +   NOW
49320 +          This is replaced by the current date and time. The time can not
49321 +          be overriden (if you want to supply a specific time, use TODAY
49322 +          rather than NOW).
49323 +
49324 +   TODAY
49325 +          This is replaced by the current date and a default time of
49326 +          00:00:00 is supplied, but can be overridden by a specific time;
49327 +          for example, if today is 8 February 2002, then "TODAY" is
49328 +          "20020802 00:00:00" but "TODAY 10:28" is "20020802 10:28:00".
49329 +
49330 +   TOMORROW
49331 +          Like TODAY, but one day later (if today is 8 February 2002, then
49332 +          "TOMORROW" is "20020803 00:00:00" but "TOMORROW 16:30" is
49333 +          "20020803 16:30:00").
49334 +
49335 +   YESTERDAY
49336 +          Like TODAY, but one day earlier.
49337 +
49338 +   MONDAY, TUESDAY, WEDNESDAY, ..., SUNDAY
49339 +          The date on the given day of the week, today or later. A default
49340 +          time of 00:00:00 is supplied but can be overridden. Example:
49341 +          "SATURDAY 12:00" means next Saturday (or today, if today is
49342 +          Saturday) at noon.
49343 +
49344 +   You can give an explicit date in almost any conceivable format, but
49345 +   there are some rules:
49346 +
49347 +     * If a date is given, it must have three fields: day, month, and
49348 +       year; the order can vary (except that the month can not be last).
49349 +     * If names are used for days, months, etc, they must be English.
49350 +     * The year must lie between 0000 and 9999, inclusive.
49351 +     * All calendar calculations use Gregorian dating, so calculated dates
49352 +       for years prior to 1582 (or later, depending on the country) will
49353 +       not agree with historical dates. Other forms of dating (e.g.
49354 +       Hebrew, Chinese) are not supported.
49355 +
49356 +   Various date-field separators are accepted: hyphen, slash, space,
49357 +   underscore, period. The same field separator (if any) must be used in
49358 +   both places; for example 18-Sep-2001 but not 18-Sep/2001. Months can be
49359 +   numeric (1-12) or English names or abbreviations. Month name
49360 +   abbreviations are normally three letters, e.g. Apr, May, Jun, Jul.
49361 +   Capitalization doesn't matter.
49362 +
49363 +   Here are a few examples:
49364 +
49365 +  18 Sep 2001                              (English month, abbreviated)
49366 +  18 September 2001                        (English month, spelled out)
49367 +  2001 Sept 18                             (Year, month, day)
49368 +  18-Sep-2001                              (With hyphens)
49369 +  18/09/2001                               (All numeric with slashes)
49370 +  18.09.2001                               (Ditto, with periods)
49371 +  18_09_2001                               (Ditto, with underscores)
49372 +  09/18/2001                               (See below)
49373 +  2001/09/18                               (See below)
49374 +  September 18, 2001                       (Correspondence style)
49375 +  Sep-18-2001                              (Month-day-year)
49376 +  20010918                                 (Numeric, no separators)
49377 +
49378 +   You can also include the day of the week with a specific date, in which
49379 +   case it is accepted (if it is a valid day name), but not verified to
49380 +   agree with the given date:
49381 +
49382 +  Tue, 18 Sep 2001                         (Abbreviated, with comma)
49383 +  Tue,18 Sep 2001                          (Comma but no space)
49384 +  Tue 18 Sep 2001                          (Abbreviated, no comma)
49385 +  Tuesday 18 Sep 2001                      (Spelled out)
49386 +  Tuesday, 18 Sep 2001                     (etc)
49387 +  Friday, 18 Sep 2001                      (Accepted even if not Friday)
49388 +
49389 +   In all-numeric dates with the year last, such as 18/09/2001, Kermit
49390 +   identifies the year because it's 4 digits, then decides which of the
49391 +   other two numbers is the month or day based on its value. If both are
49392 +   12 or less and are unequal, the date is ambiguous and is rejected. In
49393 +   all-numeric dates with the year first, the second field is always the
49394 +   month and the third is the day. The month never comes last. A date with
49395 +   no separators is accepted only if it is all numeric and has exactly
49396 +   eight digits, and is assumed to be in yyyymmdd format.
49397 +
49398 +  20010918                                 (18-Sep-2001 00:00:00)
49399 +
49400 +   or 14 digits (as in FTP MDTM format):
49401 +
49402 +  20010918123456                           (18-Sep-2001 12:34:56)
49403 +
49404 +   You can always avoid ambiguity by putting the year first, or by using
49405 +   an English, rather than numeric, month. A date such as 09/08/2001 would
49406 +   be ambiguous but 2001/09/08 is not, nor is 09-Aug-2001.
49407 +
49408 +   Until the late 1990s, it was common to encounter 2-digit years, and
49409 +   these are found to this day in old e-mails and other documents. Kermit
49410 +   accepts these dates if they have English months, and interprets them
49411 +   according to the windowing rules of [480]RFC 2822: "If a two digit year
49412 +   is encountered whose value is between 00 and 49, the year is
49413 +   interpreted by adding 2000, ending up with a value between 2000 and
49414 +   2049. If a two digit year is encountered with a value between 50 and
49415 +   99, or any three digit year is encountered, the year is interpreted by
49416 +   adding 1900."
49417 +
49418 +   If you need to specify a year prior to 1000, use leading zeros to
49419 +   ensure it is not misinterpreted as a "non-Y2K-compliant" modern year:
49420 +
49421 +  7-Oct-77                                 (19771007 00:00:00)
49422 +  7-Oct-0077                               (00771007 00:00:00)
49423 +
49424 +8.13.2. The Time
49425 +
49426 +   The basic time format is hh:mm:dd; that is hours, minutes, seconds,
49427 +   separated by colons, perhaps with an optional fractional second
49428 +   separated by a decimal point (period). The hours are in 24-hour format;
49429 +   12 is noon, 13 is 1pm, and so on. Fields omitted from the right default
49430 +   to zero. Fields can be omitted from the left or middle by including the
49431 +   field's terminating colon. Examples:
49432 +
49433 +  11:59:59                                 (11:59:59 AM)
49434 +  11:59                                    (11:59:00 AM)
49435 +  11                                       (11:00:00 AM)
49436 +  11:59:59.33                              (11:59:59 AM)
49437 +  11:59:59.66                              (Noon)
49438 +  03:21:00                                 (3:21:00 AM)
49439 +  3:21:00                                  (3:21:00 AM)
49440 +  15:21:00                                 (3:21:00 PM)
49441 +  :21:00                                   (00:21:00 AM)
49442 +  ::01                                     (00:00:01 AM)
49443 +  11::59                                   (11:00:59 AM)
49444 +
49445 +   Leading zeros can be omitted, but it is customary and more readable to
49446 +   keep them in the minute and second fields:
49447 +
49448 +  03:02:01                                 (03:02:01 AM)
49449 +  3:02:01                                  (03:02:01 AM)
49450 +  3:2:1                                    (03:02:01 AM)
49451 +
49452 +   AM/PM notation is accepted if you wish to use it:
49453 +
49454 +  11:59:59                                 (11:59:59 AM)
49455 +  11:59:59AM                               (11:59:59 AM)
49456 +  11:59:59A.M.                             (11:59:59 AM)
49457 +  11:59:59am                               (11:59:59 AM)
49458 +  11:59:59a.m.                             (11:59:59 AM)
49459 +  11:59:59PM                               (11:59:59 PM = 23:59:59)
49460 +  11:59:59P.M.                             (11:59:59 PM = 23:59:59)
49461 +  11:59:59pm                               (11:59:59 PM = 23:59:59)
49462 +  11:59:59p.m.                             (11:59:59 PM = 23:59:59)
49463 +
49464 +   You can omit the colons if you wish, in which case Kermit uses the
49465 +   following rules to interpret the time:
49466 +
49467 +    1. 6 digits is hh:mm:ss, e.g. 123456 is 12:34:56.
49468 +    2. 5 digits is h:mm:ss, e.g. 12345 is 1:23:45.
49469 +    3. 4 digits is hh:mm, e.g. 1234 is 12:34.
49470 +    4. 3 digits is h:mm, e.g. 123 is 1:23.
49471 +    5. 2 digits is hh, e.g. 12 is 12:00.
49472 +    6. 1 digit is h (the hour), e.g. 1 is 1:00.
49473 +
49474 +   Examples:
49475 +
49476 +  1                                        (01:00:00 AM)
49477 +  10                                       (10:00:00 AM)
49478 +  230                                      (02:30:00 AM)
49479 +  230pm                                    (02:30:00 PM = 14:30:00)
49480 +  1115                                     (11:15:00 AM)
49481 +  2315                                     (11:15:00 PM = 23:15:00 PM)
49482 +  23150                                    (02:31:50 AM)
49483 +  231500                                   (23:15:00 PM)
49484 +
49485 +8.13.3. Time Zones
49486 +
49487 +   If a time is given, it can (but need not) be followed by a time zone
49488 +   designator. If no time zone is included, the time is treated as local
49489 +   time and no timezone conversions are performed.
49490 +
49491 +   The preferred time zone designator is the UTC Offset, as specified in
49492 +   [481]RFC 2822: a plus sign or minus sign immediately followed by
49493 +   exactly four decimal digits, signifying the difference in hh (hours)
49494 +   and mm (minutes) from Universal Coordinated Time (UTC, also known as
49495 +   Greenwich Mean Time, or GMT), with negative numbers to the West and
49496 +   positive numbers to the East. For example:
49497 +
49498 +  Fri, 13 Jul 2001 12:54:29 -0700
49499 +
49500 +   indicates a local time of 12:54:29 that is 07 hours and 00 minutes
49501 +   behind (less than, East of) Universal Time. The space is optional, so
49502 +   the example could also be written as:
49503 +
49504 +  Fri, 13 Jul 2001 12:54:29-0700
49505 +
49506 +   The following symbolic time zones are also accepted, as specified by
49507 +   [482]RFC 2822 and/or in ISO 8601:
49508 +
49509 +  GMT  =  +0000       Greenwich Mean Time
49510 +  Z    =  +0000       Zulu (Zero Meridian) Time
49511 +  UTC  =  +0000       Universal Coordinated Time
49512 +  UT   =  +0000       Universal Time
49513 +  EDT  =  -0400       Eastern (USA) Daylight Time
49514 +  EST  =  -0500       Eastern (USA) Standard Time
49515 +  CDT  =  -0500       Central (USA) Daylight Time
49516 +  CST  =  -0600       Central (USA) Standard Time
49517 +  MDT  =  -0600       Mountain (USA) Daylight Time
49518 +  MST  =  -0700       Mountain (USA) Standard Time
49519 +  PDT  =  -0700       Pacific (USA) Daylight Time
49520 +  PST  =  -0800       Pacific (USA) Standard Time
49521 +
49522 +   Note that GMT, Z, UTC, and UT all express the same concept: standard
49523 +   (not daylight) time at the Zero Meridian. UTC, by the way, is an
49524 +   international standard symbol and does not correspond to the order of
49525 +   the English words, Universal Coordinated Time, but it happens to have
49526 +   the same initial letters as these words. Of course hundreds of other
49527 +   symbolic timezones and variations exist, but they are not standardized,
49528 +   and are therefore not supported by Kermit.
49529 +
49530 +   When a time zone is included with a time, the time is converted to
49531 +   local time. In case the conversion crosses a midnight boundary, the
49532 +   date is adjusted accordingly. Examples converting to EST (Eastern USA
49533 +   Standard Time = -0500):
49534 +
49535 + 11:30:00      =  11:30:00
49536 + 11:30:00 EST  =  11:30:00
49537 + 11:30:00 GMT  =  06:30:00
49538 + 11:30:00 PST  =  14:30:00
49539 + 11:30:00Z     =  06:30:00
49540 + 11:30PM GMT   =  18:30:00
49541 + 11:30 -0500   =  11:30:00
49542 + 11:30 -0800   =  08:30:00
49543 + 11:30 +0200   =  04:30:00
49544 +
49545 +   Unlike most of Kermit's other date-time conversions, timezone knowledge
49546 +   (specifically, the offset of local time from UTC) is embodied in the
49547 +   underlying operating system, not in Kermit itself, and any conversion
49548 +   errors in this department are the fault of the OS. For example, most
49549 +   UNIX platforms do not perform conversions for years prior to 1970.
49550 +
49551 +8.13.4. Delta Time
49552 +
49553 +   Date/time expressions can be composed of a date and/or time and a delta
49554 +   time, or a delta time by itself. When a delta time is given by itself,
49555 +   it is relative to the current local date and time. Delta times have the
49556 +   following general format:
49557 +
49558 +  {+,-}[number units][hh[:mm[:ss]]]
49559 +
49560 +   In other words, a delta time always starts with a plus or minus sign,
49561 +   which is followed by a "part1", a "part2", or both. The "part1", if
49562 +   given, specifies a number of days, weeks, months, or years; "part2"
49563 +   specifies a time in hh:mm:ss notation. In arithmetic terms, these
49564 +   represents some number of days or other big time units, and then a
49565 +   fraction of a day expressed as hours, minutes, and seconds; these are
49566 +   to be added to or subtracted from the given (or implied) date and time.
49567 +   The syntax is somewhat flexible, as shown by the following examples:
49568 +
49569 +  +1 day                (Plus one day)
49570 +  +1day                 (Ditto)
49571 +  +1d                   (Ditto)
49572 +  + 1 day               (Ditto)
49573 +  + 1 day 3:00          (Plus one day and 3 hours)
49574 +  +1d3:00               (Ditto)
49575 +  +1d3                  (Ditto)
49576 +  +3:00:00              (Plus 3 hours)
49577 +  +3:00                 (Ditto)
49578 +  +3                    (Ditto)
49579 +  +2 days               (Plus 2 days)
49580 +  -12 days 7:14:22      (Minus 12 days, 7 hours, 14 minutes, and 22 seconds)
49581 +
49582 +   The words "week", "month", and "year" can be used like "day" in the
49583 +   examples above. A week is exactly equivalent to 7 days. When months are
49584 +   specified, the numeric month number of the date is incremented or
49585 +   decremented by the given number, and the year and day adjusted
49586 +   accordingly if necessary (for example, 31-Jan-2001 +1month =
49587 +   03-Mar-2001 because February does not have 31 days). When years are
49588 +   specified, they are added or subtracted to the base year. Examples
49589 +   (assuming the current date is 10-Aug-2001 and the current time is
49590 +   19:21:11):
49591 +
49592 +  18-Sep-2001 +1day              (20010918 00:00:00)
49593 +  today +1day                    (20010811 00:00:00)
49594 +  now+1d                         (20010811 19:21:11)
49595 +  + 1 day                        (20010811 19:21:11)
49596 +  + 1 day 3:14:42                (20010811 22:35:54)
49597 +  + 7 weeks                      (20010928 19:21:11)
49598 +  +1d3:14:42                     (20010811 22:35:54)
49599 +  +1w3:14:42                     (20010817 22:35:54)
49600 +  +1m3:14:42                     (20010910 22:35:54)
49601 +  +1y3:14:42                     (20020810 22:35:54)
49602 +  2 feb 2001 + 10 years          (20110208 00:00:00)
49603 +  2001-02-08 +10y12              (20110208 12:00:00)
49604 +  31-dec-1999 23:59:59+00:00:01  (20000101 00:00:00)
49605 +  28-feb-1996 +1day              (19960229 00:00:00) (leap year)
49606 +  28-feb-1997 +1day              (19970301 00:00:00) (nonleap year)
49607 +  28-feb-1997 +1month            (19970328 00:00:00)
49608 +  28-feb-1997 +1month 11:59:59   (19970328 11:59:59)
49609 +  28-feb-1997 +20years           (20170228 00:00:00)
49610 +  28-feb-1997 +8000years         (99970228 00:00:00)
49611 +
49612 +   For compatibility with VMS, the following special delta-time format is
49613 +   also accepted:
49614 +
49615 +  +number-hh:mm:ss
49616 +  -number-hh:mm:ss
49617 +
49618 +   (no spaces). The hyphen after the number indicates days. It corresponds
49619 +   exactly to the Kermit notation:
49620 +
49621 +  +numberdhh:mm:ss
49622 +  -numberdhh:mm:ss
49623 +
49624 +   The following forms all indicate exactly the same date and time:
49625 +
49626 +  18-Sep-2001 12:34:56 +1-3:23:01
49627 +  18-Sep-2001 12:34:56 +1d3:23:01
49628 +  18-Sep-2001 12:34:56 +1 day 3:23:01
49629 +
49630 +   and mean "add a day plus 3 hours, 23 minutes, and 1 second" to the
49631 +   given date.
49632 +
49633 +   Note that delta times are not at all the same as UTC offsets; the
49634 +   former specifies an adjustment to the given date/time and the latter
49635 +   specifies that the local time is a particular distance from Universal
49636 +   Time, for example:
49637 +
49638 +  11-Aug-2001 12:34:56 -0800          (20010811 16:34:56 -- UTC Offset)
49639 +  11-Aug-2001 12:34:56 -08:00         (20010811 04:34:56 -- Delta time)
49640 +
49641 +   If you give a time followed by a modifer that starts with a + or -
49642 +   sign, how does Kermit know whether it's a UTC offset or a delta time?
49643 +   It is treated as a UTC offset if the sign is followed by exactly four
49644 +   decimal digits; otherwise it is a delta time. Examples (for USA Eastern
49645 +   Daylight Time):
49646 +
49647 +  11-Aug-2001 12:34:56 -0800          (20010811 16:34:56 -- UTC Offset)
49648 +  11-Aug-2001 12:34:56 -08:00         (20010811 04:34:56 -- Delta time)
49649 +  11-Aug-2001 12:34:56 -800           (20010811 04:34:56 -- Delta time)
49650 +  11-Aug-2001 12:34:56 -8             (20010811 04:34:56 -- Delta time)
49651 +
49652 +   The first example says that at some unknown place which is 8 hours
49653 +   ahead of Universal Time, the time is 12:34:56, and this corresponds to
49654 +   16:34:56 in Eastern Daylight time. The second example says to subtract
49655 +   8 hours from the local time. The third and fourth are delta times
49656 +   because, even though a colon is not included, the time does not consist
49657 +   of exactly 4 digits.
49658 +
49659 +   When a delta time is written after a timezone, however, there is no
49660 +   ambiguity and no syntax distinction is required:
49661 +
49662 +  11-Aug-2001 12:34:56 -0800 -0800    (20010811 08:34:56)
49663 +  11-Aug-2001 12:34:56 -0800 -08:00   (Ditto)
49664 +  11-Aug-2001 12:34:56 -08:00 -08:00  (Illegal)
49665 +
49666 +8.13.5. The DATE Command
49667 +
49668 +   Obviously a great many combinations of date, time, time zone, and delta
49669 +   time are possible, as well as many formatting options. The purpose of
49670 +   all this flexibility is to comply with as many standards as possible --
49671 +   Internet RFCs, ISO standards, and proven corporate standards -- as well
49672 +   as with notations commonly used by real people, in order that dates and
49673 +   times from the widest variety of sources can be assigned to a variable
49674 +   and used in any date-time field in any Kermit command.
49675 +
49676 +   You can test any date-and/or-time format with the DATE command, which
49677 +   converts it to standard yyyymmdd hh:mm:ss format if it is understood,
49678 +   or else gives an explicit error message (rather than just "BAD DATE" as
49679 +   in previous C-Kermit releases) to indicate what is wrong with it.
49680 +   Examples (on Tuesday, 31 July 2001 in New York City, Eastern Daylight
49681 +   Time, UTC -0400):
49682 +
49683 +  DATE command argument                   Result
49684 +  12:30                                   20010731 12:30:00
49685 +  12:30:01                                20010731 12:30:01
49686 +  12:30:01.5                              20010731 12:30:02
49687 +  1230                                    20010731 12:30:00
49688 +  230                                     20010731 02:30:00
49689 +  230+1d                                  20010801 02:30:00
49690 +  230+1d3:00                              20010801 05:30:00
49691 +  20010718 19:21:15                       20010718 19:21:15
49692 +  20010718_192115                         20010718 19:21:15
49693 +  20010718T192115                         20010718 19:21:15
49694 +  18 Jul 2001 +0400                       20010717 23:59:59
49695 +  18 Jul 2001 192115                      20010718 19:21:15
49696 +  18 Jul 2001 192115.8                    20010718 19:21:16
49697 +  18-Jul-2001T1921                        20010718 19:21:00
49698 +  18-Jul-2001 1921Z                       20010718 15:21:00
49699 +  18-Jul-2001 1921 GMT                    20010718 15:21:00
49700 +  18-Jul-2001 1921 UTC                    20010718 15:21:00
49701 +  18-Jul-2001 1921 Z                      20010718 15:21:00
49702 +  18-Jul-2001 1921Z                       20010718 15:21:00
49703 +  18-Jul-2001 1921 -04:00:00              20010718 19:21:00
49704 +  21-Jul-2001_08:20:00am                  20010721 08:20:00
49705 +  21-Jul-2001_8:20:00P.M.                 20010721 20:20:00
49706 +  Fri Jul 20 11:26:25 2001                20010720 11:26:25
49707 +  Fri Jul 20 11:26:25 GMT 2001            20010720 07:26:25
49708 +  Sun, 9 Apr 2000 06:46:46 +0100          20000409 01:46:46
49709 +  Sunday, 9 Apr 2000 06:46:46 +0100       20000409 01:46:46
49710 +  now                                     20010731 19:41:12
49711 +  today                                   20010731 00:00:00
49712 +  today 09:00                             20010731 09:00:00
49713 +  tomorrow                                20010801 00:00:00
49714 +  tomorrow 09:00                          20010801 09:00:00
49715 +  tomorrow 09:00 GMT                      20010801 05:00:00
49716 +  yesterday                               20010730 00:00:00
49717 +  yesterday 09:00                         20010730 09:00:00
49718 +  + 3 days                                20010803 00:00:00
49719 +  +3 days                                 20010803 00:00:00
49720 +  +3days                                  20010803 00:00:00
49721 +  + 3days                                 20010803 00:00:00
49722 +  + 3 days 09:00                          20010803 09:00:00
49723 +  + 2 weeks                               20010814 00:00:00
49724 +  + 1 month                               20010831 00:00:00
49725 +  - 7 months                              20001231 00:00:00
49726 +  + 10 years                              20110731 00:00:00
49727 +  friday                                  20010803 00:00:00
49728 +  saturday                                20010804 00:00:00
49729 +  sunday                                  20010805 00:00:00
49730 +  monday                                  20010806 00:00:00
49731 +  tuesday                                 20010731 00:00:00
49732 +  wednesday                               20010801 00:00:00
49733 +  thursday                                20010802 00:00:00
49734 +  friday 07:00                            20010803 07:00:00
49735 +  thursday 1:00pm                         20010802 13:00:00
49736 +  thursday 1:00pm GMT                     20010802 09:00:00
49737 +  Thu, 10 Nov 94 10:50:47 EST             19941110 10:50:47
49738 +  Fri, 20 Oct 1995 18:35:15 -0400 (EDT)   19951020 18:35:15
49739 +  31/12/2001                              20011231 00:00:00
49740 +  12/31/2001                              20011231 00:00:00
49741 +  2001-July-20                            20010720 00:00:00
49742 +  2001-September-30                       20010930 00:00:00
49743 +  30-September-2001                       20010930 00:00:00
49744 +  Sep 30, 2001 12:34:56                   20010930 12:34:56
49745 +  September 30, 2001                      20010930 00:00:00
49746 +  September 30, 2001 630                  20010930 06:30:00
49747 +  September 30 2001 630                   20010930 06:30:00
49748 +  Sep-30-2001 12:34:59                    20010930 12:34:59
49749 +  20010807113542.014                      20010807 11:35.42
49750 +  20010807113542.014Z                     20010807 07:35:42
49751 +
49752 +8.13.6. New Date-Time Functions
49753 +
49754 +   In the following descriptions, date-time function arguments are the
49755 +   same free-format date-time strings discussed above, with the same
49756 +   defaults for missing fields. They are automatically converted to
49757 +   standard format internally prior to processing.
49758 +
49759 +   \fcvtdate(d1)
49760 +          Converts the date-time d1 to standard format and local time.
49761 +          This function is not new, but now it accepts a wider range of
49762 +          argument formats that can include timezones and/or delta times.
49763 +          If the first argument is omitted, the current date and time are
49764 +          assumed. The optional second argument is a format code for the
49765 +          result:
49766 +
49767 +     n1 = 1: yyyy-mmm-dd hh:mm:ss (mmm = English 3-letter month
49768 +     abbreviation)
49769 +     n1 = 2: dd-mmm-yyyy hh:mm:ss (ditto)
49770 +     n1 = 3: yyyymmddhhmmss (all numeric)
49771 +
49772 +   \futcdate(d1)
49773 +          Converts the date-time d1 to Universal Coordinated Time (UTC),
49774 +          also known as GMT or Zulu or Zero-Meridian time. The default d1
49775 +          is NOW. If d1 is a valid date-time, the UTC result is returned
49776 +          in standard format, yyyymmdd hh:ss:mm.
49777 +
49778 +   \fcmpdates(d1,d2)
49779 +          Compares two free-format date-times, d1 and d2, and, if both
49780 +          arguments are valid, returns a number: -1 if d1 is earlier than
49781 +          (before) d2; 0 if d1 is the same as d2; 1 if d1 is later than
49782 +          (after) d2.
49783 +
49784 +   \fdiffdates(d1,d2)
49785 +          Computes the difference between two free-format date-times, d1
49786 +          and d2. If both arguments are valid, returns a delta time which
49787 +          is negative if d1 is earlier than (before) d2 and positive
49788 +          otherwise. If d1 and d2 are equal, the result is "+0:00".
49789 +          Otherwise, the result consists of the number of days, hours,
49790 +          minutes, and seconds that separate the two date-times. If the
49791 +          number of days is zero, it is omitted. If the number of days is
49792 +          nonzero but the hours, minutes, and seconds are all zero, the
49793 +          time is omitted. if the seconds are zero, they are omitted.
49794 +
49795 +   \fdelta2secs(dt)
49796 +          Converts a delta time to seconds. For example, "+1d00:00:01" to
49797 +          86401. Valid delta times must start with a + or - sign. Days are
49798 +          accepted as time units, but not years, months, or weeks. If the
49799 +          result would overflow a computer long word (as would happen with
49800 +          32-bit long words when the number of days is greater than
49801 +          24854), the function fails.
49802 +
49803 +   HINT: Although Kermit has a number of built-in date and time variables,
49804 +   it doesn't have a single one suitable for writing a timestamp. For this
49805 +   you would normally use something like "\v(ndate) \v(time)". But
49806 +   \fcvtdate() (with no arguments) is equivalent: it returns the current
49807 +   date and time in yyyymmdd hh:mm:ss format, suitable for time stamping.
49808 +
49809 +8.13.7. Date-Time Programming Examples
49810 +
49811 +   Here's a macro that converts any date-time to UTC, which you might use
49812 +   if C-Kermit didn't already have a \futcdate() function:
49813 +
49814 +  define utcdate {
49815 +      .local := \fcvtdate(\%*)                 ; 1.
49816 +      .tmp := \fcvtdate(\m(local)UTC)          ; 2.
49817 +      .offset := \fdiffdate(\m(local),\m(tmp)) ; 3.
49818 +      .utc := \fcvtdate(\m(local)\m(offset))   ; 4.
49819 +      sho mac utc                              ; 5.
49820 +  }
49821 +
49822 +   Brief explanation: Line 1 converts the macro argument, a free-format
49823 +   date-time, to standard-format local time. Line 2 appends the "UTC"
49824 +   timezone to the local time and converts the result to local time. In
49825 +   other words, we take the same time as the local time, but pretend it's
49826 +   UTC time, and convert it to local time. For example, if New York time
49827 +   is 4 hours ahead of UTC, then 6:00pm New York time is 2:00pm UTC. Line
49828 +   3 gets the difference of the two results (e.g. "+04:00"). Line 4
49829 +   appends the difference (delta time) to the local time, and converts it
49830 +   again, which adds (or subtracts) the UTC offset to the given time. Line
49831 +   5 displays the result.
49832 +
49833 +   Here's a script that opens a web page, gets its headers into an array,
49834 +   scans the array for the "Last-Modified:" header, and inteprets it:
49835 +  http open www.columbia.edu
49836 +  if fail stop 1 HTTP OPEN failed
49837 +  http /array:a head index.html /dev/null
49838 +  if fail stop 1 HTTP GET failed
49839 +  show array a
49840 +  for \%i 1 \fdim(&a) 1 {
49841 +      .\%x := \findex(:,\&a[\%i])
49842 +      if not \%x continue
49843 +      .tag := \fleft(\&a[\%i],\%x-1)
49844 +      .val := \fltrim(\fsubstr(\&a[\%i],\%x+1))
49845 +      if ( eq "\m(tag)" "Last-Modified" ) {
49846 +          echo HTTP Date: \m(val)
49847 +          .rdate := \fcvtdate(\m(val))
49848 +          echo {Standard Date (local): \m(rdate)}
49849 +          echo {Standard Date (UTC):   \futcdate(\m(rdate))}
49850 +          break
49851 +      }
49852 +  }
49853 +  http close
49854 +
49855 +   The result:
49856 +
49857 +  HTTP Date: Mon, 13 Aug 2001 20:05:42 GMT
49858 +  Standard Date (local): 20010813 16:05:42
49859 +  Standard Date (UTC):   20010813 20:05:42
49860 +
49861 +   As you can see, Kermit had no trouble decoding the date-time-string
49862 +   from the website, converting to local time, and converting back to UTC
49863 +   with no conflicts or loss of information. If it had been in any other
49864 +   known format, the result would have been the same.
49865 +
49866 +   Now suppose we want to download the web page only if it is newer than
49867 +   our local copy. The \fdate(filename) function (which returns the
49868 +   modification date-time of the given file) and the new \fcmpdates()
49869 +   function make it easy. Insert the following just before the BREAK
49870 +   statement:
49871 +
49872 +  if ( < 0 \fcmpdates(\m(rdate),\fdate(index.html)) ) {
49873 +     echo GETTING index.html...
49874 +     http get index.html index.html
49875 +     if success echo HTTP GET OK
49876 +  } else {
49877 +     echo index.html: no update needed
49878 +  }
49879 +  http close
49880 +  exit
49881 +
49882 +   This says, "if 0 is less than the comparison of the remote file date
49883 +   and the local file date, get the remote file, otherwise skip it." And
49884 +   it automatically reconciles the time-zone difference (if any).
49885 +
49886 +   It would be nice to be able to extend this script into a
49887 +   general-purpose website updater, but unfortunately HTTP protocol
49888 +   doesn't provide any mechanism for the client to ask the server for a
49889 +   list of files, recursive or otherwise.
49890 +
49891 +   [ [483]Top ] [ [484]Contents ] [ [485]C-Kermit Home ] [ [486]Kermit
49892 +   Home ]
49893 +
49894 +8.14. Trapping Keyboard Interruption
49895 +
49896 +   Normally when you type Ctrl-C and Kermit is in command mode (as opposed
49897 +   to CONNECT mode) with COMMAND INTERRUPTION ON (as it is unless you have
49898 +   set it OFF), Kermit interrupts any command that is currently in
49899 +   progress, and if a command file or macro is executing, rolls the
49900 +   command stack back to top level, closing all open command files,
49901 +   deactivating all macros, deallocating all local variables and arrays,
49902 +   and leaving you at the command prompt.
49903 +
49904 +   Suppose, however, you want certain actions to occur when a script is
49905 +   interrupted; for example, closing open files, writing log entries, or
49906 +   displaying summary results. You can do this by defining a macro named
49907 +   ON_CTRLC. When Ctrl-C is detected, and a macro with this name is
49908 +   defined, Kermit executes it from the current command level, thus giving
49909 +   it full access to the environment in which the interruption occurred,
49910 +   including local variables and open files. Only when the ON_CTRLC macro
49911 +   completes execution is the command stack rolled back to top level.
49912 +
49913 +   Once the ON_CTRLC macro is defined, it can be executed only once. This
49914 +   is to prevent recursion if the user types Ctrl-C while the ON_CTRLC
49915 +   macro is executing. If you type Ctrl-C while the Ctrl-C macro is
49916 +   active, this does not start a new copy of ON_CTRLC; rather, it returns
49917 +   to the top-level command prompt. After the ON_CTRLC macro returns, it
49918 +   has been removed from the macro table so if you want to use it again or
49919 +   install a different Ctrl-C trap, you must execute a new DEFINE ON_CTRLC
49920 +   command. In any case, as always when you interrupt a script with
49921 +   Ctrl-C, its completion status is FAILURE.
49922 +
49923 +   Normally the ON_CTRLC macro would be defined in the command file or
49924 +   macro to which it applies, and should be declared LOCAL. This way, if
49925 +   the command file or macro completes successfully without being
49926 +   interrupted, the ON_CTRLC definition disappears automatically.
49927 +   Otherwise the definition would still be valid and the macro would be
49928 +   executed, probably out of context, the next time you typed Ctrl-C.
49929 +
49930 +   Here's a simple example of a command file that sets a Ctrl-C trap for
49931 +   itself:
49932 +
49933 +  local on_ctrlc              ; Make Ctrl-C trap local to this command file.
49934 +  define on_ctrlc {           ; Define the ON_CTRLC macro.
49935 +      echo Interrupted at \v(time).
49936 +      echo Iterations: \%n
49937 +  }
49938 +  xecho Type Ctrl-C to quit
49939 +  for \%n 1 999 1 {           ; Prints a dot every second until interrupted.
49940 +      sleep 1
49941 +      xecho .
49942 +  }
49943 +  echo Finished normally at \v(time) ; Get here only if not interrupted.
49944 +  decrement \%n
49945 +  echo Iterations: \%n
49946 +
49947 +   This prints a summary no matter whether it completes normally or is
49948 +   interrupted from the keyboard. In both cases the trap is automatically
49949 +   removed afterwards.
49950 +
49951 +   For an example of how to use ON_CTRLC to debug scripts, see
49952 +   [487]Section 8.1.
49953 +
49954 +   [ [488]Top ] [ [489]Contents ] [ [490]C-Kermit Home ] [ [491]Kermit
49955 +   Home ]
49956 +
49957 +9. S-EXPRESSIONS
49958 +
49959 +   This section is primarily for those who want to write
49960 +   calculation-intensive scripts, especially if they require
49961 +   floating-point arithmetic, and/or for those who are familiar with the
49962 +   LISP programming language.
49963 +
49964 +   Ever since C-Kermit version 5 was released in 1988, scripting has been
49965 +   one of its major attractions, and arithmetic is a key part of it.
49966 +   Versions 5 and 6 included integer arithmetic only, using traditional
49967 +   algebraic notation, e.g.:
49968 +
49969 +  echo \fevaluate(3*(2+7)/2)
49970 +  13
49971 +
49972 +   C-Kermit 7.0 added support for floating-point arithmetic, but only
49973 +   through function calls:
49974 +
49975 +  echo \ffpdivide(\ffpmultiply(3.0,\ffpadd(2.0,7.0)),2.0)
49976 +  13.5
49977 +
49978 +   C-Kermit 8.0 introduces a third form of arithmetic that treats integers
49979 +   and floating-point numbers uniformly, is easier to read and write, and
49980 +   executes very quickly:
49981 +
49982 +  (/ (* 3 (+ 2 7)) 2)
49983 +  13.5
49984 +
49985 +   But first some background.
49986 +
49987 +   The Kermit command and scripting language differs from true programming
49988 +   languages (such as C or Fortran) in many ways; one of the most
49989 +   prominent differences is the way in which variables are distinguished
49990 +   from constants. In a command language, words are taken literally; for
49991 +   example, the Unix shell:
49992 +
49993 +  cat foo.bar
49994 +
49995 +   displays the file named foo.bar. Whereas in a programming language like
49996 +   C, words are assumed to be variables:
49997 +
49998 +  s = foo.bar;    /* Assigns the value of foo.bar to the variable s */
49999 +
50000 +   To make a programming language take words literally, you have to quote
50001 +   or "escape" them:
50002 +
50003 +  s = "foo.bar";  /* Assigns a pointer to the string "foo.bar" to the variable s
50004 + */
50005 +
50006 +   The opposite holds for command languages: to get them to treat a word
50007 +   as a variable rather than a constant, you have to escape them. For
50008 +   example, in the Unix shell:
50009 +
50010 +  foo=123         ; Assign value 123 to variable foo.
50011 +  echo foo        ; Prints "foo"
50012 +  echo $foo       ; Prints "123"
50013 +
50014 +   And in Kermit:
50015 +
50016 +  define foo 123  ; Assign value 123 to variable foo.
50017 +  echo 123        ; This prints "123".
50018 +  echo foo        ; This prints "foo".
50019 +  echo \m(foo)    ; This prints "123".
50020 +
50021 +   In other words, character strings (such as "foo" above) are interpreted
50022 +   as literal strings, rather than variable names, except in special
50023 +   commands like DEFINE that deal specifically with variable names (or in
50024 +   numeric contexts as explained in [492]Section 8.2). The special
50025 +   "escape" character (dollar sign ($) for the shell, backslash (\) for
50026 +   Kermit) indicates that a variable is to be replaced by its value.
50027 +
50028 +   The requirement to escape variable names in command languages normally
50029 +   does not impose any special hardship, but can add a considerable
50030 +   notational burden to arithmetic expressions, which are typically full
50031 +   of variables. Especially in Kermit when floating point numbers are
50032 +   involved, where you must use special \ffpxxx() functions, e.g.
50033 +   "\ffpadd(\m(a),\m(b))" rather than the simple "+" operator to add two
50034 +   floating-point numbers together, because the original arithmetic
50035 +   handler doesn't support floating point (this might change in the
50036 +   future). To illustrate, the general formula for the area of a triangle
50037 +   is:
50038 +
50039 +  sqrt(s * (s - a) * (s - b) * (s - c))
50040 +
50041 +   where a, b, and c are the lengths of the triangle's three sides and:
50042 +
50043 +  s = (a + b + c) / 2
50044 +
50045 +   Except in special cases (e.g. a = 3, b = 4, c = 5), the result has a
50046 +   fractional part so the computation must be done using floating-point
50047 +   arithmetic. We can create a Kermit 7.0 function for this as follows:
50048 +
50049 +  def area {
50050 +      local s t1 t2 t3
50051 +      assign s \ffpdiv(\ffpadd(\ffpadd(\%1,\%2),\%3),2.0)
50052 +      assign t1 \ffpsub(\m(s),\%1)
50053 +      assign t2 \ffpsub(\m(s),\%2)
50054 +      assign t3 \ffpsub(\m(s),\%3)
50055 +      return \ffpsqrt(\ffpmul(\m(s),\ffpmul(\m(t1),\ffpmul(\m(t2),\m(t3)))))
50056 +  }
50057 +
50058 +   But as you can see, this is rather cumbersome. Note, in particular,
50059 +   that arithmetic functions like \ffpadd(), \ffpmul(), etc, take exactly
50060 +   two operands (like their symbolic counterparts + and *), so obtaining
50061 +   the product of three or more numbers (as we do in this case) is
50062 +   awkward.
50063 +
50064 +   Using the alternative S-Expression notation, we can reduce this to a
50065 +   form that is both easier to read and executes faster (the details are
50066 +   explained later):
50067 +
50068 +  def newarea {
50069 +      (let s (/ (+ \%1 \%2 \%3) 2.0))
50070 +      (sqrt (* s (- s \%1) (- s \%2) (- s \%3)))
50071 +  }
50072 +
50073 +   In both examples, the \%1..3 variables are the normal Kermit macro
50074 +   arguments, referenced by the normal escaping mechanism. For increased
50075 +   readability, we can also assign the macro arguments \%1, \%2, and \%3
50076 +   to the letters a, b, and c corresponding to our formula:
50077 +
50078 +def newarea {
50079 +    (let a \%1 b \%2 c \%3)
50080 +    (let s (/ (+ a b c) 2.0))
50081 +    (sqrt (* s (- s a) (- s b) (- s c)))
50082 +}
50083 +
50084 +   And now the Kermit function reads almost like the original formula.
50085 +   Here Kermit behaves more like a regular programming language. In an
50086 +   S-Expression, macro names need not be escaped when they are used as the
50087 +   names of numeric variables.
50088 +
50089 +   [ [493]Top ] [ [494]Contents ] [ [495]C-Kermit Home ] [ [496]Kermit
50090 +   Home ]
50091 +
50092 +9.1. What is an S-Expression?
50093 +
50094 +   The S-Expression concept is borrowed from the Lisp programming
50095 +   language. "S-Expression" is short for Symbolic Expression (itself
50096 +   sometimes shortened to SEXP). S-Expressions provide a kind of
50097 +   Alternative Mini-Universe within the Kermit command language when the
50098 +   regular rules don't apply, a universe enclosed in parentheses.
50099 +
50100 +   C-Kermit does not pretend to be a full Lisp interpreter; only the
50101 +   arithmetic parts of Lisp have been incorporated: S-Expressions that
50102 +   operate on numbers and return numeric values (plus extensibility
50103 +   features described in [497]Section 9.8, which allow some degree of
50104 +   string processing).
50105 +
50106 +   An S-Expression is a list of zero or more items, separated by spaces,
50107 +   within parentheses. Examples:
50108 +
50109 +  ()
50110 +  (1)
50111 +  (a)
50112 +  (+ a 1)
50113 +  (* 2 a b)
50114 +
50115 +   If the S-Expression is empty, it has the NIL (empty) value. If it is
50116 +   not empty and the first item is an operator (such as + or *), there can
50117 +   be zero or more subsequent items, called the operands:
50118 +
50119 +  (+ 1 2)
50120 +
50121 +   Here the operator is "+" and the operands are "1" and "2", and the
50122 +   value of the S-Expression is the value of the operation (in this case
50123 +   3). The operator always comes first, which is different from the
50124 +   familiar algebraic notation; this because S-Expression operators can
50125 +   have different numbers of operands:
50126 +
50127 +  (+ 1)
50128 +  (+ 1 2)
50129 +  (+ 1 2 3 4 5 6 7 8 9)
50130 +
50131 +   If the first item in the S-Expression is not an operator, then it must
50132 +   be a variable or a number (or a macro; see [498]Section 9.8), and the
50133 +   S-Expression can only contain one item; in this case, the
50134 +   S-Expression's value is the value of the variable or number:
50135 +
50136 +  (a)
50137 +  (3)
50138 +
50139 +   Operands can be numbers, variables that have numeric values, functions
50140 +   that return numbers, or other S-Expressions. To illustrate an
50141 +   S-Expression within an S-Expression, observe that:
50142 +
50143 +  (+ 1 2)
50144 +
50145 +   is equivalent to any of the following (plus an infinite number of
50146 +   others):
50147 +
50148 +  (+ 1 (+ 1 1))
50149 +  (+ (- 3 2) (/ 14 (+ 3 4)))
50150 +
50151 +   S-Expressions can be nested to any reasonable level; for example, the
50152 +   value of the following S-Expression is 64:
50153 +
50154 +  (- (* (+ 2 (* 3 4)) (- 9 (* 2 2))) 6)
50155 +
50156 +   Operators have no precedence, implied or otherwise, since they can't be
50157 +   mixed. The only exceptions are unary + and -, which simply indicate the
50158 +   sign of a number:
50159 +
50160 +  (* 3 -1)
50161 +
50162 +   Order of evaluation is specified entirely by parentheses, which are
50163 +   required around each operator and its operands: (+ a (* b c)) instead
50164 +   of (a + b * c).
50165 +
50166 +   S-Expressions provide a simple and isolated environment in which
50167 +   Kermit's macro names can be used without the \m(...) escaping that is
50168 +   normally required. Given:
50169 +
50170 +  define a 1
50171 +  define b 2
50172 +  define c 3
50173 +
50174 +   Then:
50175 +
50176 +  (+ \m(a) \m(b) \m(c))
50177 +
50178 +   is equivalent to:
50179 +
50180 +  (+ a b c)
50181 +
50182 +   Within an S-Expression, as in other strictly numeric contexts
50183 +   ([499]Section 8.2), any operand that starts with a letter is treated as
50184 +   a Kermit macro name. In this context, abbreviations are not accepted;
50185 +   variable names must be spelled out in full. Alphabetic case is not
50186 +   significant; "a" and "A" are the same variable, but both are different
50187 +   from "area".
50188 +
50189 +   Of course, regular Kermit variables and functions can be used in
50190 +   S-Expressions in the normal ways:
50191 +
50192 +  (* \v(math_pi) (^ \%r 2))             ; Area of a circle with radius \%r
50193 +  (+ \fjoin(&a))                        ; Sum of all elements of array \&a[]
50194 +
50195 +   [ [500]Top ] [ [501]Contents ] [ [502]C-Kermit Home ] [ [503]Kermit
50196 +   Home ]
50197 +
50198 +9.2. Integer and Floating-Point-Arithmetic
50199 +
50200 +   Normally, if all numbers in an S-Expression are integers, the result is
50201 +   an integer:
50202 +
50203 +  (+ 1 1)                               ; Result is 2
50204 +  (/ 9 3)                               ; Result is 3
50205 +
50206 +   If any of the operands is floating point, however, the result is also
50207 +   floating point:
50208 +
50209 +  (+ 1 1.0)                             ; Result is 2.0
50210 +  (/ 9.0 3)                             ; Result is 3.0
50211 +
50212 +   If all the operands are integers but the result has a fractional part,
50213 +   the result is floating point:
50214 +
50215 +  (/ 10 3)                              ; Result is 3.333333333333333
50216 +
50217 +   To force an integer result in such cases, use the TRUNCATE operator:
50218 +
50219 +  (truncate (/ 10 3))                   ; Result is 3
50220 +
50221 +   Similarly, to force a computation to occur in floating point, you can
50222 +   coerce one of its operands to FLOAT:
50223 +
50224 +  (+ 1 (float 1))                       ; Result is 2.0
50225 +
50226 +   The result is also floating point if the magnitude of any integer
50227 +   operand, intermediate result, or the result itself, is larger than the
50228 +   maximum for the underlying machine architecture:
50229 +
50230 +  (^ 100 100)
50231 +
50232 +   If the result is too large even for floating-point representation,
50233 +   "Infinity" is printed; if it is too small to be distinguished from 0,
50234 +   0.0 is returned.
50235 +
50236 +   Large numbers can be used and large results generated, but they are
50237 +   accurate only to the precision of the underlying machine. For example,
50238 +   the result of:
50239 +
50240 + (+ 111111111111111111111 222222222222222222222)
50241 +
50242 +   should be 333333333333333333333, but 333333333333333300000.0 is
50243 +   produced instead if the machine is accurate to only about 16 decimal
50244 +   digits, even with coercion to floating-point. The order of magnitude is
50245 +   correct but the least significant digits are wrong. The imprecise
50246 +   nature of the result is indicated by the ".0" at the end. Contrast
50247 +   with:
50248 +
50249 + (+ 111111111 222222222)
50250 +
50251 +   which produces an exact integer result.
50252 +
50253 +   [ [504]Top ] [ [505]Contents ] [ [506]C-Kermit Home ] [ [507]Kermit
50254 +   Home ]
50255 +
50256 +9.3. How to Use S-Expressions
50257 +
50258 +   S-Expressions may be given as commands to C-Kermit. Any command whose
50259 +   first character is "(" (left parenthesis) is interpreted as an
50260 +   S-Expression.
50261 +
50262 +   If you enter an S-Expression at the C-Kermit> prompt, its result is
50263 +   printed:
50264 +
50265 +  C-Kermit>(/ 10.0 3)
50266 +   3.333333333333333
50267 +  C-Kermit>
50268 +
50269 +   If an S-Expression is executed within a macro or command file, its
50270 +   value is not printed. However, you can control the printing action
50271 +   with:
50272 +
50273 +   SET SEXPRESSION ECHO { AUTO, ON, OFF }
50274 +          AUTO is the default, meaning print the value at top level only;
50275 +          ON means always print the value; OFF means never print it.
50276 +
50277 +   In any case, the value of the most recent S-Expression (and the
50278 +   S-Expression itself) may be accessed programmatically through the
50279 +   following variables:
50280 +
50281 +   \v(sexpression)
50282 +          The S-Expression most recently executed.
50283 +
50284 +   \v(svalue)
50285 +          The value of the S-Expression most recently executed.
50286 +
50287 +   Besides issuing S-Expressions as commands in themselves, you can also
50288 +   execute them anywhere within a Kermit command, but in this case they
50289 +   must be enclosed in a function call (otherwise they are taken
50290 +   literally):
50291 +
50292 +   \fsexpression(s)
50293 +          The argument "s" is an S-Expression; the outer parentheses may
50294 +          be omitted. The value of the S-Expression is returned. Note that
50295 +          since S-Expressions usually contain spaces, some form of
50296 +          grouping or quoting might be needed in some contexts:
50297 +
50298 +  echo \fsexpression((+ 1 1))            ; Outer parentheses may be included
50299 +  echo \fsexpr(+ 1 1)                    ; Outer parentheses may be omitted
50300 +  echo Value = "\fsexp(+ 1 a)"           ; Can be embedded in strings
50301 +  echo Value = \&a[\fsexp(/ b 2)]        ; Can be used in array subscripts
50302 +  if = {\fsexp(+ 1 1)} 2 {               ; Braces needed here for grouping
50303 +      echo One plus one still equals two
50304 +  }
50305 +
50306 +   The IF statement illustrates how to use S-Expressions as (or in) IF or
50307 +   WHILE conditions:
50308 +
50309 +     * Although S-Expressions and IF conditions are similar in appearance,
50310 +       they are not interchangeable. Therefore you must use \fsexpr() to
50311 +       let Kermit know it's an S-Expression rather than a regular IF
50312 +       condition, or a boolean or algebraic expression within an IF
50313 +       condition.
50314 +     * In contexts where a single "word" is expected, you must enclose the
50315 +       \fsexp() invocation in braces if the S-Expression contains spaces
50316 +       (and most of them do).
50317 +
50318 +   If an S-Expression is the last command executed in a macro, its value
50319 +   becomes the return value of the macro; no RETURN command is needed.
50320 +   Example:
50321 +
50322 +  def newarea {
50323 +      (let s (/ (+ \%1 \%2 \%3) 2.0))
50324 +      (sqrt (* s (- s \%1) (- s \%2) (- s \%3)))
50325 +  }
50326 +
50327 +   This is equivalent to (but more efficient than):
50328 +
50329 +  def newarea {
50330 +      (let s (/ (+ \%1 \%2 \%3) 2.0))
50331 +      return \fsexp(sqrt (* s (- s \%1) (- s \%2) (- s \%3)))
50332 +  }
50333 +
50334 +   When an S-Expression is entered as a command -- that is, the first
50335 +   nonblank character of the command is a left parenthesis -- then it is
50336 +   allowed to span multiple lines, as many as you like, until the first
50337 +   left parenthesis is matched:
50338 +
50339 +  (let s (/
50340 +          (+
50341 +           \%1
50342 +           \%2
50343 +           \%3
50344 +           )
50345 +          2.0
50346 +          )
50347 +       )
50348 +  (sqrt (*
50349 +         s
50350 +         (- s \%1)
50351 +         (- s \%2)
50352 +         (- s \%3)
50353 +         )
50354 +        )
50355 +
50356 +   The S-Expression concept lends itself easily to embedding and
50357 +   recursion, but the depth to which recursion can occur is limited by the
50358 +   resources of the computer (memory size, address space, swap space on
50359 +   disk) and other factors. There is no way that C-Kermit can know what
50360 +   this limit is, since it varies not only from computer to computer, but
50361 +   also from moment to moment. If resources are exhausted by recursion,
50362 +   C-Kermit simply crashes; there's no way to trap this error. However,
50363 +   you can set a depth limit on S-Expressions:
50364 +
50365 +   SET SEXPRESSION DEPTH-LIMIT number
50366 +          Limits the number of times the S-Expression reader can invoke
50367 +          itself without returning to the given number. The default limit
50368 +          is 1000. This limit applies to S-Expressions embedded within
50369 +          other S-Expressions as well as to S-Expressions that invoke
50370 +          recursive macros. If the limit is exceeded, Kermit prints
50371 +          "?S-Expression depth limit exceeded" and returns to its prompt.
50372 +          More about recursion in [508]Section 9.8.
50373 +
50374 +   You can also test the depth programmatically:
50375 +
50376 +   \v(sdepth)
50377 +          The current S-Expression invocation depth. The depth includes
50378 +          both nesting level and recursion. For example, in:
50379 +          (foo (foo (foo (foo (foo))))), the innermost (foo) is at depth
50380 +          5.
50381 +
50382 +   Help, completion, and syntax checking are not available within an
50383 +   S-Expression. If you type ? within an S-Expression, it says:
50384 +
50385 +  C-Kermit>(? S-Expression ("help sexp" for details)
50386 +
50387 +   As it says, typing "help sexp" will display a brief help text.
50388 +
50389 +   The SHOW SEXPRESSION command displays current SET SEXPRESSION settings
50390 +   and related information.
50391 +
50392 +   [ [509]Top ] [ [510]Contents ] [ [511]C-Kermit Home ] [ [512]Kermit
50393 +   Home ]
50394 +
50395 +9.4. Summary of Built-in Constants and Operators
50396 +
50397 +   Three constants are built in:
50398 +
50399 +     * PI, whose value is the value of pi (the quotient of circumference
50400 +       of any circle and its diameter, 3.141592653...) to the underlying
50401 +       machine's precision;
50402 +     * T, which always has the value 1, which signifies truth in Kermit
50403 +       logical expressions or S-Expressions;
50404 +     * NIL, which always has the empty value, and can serve as a False
50405 +       truth value.
50406 +
50407 +   These constants are specific to S-Expressions and are not visible
50408 +   outside them. They may not be used as the target of an assignment. So,
50409 +   for example:
50410 +
50411 +  (setq t 0)   Fails
50412 +  assign t 0   Succeeds but this is not the same T!
50413 +
50414 +   E (the base of natural logarithms, 2.7182818184...) is not built in
50415 +   since it is not intrinsic in most Lisp dialects. If you want E to be
50416 +   the base of natural logarithms you can:
50417 +
50418 +  (setq e (exp 1))
50419 +
50420 +   Operators are either symbols (such as "+") or words. Words must be
50421 +   spelled out in full, not abbreviated. Differences of alphabetic case
50422 +   are ignored.
50423 +
50424 +   The most basic operation in S-Expressions is evaluation:
50425 +
50426 +   EVAL [ s-expression or variable or number [ another [ another ... ] ] ]
50427 +          Evaluates its operands and returns the value of the last one
50428 +          evaluated. Examples:
50429 +
50430 +  (eval)                                0
50431 +  (eval 1)                              1
50432 +  (eval a)                              value of a
50433 +  (eval (+ 1 a))                        value of a+1
50434 +  (eval (setq a 1) (setq b (+ a 0.5)))  value of b (= a+0.5)
50435 +
50436 +          You can use "." as a shorthand for EVAL:
50437 +
50438 +  (.)
50439 +  (. 1)
50440 +  (. a)
50441 +  (. (+ 1 a))
50442 +  (. (setq a 1) (setq b (+ a 0.5)))
50443 +
50444 +   Opposite of EVAL is the operator that suppresses evaluation of its
50445 +   operand:
50446 +
50447 +   QUOTE item
50448 +          The value (quote item) is "item". If the item is itself an
50449 +          S-Expression, the result is the S-Expression with the outer
50450 +          parentheses stripped. Examples:
50451 +
50452 +  (quote)                               (illegal)
50453 +  (quote a)                             a
50454 +  (quote hello)                         hello
50455 +  (quote (this is a string))            this is a string
50456 +  (quote this is a string)              (illegal)
50457 +
50458 +          A shorthand notation is also accepted for quoting:
50459 +          'a is equivalent to (quote a). And therefore:
50460 +          '(a b c) is equivalent to (quote (a b c)).
50461 +          More about quoting in [513]Section 9.8.
50462 +
50463 +   STRING item
50464 +          Is a combination of EVAL and QUOTE. It evaluates the item as an
50465 +          S-Expression, and then puts quotes around the result (more about
50466 +          this in [514]Section 9.8).
50467 +
50468 +   The following operators assign values to variables:
50469 +
50470 +   SETQ [ variable [ value [ variable [ value [ ... ] ] ] ] ]
50471 +          Applies to global variables. For each variable given: if a value
50472 +          is not given, the variable is undefined. If a value is given,
50473 +          assigns the value to the variable. The value may be a number, a
50474 +          variable, or anything that resolves to a number including an
50475 +          S-Expression. Returns the value of the last assignment.
50476 +          Examples:
50477 +
50478 +  (setq)             Does nothing, returns NIL.
50479 +  (setq a)           Undefines a, returns NIL.
50480 +  (setq a 1)         Assigns 1 to a, returns 1.
50481 +  (setq a 1 b 2)     Assigns 1 to a, 2 to b, returns 2.
50482 +  (setq a 1 b 2 c)   Assigns 1 to a, 2 to b, undefines c, returns NIL.
50483 +
50484 +   To undefine a variable that is not the final one in the list, give it a
50485 +   value of "()" or NIL:
50486 +
50487 +  (setq a () b 2)    Undefines a, assigns 2 to b, returns 2.
50488 +  (setq a nil b 2)   Ditto.
50489 +
50490 +   Note that a variable can be used right away once it has a value:
50491 +
50492 +  (setq a 1 b a)     Assigns 1 to a, the value of a (1) to b, returns 1.
50493 +
50494 +   The results of SETQ (when used with macro names) can be checked
50495 +   conveniently with SHOW MACRO, e.g:
50496 +
50497 +  show mac a b c
50498 +
50499 +   LET [ variable [ value [ variable [ value [ ... ] ] ] ] ]
50500 +          Like SETQ, but applies to local variables. Note that "local" is
50501 +          used in the Kermit sense, not the Lisp sense; it applies to the
50502 +          current Kermit command level, not to the current S-Expression.
50503 +
50504 +   If you want to use SETQ or LET to assign a value to a backslash
50505 +   variable such as \%a or \&a[2], you must double the backslash:
50506 +
50507 +  (setq \\%a 3)
50508 +  (setq \\%b (+ \%a 1))
50509 +  (setq \\&a[2] (setq (\\%c (+ \%a \%b))))
50510 +
50511 +   In other words:
50512 +
50513 +     * Double the backslash when you want to indicate the variable's NAME;
50514 +     * Don't double the backslash when you want its VALUE.
50515 +
50516 +   See [515]Section 9.6 for a fuller explanation of variable syntax and
50517 +   scope.
50518 +
50519 +   Here's a summary table of arithmetic operators; in the examples, a is 2
50520 +   and b is -1.3:
50521 +
50522 +  Operator  Description                            Example           Result
50523 +  +         Adds all operands (0 or more)          (+ a b)           0.7
50524 +  -         Subtracts all operands (0 or more)     (- 9 5 2 1)       1
50525 +  *         Multiplies all operands (0 or more)    (* a (+ b 1) 3)  -1.80
50526 +  /         Divides all operands (2 or more)       (/ b a 2)        -0.325
50527 +  ^         Raise given number to given power      (^ 3 2)           9
50528 +  ++        Increments variables                   (++ a 1.2)        3.2
50529 +  --        Decrements variables                   (-- a)            1
50530 +  ABS       Absolute value of 1 operand            (abs (* a b 3))   7.8
50531 +  MAX       Maximum of all operands (1 or more)    (max 1 2 3 4)     4
50532 +  MIN       Minimum of all operands (1 or more)    (min 1 2 3 4)     1
50533 +  MOD (%)   Modulus of all operands (1 or more)    (mod 7 4 2)       1
50534 +  FLOAT     Convert an integer to floating-point   (float 1)         1.0
50535 +  TRUNCATE  Integer part of floating-point operand (truncate 3.333)  3
50536 +  CEILING   Ceiling of floating-point operand      (ceiling 1.25)    2
50537 +  FLOOR     Floor of floating-point operand        (floor 1.25)      1
50538 +  ROUND     Operand rounded to nearest integer     (round 1.75)      2
50539 +  SQRT      Square root of 1 operand               (sqrt 2)          1.414..
50540 +  EXP       e (2.71828..) to the given power       (exp -1)          0.367..
50541 +  SIN       Sine of angle-in-radians               (sin (/ pi 2))    1.0
50542 +  COS       Cosine of angle-in-radians             (cos pi)         -1.0
50543 +  TAN       Tangent of angle-in-radians            (tan pi)          0.0
50544 +  LOG       Natural log (base e) of given number   (log 2.7183)      1.000..
50545 +  LOG10     Log base 10 of given number            (log10 1000)      3.0
50546 +
50547 +   The ++ and -- operators are also assignment operators and work just
50548 +   like SETQ and LET in their interpretations of operators and operands,
50549 +   but:
50550 +
50551 +     * Each target variable must already be defined and have a numeric
50552 +       value;
50553 +     * The assignment value is the amount by which to increment or
50554 +       decrement the variable.
50555 +     * If an assignment value is not given, 1 is used.
50556 +
50557 +   If you include more than one variable-value pair in a ++ or --
50558 +   expression, every variable (except, optionally, the last) must be
50559 +   followed by a value. Examples:
50560 +
50561 +  (++ a)                Equivalent to (setq a (+ a 1)) and to (++ a 1)
50562 +  (++ a 2)              Equivalent to (setq a (+ a 2))
50563 +  (-- a (* 2 pi))       Equivalent to (setq a (- a (* 2 pi)))
50564 +  (++ a 1 b 1 c 1 d)    Equivalent to four SETQs incrementing a,b,c,d by 1.
50565 +
50566 +   Another group of operators forms the predicates. These return a "truth
50567 +   value", in which 0 (or NIL) is false, and 1 or any other nonzero number
50568 +   is true.
50569 +
50570 +  Operator  Description                            Example           Result
50571 +  = (or ==) Operands are equal                     (= 1 1.0)         1
50572 +  !=        Operands are not equal                 (!= 1 1.0)        0
50573 +  <         Operands in strictly ascending order   (< 1 2 3)         1
50574 +  <=        Operands in ascending order            (<= 1 1 2 3)      1
50575 +  >         Operands in strictly descending order  (> 3 2 1)         1
50576 +  >=        Operands in descending order           (<= 3 3 2 1)      1
50577 +  AND (&&)  Operands are all true                  (and 1 1 1 1 0)   0
50578 +  OR  (||)  At least one operand is true           (or 1 1 1 1 0)    1
50579 +  XOR       Logical Exclusive OR                   (xor 3 1)         0
50580 +  NOT (!)   Reverses truth value of operand        (not 3)           0
50581 +
50582 +   The Exclusive OR of two values is true if one value is true and the
50583 +   other value is false.
50584 +
50585 +   And another group operates on bits within an integer word:
50586 +
50587 +  Operator  Description                            Example           Result
50588 +  &         Bitwise AND                            (& 7 2)           2
50589 +  |         Bitwise OR                             (| 1 2 3 4)       7
50590 +  #         Bitwise Exclusive OR                   (# 3 1)           2
50591 +  ~         Reverses all bits                      (~ 3)            -4
50592 +
50593 +   These operators coerce their operands to integer by truncation if
50594 +   necessary. The result of bit reversal is hardware dependent.
50595 +
50596 +   The final category of operator works on truth values:
50597 +
50598 +  Operator  Description                            Example           Result
50599 +  IF        Conditional evaluation                 (if (1) 2 3)      2
50600 +
50601 +   IF (predicate) (s1) [ (s2) ]
50602 +          The IF operator is similar to Kermit's IF command. If the
50603 +          predicate is true (i.e. evaluates to a nonzero number), the
50604 +          first S-Expression (s1) is evaluated and its value is returned.
50605 +          Otherwise, if (s2) is given, it is evaluated and its value
50606 +          returned; if (s2) is not given, nothing happens and the NIL
50607 +          (empty) value is returned.
50608 +
50609 +   You can group multiple expressions in the s1 and s2 expressions using
50610 +   EVAL (or "."):
50611 +
50612 +  (if (< a 0) (eval (setq x 0) (setq y 0)) (eval (setq x a) (setq y b)))
50613 +
50614 +   or equivalently:
50615 +
50616 +  (if (< a 0) (. (setq x 0) (setq y 0)) (. (setq x a) (setq y b)))
50617 +
50618 +   Each operator has its own requirement as to number and type of
50619 +   operands. In the following table, "number" means any kind of number --
50620 +   integer or floating-point -- or a variable, function, macro, or
50621 +   S-Expression that returns a number; "vname" means variable name,
50622 +   "fpnumber" means a floating-point number (or anything that resolves to
50623 +   one), and "integer" means integer (or anything that resolves to one).
50624 +   "truthvalue" means anything that resolves to a value of zero or an
50625 +   empty value (which indicates false) or a nonzero value (which indicates
50626 +   true). "any" means any kind of value, including none at all.
50627 +
50628 +  Operator  Number of operands   Type of operands    Returns
50629 +  EVAL  (.) 0 or more            S-Expression        Last value (default NIL)
50630 +  STRING    1                    S-Expression        string
50631 +  QUOTE (') 1                    word                string
50632 +  SETQ      0 or more            vname value pairs   Last value (default NIL)
50633 +  LET       0 or more            vname value pairs   Last value (default NIL)
50634 +  +         0 or more            number              number     (default 0)
50635 +  -         0 or more            number              number     (default 0)
50636 +  *         0 or more            number              number     (see note (1))
50637 +  /         2 or more            number              number
50638 +  ^         2 or more            number              number
50639 +  ++        1 or more            vname value pairs   Result of last increment
50640 +  --        1 or more            vname value pairs   Result of last decrement
50641 +  ABS       1                    number              number
50642 +  MAX       1 or more            number              number
50643 +  MIN       1 or more            number              number
50644 +  MOD (%)   2                    number              number
50645 +  FLOAT     1                    number              fpnumber
50646 +  TRUNCATE  1                    number              integer
50647 +  CEILING   1                    number              integer
50648 +  FLOOR     1                    number              integer
50649 +  ROUND     1                    number              integer
50650 +  SQRT      1                    number              fpnumber
50651 +  EXP       1                    number              fpnumber
50652 +  SIN       1                    number              fpnumber
50653 +  COS       1                    number              fpnumber
50654 +  TAN       1                    number              fpnumber
50655 +  LOG       1                    number              fpnumber
50656 +  LOG10     1                    number              fpnumber
50657 +  = (==)    1 or more            number              truthvalue
50658 +  !=        1 or more            number              truthvalue
50659 +  <         1 or more            number              truthvalue
50660 +  <=        1 or more            number              truthvalue
50661 +  >         1 or more            number              truthvalue
50662 +  >=        1 or more            number              truthvalue
50663 +  AND (&&)  1 or more            truthvalue          truthvalue
50664 +  OR  (||)  1 or more            truthvalue          truthvalue
50665 +  XOR       2                    truthvalue          truthvalue
50666 +  NOT (!)   1                    truthvalue          truthvalue
50667 +  &         1 or more            number (see note 2) integer
50668 +  |         1 or more            number (see note 2) integer
50669 +  #         2                    number (see note 2) integer
50670 +  ~         1                    number (see note 2) integer
50671 +  IF        2 or 3               truthvalue,any,any  any
50672 +
50673 +   Operators that don't require any arguments return the default values
50674 +   shown.
50675 +
50676 +    1. The value of "*", when used as an operand, is initially "1" and the
50677 +       value of the most recent S-Expression thereafter, as in Franz Lisp.
50678 +       This is handy when doing a series of calculations by hand:
50679 +  C-Kermit>(* 13272.42 0.40)
50680 +   5308.968
50681 +  C-Kermit>(/ * 2)
50682 +   2654.4840
50683 +  C-Kermit>
50684 +
50685 +    2. The bitwise operators coerce their operands to integer by
50686 +       truncation.
50687 +
50688 +   [ [516]Top ] [ [517]Contents ] [ [518]C-Kermit Home ] [ [519]Kermit
50689 +   Home ]
50690 +
50691 +9.5. Variables
50692 +
50693 +   As noted elsewhere in this discussion, all backslash items (variables
50694 +   such as \%a, macro parameters such as \%1, array elements such as
50695 +   \&a[\%i], built-in variables such as \v(ndate), built-in functions such
50696 +   as \fjoin(), macro names enclosed in \m(), \s(), or \:(), etc) are
50697 +   evaluated at "top level" before the S-Expression is sent to the
50698 +   S-Expression reader. To use a backslash variable as the target of an
50699 +   assignment (e.g. by SETQ, LET, ++, or --), you must double the
50700 +   backslash, e.g. (setq \\%r 1234). This is discussed at greater length
50701 +   in the next section.
50702 +
50703 +   Thus S-Expression reader generally deals only with macro names (not
50704 +   backslash items) as variables. It is important to understand how the
50705 +   reader handles macro names. There are fundamentally two kinds of
50706 +   S-Expressions: those that contain a single element, such as:
50707 +
50708 +  (foo)
50709 +
50710 +   and those that contain more than one element:
50711 +
50712 +  (foo a b c)
50713 +
50714 +   If an S-Expression contains only one element, and it is the name of a
50715 +   macro, the macro's definition is examined. If the definition is a
50716 +   number (integer or floating-point, positive or negative), then this
50717 +   becomes the value of the expression. If the definition starts with '
50718 +   (apostrophe), then the quoted word or string is the value of the
50719 +   expression (explained in [520]Section 9.8). Otherwise, the macro is
50720 +   assumed to be composed of Kermit commands (possibly including
50721 +   S-Expressions), which are executed. If the macro has a RETURN value, or
50722 +   it executes an S-Expression as its last command, the result becomes the
50723 +   value of the S-Expression; otherwise the result is empty.
50724 +
50725 +   For S-Expressions that contain more than one element, and the first
50726 +   element is the name of a macro, then this macro is executed with the
50727 +   arguments that are given, after the arguments are evaluated by the
50728 +   S-Expression reader. Likewise, If the first element is a built-in
50729 +   operator, then it is applied to the operands after they are evaluated.
50730 +   In both cases, each operand is fed to the S-Expression reader
50731 +   recursively for evaluation. If an operand is a number or a quoted
50732 +   string, it is used as-is. But if it's a macro name, this degenerates
50733 +   into the first case, and the previous paragraph applies.
50734 +
50735 +   Examples:
50736 +
50737 +  define foo 123
50738 +  (foo)                                Result: 123
50739 +  define foo 'abc
50740 +  (foo)                                Result: abc
50741 +  define foo '(one two three)
50742 +  (foo)                                Result: one two three
50743 +  define foo return \frandom(1000)
50744 +  (foo)                                Result: 713 (or other number)
50745 +  define foo (+ a b)
50746 +  (foo)                                Result: The sum of a and b
50747 +
50748 +   A more difficult example:
50749 +
50750 +  define foo abc
50751 +  (foo)                                Result: ???
50752 +
50753 +   The result in the last example depends on the definition of abc:
50754 +
50755 +     * If it has no definition, an error occurs; otherwise:
50756 +     * If the definition is an S-Expression, the result is the
50757 +       S-Expression's value; otherwise:
50758 +     * If the definition consists of Kermit commands, they are executed.
50759 +       But in this case "(foo)" produces the empty result, because it
50760 +       doesn't RETURN anything.
50761 +
50762 +   The use of macros as S-Expression operators is described in
50763 +   [521]Section 9.8.
50764 +
50765 +   [ [522]Top ] [ [523]Contents ] [ [524]C-Kermit Home ] [ [525]Kermit
50766 +   Home ]
50767 +
50768 +9.6. Assignments and Scope
50769 +
50770 +   The assignment operators SETQ and LET apply to global and local
50771 +   variables, respectively. SETQ and LET are standard Lisp operators
50772 +   adapted to Kermit scoping rules. When the operands are numeric or
50773 +   arithmetic, SETQ is equivalent to Kermit's EVALUATE command:
50774 +
50775 +  (setq a (+ 1 2))
50776 +  evaluate a 1 + 2
50777 +
50778 +   When the operand is a string, SETQ is equivalent to DEFINE:
50779 +
50780 +  (setq a '(this is a string))
50781 +  define a this is a string
50782 +
50783 +   In the first case, both statements create a macro named "a" with a
50784 +   value of 3. But in neither case is the macro "a" necessarily global. If
50785 +   either of these commands executes in an environment (i.e. macro
50786 +   invocation level) where a "local a" command has been given, the "a"
50787 +   macro is global to that environment, but is not visible outside it.
50788 +
50789 +   LET is equivalent to the Kermit LOCAL command, followed by the
50790 +   corresponding EVALUATE:
50791 +
50792 +  (let a (+ 1 2))
50793 +
50794 +   is equivalent to:
50795 +
50796 +  local a
50797 +  evaluate a 1 + 2
50798 +
50799 +   Again, "local" in this context applies to the Kermit macro invocation
50800 +   stack, not to the S-Expression nesting level. To illustrate, recall our
50801 +   "newarea" macro:
50802 +
50803 +def newarea {
50804 +    (let a \%1 b \%2 c \%3)
50805 +    (let s (/ (+ a b c) 2.0))
50806 +    (sqrt (* s (- s a) (- s b) (- s c)))
50807 +}
50808 +
50809 +   Because SETQ and LET expressions return a value, they can be placed
50810 +   within a larger S-Expression. In this case we can replace the first
50811 +   reference to the "s" variable by its defining expression:
50812 +
50813 +def newarea {
50814 +    (let a \%1 b \%2 c \%3)
50815 +    (sqrt (* (let s (/ (+ a b c) 2.0)) (- s a) (- s b) (- s c)))
50816 +}
50817 +
50818 +   This would not work if LET were local to the S-Expression, but it works
50819 +   nicely in the context of Kermit macros. The previous definition is
50820 +   equivalent to:
50821 +
50822 +def newarea {
50823 +    local a b c s
50824 +    (setq a \%1 b \%2 c \%3)
50825 +    (sqrt (* (setq s (/ (+ a b c) 2.0)) (- s a) (- s b) (- s c)))
50826 +}
50827 +
50828 +   In both cases, the variables a, b, c, and s are local to the "newarea"
50829 +   macro, and global within it.
50830 +
50831 +   Multiple assignments can be handled in several ways. Here is the
50832 +   obvious way to initialize a series of variables to the same value:
50833 +
50834 +  (setq a 0)
50835 +  (setq b 0)
50836 +  (setq c 0)
50837 +  (setq s 0)
50838 +
50839 +   Here is a more compact and efficient way of doing the same thing:
50840 +
50841 +  (setq a 0 b 0 c 0 s 0)
50842 +
50843 +   However, in case the value was more complex, it's better to put only
50844 +   one copy of it in the S-Expression; in this case we rely on the fact
50845 +   that SETQ returns the value of its last assignment:
50846 +
50847 +  (setq a (setq b (setq c (setq s (* x (^ y 2))))))
50848 +
50849 +   Similarly, to set a series of variables to x, x+1, x+2, ...
50850 +
50851 +  (setq c (+ (setq b (+ (setq a (+ (setq s x) 1)) 1)) 1))
50852 +
50853 +   In the last example, you can see why "last" does not always correspond
50854 +   to "rightmost" (the leftmost variable "c" is assigned last).
50855 +
50856 +   If you are working with backslash variables like \%a or array elements
50857 +   like \&a[1], remember two rules:
50858 +    1. Don't put spaces inside array brackets.
50859 +    2. You must double the backslash when using SETQ, LET, ++, or -- to
50860 +       assign a value to a backslash variable.
50861 +
50862 +   Examples of assigning to a backslash variable:
50863 +
50864 +  (setq x 1)
50865 +  (setq \\%a 0)
50866 +  (setq \\&a[x+1] 1)
50867 +  (++ \\%x)
50868 +  (-- \\&a[x+2])
50869 +
50870 +   Examples of referring to a backslash variable's value:
50871 +
50872 +  (setq a (+ \%a 1))
50873 +  (setq b (+ \%a \&a[1]))
50874 +  (++ a \%x)
50875 +  (-- b \&a[1])
50876 +
50877 +   The special notation is required because all backslashed items (\%x
50878 +   variables, array elements, built-in \v(xxx) variables, and \fxxx()
50879 +   function invocations) are evaluated in a single pass BEFORE the
50880 +   S-Expression is executed; any other approach would result in
50881 +   unacceptable performance. So, for example, in:
50882 +
50883 +  declare \&a[] = 1 2 3
50884 +  define \%x 4
50885 +  define \%y 0
50886 +  (setq \\%y (+ \%x \&a[1]))
50887 +
50888 +   the S-Expression becomes:
50889 +
50890 +  (setq \%y (+ 4 1))
50891 +
50892 +   before it is sent to the S-Expression evaluator. If the backslash had
50893 +   not been doubled on the assignment target, the result would have been:
50894 +
50895 +  (setq 0 (+ 4 1))
50896 +
50897 +   which is illegal because you can't assign a value to a number.
50898 +   Conversely, if backslashes were doubled on right-hand-side values:
50899 +
50900 +  (setq \\%y (+ \\%x \\&a[1])
50901 +
50902 +   this too, would give an error (not numeric - "\%x").
50903 +
50904 +   If you omit the double backslash in the assignment target, the result
50905 +   depends on whether the variable already has a value:
50906 +
50907 +  (setq \%a (* 3 3))
50908 +
50909 +   If \%a has a non-numeric single-word value, then this becomes the name
50910 +   of the variable that is assigned by SETQ. To illustrate:
50911 +
50912 +  define \%a foo
50913 +  echo \%a
50914 +  foo
50915 +  (setq \%a (* 3 3))
50916 +  echo \%a
50917 +  foo
50918 +  show macro foo
50919 +  foo = 9
50920 +
50921 +   If \%a has no value, a numeric value, or a multiword value, an "invalid
50922 +   assignment" error occurs.
50923 +
50924 +   [ [526]Top ] [ [527]Contents ] [ [528]C-Kermit Home ] [ [529]Kermit
50925 +   Home ]
50926 +
50927 +9.7. Conditional Expressions
50928 +
50929 +   The IF operator provides a compact form of decision-making within
50930 +   S-Expressions. An IF expression can stand wherever a number might
50931 +   stand, as long is it returns a number. Here's a quick way to obtain the
50932 +   average value of all the elements in an array that contains only
50933 +   numbers:
50934 +
50935 +  (/ (+ \fjoin(&a)) (float \fdim(&a)))
50936 +
50937 +   This results in a "Divide by zero" error if the array is empty. If you
50938 +   want to define the average value of an empty array to be 0 instead of
50939 +   getting an error, you can use IF to check the array size:
50940 +
50941 +  (if \fdim(&a) (/ (+ \fjoin(&a)) (float \fdim(&a))) 0)
50942 +
50943 +   or equivalently:
50944 +
50945 +  (if (not \fdim(&a)) 0 (/ (+ \fjoin(&a)) (float \fdim(&a))))
50946 +
50947 +   Of course, IF can fit anywhere else into an S-Expression:
50948 +
50949 +  (setq a (+ b (if (< c 0) 0 c)))
50950 +
50951 +   and the IF expression can be as complex as you like:
50952 +
50953 +  (setq a (+ b (if (and (or (> x 0) (> y 0)) (< c 0) (> d 1) (!= e 0)) 1 0)))
50954 +
50955 +   and the "then" and "else" parts can contain multiple S-Expressions
50956 +   enclosed within (EVAL ...):
50957 +
50958 +  (if x (eval (...) (...) (...)) (eval (...) (...) (...)))
50959 +
50960 +   AND and OR operators are guaranteed to "short circuit". If any operand
50961 +   of AND is false, none of the subsequent operands is evaluated;
50962 +   likewise, if an OR operand is true, no further operands are evaluated.
50963 +
50964 +   Bear in mind that the S-Expression IF is not the same as Kermit IF; the
50965 +   condition is only allowed to be an S-Expression or a variable or
50966 +   number, not the whole list of possibilities you see when you type "if
50967 +   ?" at the C-Kermit> prompt. But keep reading...
50968 +
50969 +   [ [530]Top ] [ [531]Contents ] [ [532]C-Kermit Home ] [ [533]Kermit
50970 +   Home ]
50971 +
50972 +9.8. Extensibility
50973 +
50974 +   To extend the capabilities of S-Expressions, you can use Kermit macro
50975 +   names as operators, with the following limitations:
50976 +
50977 +     * The macro must not have the same name as a built-in operator.
50978 +     * You must use the full macro name, not an abbreviation.
50979 +
50980 +   And with the following enhancement:
50981 +
50982 +     * If the last statement executed by the macro is an S-Expression, its
50983 +       value is returned automatically. In other words:
50984 +
50985 +  define bump (++ \%1)
50986 +
50987 +   is equivalent to:
50988 +
50989 +  define bump return \fsexpression(++ \%1)
50990 +
50991 +   Here's an example in which we define a FIBONACCI operator that returns
50992 +   the nth element, n >= 0, of the Fibonacci series, 0 1 1 2 3 5 8 13 21
50993 +   34 55, . . ., in which the first element is 0, the second is 1, and
50994 +   each subsequent element is the sum of the two before it. This series
50995 +   was devised by Leonardo Pisano, Filius Bonacci (Fibonacci for short) in
50996 +   1202 to describe how fast rabbits can breed, and also forms the basis
50997 +   for the Golden Mean, the branching behavior of plants, the spiral of a
50998 +   nautilus shell, etc. (Thanks to [534]Dat Thuc Nguyen for December 2003
50999 +   corrections to this section!)
51000 +
51001 +   We can write a FIBONACCI function as a macro easily with S-Expressions:
51002 +
51003 +  define FIBONACCI {
51004 +    (if (== \%1 0) 0
51005 +        (if (== \%1 1) 1 (+ (fibonacci (- \%1 2)) (fibonacci (- \%1 1)))))
51006 +  }
51007 +
51008 +   You can read this as:
51009 +
51010 +     If the argument (\%1) is 0, return a result of 0; if it is 1,
51011 +     return 1; otherwise:
51012 +     return the sum of fibonacci(argument - 2) and fibonacci(argument -
51013 +     1)
51014 +
51015 +   Note that a RETURN statement is not needed, since S-Expressions
51016 +   automatically set the return value of their containing macros.
51017 +
51018 +   For comparison, here's how it would be coded without S-Expressions:
51019 +
51020 +  define FIBONACCI {
51021 +      if == \%1 0 {
51022 +          return 0
51023 +      } else if == \%1 1 {
51024 +          return 1
51025 +      } else {
51026 +          return \feval(\fexec(fibonacci \feval(\%1-2)) -
51027 +               + \fexec(fibonacci \feval(\%1-1)))
51028 +      }
51029 +  }
51030 +
51031 +   Now we can use the FIBONACCI function (whichever way you write it) just
51032 +   as if it were a built-in operator:
51033 +
51034 +  (fibonacci 6)
51035 +
51036 +   Or:
51037 +
51038 +  (setq a 10)
51039 +  (fibonacci a)
51040 +
51041 +   Within S-Expressions only (not outside them), S-Expressions themselves
51042 +   can be used as macro arguments:
51043 +
51044 +  (setq a 2 b 4)
51045 +  (setq x (fibonacci (* a b )))
51046 +
51047 +   The value of the S-Expression (in this case "8"), and not the
51048 +   S-Expression itself, is sent to the macro.
51049 +
51050 +   Your macro is responsible for argument validation and error handling. A
51051 +   robust Fibonacci macro would be more like this:
51052 +
51053 +  define FIBONACCI {
51054 +      if < \v(argc) 2 end 1 ?\%0: Missing argument
51055 +      if > \v(argc) 2 end 1 ?\%0: Too many arguments
51056 +      if not integer \%1 end 1 ?\%0: Integers only
51057 +      if < \%1 1 end 1 ?\%0: Argument out of range
51058 +      (if (== \%1 0) 0
51059 +         (if (== \%1 1) 1 (+ (fibonacci (- \%1 2)) (fibonacci (- \%1 1)))))
51060 +  }
51061 +
51062 +   Recall that "END nonzero-number [ message ]" causes a macro invocation
51063 +   to fail. When the macro is the operator in an S-Expression, this makes
51064 +   the S-Expression fail too. Also note that our Fibonacci macro is just
51065 +   an illustration, not a practical example. Since it is recursive (calls
51066 +   itself), it won't work for large arguments because the call stack can
51067 +   exceed available memory. See [535]Section 9.9.2 for a practical
51068 +   alternative.
51069 +
51070 +   Kermit macros, when used as S-Expression operators, can do anything at
51071 +   all except initiate file transfers: they can print messages on the
51072 +   screen, read and write files, interact with the user, and so on. For
51073 +   example, here's a macro ASKME that asks you to enter a number, makes
51074 +   sure that you did, and then returns its value for use in the
51075 +   S-Expression:
51076 +
51077 +  define ASKME {
51078 +      local \%n
51079 +      while true {
51080 +          ask \%n { Number: }
51081 +          if not def \%n continue
51082 +          if not numeric \%n {
51083 +              echo Not numeric - "\%n"
51084 +              continue
51085 +          }
51086 +          break
51087 +      }
51088 +      return \%n
51089 +  }
51090 +  (setq a (* 2 (askme))) ; Get number from user, double it, assign result to a.
51091 +
51092 +   Here's a macro you can use to validate that a number is in a given
51093 +   range:
51094 +
51095 +  define inrange {
51096 +      if != \v(argc) 4 end 1 ?\%0: Wrong number of arguments
51097 +      if ( < \%1 \%2 || > \%1 \%3 ) return 0
51098 +      return 1
51099 +  }
51100 +
51101 +   The first argument is the number to be checked, the second is the
51102 +   minimum acceptable value, the third is the maximum. You can use this
51103 +   (for example) in IF conditions:
51104 +
51105 +  define yes echo \%1 IS OK
51106 +  define no echo \%1 IS NOT OK
51107 +
51108 +  (setq a -1 b 999)
51109 +  (if (inrange a 0 100) (yes a) (no a))
51110 +  (if (inrange b -1000 +1000) (yes b) (no b))
51111 +
51112 +   This is just an illustration, of course; there's already a built-in
51113 +   operator to let you do range checking without help from macros:
51114 +
51115 +  (if (<= 0 a 100) (yes a) (no a))
51116 +  (if (<= -1000 b +1000) (yes b) (no b))
51117 +
51118 +   To send string parameters to a macro, some kind of quoting is required
51119 +   to tell the S-Expression parser to take a given "word" literally rather
51120 +   than replacing it by its value. For this we use the Lisp QUOTE
51121 +   operator:
51122 +
51123 +  define length return \flength(\%1)
51124 +  (length (quote abcdefghijklmnopqrstuvwxyz))
51125 +  26
51126 +
51127 +   This causes the string "abcdefghijklmnopqrstuvwxyz" to be sent
51128 +   literally to the LENGTH macro. Kermit, like Lisp, also offers a
51129 +   shortcut for QUOTE, that lets us quote a word by prefixing it with a
51130 +   single quote (') character, also called apostophe (ASCII 39):
51131 +
51132 +  (length 'abcdefghijklmnopqrstuvwxyz)
51133 +  26
51134 +
51135 +   The two forms are equivalent.
51136 +
51137 +   How the macro treats its arguments is up to the macro. In the example
51138 +   above, the argument is treated as a literal string. However, it can
51139 +   also be treated as a variable name:
51140 +
51141 +  define string This is a string
51142 +  define length return \flength(\m(\%1))
51143 +  (length 'string)
51144 +  16
51145 +
51146 +   Note the construct \m(\%1). This means "the value of the macro whose
51147 +   name is the value of
51148 +   \%1". The value of \%1 in this case is the word "string", and the value
51149 +   of the macro whose name is "string" is "This is a string".
51150 +
51151 +   What if the macro takes multiple arguments, or a variable number of
51152 +   them? Here's a simple macro that prints a phrase that includes its
51153 +   arguments:
51154 +
51155 +  define complain echo It's too \%*!
51156 +
51157 +   (Recall that \%* means "all arguments".)
51158 +
51159 +   It can be called in the traditional way:
51160 +
51161 +  complain hot                       Result: "It's too hot!"
51162 +  complain cold and wet              Result: "It's too cold and wet!"
51163 +
51164 +   Or from an S-Expression if you quote the arguments:
51165 +
51166 +  (complain 'hot)                    Result: "It's too hot!"
51167 +  (complain 'cold 'and 'wet)         Result: "It's too cold and wet!"
51168 +
51169 +   To group multiple words into a single argument, use parentheses:
51170 +
51171 +  (complain (quote (cold and wet)))  Result: "It's too cold and wet!"
51172 +  (complain '(cold and wet))         Result: "It's too cold and wet!"
51173 +
51174 +   Note the difference:
51175 +
51176 +  (complain 'cold 'and 'wet)         Three arguments
51177 +  (complain '(cold and wet))         One argument
51178 +
51179 +   Since the COMPLAIN macro uses \%* to refer to all its arguments, no
51180 +   matter how many, it doesn't care which form you use. But it makes a
51181 +   difference in cases where the macro refers to its arguments
51182 +   individually.
51183 +
51184 +   To illustrate, let's consider a macro that receives the name of a macro
51185 +   and its argument list and executes it with its arguments, without
51186 +   knowing how many arguments there are. The following LOOP macro is used
51187 +   to execute the given macro with the given argument list the requested
51188 +   number of times:
51189 +
51190 +  def loop { local i, for i 1 \%1 1 do \%2 \%3 }
51191 +
51192 +   Within the LOOP macro, the first argument (\%1) is the loop count, \%2
51193 +   is the macro name, and \%3 is the argument list. When the LOOP macro is
51194 +   invoked traditionally like this:
51195 +
51196 +  loop 3 complain hot
51197 +
51198 +   it prints "It's too hot!" three times. To invoke it from an
51199 +   S-Expression, you must quote both the macro name as well as the
51200 +   argument, since in this case the macro name itself is an argument:
51201 +
51202 +  (loop 3 'complain 'hot)
51203 +
51204 +   Now what if you need to send different or variable numbers of arguments
51205 +   to the LOOP macro? The LOOP macro can handle it already, provided you
51206 +   group the arguments into LOOP's third argument (\%3). In Kermit syntax,
51207 +   without grouping:
51208 +
51209 +  loop 3 complain cold and wet
51210 +
51211 +   prints "It's too cold!" three times ("and wet" is lost); but with
51212 +   grouping (either of the following two forms):
51213 +
51214 +  loop 3 complain {cold and wet}
51215 +  loop 3 complain "cold and wet"
51216 +
51217 +   the LOOP macro prints "It's too cold and wet!" three times as desired.
51218 +
51219 +   To do the same thing in an S-Expression, just use the Lisp forms of
51220 +   quoting instead of the Kermit forms; the following two are equivalent:
51221 +
51222 +  (loop 3 'complain (quote (cold and wet)))
51223 +  (loop 3 'complain '(cold and wet))
51224 +
51225 +   Here's a similar example in which we write a macro that shows both the
51226 +   name and the value of one or more other macros, whose names are given
51227 +   as arguments (similar to "show macro"):
51228 +
51229 +  define display {
51230 +      local \%i
51231 +      for \%i 1 \v(argc)-1 1 {
51232 +          echo \&_[\%i] = \m(\&_[\%i])
51233 +      }
51234 +  }
51235 +
51236 +   (Recall that \&_[] is the macro's argument vector array, equivalent to
51237 +   \%1, \%2, ...) The DISPLAY macro can be used in S-Expressions like
51238 +   this:
51239 +
51240 +  (setq a 1 b 2 c 3)
51241 +  (display 'a 'b 'c 'd)
51242 +
51243 +   which prints:
51244 +
51245 +  a = 1
51246 +  b = 2
51247 +  c = 3
51248 +  d =
51249 +
51250 +   The names must be quoted to prevent their evaluation before they are
51251 +   sent to the macro. This ability to pass variables "by name" to macros,
51252 +   rather than by value, lets you write macros that change the values of
51253 +   argument variables. For example, here's a macro that doubles the value
51254 +   of its argument variable:
51255 +
51256 +  define double (++ \%1 \%1)
51257 +
51258 +   which you can call like this:
51259 +
51260 +  (setq a 12)
51261 +  (double 'a)
51262 +
51263 +   In the macro, \%1 is replace by the variable name "a"; "(++ a a)" adds
51264 +   "a" to itself, and sets the value of "a" to the result.
51265 +
51266 +   There are no built-in operators other than QUOTE, ', and STRING for
51267 +   handling strings in S-Expressions, but using just these, plus macros
51268 +   that use Kermit's regular string-handling features, you can easily
51269 +   extend S-Expressions to do string manipulation:
51270 +
51271 +  define len return \flen(\%1)               Returns length of argument string
51272 +  define cap return \fupper(\%1)             Uppercase argument string
51273 +  define rev return \freverse(\%1)           Reverses argument string
51274 +  define sub return \fsubstr(\%1,\%2,\%3)    Returns substring of arg string
51275 +
51276 +  (len '(this is a string))                  Result: 16
51277 +  (rev '(this is a string))                  Result: gnirts a si siht
51278 +  (rev (cap '(this is a string)))            Result: GNIRTS A SI SIHT
51279 +  (sub (rev (cap '(this is a string))) 5 9)  Result: TS A SI S
51280 +
51281 +   You can assign a string to a macro name as follows:
51282 +
51283 +  (setq foo '(this is a string))
51284 +  (setq foo (quote (this is a string)))
51285 +
51286 +   The two are exactly equivalent. In both cases, the macro "foo" has the
51287 +   value:
51288 +
51289 +  '(this is a string)
51290 +
51291 +   so when it is retrieved it can be identified as a string rather than a
51292 +   number or commands to be executed. Thus:
51293 +
51294 +  (setq foo (quote (this is a string)))
51295 +  show macro foo
51296 +  foo = '(this is a string)
51297 +  (foo)
51298 +  this is a string
51299 +
51300 +   Note the different results for "show macro foo" and "(foo)". The former
51301 +   shows the internal definition; the latter evaluates the variable, which
51302 +   removes the quoting. And perhaps more important, note that if the
51303 +   apostrophe and surrounding parentheses were not stored as part of the
51304 +   definition, (foo) would try to execute "this is a string" as a command.
51305 +
51306 +   Given the assignment above, the following work as expected:
51307 +
51308 +  (len foo)                                  Result: 16
51309 +  (rev foo)                                  Result: gnirts a si siht
51310 +  (rev (cap foo))                            Result: GNIRTS A SI SIHT
51311 +  (sub (rev (cap foo)) 5 8)                  Result: TS A SI S
51312 +
51313 +   Note that, unlike built-in S-Expression operators that return numbers
51314 +   or truth values, these operators return strings. If you want to assign
51315 +   their return values to other variables, you can do so:
51316 +
51317 +  (setq bar (rev (cap foo)))                 Result: GNIRTS A SI SIHT
51318 +
51319 +   But now the S-Expression processor doesn't know the value of "bar" is
51320 +   supposed to be a string, rather than a macro to execute. For this you
51321 +   need one final special operator, STRING. The STRING operator takes an
51322 +   S-Expression as an operand, evaluates it, and then returns its value
51323 +   enclosed in '(), so you can use the value as a string is subsequent
51324 +   S-Expressions. Use STRING for referencing macros that return strings:
51325 +
51326 +  (setq bar (string (rev (cap foo))))        Result: '(GNIRTS A SI SIHT)
51327 +
51328 +   STRING is like QUOTE, except that it evaluates its operand before
51329 +   applying the quoting, rather than taking the operand literally.
51330 +
51331 +   To reference backslash variables or functions that return string
51332 +   values, you must use the regular quoting mechanisms:
51333 +
51334 +  (setq time '(\v(time)))
51335 +  (setq date '(\v(date)))
51336 +  assign \%r this is a string
51337 +  (setq s1 '(\%r))
51338 +
51339 +   That's because backslash items are evaluated BEFORE the S-Expression
51340 +   parser ever sees them, and the values of \v(time) and so on are not
51341 +   valid S-Expressions, so STRING won't like them.
51342 +
51343 +   Finally a brief word on the touchy topic of quoting. Suppose you want
51344 +   to include (say) literal parentheses in a string that will later be
51345 +   processed by the S-Expression reader (or \fsplit() or \fword()).
51346 +   Normally, you can't do this because parentheses are meaningful in these
51347 +   contexts. To defeat the normal parsing rules, you can quote the
51348 +   parentheses with backslash. However, due to the many levels of string
51349 +   processing involved, a surprisingly large amount of backslashes might
51350 +   be required, for example:
51351 +
51352 +  (setq s '(a b (c d) \\\\\\\\\\\\\\\\(e f (g h) x\\\\\\\\\\\\\\\\) j k))
51353 +
51354 +   This is nearly impossible to explain(*). Instead, just remember two
51355 +   points:
51356 +
51357 +     * In situations like this, it's better to use DEFINE to create the
51358 +       string, rather than SETQ. The example above requires only double
51359 +       backslashes when DEFINE is used:
51360 +  define s '(a b (c d) \\(e f (g h) x\\) j k)
51361 +
51362 +     * The level of quoting depends on how many levels of evaluation the
51363 +       string must pass through, which is not always obvious. However, the
51364 +       number of backslashes required in any given situation is always a
51365 +       power of 2. So if 1 doesn't work, try 2; if 2 doesn't work, try 4;
51366 +       if 4 doesn't work, try 8, 16, 32, and so on.
51367 +
51368 +   Considerations like this apply in any scripting language (shell, Tcl,
51369 +   Perl, Python, etc). The situation is known as "Quoting Hell".
51370 +
51371 +   (*) If you really want an explanation, here it is:
51372 +
51373 +     * Every SEXP has its backslash items evaluated in a single pass at
51374 +       top level before being passed to the SEXP reader, so \%1,
51375 +       \v(ftime), etc, can be evaluated up front, freeing the SEXP reader
51376 +       of having to know about such things, which in turn makes it much
51377 +       more efficient. Therefore one level of quoting is lost right away,
51378 +       and therefore you must double each backslash that is to be used as
51379 +       a quote.
51380 +     * When the SEXP reader sees '\', it treats it as a quote; discards it
51381 +       and keeps the next character. Thus '\\' becomes '\'. This would be
51382 +       the end of it, except that:
51383 +     * The SEXP reader must call itself recursively on its operands, so we
51384 +       must double any quotes in the operands: 2^2 = 4.
51385 +     * If the result is to be passed as an argument to a macro, the
51386 +       backslashes must again be doubled, because the macro processor
51387 +       evaluates the arguments before sending them to the macro: 2^3 = 8.
51388 +     * If the macro itself is to see the quotes, rather than just the
51389 +       result of the quoting, the quotes must be doubled again: 2^4 = 16.
51390 +
51391 +   Moral: To create string constants in which grouping characters must be
51392 +   quoted, use DEFINE rather than SETQ.
51393 +
51394 +   [ [536]Top ] [ [537]Contents ] [ [538]C-Kermit Home ] [ [539]Kermit
51395 +   Home ]
51396 +
51397 +9.9. Examples
51398 +
51399 +9.9.1. Statistics
51400 +
51401 +   The following program computes statistics -- means, maxima, mimima,
51402 +   variance, standard deviation, and correlation -- from data stored in
51403 +   parallel arrays, \&x[] and \&y[], which can contain any mixture of
51404 +   integer and floating-point numbers: positive, negative, or zero. Array
51405 +   setup and validation are not shown. Except for the traditional FOR loop
51406 +   and printing the results at the end, the entire computation is done
51407 +   with S-Expressions:
51408 +
51409 +; Initialize sums, maxima, minima, and number of elements
51410 +
51411 +  (setq xsum 0 ysum 0 xsum2 0 ysum2 0 xysum 0)
51412 +  (setq xmin (setq xmax \&x[1]) ymin (setq ymax \&y[1]))
51413 +  (setq n \fdim(&x))
51414 +
51415 +; Loop through elements and accumulate sums, maxima, and minima
51416 +
51417 +  for i 1 n 1 {
51418 +      (setq x \&x[i] y \&y[i])                    ; Notational convenience
51419 +      (setq xmax (max xmax x) ymax (max ymax y))  ; X and Y maxima
51420 +      (setq xmin (min xmin x) ymin (min ymin y))  ; X and Y minima
51421 +      (++ xsum x ysum y)                          ; X and Y sums
51422 +      (++ xsum2 (^ x 2) ysum2 (^ y 2))            ; Sum of X and Y squares
51423 +      (++ xysum (* x y))                          ; Sum of XY products
51424 +  }
51425 +
51426 +; Calculate results
51427 +
51428 +  (setq xmean (/ xsum n) ymean (/ ysum n))        ; Mean X and Y
51429 +  (setq xss (- xsum2 (/ (^ xsum 2) n)))           ; Intermediate values
51430 +  (setq yss (- ysum2 (/ (^ ysum 2) n)))
51431 +  (setq xyss (- xysum (/ (* xsum ysum) n)))
51432 +  (setq xvar (/ xss n) yvar (/ yss n))            ; X and Y variance
51433 +  (setq sdx (sqrt xvar) sdy (sqrt yvar))          ; Std deviation in X and Y
51434 +  (setq tmp (* xss yss))
51435 +  (setq cc (if tmp (/ xyss (sqrt tmp)) 1.0))      ; Correlation coefficient
51436 +  show macro xmean ymean xvar yvar sdx sdy cc     ; Print the results
51437 +
51438 +   The final "if tmp" check accounts for the possibility that both arrays
51439 +   contain all 0's. Results can also be printed with "echo CC = \m(cc)",
51440 +   or any other desired way. Interestingly, if we had not needed the sum
51441 +   of the squares and products, we could have obtained the sums, maxima,
51442 +   and minima of the X's and Y's without a loop like this:
51443 +
51444 +  (setq xsum (+ \fjoin(&x)) ysum (+ \fjoin(&y)))
51445 +  (setq xmax (max \fjoin(&x)) ymax (max \fjoin(&y)))
51446 +  (setq xmin (min \fjoin(&x)) ymin (min \fjoin(&y)))
51447 +
51448 +   Any Kermit function that returns numbers or lists of numbers can be
51449 +   included in an S-Expression as an operand.
51450 +
51451 +9.9.2. Practical Fibonacci Series
51452 +
51453 +   The recursive Fibonacci example given previously is simple and elegant,
51454 +   but not very useful since it causes memory occupation to grow each time
51455 +   it calls itself, until eventually both physical memory and disk swap
51456 +   space are filled and the program crashes. Even for small arguments,
51457 +   like 17, execution time can be prohibitive:
51458 +
51459 +  (setq t1 \v(ftime))
51460 +  (setq result (fibonacci 17))
51461 +  (setq t2 (- \v(ftime) t1))
51462 +  echo FIBONACCI(17) = \m(result): TIME = \ffpround(t2,3)
51463 +
51464 +   prints (on a certain rather slow computer):
51465 +
51466 +  FIBONACCI(17) = 1597: TIME = 5.861
51467 +
51468 +   Any recursive function can be recoded iteratively. The result is not as
51469 +   pretty, but execution is far less expensive:
51470 +
51471 +    define FIBITER {
51472 +        (if (== \%3 0) (\%2) (fibiter (+ \%1 \%2) \%1 (- \%3 1)))
51473 +    }
51474 +    define FIBONACCI {
51475 +        (fibiter 1 0 \%1)
51476 +    }
51477 +
51478 +   Here's the result on the same computer for the same argument of 17:
51479 +
51480 +  FIBONACCI(17) = 1597: TIME = 0.015
51481 +
51482 +   (47 times faster.) Execution time increases proportionally to the size
51483 +   of the argument in the iterative case, whereas in the recursive case it
51484 +   goes up geometrically, quickly reaching infinity.
51485 +
51486 +   [ [540]Top ] [ [541]Contents ] [ [542]C-Kermit Home ] [ [543]Kermit
51487 +   Home ]
51488 +
51489 +9.10. Differences from Algebraic Notation
51490 +
51491 +   In C-Kermit:
51492 +
51493 +     * Algebraic notation uses infix operators and normal rules of
51494 +       operator precedence, with parentheses used to force exceptions to
51495 +       the rules; many operations can be included in an expression.
51496 +       S-Expressions use prefix operators with no intrinsic precedence;
51497 +       each operation is enclosed in parentheses, and the arrangement of
51498 +       parentheses determines precedence.
51499 +     * Algebraic infix operators require two operands; S-Expression prefix
51500 +       operators can accept a variable number of operands.
51501 +     * You can use algebraic notation anywhere that C-Kermit accepts a
51502 +       number, e.g. "echo \&a[((1+1)*2-1]", but you can use S-Expressions
51503 +       only as top-level commands. You can, however, use either algebraic
51504 +       or S-Expressions anywhere at all by enclosing them in \fevaluate()
51505 +       or \fsexpression(), respectively.
51506 +     * You can use any mixture of integer and floating-point numbers in
51507 +       S-Expressions, but only integers are permitted in algebraic
51508 +       expressions. Outside of S-Expressions, floating point arithmetic is
51509 +       supported only by \ffp...() function calls.
51510 +     * Operators and operands in S-Expressions must be separated by
51511 +       spaces, e.g. "(+ a b)". Spaces are not required in algebraic
51512 +       expressions: "((a+b)*c)".
51513 +     * When assigning values to backslash variables (such as \%x or
51514 +       \&a[2]) using SETQ or LET, you must double the backslash.
51515 +
51516 +   [ [544]Top ] [ [545]Contents ] [ [546]C-Kermit Home ] [ [547]Kermit
51517 +   Home ]
51518 +
51519 +9.11. Differences from Lisp
51520 +
51521 +     * Kermit has a lot of built-in operators not found in Lisp: ++, ^,
51522 +       etc.
51523 +     * Most dialects of real Lisp do not allow S-Expressions that don't
51524 +       start with an operator, for example:
51525 +  (a)
51526 +
51527 +       This expression can cause an error in Lisp (even if "a" has a
51528 +       value), but is acceptable in Kermit, where it returns the value of
51529 +       the variable "a". Similarly, (1) returns the value "1".
51530 +     * In real Lisp, EVAL requires exactly one operand. In Kermit, it can
51531 +       have 0, 1, 2, or more operands. It returns the value of the last
51532 +       operand evaluated.
51533 +     * Real Lisp SETQ and LET usually require an even number of operands.
51534 +       Kermit allows an odd number, in which case the last (or only)
51535 +       variable is undefined (i.e. deleted, destroyed).
51536 +     * Kermit does not support ratios such as "7/8". Some Lisp dialects
51537 +       accept ratios as numbers, and generate ratios when told to divide
51538 +       two integers whose quotient is not a whole number; e.g. in Common
51539 +       Lisp:
51540 +  [13] USER(37): (/ (+ 1 2 3 4) 3)
51541 +  10/3
51542 +  [13] USER(38):
51543 +
51544 +     * The result of (/ 10 3) is 3.333.... Some Lisp dialects truncate the
51545 +       result to 3 since both operands are integers, some don't; some give
51546 +       the result as a ratio. C-Kermit always gives a floating point
51547 +       result when there is a fractional part. If you want an integer
51548 +       result, you can use TRUNCATE, FLOOR, or CEILING, e.g. (truncate (/
51549 +       10 3)).
51550 +     * There is currently no "bignum" support. Large numbers can be used
51551 +       and large results generated, but (as noted in [548]Section 9.2)
51552 +       they are accurate only to the precision of the underlying machine.
51553 +       \v(math_precision) gives the machine precision as a number of
51554 +       decimal digits, e.g. 16.
51555 +     * Scientific notation for floating-point numbers is not supported. If
51556 +       the magnitude of a number is greater than the precision of the
51557 +       underlying hardware, the less-significant digits are shown but
51558 +       their values are meaningless. If it the number is too small to be
51559 +       represented internally, it is shown as "0.0".
51560 +     * Many Lisp features are omitted: List processing (CAR, CDR, etc),
51561 +       DEFUN, Lisp-specific control structures, and so on.
51562 +
51563 +   [ [549]Top ] [ [550]Contents ] [ [551]C-Kermit Home ] [ [552]Kermit
51564 +   Home ]
51565 +
51566 +10. FILE TRANSFER
51567 +
51568 +   New commands and switches:
51569 +
51570 +   SET TRANSFER REPORT { OFF, ON }
51571 +          Enables or disables the (new) one-line message printed by Kermit
51572 +          after a remote-mode file transfer to indicate the source and
51573 +          destination file, complete with path, to let you know where the
51574 +          file went.
51575 +
51576 +   SEND /TYPE:{TEXT,BINARY}
51577 +          Sends only files of the given type (see [553]Section 4).
51578 +
51579 +   SEND /NOFOLLOWLINKS:
51580 +          (UNIX only) Skip over symbolic links rather than following them
51581 +          (default). This applies to wildcard and/or recursive SENDs; if a
51582 +          single filename is given, and it happens to be a symbolic link,
51583 +          the file it points to is sent.
51584 +
51585 +   SEND /FOLLOWLINKS:
51586 +          (UNIX only) Follow (resolve) symbolic links. Watch out for
51587 +          circular links, endless loops, etc.
51588 +
51589 +   SET SEND I-PACKETS { OFF, ON }
51590 +          When sending commands to a Kermit server, this tells whether
51591 +          command packets should be preceded by an I (information) packet,
51592 +          which is used to synchronize parameters prior to executing the
51593 +          command. Normally ON. The only reason to set this OFF is for
51594 +          communicating with buggy Kermit servers that misbehave when an I
51595 +          packet is sent to them. There is also a SET RECEIVE I-PACKETS
51596 +          command, but presently it has no effect.
51597 +
51598 +   SET TRANSFER MESSAGE [ text ]
51599 +          Sets an initial message to be shown in the Last Message field of
51600 +          the fullscreen file-transfer display.
51601 +
51602 +   SET TRANSFER TRANSLATION { ON, OFF }
51603 +          Inhibits or re-enables text-file transfer character-set
51604 +          translation globally.
51605 +
51606 +   { SEND, MSEND, GET, RECEIVE } /TRANSPARENT
51607 +          Inhibits character-set translation for this transfer only.
51608 +
51609 +   { GET, RECEIVE } /PIPES:{ON,OFF}
51610 +          Overrides global TRANSFER PIPES setting for this transfer only;
51611 +          ON allows incoming files with names like "!tar xf -" to be
51612 +          opened as pipelines rather than regular files.
51613 +
51614 +   The following new "hot keys" are available when Kermit's file-transfer
51615 +   display is visible:
51616 +
51617 +     D: Turn on debugging, open "debug.log" if not already open.
51618 +     d: Turn off debugging but leave log open (if it was open).
51619 +     T: Turn on debug-log timestamps.
51620 +     t: Turn off debug-log timestamps.
51621 +
51622 +   Other improvements:
51623 +     * SET FILE DOWNLOAD-DIRECTORY now works for external protocols (e.g.
51624 +       sz/rz) too.
51625 +     * Improved automatic per-file text/binary switching, described in
51626 +       [554]Section 4.
51627 +     * When sending a file group (e.g. "send *.*"), failure to open a file
51628 +       is no longer fatal; now C-Kermit simply goes ahead to the next
51629 +       file.
51630 +     * Transaction log entries are now made for external protocols too.
51631 +
51632 +   [ [555]Top ] [ [556]Contents ] [ [557]C-Kermit Home ] [ [558]Kermit
51633 +   Home ]
51634 +
51635 +11. MODEMS AND DIALING
51636 +
51637 +   In C-Kermit 8.0, the default modem type for dialing has changed from
51638 +   NONE (= DIRECT, meaning no modem) to GENERIC. This change should have
51639 +   no impact on direct connections. For dialing, it means that, unless you
51640 +   SET MODEM TYPE to a specific type, such as USROBOTICS or CONEXANT,
51641 +   Kermit assumes:
51642 +
51643 +    1. The modem uses the Hayes AT command set.
51644 +    2. The modem supports error correction, data compression, and hardware
51645 +       flow control and is already configured to use them.
51646 +
51647 +   In fact, Kermit assumes the modem is completely configured, and
51648 +   therefore does not send it an initialization string or any
51649 +   configuration commands. Instead, it sends only the simplest and most
51650 +   portable commands:
51651 +
51652 +     ATQ0V1          Give dial result codes.
51653 +     ATDTnumber      Dial the number.
51654 +
51655 +   (or ATD or ATDP, as appropriate).
51656 +
51657 +   The new defaults work for direct connections and for most modern modems
51658 +   on most platforms, and they work much faster than "full-treatment"
51659 +   dialing. If the new defaults don't work for you, or if you need to
51660 +   perform explicit modem configuations or interactions, then set a
51661 +   specific modem type and use the SET MODEM and SET DIAL commands as
51662 +   documented in Using C-Kermit.
51663 +
51664 +     WARNING: Don't use the generic modem on hosts that do not support
51665 +     RTS/CTS flow control. If Xon/Xoff is in use on the serial port,
51666 +     you'll need to select a particular modem type so Kermit knows what
51667 +     command to give it to enable Xon/Xoff flow control between itself
51668 +     and your serial port.
51669 +
51670 +   The following new modem types were added in C-Kermit 8.0:
51671 +
51672 +     lucent:          Lucent Venus chipset
51673 +     pctel:           PCTel V.90 chipset
51674 +     conexant:        Conexant (ex-Rockwell) modem family
51675 +     zoom-v32bis:     New name for "Zoom"
51676 +     zoom-v34         Zoom V.34
51677 +     zoom-v90         Zoom V.90 56K
51678 +     zoom-v92:        Zoom V.92 with V.44 data compression
51679 +     zoltrix-v34:     New name for "zoltrix"
51680 +     zoltrix-hsp-v90: Synonym for PCTel
51681 +     zoltrix-hcf-v90: Synonym for ITU-T-V250
51682 +     smartlink-v90:   Synonym for usrobotics (same chipset)
51683 +     acer-v90:        Synonym for Rockwell-v90
51684 +
51685 +   New DIAL-related variables:
51686 +
51687 +     \v(dm_hf):  Dial modifier: Wait for Hook-Flash.
51688 +     \v(dm_wb):  Dial modifier: Wait for Bong.
51689 +
51690 +   Finally, if dialing fails, Kermit now prints a context-sensitive hint
51691 +   suggesting possible reasons and remedies.
51692 +
51693 +   Added in C-Kermit 8.0.201:   Rudimentary support for Caller ID, for use
51694 +   with the ANSWER command. If the modem reports Caller ID information,
51695 +   Kermit stores it in variables that you can access after the call is
51696 +   answered:
51697 +
51698 +  \v(callid_date)   The date of the call
51699 +  \v(callid_time)   The time of the call
51700 +  \v(callid_name)   The name of the caller
51701 +  \v(callid_nmbr)   The telephone number of the caller
51702 +  \v(callid_mesg)   A message
51703 +
51704 +   The format of these items depends on the originating and answering
51705 +   phone companies and the modems and their configuration.
51706 +
51707 +   Not very many modems support Caller ID, and those that do (a) tend to
51708 +   have it disabled by default, and (b) use different commands to enable
51709 +   it. A quick survey shows of some current models shows:
51710 +
51711 +   - USR V.90:      No
51712 +   - ITU-T V.250:   No
51713 +   - Lucent Venus:  No
51714 +   - Diamond Supra: #CID=1
51715 +   - Rockwell 56K:  #CID=1
51716 +   - PCTEL:         #CID=1
51717 +   - Zoltrix:       +VCID=1
51718 +   - Conexant:      +VCID=1
51719 +
51720 +   To use Kermit's Caller ID feature, you have to set the modem to wait
51721 +   for at least two rings before answering, and you have to give the
51722 +   command to enable Caller ID; for example (after choosing a modem with
51723 +   SET MODEM TYPE):
51724 +
51725 +  set modem command autoanswer on ATS0=2#CID=1\{13}
51726 +  set modem command autoanswer on ATS0=2+VCID=1\{13}
51727 +
51728 +   These commands can be undone with:
51729 +
51730 +  set modem command autoanswer on ATS0=1#CID=0\{13}
51731 +  set modem command autoanswer on ATS0=1+VCID=0\{13}
51732 +
51733 +   Kermit presently has no built-in knowledge of the Caller ID
51734 +   capabilities or commands of the modems in its database.
51735 +
51736 +   Since the variables can be accessed only after the call is answered,
51737 +   the only way to refuse a call is to answer it, inspect the variables,
51738 +   and then hang it up if desired.
51739 +
51740 +   [ [559]Top ] [ [560]Contents ] [ [561]C-Kermit Home ] [ [562]Kermit
51741 +   Home ]
51742 +
51743 +12. TERMINAL CONNECTION
51744 +
51745 +   Now that 7-bit connections are no longer the norm, the default terminal
51746 +   bytesize (also called "data size" or "word size") in C-Kermit 8.0 is 8
51747 +   bits, rather than 7 bits as it was in C-Kermit 7.0 and earlier:
51748 +
51749 +   SET ESCAPE character
51750 +          This command, which specifies your CONNECT-mode escape
51751 +          character, allows you to specify any ASCII control character in
51752 +          a variety of formats. C-Kermit 8.0.201 now also lets you specify
51753 +          any 8-bit value, 128-255, as the escape character. In the SET
51754 +          ESCAPE command, you can type the 8-bit character literally or
51755 +          you can enter its numeric code. Here are examples that you can
51756 +          enter from a terminal or console that uses the ISO Latin-1
51757 +          character set:
51758 +
51759 +  C-Kermit> set escape Ãƒ
51760 +  C-Kermit> set escape 195
51761 +  C-Kermit> show escape
51762 +   Escape character: Code 195 (Ã): enabled
51763 +  C-Kermit>
51764 +
51765 +          Both of these commands set the escape character value to 195
51766 +          (decimal), which happens to be uppercase letter A with Tilde in
51767 +          Latin-1. SHOW ESCAPE and SHOW TERMINAL show the value, as does
51768 +          the CONNECT message.
51769 +
51770 +   SET TERMINAL AUTODOWNLOAD ERROR { STOP, CONTINUE }
51771 +          When Kermit has a terminal connection to another computer, and a
51772 +          file transfer is initiated automatically because a Kermit packet
51773 +          was received in CONNECT mode (i.e. in the terminal screen), this
51774 +          command tells what Kermit should do if the transfer fails. The
51775 +          default is to STOP, which leaves Kermit in command mode with its
51776 +          file-transfer display showing, so you can see that the transfer
51777 +          failed and why. If you SET TERMINAL AUTODOWNLOAD ERROR CONTINUE,
51778 +          this causes Kermit to return automatically to its terminal
51779 +          screen (i.e. resume its CONNECT session) as if the transfer had
51780 +          succeeded; this can be desirable if the entire session is under
51781 +          control of a host-based script.
51782 +
51783 +   SET TERMINAL BYTESIZE { 7, 8 }
51784 +          The byte size to use during CONNECT and INPUT command execution,
51785 +          which can be more restrictive than the bytesize implied by the
51786 +          current PARITY setting, but not less restrictive. In C-Kermit
51787 +          7.0 and earlier, the terminal bytesize was 7 by default to
51788 +          protect against the likelihood that parity was in use on the
51789 +          connection without the user's knowledge. When the terminal
51790 +          bytesize is 8 (as it is in C-Kermit 8.0 and later), the user
51791 +          will see garbage in this (increasingly unlikely) situation. Note
51792 +          that 8 data bits are required for most character sets other than
51793 +          ASCII: Latin-1, UTF-8, and so on.
51794 +
51795 +   A new command has been added to produce timestamped session logs:
51796 +
51797 +   SET TERMINAL SESSION-LOG TIMESTAMPED-TEXT
51798 +          Records the terminal session in text mode (like SET TERMINAL
51799 +          SESSION-LOG TEXT) but adds a timestamp at the beginning of each
51800 +          line. The timestamp format is hh:mm:ss.nnn, and indicates the
51801 +          time at which the first character of the line appeared.
51802 +
51803 +   In most UNIX versions (those built with the select()-capable CONNECT
51804 +   module -- pretty much all the ones that have or could have TELNET
51805 +   included), an idle timeout feature has been added:
51806 +
51807 +   SET TERMINAL IDLE-TIMEOUT number
51808 +          If the number is not 0, then Kermit is to take an action when
51809 +          the given amount of time passes with no activity during CONNECT
51810 +          mode. If the number is positive it is the maximum number of idle
51811 +          seconds; if number is negative it represents milliseconds
51812 +          (thousandths of seconds). If 0 is given as the number, there are
51813 +          no idle timeouts. Synonym: SET TERMINAL IDLE-LIMIT.
51814 +
51815 +   SET TERMINAL IDLE-ACTION { RETURN, HANGUP, EXIT, OUTPUT [ string ] }
51816 +          The action to be taken upon an idle timeout in CONNECT mode.
51817 +          RETURN to the prompt, HANGUP the connection, EXIT from Kermit,
51818 +          or OUTPUT the given string (if no string is given, a NUL (ASCII
51819 +          0) character is sent).
51820 +
51821 +   SET TERMINAL IDLE-ACTION { TELNET-NOP, TELNET-AYT }
51822 +          Actions that can be selected on Telnet connections only, that
51823 +          might be useful if idle limits are enforced by the Telnet server
51824 +          or in the TCP/IP protocol: TELNET-NOP sends a "NO Operation"
51825 +          (do-nothing) command, which causes no response from the server;
51826 +          TELNET-AYT sends an "Are You There" message to the server, which
51827 +          should make the server send back a message. Neither of these
51828 +          actions interferes with your remote session.
51829 +
51830 +   SET TERMINAL IDLE-ACTION is useful for connections to hosts or services
51831 +   that automatically log you out after a certain amount of idle time,
51832 +   e.g.:
51833 +
51834 +  set term idle-timeout 300
51835 +  set term idle-action output \32
51836 +
51837 +   sends a space (as if you had pressed the space bar) every 300 seconds
51838 +   (five minutes) while there is no activity (32 is the ASCII code for
51839 +   space).
51840 +
51841 +   When C-Kermit returns from CONNECT to command mode, the reason for the
51842 +   transition is given in a new variable, \v(cx_status):
51843 +
51844 +      0  No CONNECT command given yet.
51845 +      1  User escaped back manually.
51846 +      2  A trigger string was encountered.
51847 +      3  IKSD entered server mode.
51848 +      4  Application Program Command received from host.
51849 +      5  Idle timeout.
51850 +      6  Telnet protocol error.
51851 +      7  Keystroke macro.
51852 +      8  Time limit exceeded.
51853 +    100  Internal error.
51854 +    101  Carrier required by not detected.
51855 +    102  I/O error on connection.
51856 +    103  Disconnected by host.
51857 +    104  Disconnected by user.
51858 +    105  Session limit exceeded.
51859 +    106  Rejected due to Telnet policy.
51860 +    107  Received kill signal.
51861 +
51862 +   Values 100 and above indicate there is no connection.
51863 +
51864 +   [ [563]Top ] [ [564]Contents ] [ [565]C-Kermit Home ] [ [566]Kermit
51865 +   Home ]
51866 +
51867 +13. CHARACTER SETS
51868 +
51869 +   See the section on [567]file scanning above, and the section on
51870 +   character-set conversion in [568]FTP. Also:
51871 +
51872 +     * True support for CP1252 (rather than treating it as Latin-1).
51873 +     * Proper handling of C1 values when converting ISO 8-bit text to
51874 +       UTF-8.
51875 +     * TYPE /CHARACTER-SET: /TRANSLATE-TO: allows specific translations.
51876 +     * The TRANSLATE command now works on multiple files.
51877 +     * K_CHARSET environment variable to set the file character-set.
51878 +     * SET TRANSFER TRANSLATION OFF.
51879 +     * FTP client character-set translation ([569]Section 3.7).
51880 +
51881 +   [ [570]Top ] [ [571]Contents ] [ [572]C-Kermit Home ] [ [573]Kermit
51882 +   Home ]
51883 +
51884 +14. DIALOUT FROM TELNET TERMINAL SERVERS
51885 +
51886 +   For years, C-Kermit has supported dialing out from Telnet modem servers
51887 +   (also called reverse terminal servers or access servers), but until now
51888 +   there was no way for Kermit to control the communication parameters
51889 +   (speed, parity, etc) on the serial port of the terminal server; it had
51890 +   to use whatever was there.
51891 +
51892 +   But now, if you make a connection to a server that supports the Telnet
51893 +   Com Port Control Option, [574]RFC 2217, you have the same degree of
51894 +   control as you would have over a serial port on the computer where
51895 +   Kermit is running: SET SPEED, SET FLOW, SET PARITY, SET STOP-BITS, SHOW
51896 +   COMM, WAIT, SET CARRIER-WATCH, the modem-signal variables, sending
51897 +   Break, and so on, apply to the connection between the terminal server
51898 +   and the modem.
51899 +
51900 +   For example, using a Cisco Access Server 2509, where specifying a TCP
51901 +   port in the 6000's selects a serial port that can be used for dialing
51902 +   out:
51903 +
51904 +  set host xxx 6001      ; xxx is the IP hostname or address of the server
51905 +  (log in if necessary)  ; With a script or by hand
51906 +  set modem type usr     ; Tell Kermit what kind of modem it has
51907 +  set speed 57600        ; This affects the server's port
51908 +  set flow rts/cts       ; Ditto
51909 +  dial 7654321
51910 +
51911 +   The modem server might or might not require a login sequence. It might
51912 +   also allow for automatic authentication, e.g. via Kerberos tickets.
51913 +   NOTE: If the modem server requires a login sequence, then REDIAL might
51914 +   not work as expected.
51915 +
51916 +   When you have a Telnet Com Port connection, your SET SPEED and SET FLOW
51917 +   options change automatically to reflect the capabilities of the server,
51918 +   rather than those of your local computer.
51919 +
51920 +   See the configuration manual for your server for additional
51921 +   information. For example, how to set up the server to drop the Telnet
51922 +   connection automatically when the telephone call is hung up (e.g.
51923 +   "autohangup" on Cisco models).
51924 +
51925 +   For a Linux-based Telnet Com-Port server, click the Srdird link:
51926 +
51927 +   [ [575]Top ] [ [576]Contents ] [ [577]Sredird ] [ [578]C-Kermit Home ]
51928 +   [ [579]Kermit Home ]
51929 +
51930 +15. COPING WITH BROKEN KERMIT PARTNERS
51931 +
51932 +   There are lots of faulty Kermit protocol implementations out there,
51933 +   found mainly in 3rd-party products ranging from communications software
51934 +   packages to file-transfer functions imbedded within devices. This topic
51935 +   is covered [580]HERE for C-Kermit 7.0, but C-Kermit 8.0 adds some
51936 +   additional tricks.
51937 +
51938 +   SET ATTRIBUTE RECORD-FORMAT { ON, OFF }
51939 +          Allows control of the Kermit's Record-Format attribute. Set this
51940 +          to OFF in case incoming file are refused due to unknown or
51941 +          invalid record formats if you want to accept the file anyway.
51942 +
51943 +   SET ATTRIBUTES OFF
51944 +          This is not a new trick, but it was recently discovered that the
51945 +          Kermit implementation embedded within a certain kind of
51946 +          punching/bending machine (Salvagnini if you must know) hangs
51947 +          upon reception of standard format Kermit attributes when
51948 +          receiving files. When sending files, it sends attributes of its
51949 +          own, one per A-packet, which is slightly unusual but legal. When
51950 +          receiving files from C-Kermit, K95, MS-DOS Kermit, Kermit-370,
51951 +          etc, it simply exits upon reception of the first A-packet;
51952 +          apparently it was not coded according to the protocol
51953 +          specification, which allows multiple attributes per A-packet.
51954 +          Solution: tell the file sender to SET ATTRIBUTES OFF.
51955 +
51956 +   SET SEND I-PACKETS { ON, OFF }
51957 +          A Kermit server is supposed to accept I-packets; this is how the
51958 +          client lets the server know its capabilities and preferences
51959 +          before sending a command. Apparently there is at least one
51960 +          Kermit server implementation that does not accept I-packets, and
51961 +          does not properly respond with an Error packet if it gets one.
51962 +          To get around such situations in C-Kermit 8.0, you can use SET
51963 +          SEND I-PACKETS OFF to inhibit the sending of I packets. In this
51964 +          case, the client must be able to adjust to the server's
51965 +          configuration, rather than the other way around as we are used
51966 +          to.
51967 +
51968 +   SET PROTOCOL KERMIT {} {} {}
51969 +          C-Kermit 6.0 and later automatically send "autoupload" and
51970 +          "autodownload" commands when in local mode and you give a file
51971 +          transfer command. For example, if you tell kermit to "send
51972 +          oofa.txt", Kermit sends "kermit -r" and a carriage return, in
51973 +          case you had forgotten to start Kermit on the far end and told
51974 +          it to receive a file. If a Kermit program had already been
51975 +          started on the far end, it should harmlessly absorb this string.
51976 +          However, some Kermit programs violate the Kermit protocol
51977 +          definition and treat such strings as Kermit packets even though
51978 +          they are not. In such cases, give this command to set the Kermit
51979 +          protocol autoupload and download strings to nothing, which tells
51980 +          Kermit not to send them. (This is not a new feature, but it was
51981 +          not previously included in the "Coping" section of the
51982 +          documentation.)
51983 +
51984 +   [ [581]Top ] [ [582]Contents ] [ [583]C-Kermit Home ] [ [584]Kermit
51985 +   Home ]
51986 +
51987 +16. NEW COMMAND-LINE OPTIONS
51988 +
51989 +   kermit -h Now prints a complete listing of its command-line options,
51990 +   rather than an abbreviated list squeezed into a 24x80 space.
51991 +
51992 +   -dd              Debug, like -d but adds timestamps
51993 +   --version  Shows C-Kermit version number.
51994 +   --noperms  Equivalent to SET ATTRIBUTE PROTECTION OFF.
51995 +
51996 +   Kermit now accepts a selection of URLs (Universal Resource Locators) as
51997 +   its first command-line argument. These are:
51998 +
51999 +   telnet:hostname
52000 +          Makes a Telnet connection to the given host (IP hostname or
52001 +          address).
52002 +
52003 +   ftp://[user[:password]@]hostname[/path...]
52004 +          Makes an FTP connection to the given host (IP hostname or
52005 +          address). If a username is given, Kermit tries to log you in; if
52006 +          a password is given, it is used; if not, you are prompted for
52007 +          one. If no username is given, an anonymous login is performed.
52008 +          If a pathname is included, Kermit tries to GET the given file.
52009 +          See [585]Section 3.1.3 for details.
52010 +
52011 +   ftps://[user[:password]@]hostname[/path...]
52012 +          Makes a secure FTP connection over SSL.
52013 +
52014 +   telnets://[user[:password]@]hostname
52015 +          Makes a secure Telnet connection over SSL.
52016 +
52017 +   kermit://[user[:password]@]hostname[/path...]
52018 +          Makes a connection to an [586]Internet Kermit Server.
52019 +
52020 +   http://[user[:password]@]hostname[/path...]
52021 +          Makes a connection to Web server.
52022 +
52023 +   https://[user[:password]@]hostname[/path...]
52024 +          Makes a connection to secure Web server.
52025 +
52026 +   [ [587]Top ] [ [588]Contents ] [ [589]C-Kermit Home ] [ [590]Kermit
52027 +   Home ]
52028 +
52029 +17. LOGS
52030 +
52031 +   In C-Kermit 8.0, we make an effort to keep passwords out of the debug
52032 +   log. This can never be 100% effective, but it's better than before,
52033 +   when there were no precautions at all. Whenever Kermit knows it's
52034 +   prompting for, parsing, or transmitting a password, it temporarily
52035 +   turns off logging and then turns it back on afterwards. This keeps the
52036 +   debug log password-free in most common cases, but there can be no
52037 +   guarantees.
52038 +
52039 +   As noted elsewhere, the new "-dd" command-line option selects a
52040 +   timestamped debug log (equivalent to "set debug timestamps on", "log
52041 +   debug debug.log").
52042 +
52043 +   C-Kermit 8.0 also supports a new timestamped session log via "set
52044 +   session-log timestamped-text", "log session".
52045 +
52046 +   There have been requests for other kinds of logs, for example a command
52047 +   log. These might be added at some point. One person wanted to be able
52048 +   to log commands with timestamps, but only commands issued at the
52049 +   prompt, not commands from files or macros, and also wanted a header
52050 +   line at the beginning showing the date, user, and host. This can be
52051 +   done as follows:
52052 +
52053 +  .filename := \v(home)commands.log  ; (for example)
52054 +  fopen /write \%c \m(filename)
52055 +  if success {
52056 +      fwrite /line \%c \v(date): User=\v(user) Host=\v(host)
52057 +      fclose \%c
52058 +      set debug timestamps on
52059 +      log debug {| grep "CMD(P)" >> \m(filename)} append
52060 +  }
52061 +
52062 +   [ [591]Top ] [ [592]Contents ] [ [593]C-Kermit Home ] [ [594]Kermit
52063 +   Home ]
52064 +     __________________________________________________________________
52065 +
52066 +
52067 +    C-Kermit 8.0 Update Notes / [595]The Kermit Project / Columbia
52068 +    University / 15 Dec 2003 - 13 Sep 2010
52069 +
52070 +References
52071 +
52072 +   1. http://www.columbia.edu/
52073 +   2. mailto:kermit@columbia.edu
52074 +   3. http://www.columbia.edu/kermit/index.html
52075 +   4. http://www.columbia.edu/kermit/k95.html
52076 +   5. http://www.columbia.edu/kermit/ckermit.html
52077 +   6. http://www.columbia.edu/kermit/ckscripts.html
52078 +   7. http://www.columbia.edu/kermit/current.html
52079 +   8. http://www.columbia.edu/kermit/whatsnew.html
52080 +   9. http://www.columbia.edu/kermit/faq.html
52081 +  10. http://www.columbia.edu/kermit/support.html
52082 +  11. http://www.columbia.edu/kermit/ckermit80.html#contents
52083 +  12. http://www.columbia.edu/kermit/ckermit.html
52084 +  13. http://www.columbia.edu/kermit/index.html
52085 +  14. http://www.amazon.com/gp/product/1555581641?ie=UTF8&tag=aleidmoreldom-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=1555581641
52086 +  15. http://www.columbia.edu/kermit/ckermit80.html
52087 +  16. mailto:kermit-support@columbia.edu
52088 +  17. http://www.columbia.edu/kermit/
52089 +  18. http://www.kermit-project.org/
52090 +  19. http://www.columbia.nyc.ny.us/kermit/
52091 +  20. ftp://kermit.columbia.edu/kermit/f/COPYING.TXT
52092 +  21. ftp://kermit.columbia.edu/kermit/f/ckcmai.c
52093 +  22. http://www.columbia.edu/kermit/ckermit80.html#xv
52094 +  23. http://www.columbia.edu/kermit/ck60manual.html
52095 +  24. http://www.columbia.edu/kermit/ckermi70.html
52096 +  25. ftp://kermit.columbia.edu/kermit/f/ckermit70.txt
52097 +  26. http://www.columbia.edu/kermit/ckututor.html
52098 +  27. ftp://kermit.columbia.edu/kermit/f/ckuker.nr
52099 +  28. http://www.columbia.edu/kermit/security.htm
52100 +  29. http://www.columbia.edu/kermit/telnet.htm
52101 +  30. http://www.columbia.edu/kermit/ftpscripts.html
52102 +  31. http://www.columbia.edu/kermit/ckcbwr.html
52103 +  32. ftp://kermit.columbia.edu/kermit/f/ckcbwr.txt
52104 +  33. http://www.columbia.edu/kermit/ckubwr.html
52105 +  34. ftp://kermit.columbia.edu/kermit/f/ckubwr.txt
52106 +  35. http://www.columbia.edu/kermit/ckvbwr.html
52107 +  36. ftp://kermit.columbia.edu/kermit/f/ckvbwr.txt
52108 +  37. http://www.columbia.edu/kermit/ckuins.html
52109 +  38. ftp://kermit.columbia.edu/kermit/f/ckuins.txt
52110 +  39. http://www.columbia.edu/kermit/ckvins.html
52111 +  40. ftp://kermit.columbia.edu/kermit/f/ckvins.txt
52112 +  41. http://www.columbia.edu/kermit/ckccfg.html
52113 +  42. ftp://kermit.columbia.edu/kermit/f/ckccfg.txt
52114 +  43. http://www.columbia.edu/kermit/ckcplm.html
52115 +  44. ftp://kermit.columbia.edu/kermit/f/ckcplm.txt
52116 +  45. http://www.columbia.edu/kermit/iksd.html
52117 +  46. http://www.columbia.edu/kermit/skermit.html
52118 +  47. http://www.columbia.edu/kermit/ckermit80.html#top
52119 +  48. http://www.columbia.edu/kermit/ckermit.html
52120 +  49. http://www.columbia.edu/kermit/index.html
52121 +  50. http://www.columbia.edu/kermit/ckermit80.html#x0
52122 +  51. http://www.columbia.edu/kermit/ckermit80.html#x1
52123 +  52. http://www.columbia.edu/kermit/ckermit80.html#x2
52124 +  53. http://www.columbia.edu/kermit/ckermit80.html#x2.1
52125 +  54. http://www.columbia.edu/kermit/ckermit80.html#x2.2
52126 +  55. http://www.columbia.edu/kermit/ckermit80.html#x2.2.1
52127 +  56. http://www.columbia.edu/kermit/ckermit80.html#x2.2.2
52128 +  57. http://www.columbia.edu/kermit/ckermit80.html#x2.2.3
52129 +  58. http://www.columbia.edu/kermit/ckermit80.html#x2.2.4
52130 +  59. http://www.columbia.edu/kermit/ckermit80.html#x2.2.5
52131 +  60. http://www.columbia.edu/kermit/ckermit80.html#x2.2.6
52132 +  61. http://www.columbia.edu/kermit/ckermit80.html#x3
52133 +  62. http://www.columbia.edu/kermit/ckermit80.html#x3.1
52134 +  63. http://www.columbia.edu/kermit/ckermit80.html#x3.1.1
52135 +  64. http://www.columbia.edu/kermit/ckermit80.html#x3.1.2
52136 +  65. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
52137 +  66. http://www.columbia.edu/kermit/ckermit80.html#x3.1.4
52138 +  67. http://www.columbia.edu/kermit/ckermit80.html#x3.2
52139 +  68. http://www.columbia.edu/kermit/ckermit80.html#x3.3
52140 +  69. http://www.columbia.edu/kermit/ckermit80.html#x3.4
52141 +  70. http://www.columbia.edu/kermit/ckermit80.html#x3.5
52142 +  71. http://www.columbia.edu/kermit/ckermit80.html#x3.5.1
52143 +  72. http://www.columbia.edu/kermit/ckermit80.html#x3.5.2
52144 +  73. http://www.columbia.edu/kermit/ckermit80.html#x3.5.3
52145 +  74. http://www.columbia.edu/kermit/ckermit80.html#x3.6
52146 +  75. http://www.columbia.edu/kermit/ckermit80.html#x3.6.1
52147 +  76. http://www.columbia.edu/kermit/ckermit80.html#x3.6.2
52148 +  77. http://www.columbia.edu/kermit/ckermit80.html#x3.6.3
52149 +  78. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52150 +  79. http://www.columbia.edu/kermit/ckermit80.html#x3.7.1
52151 +  80. http://www.columbia.edu/kermit/ckermit80.html#x3.7.2
52152 +  81. http://www.columbia.edu/kermit/ckermit80.html#x3.8
52153 +  82. http://www.columbia.edu/kermit/ckermit80.html#x3.9
52154 +  83. http://www.columbia.edu/kermit/ckermit80.html#x3.10
52155 +  84. http://www.columbia.edu/kermit/ckermit80.html#x3.10.1
52156 +  85. http://www.columbia.edu/kermit/ckermit80.html#x3.10.2
52157 +  86. http://www.columbia.edu/kermit/ckermit80.html#x3.10.3
52158 +  87. http://www.columbia.edu/kermit/ckermit80.html#x3.11
52159 +  88. http://www.columbia.edu/kermit/ckermit80.html#x4
52160 +  89. http://www.columbia.edu/kermit/ckermit80.html#x5
52161 +  90. http://www.columbia.edu/kermit/ckermit80.html#x6
52162 +  91. http://www.columbia.edu/kermit/ckermit80.html#x6.1
52163 +  92. http://www.columbia.edu/kermit/ckermit80.html#x6.2
52164 +  93. http://www.columbia.edu/kermit/ckermit80.html#x6.3
52165 +  94. http://www.columbia.edu/kermit/ckermit80.html#x6.4
52166 +  95. http://www.columbia.edu/kermit/ckermit80.html#x6.5
52167 +  96. http://www.columbia.edu/kermit/ckermit80.html#x6.6
52168 +  97. http://www.columbia.edu/kermit/ckermit80.html#x7
52169 +  98. http://www.columbia.edu/kermit/ckermit80.html#x8
52170 +  99. http://www.columbia.edu/kermit/ckermit80.html#x8.1
52171 + 100. http://www.columbia.edu/kermit/ckermit80.html#x8.2
52172 + 101. http://www.columbia.edu/kermit/ckermit80.html#x8.3
52173 + 102. http://www.columbia.edu/kermit/ckermit80.html#x8.4
52174 + 103. http://www.columbia.edu/kermit/ckermit80.html#x8.5
52175 + 104. http://www.columbia.edu/kermit/ckermit80.html#x8.6
52176 + 105. http://www.columbia.edu/kermit/ckermit80.html#x8.7
52177 + 106. http://www.columbia.edu/kermit/ckermit80.html#x8.8
52178 + 107. http://www.columbia.edu/kermit/ckermit80.html#x8.9
52179 + 108. http://www.columbia.edu/kermit/ckermit80.html#x8.10
52180 + 109. http://www.columbia.edu/kermit/ckermit80.html#x8.11
52181 + 110. http://www.columbia.edu/kermit/ckermit80.html#x8.12
52182 + 111. http://www.columbia.edu/kermit/ckermit80.html#x8.13
52183 + 112. http://www.columbia.edu/kermit/ckermit80.html#x8.14
52184 + 113. http://www.columbia.edu/kermit/ckermit80.html#x9
52185 + 114. http://www.columbia.edu/kermit/ckermit80.html#x9.1
52186 + 115. http://www.columbia.edu/kermit/ckermit80.html#x9.2
52187 + 116. http://www.columbia.edu/kermit/ckermit80.html#x9.3
52188 + 117. http://www.columbia.edu/kermit/ckermit80.html#x9.4
52189 + 118. http://www.columbia.edu/kermit/ckermit80.html#x9.5
52190 + 119. http://www.columbia.edu/kermit/ckermit80.html#x9.6
52191 + 120. http://www.columbia.edu/kermit/ckermit80.html#x9.7
52192 + 121. http://www.columbia.edu/kermit/ckermit80.html#x9.8
52193 + 122. http://www.columbia.edu/kermit/ckermit80.html#x9.9
52194 + 123. http://www.columbia.edu/kermit/ckermit80.html#x9.10
52195 + 124. http://www.columbia.edu/kermit/ckermit80.html#x9.11
52196 + 125. http://www.columbia.edu/kermit/ckermit80.html#x10
52197 + 126. http://www.columbia.edu/kermit/ckermit80.html#x11
52198 + 127. http://www.columbia.edu/kermit/ckermit80.html#x12
52199 + 128. http://www.columbia.edu/kermit/ckermit80.html#x13
52200 + 129. http://www.columbia.edu/kermit/ckermit80.html#x14
52201 + 130. http://www.columbia.edu/kermit/ckermit80.html#x15
52202 + 131. http://www.columbia.edu/kermit/ckermit80.html#x16
52203 + 132. http://www.columbia.edu/kermit/ckermit80.html#x17
52204 + 133. http://www.columbia.edu/kermit/ckermit80.html#top
52205 + 134. http://www.columbia.edu/kermit/ckermit.html
52206 + 135. http://www.columbia.edu/kermit/index.html
52207 + 136. http://www.columbia.edu/kermit/ckuins.html#x5
52208 + 137. http://www.columbia.edu/kermit/ckuins.html
52209 + 138. http://www.columbia.edu/kermit/ckermit80.html#x5
52210 + 139. http://www.columbia.edu/kermit/ckermit80.html#x2.2
52211 + 140. http://www.columbia.edu/kermit/ckermit80.html#contents
52212 + 141. http://www.columbia.edu/kermit/ckermit80.html#x15
52213 + 142. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52214 + 143. http://www.columbia.edu/kermit/ckermit80.html#ftpdates
52215 + 144. http://www.columbia.edu/kermit/ckermit80.html#ftpcheck
52216 + 145. http://www.columbia.edu/kermit/ckermit80.html#ftpnamelist
52217 + 146. http://www.columbia.edu/kermit/ckermit80.html#srvrename
52218 + 147. http://www.columbia.edu/kermit/ckermit80.html#ftpvdir
52219 + 148. http://www.columbia.edu/kermit/ckermit80.html#setftptype
52220 + 149. http://www.columbia.edu/kermit/ckermit80.html#x3.6
52221 + 150. http://www.columbia.edu/kermit/ckermit80.html#x15
52222 + 151. http://www.columbia.edu/kermit/ckermit80.html#x8.7
52223 + 152. http://www.columbia.edu/kermit/ckermit80.html#x2.1
52224 + 153. http://www.columbia.edu/kermit/ckermit80.html#x2.2
52225 + 154. http://www.columbia.edu/kermit/ckermit80.html#x8.14
52226 + 155. http://www.columbia.edu/kermit/ckermit80.html#x8.13
52227 + 156. http://www.columbia.edu/kermit/ckermit80.html#x8.13
52228 + 157. http://www.columbia.edu/kermit/ckututor.html
52229 + 158. http://www.columbia.edu/kermit/ckuins.html
52230 + 159. http://www.columbia.edu/kermit/skermit.html
52231 + 160. http://www.columbia.edu/kermit/ckermit80.html#setlocus
52232 + 161. http://www.columbia.edu/kermit/ckermit80.html#lcommands
52233 + 162. http://www.columbia.edu/kermit/ckermit80.html#ftpuser
52234 + 163. http://www.columbia.edu/kermit/ckermit80.html#showvar
52235 + 164. http://www.columbia.edu/kermit/ckermit80.html#callerid
52236 + 165. http://www.columbia.edu/kermit/ckermit80.html#x6.6
52237 + 166. http://www.columbia.edu/kermit/ckermit80.html#x0
52238 + 167. http://www.columbia.edu/kermit/ckermit80.html#x3.11
52239 + 168. http://www.columbia.edu/kermit/ckermit80.html#top
52240 + 169. http://www.columbia.edu/kermit/ckermit80.html#contents
52241 + 170. http://www.columbia.edu/kermit/ckermit.html
52242 + 171. http://www.columbia.edu/kermit/index.html
52243 + 172. http://www.columbia.edu/kermit/ckermit80.html#x0
52244 + 173. http://www.columbia.edu/kermit/ckermit80.html#top
52245 + 174. http://www.columbia.edu/kermit/ckermit80.html#contents
52246 + 175. http://www.columbia.edu/kermit/ckermit.html
52247 + 176. http://www.columbia.edu/kermit/index.html
52248 + 177. http://www.columbia.edu/kermit/k95.html
52249 + 178. http://www.columbia.edu/kermit/sshclient.html
52250 + 179. http://www.columbia.edu/kermit/skermit.html
52251 + 180. http://www.columbia.edu/kermit/skermit.html
52252 + 181. http://www.columbia.edu/kermit/sshclien.htm
52253 + 182. http://www.columbia.edu/kermit/ckermit80.html#x3
52254 + 183. ftp://ftp.isi.edu/in-notes/rfc1738.txt
52255 + 184. http://www.columbia.edu/kermit/ckermit80.html#x2.2.2
52256 + 185. http://www.columbia.edu/kermit/ckermit80.html#x2.2.1
52257 + 186. ftp://ftp.isi.edu/in-notes/rfc2396.txt
52258 + 187. ftp://ftp.isi.edu/in-notes/rfc2616.txt
52259 + 188. http://www.columbia.edu/kermit/ckermit80.html#x2.2.3
52260 + 189. ftp://ftp.isi.edu/in-notes/rfc2616.txt
52261 + 190. http://www.columbia.edu/kermit/ckermit80.html#x8.13.7
52262 + 191. http://www.columbia.edu/kermit/security.htm#x5.4
52263 + 192. http://www.columbia.edu/kermit/security.htm#x15
52264 + 193. http://www.columbia.edu/kermit/security.htm#x6.2
52265 + 194. http://www.columbia.edu/kermit/security.html
52266 + 195. http://www.columbia.edu/kermit/ckermit80.html#x16
52267 + 196. http://www.columbia.edu/kermit/ckermit80.html#top
52268 + 197. http://www.columbia.edu/kermit/ckermit80.html#contents
52269 + 198. http://www.columbia.edu/kermit/ckermit.html
52270 + 199. http://www.columbia.edu/kermit/index.html
52271 + 200. http://www.columbia.edu/kermit/ckermit80.html#x3.1
52272 + 201. http://www.columbia.edu/kermit/ckermit80.html#x3.2
52273 + 202. http://www.columbia.edu/kermit/ckermit80.html#x3.3
52274 + 203. http://www.columbia.edu/kermit/ckermit80.html#x3.4
52275 + 204. http://www.columbia.edu/kermit/ckermit80.html#x3.5
52276 + 205. http://www.columbia.edu/kermit/ckermit80.html#x3.6
52277 + 206. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52278 + 207. http://www.columbia.edu/kermit/ckermit80.html#x3.8
52279 + 208. http://www.columbia.edu/kermit/ckermit80.html#x3.9
52280 + 209. http://www.columbia.edu/kermit/ckermit80.html#x3.10
52281 + 210. http://www.columbia.edu/kermit/ckermit80.html#x3.11
52282 + 211. http://www.columbia.edu/kermit/security.htm
52283 + 212. http://www.columbia.edu/kermit/security.htm#servers
52284 + 213. http://www.columbia.edu/kermit/ckcsets.html
52285 + 214. http://www.columbia.edu/kermit/unicode.html
52286 + 215. http://www.columbia.edu/kermit/ckermi70.htm#x1.5.4
52287 + 216. http://www.columbia.edu/kermit/case10.html
52288 + 217. http://www.columbia.edu/kermit/ckermit80.html#x4
52289 + 218. http://www.columbia.edu/kermit/ckermit80.html#x3.11
52290 + 219. http://www.columbia.edu/kermit/ftpscripts.html
52291 + 220. http://www.columbia.edu/kermit/ckermit80.html#top
52292 + 221. http://www.columbia.edu/kermit/ckermit80.html#ftp
52293 + 222. http://www.columbia.edu/kermit/ftpclient.html
52294 + 223. http://www.columbia.edu/kermit/ftpscripts.html
52295 + 224. http://www.columbia.edu/kermit/ckermit.html
52296 + 225. http://www.columbia.edu/kermit/index.html
52297 + 226. http://www.columbia.edu/kermit/ckermit80.html#x3.1.1
52298 + 227. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
52299 + 228. http://www.columbia.edu/kermit/ckermit80.html#x3.1.4
52300 + 229. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
52301 + 230. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
52302 + 231. http://www.columbia.edu/kermit/ckermit80.html#x3.2
52303 + 232. http://www.columbia.edu/kermit/ckermit80.html#x3.5
52304 + 233. http://www.columbia.edu/kermit/ckermit80.html#x3.6
52305 + 234. http://www.columbia.edu/kermit/ftpscripts.html
52306 + 235. http://www.columbia.edu/kermit/ckb2.htm
52307 + 236. http://www.columbia.edu/kermit/ckermit80.html#ftpautolog
52308 + 237. http://www.columbia.edu/kermit/ckermit80.html#ftpuser
52309 + 238. http://www.columbia.edu/kermit/ckermit80.html#x3.8
52310 + 239. http://www.columbia.edu/kermit/ckermit80.html#x3.8
52311 + 240. http://www.columbia.edu/kermit/ckermit80.html#top
52312 + 241. http://www.columbia.edu/kermit/ckermit80.html#ftp
52313 + 242. http://www.columbia.edu/kermit/ckermit.html
52314 + 243. http://www.columbia.edu/kermit/index.html
52315 + 244. http://www.columbia.edu/kermit/ibm_ie.html
52316 + 245. http://www.columbia.edu/kermit/ckermit80.html#x3.10
52317 + 246. http://www.columbia.edu/kermit/ckermit80.html#top
52318 + 247. http://www.columbia.edu/kermit/ckermit80.html#ftp
52319 + 248. http://www.columbia.edu/kermit/ckermit.html
52320 + 249. http://www.columbia.edu/kermit/index.html
52321 + 250. http://www.columbia.edu/kermit/ck60manual.html
52322 + 251. http://www.columbia.edu/kermit/ckermit70.html#x4.17
52323 + 252. http://www.columbia.edu/kermit/ckermit70.html
52324 + 253. http://www.columbia.edu/kermit/ckermit80.html#x3.6
52325 + 254. http://www.columbia.edu/kermit/ckermit80.html#x3.11
52326 + 255. http://www.columbia.edu/kermit/ckermit80.html#x3.1.4
52327 + 256. http://www.columbia.edu/kermit/security.html
52328 + 257. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52329 + 258. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52330 + 259. http://www.columbia.edu/kermit/ckermit80.html#x8.13.4
52331 + 260. http://www.columbia.edu/kermit/ckermit80.html#permswitch
52332 + 261. http://www.columbia.edu/kermit/ckermit80.html#ftpchmod
52333 + 262. http://www.columbia.edu/kermit/ckermit80.html#x3.6.2
52334 + 263. http://www.columbia.edu/kermit/ckermit80.html#x4
52335 + 264. http://www.columbia.edu/kermit/ckermit80.html#top
52336 + 265. http://www.columbia.edu/kermit/ckermit80.html#ftp
52337 + 266. http://www.columbia.edu/kermit/ckermit.html
52338 + 267. http://www.columbia.edu/kermit/index.html
52339 + 268. http://www.columbia.edu/kermit/ckermit80.html#x7
52340 + 269. http://www.columbia.edu/kermit/ckermit80.html#x3.8
52341 + 270. http://www.columbia.edu/kermit/ckermit80.html#x3.8
52342 + 271. http://www.columbia.edu/kermit/ckb2.htm
52343 + 272. http://www.columbia.edu/kermit/ckermit80.html#x3.10
52344 + 273. http://www.columbia.edu/kermit/ckermit80.html#x3.10
52345 + 274. http://www.columbia.edu/kermit/ckermit80.html#x3.6
52346 + 275. http://www.columbia.edu/kermit/ckermit80.html#setftptype
52347 + 276. http://www.columbia.edu/kermit/ckermit80.html#top
52348 + 277. http://www.columbia.edu/kermit/ckermit80.html#ftp
52349 + 278. http://www.columbia.edu/kermit/ckermit.html
52350 + 279. http://www.columbia.edu/kermit/index.html
52351 + 280. http://www.columbia.edu/kermit/ckermit70.html#x4.9
52352 + 281. http://www.columbia.edu/kermit/ckermit80.html#x3.5.1
52353 + 282. http://www.columbia.edu/kermit/ckermit80.html#erroraction
52354 + 283. http://www.columbia.edu/kermit/ckermit70.html#x1.5
52355 + 284. http://www.columbia.edu/kermit/ckermit70.html#x4.7
52356 + 285. http://www.columbia.edu/kermit/ckermit70.html#x1.6
52357 + 286. http://www.columbia.edu/kermit/ckermit80.html#x8.13
52358 + 287. http://www.columbia.edu/kermit/ckermi70.htm#x1.5.4
52359 + 288. http://www.columbia.edu/kermit/ckermi70.htm
52360 + 289. http://www.columbia.edu/kermit/ckermit80.html#x4
52361 + 290. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52362 + 291. http://www.columbia.edu/kermit/ckermit80.html#x3.5.2
52363 + 292. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52364 + 293. http://www.columbia.edu/kermit/ckermit80.html#erroraction
52365 + 294. http://www.columbia.edu/kermit/ckermit80.html#x3.5.2
52366 + 295. http://www.columbia.edu/kermit/ckermit80.html#erroraction
52367 + 296. http://www.columbia.edu/kermit/ckermit80.html#ftpfilenames
52368 + 297. http://www.columbia.edu/kermit/ckermit80.html#ftpperms
52369 + 298. http://www.columbia.edu/kermit/ckermit80.html#ftpunique
52370 + 299. http://www.columbia.edu/kermit/ckermit80.html#ftpfilenames
52371 + 300. http://www.columbia.edu/kermit/ckermit80.html#note_utc
52372 + 301. http://www.columbia.edu/kermit/ckermit80.html#note_date
52373 + 302. http://www.columbia.edu/kermit/ckermit80.html#x3.6
52374 + 303. http://www.boulder.nist.gov/timefreq/faq/faq.htm#10:
52375 + 304. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52376 + 305. http://www.columbia.edu/kermit/ckermit80.html#top
52377 + 306. http://www.columbia.edu/kermit/ckermit80.html#ftp
52378 + 307. http://www.columbia.edu/kermit/ckermit.html
52379 + 308. http://www.columbia.edu/kermit/index.html
52380 + 309. http://www.columbia.edu/kermit/ckermit80.html#x3.11
52381 + 310. http://www.columbia.edu/kermit/ckermi70.htm#x4.3
52382 + 311. http://www.columbia.edu/kermit/ckermit70.html
52383 + 312. http://www.columbia.edu/kermit/ckermit80.html#x5
52384 + 313. http://www.columbia.edu/kermit/ckermit80.html#x3.6.3
52385 + 314. http://www.columbia.edu/kermit/ckermit80.html#ftpfilenames
52386 + 315. http://www.columbia.edu/kermit/ckermi70.htm#x4.1
52387 + 316. http://www.columbia.edu/kermit/ckermi70.htm#x4.2.2
52388 + 317. http://www.columbia.edu/kermit/ckermi70.htm#x1.5.4
52389 + 318. http://www.columbia.edu/kermit/ckermit80.html#x3.6.2
52390 + 319. http://www.columbia.edu/kermit/ckermit80.html#x3.11
52391 + 320. http://www.columbia.edu/kermit/ckermit80.html#x3.11
52392 + 321. http://www.columbia.edu/kermit/ckermit80.html#srvrename
52393 + 322. http://www.columbia.edu/kermit/ckermi70.htm#x4.1
52394 + 323. http://www.columbia.edu/kermit/ckermi70.htm
52395 + 324. http://www.columbia.edu/kermit/ckb2.htm
52396 + 325. http://www.columbia.edu/kermit/ckermit80.html#ftpfilenames
52397 + 326. http://www.columbia.edu/kermit/ckermit80.html#x3.5.3
52398 + 327. http://www.proftpd.net/
52399 + 328. http://www.columbia.edu/kermit/ckermit80.html#top
52400 + 329. http://www.columbia.edu/kermit/ckermit80.html#ftp
52401 + 330. http://www.columbia.edu/kermit/ckermit.html
52402 + 331. http://www.columbia.edu/kermit/index.html
52403 + 332. http://www.columbia.edu/kermit/ckb2.htm
52404 + 333. http://www.columbia.edu/kermit/ckcsets.html
52405 + 334. http://www.columbia.edu/kermit/unicode.html
52406 + 335. http://www.columbia.edu/kermit/ckcsets.html
52407 + 336. http://www.columbia.edu/kermit/ckcsets.html
52408 + 337. http://www.columbia.edu/kermit/ckermit80.html#x4
52409 + 338. http://www.columbia.edu/kermit/utf8.html
52410 + 339. http://www.columbia.edu/kermit/ckcsets.html
52411 + 340. http://www.columbia.edu/kermit/ckermit80.html#x4
52412 + 341. ftp://ftp.isi.edu/in-notes/rfc2640.txt
52413 + 342. http://www.columbia.edu/kermit/ckermit80.html#top
52414 + 343. http://www.columbia.edu/kermit/ckermit80.html#ftp
52415 + 344. http://www.columbia.edu/kermit/ckermit.html
52416 + 345. http://www.columbia.edu/kermit/index.html
52417 + 346. http://www.columbia.edu/kermit/ckermit80.html#top
52418 + 347. http://www.columbia.edu/kermit/ckermit80.html#ftp
52419 + 348. http://www.columbia.edu/kermit/ckermit.html
52420 + 349. http://www.columbia.edu/kermit/index.html
52421 + 350. http://www.columbia.edu/kermit/ckermit80.html#top
52422 + 351. http://www.columbia.edu/kermit/ckermit80.html#ftp
52423 + 352. http://www.columbia.edu/kermit/ckermit.html
52424 + 353. http://www.columbia.edu/kermit/index.html
52425 + 354. http://www.columbia.edu/kermit/ftpscripts.html
52426 + 355. http://www.columbia.edu/kermit/ckermit80.html#x3.2
52427 + 356. http://www.columbia.edu/kermit/ckermit80.html#x3.2
52428 + 357. ftp://ftp.isi.edu/in-notes/rfc959.txt
52429 + 358. http://www.columbia.edu/kermit/ckscripts.html
52430 + 359. http://www.columbia.edu/kermit/ckermit80.html#top
52431 + 360. http://www.columbia.edu/kermit/ckermit80.html#ftp
52432 + 361. http://www.columbia.edu/kermit/ftpscript.html
52433 + 362. http://www.columbia.edu/kermit/ckermit.html
52434 + 363. http://www.columbia.edu/kermit/index.html
52435 + 364. http://www.columbia.edu/kermit/ckermit80.html#x3.11.1
52436 + 365. http://www.columbia.edu/kermit/ckermit80.html#x3.11.2
52437 + 366. http://www.columbia.edu/kermit/ckermit80.html#x3.11.3
52438 + 367. http://www.columbia.edu/kermit/ckermit80.html#x3.11.4
52439 + 368. http://www.columbia.edu/kermit/ckermit80.html#x3.11.5
52440 + 369. http://www.columbia.edu/kermit/ckermit.html
52441 + 370. http://www.columbia.edu/kermit/k95.html
52442 + 371. http://www.columbia.edu/kermit/ckermit80.html#x3.11.5
52443 + 372. ftp://ftp.isi.edu/in-notes/rfc959.txt
52444 + 373. ftp://ftp.isi.edu/in-notes/rfc2389.txt
52445 + 374. http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.txt
52446 + 375. http://www.columbia.edu/kermit/ftpclient.html
52447 + 376. http://www.columbia.edu/kermit/ckermit80.html#top
52448 + 377. http://www.columbia.edu/kermit/ckermit80.html#ftp
52449 + 378. http://www.columbia.edu/kermit/ckermit.html
52450 + 379. http://www.columbia.edu/kermit/index.html
52451 + 380. http://www.columbia.edu/kermit/ckermit80.html#x3
52452 + 381. http://www.columbia.edu/kermit/ckermit80.html#ucs2
52453 + 382. http://www.columbia.edu/kermit/ckermit80.html#top
52454 + 383. http://www.columbia.edu/kermit/ckermit80.html#contents
52455 + 384. http://www.columbia.edu/kermit/ckermit.html
52456 + 385. http://www.columbia.edu/kermit/index.html
52457 + 386. http://www.columbia.edu/kermit/ckermit80.html#top
52458 + 387. http://www.columbia.edu/kermit/ckermit80.html#contents
52459 + 388. http://www.columbia.edu/kermit/ckermit.html
52460 + 389. http://www.columbia.edu/kermit/index.html
52461 + 390. http://www.columbia.edu/kermit/ckb2.htm
52462 + 391. http://www.columbia.edu/kermit/ckermit80.html#top
52463 + 392. http://www.columbia.edu/kermit/ckermit80.html#contents
52464 + 393. http://www.columbia.edu/kermit/ckermit.html
52465 + 394. http://www.columbia.edu/kermit/index.html
52466 + 395. http://www.columbia.edu/kermit/ckermit80.html#x4
52467 + 396. http://www.columbia.edu/kermit/ckermit80.html#x4
52468 + 397. http://www.columbia.edu/kermit/ckermit80.html#x8.12
52469 + 398. http://www.columbia.edu/kermit/ckermit80.html#x8.1
52470 + 399. http://www.columbia.edu/kermit/ckermit80.html#x12
52471 + 400. http://www.columbia.edu/kermit/ckermit80.html#x8.12
52472 + 401. http://www.columbia.edu/kermit/ckermit80.html#top
52473 + 402. http://www.columbia.edu/kermit/ckermit80.html#contents
52474 + 403. http://www.columbia.edu/kermit/ckermit.html
52475 + 404. http://www.columbia.edu/kermit/index.html
52476 + 405. http://www.columbia.edu/kermit/ckermit80.html#x8.14
52477 + 406. http://www.columbia.edu/kermit/ckermit80.html#top
52478 + 407. http://www.columbia.edu/kermit/ckermit80.html#contents
52479 + 408. http://www.columbia.edu/kermit/ckermit.html
52480 + 409. http://www.columbia.edu/kermit/index.html
52481 + 410. http://www.columbia.edu/kermit/ckermit80.html#x9
52482 + 411. http://www.columbia.edu/kermit/ckermit80.html#top
52483 + 412. http://www.columbia.edu/kermit/ckermit80.html#contents
52484 + 413. http://www.columbia.edu/kermit/ckermit.html
52485 + 414. http://www.columbia.edu/kermit/index.html
52486 + 415. http://www.columbia.edu/kermit/ckermit80.html#x8.6
52487 + 416. http://www.columbia.edu/kermit/ckermit80.html#top
52488 + 417. http://www.columbia.edu/kermit/ckermit80.html#contents
52489 + 418. http://www.columbia.edu/kermit/ckermit.html
52490 + 419. http://www.columbia.edu/kermit/index.html
52491 + 420. http://www.columbia.edu/kermit/ckermit80.html#top
52492 + 421. http://www.columbia.edu/kermit/ckermit80.html#contents
52493 + 422. http://www.columbia.edu/kermit/ckermit.html
52494 + 423. http://www.columbia.edu/kermit/index.html
52495 + 424. http://www.columbia.edu/kermit/ckermit80.html#top
52496 + 425. http://www.columbia.edu/kermit/ckermit80.html#contents
52497 + 426. http://www.columbia.edu/kermit/ckermit.html
52498 + 427. http://www.columbia.edu/kermit/index.html
52499 + 428. http://www.columbia.edu/kermit/ckermit80.html#fjoin
52500 + 429. http://www.columbia.edu/kermit/ckermit80.html#fsplit
52501 + 430. http://www.columbia.edu/kermit/ckermit80.html#x8.10
52502 + 431. http://www.columbia.edu/kermit/ckermit80.html#top
52503 + 432. http://www.columbia.edu/kermit/ckermit80.html#contents
52504 + 433. http://www.columbia.edu/kermit/ckermit.html
52505 + 434. http://www.columbia.edu/kermit/index.html
52506 + 435. http://www.columbia.edu/kermit/ckermit80.html#x9
52507 + 436. http://www.columbia.edu/kermit/ckermit80.html#x9
52508 + 437. http://www.columbia.edu/kermit/ckermit80.html#x9
52509 + 438. http://www.columbia.edu/kermit/ckermit80.html#x3
52510 + 439. http://www.columbia.edu/kermit/ckermit80.html#x3
52511 + 440. http://www.columbia.edu/kermit/ckermit80.html#x3.2
52512 + 441. http://www.columbia.edu/kermit/ckermit80.html#x3.2
52513 + 442. http://www.columbia.edu/kermit/ckermit80.html#x3.8
52514 + 443. http://www.columbia.edu/kermit/ckermit80.html#x3
52515 + 444. http://www.columbia.edu/kermit/ckermit80.html#x3
52516 + 445. http://www.columbia.edu/kermit/ckermit80.html#x3
52517 + 446. http://www.columbia.edu/kermit/ckermit80.html#x3.2
52518 + 447. http://www.columbia.edu/kermit/ckermit80.html#x3
52519 + 448. http://www.columbia.edu/kermit/ckermit80.html#x8.13
52520 + 449. http://www.columbia.edu/kermit/ckermit80.html#x8.13
52521 + 450. http://www.columbia.edu/kermit/ckermit80.html#x9
52522 + 451. http://www.columbia.edu/kermit/ckermit80.html#x8.10
52523 + 452. http://www.columbia.edu/kermit/ckermit80.html#x8.7.4
52524 + 453. http://www.columbia.edu/kermit/ckermit80.html#top
52525 + 454. http://www.columbia.edu/kermit/ckermit80.html#contents
52526 + 455. http://www.columbia.edu/kermit/ckermit.html
52527 + 456. http://www.columbia.edu/kermit/index.html
52528 + 457. http://www.columbia.edu/kermit/ckermit80.html#top
52529 + 458. http://www.columbia.edu/kermit/ckermit80.html#contents
52530 + 459. http://www.columbia.edu/kermit/ckermit.html
52531 + 460. http://www.columbia.edu/kermit/index.html
52532 + 461. http://www.columbia.edu/kermit/ckermit80.html#top
52533 + 462. http://www.columbia.edu/kermit/ckermit80.html#contents
52534 + 463. http://www.columbia.edu/kermit/ckermit.html
52535 + 464. http://www.columbia.edu/kermit/index.html
52536 + 465. http://www.columbia.edu/kermit/ckermit80.html#x8.7
52537 + 466. http://www.columbia.edu/kermit/ckermit80.html#top
52538 + 467. http://www.columbia.edu/kermit/ckermit80.html#contents
52539 + 468. http://www.columbia.edu/kermit/ckermit.html
52540 + 469. http://www.columbia.edu/kermit/index.html
52541 + 470. http://www.columbia.edu/kermit/ckermit80.html#scriptedit
52542 + 471. http://www.columbia.edu/kermit/ckermit80.html#top
52543 + 472. http://www.columbia.edu/kermit/ckermit80.html#contents
52544 + 473. http://www.columbia.edu/kermit/ckermit.html
52545 + 474. http://www.columbia.edu/kermit/index.html
52546 + 475. http://www.columbia.edu/kermit/ckermit80.html#top
52547 + 476. http://www.columbia.edu/kermit/ckermit80.html#contents
52548 + 477. http://www.columbia.edu/kermit/ckermit.html
52549 + 478. http://www.columbia.edu/kermit/index.html
52550 + 479. ftp://ftp.isi.edu/in-notes/rfc2822.txt
52551 + 480. ftp://ftp.isi.edu/in-notes/rfc2822.txt
52552 + 481. ftp://ftp.isi.edu/in-notes/rfc2822.txt
52553 + 482. ftp://ftp.isi.edu/in-notes/rfc2822.txt
52554 + 483. http://www.columbia.edu/kermit/ckermit80.html#top
52555 + 484. http://www.columbia.edu/kermit/ckermit80.html#contents
52556 + 485. http://www.columbia.edu/kermit/ckermit.html
52557 + 486. http://www.columbia.edu/kermit/index.html
52558 + 487. http://www.columbia.edu/kermit/ckermit80.html#x8.1
52559 + 488. http://www.columbia.edu/kermit/ckermit80.html#top
52560 + 489. http://www.columbia.edu/kermit/ckermit80.html#contents
52561 + 490. http://www.columbia.edu/kermit/ckermit.html
52562 + 491. http://www.columbia.edu/kermit/index.html
52563 + 492. http://www.columbia.edu/kermit/ckermit80.html#x8.2
52564 + 493. http://www.columbia.edu/kermit/ckermit80.html#top
52565 + 494. http://www.columbia.edu/kermit/ckermit80.html#contents
52566 + 495. http://www.columbia.edu/kermit/ckermit.html
52567 + 496. http://www.columbia.edu/kermit/index.html
52568 + 497. http://www.columbia.edu/kermit/ckermit80.html#x9.8
52569 + 498. http://www.columbia.edu/kermit/ckermit80.html#x9.8
52570 + 499. http://www.columbia.edu/kermit/ckermit80.html#x8.2
52571 + 500. http://www.columbia.edu/kermit/ckermit80.html#top
52572 + 501. http://www.columbia.edu/kermit/ckermit80.html#contents
52573 + 502. http://www.columbia.edu/kermit/ckermit.html
52574 + 503. http://www.columbia.edu/kermit/index.html
52575 + 504. http://www.columbia.edu/kermit/ckermit80.html#top
52576 + 505. http://www.columbia.edu/kermit/ckermit80.html#contents
52577 + 506. http://www.columbia.edu/kermit/ckermit.html
52578 + 507. http://www.columbia.edu/kermit/index.html
52579 + 508. http://www.columbia.edu/kermit/ckermit80.html#x9.8
52580 + 509. http://www.columbia.edu/kermit/ckermit80.html#top
52581 + 510. http://www.columbia.edu/kermit/ckermit80.html#contents
52582 + 511. http://www.columbia.edu/kermit/ckermit.html
52583 + 512. http://www.columbia.edu/kermit/index.html
52584 + 513. http://www.columbia.edu/kermit/ckermit80.html#x9.8
52585 + 514. http://www.columbia.edu/kermit/ckermit80.html#x9.8
52586 + 515. http://www.columbia.edu/kermit/ckermit80.html#x9.6
52587 + 516. http://www.columbia.edu/kermit/ckermit80.html#top
52588 + 517. http://www.columbia.edu/kermit/ckermit80.html#contents
52589 + 518. http://www.columbia.edu/kermit/ckermit.html
52590 + 519. http://www.columbia.edu/kermit/index.html
52591 + 520. http://www.columbia.edu/kermit/ckermit80.html#x9.8
52592 + 521. http://www.columbia.edu/kermit/ckermit80.html#x9.8
52593 + 522. http://www.columbia.edu/kermit/ckermit80.html#top
52594 + 523. http://www.columbia.edu/kermit/ckermit80.html#contents
52595 + 524. http://www.columbia.edu/kermit/ckermit.html
52596 + 525. http://www.columbia.edu/kermit/index.html
52597 + 526. http://www.columbia.edu/kermit/ckermit80.html#top
52598 + 527. http://www.columbia.edu/kermit/ckermit80.html#contents
52599 + 528. http://www.columbia.edu/kermit/ckermit.html
52600 + 529. http://www.columbia.edu/kermit/index.html
52601 + 530. http://www.columbia.edu/kermit/ckermit80.html#top
52602 + 531. http://www.columbia.edu/kermit/ckermit80.html#contents
52603 + 532. http://www.columbia.edu/kermit/ckermit.html
52604 + 533. http://www.columbia.edu/kermit/index.html
52605 + 534. mailto:thucdat@hotmail.com
52606 + 535. http://www.columbia.edu/kermit/ckermit80.html#x9.9.2
52607 + 536. http://www.columbia.edu/kermit/ckermit80.html#top
52608 + 537. http://www.columbia.edu/kermit/ckermit80.html#contents
52609 + 538. http://www.columbia.edu/kermit/ckermit.html
52610 + 539. http://www.columbia.edu/kermit/index.html
52611 + 540. http://www.columbia.edu/kermit/ckermit80.html#top
52612 + 541. http://www.columbia.edu/kermit/ckermit80.html#contents
52613 + 542. http://www.columbia.edu/kermit/ckermit.html
52614 + 543. http://www.columbia.edu/kermit/index.html
52615 + 544. http://www.columbia.edu/kermit/ckermit80.html#top
52616 + 545. http://www.columbia.edu/kermit/ckermit80.html#contents
52617 + 546. http://www.columbia.edu/kermit/ckermit.html
52618 + 547. http://www.columbia.edu/kermit/index.html
52619 + 548. http://www.columbia.edu/kermit/ckermit80.html#x9.2
52620 + 549. http://www.columbia.edu/kermit/ckermit80.html#top
52621 + 550. http://www.columbia.edu/kermit/ckermit80.html#contents
52622 + 551. http://www.columbia.edu/kermit/ckermit.html
52623 + 552. http://www.columbia.edu/kermit/index.html
52624 + 553. http://www.columbia.edu/kermit/ckermit80.html#x4
52625 + 554. http://www.columbia.edu/kermit/ckermit80.html#x4
52626 + 555. http://www.columbia.edu/kermit/ckermit80.html#top
52627 + 556. http://www.columbia.edu/kermit/ckermit80.html#contents
52628 + 557. http://www.columbia.edu/kermit/ckermit.html
52629 + 558. http://www.columbia.edu/kermit/index.html
52630 + 559. http://www.columbia.edu/kermit/ckermit80.html#top
52631 + 560. http://www.columbia.edu/kermit/ckermit80.html#contents
52632 + 561. http://www.columbia.edu/kermit/ckermit.html
52633 + 562. http://www.columbia.edu/kermit/index.html
52634 + 563. http://www.columbia.edu/kermit/ckermit80.html#top
52635 + 564. http://www.columbia.edu/kermit/ckermit80.html#contents
52636 + 565. http://www.columbia.edu/kermit/ckermit.html
52637 + 566. http://www.columbia.edu/kermit/index.html
52638 + 567. http://www.columbia.edu/kermit/ckermit80.html#x4
52639 + 568. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52640 + 569. http://www.columbia.edu/kermit/ckermit80.html#x3.7
52641 + 570. http://www.columbia.edu/kermit/ckermit80.html#top
52642 + 571. http://www.columbia.edu/kermit/ckermit80.html#contents
52643 + 572. http://www.columbia.edu/kermit/ckermit.html
52644 + 573. http://www.columbia.edu/kermit/index.html
52645 + 574. ftp://ftp.isi.edu/in-notes/rfc2217.txt
52646 + 575. http://www.columbia.edu/kermit/ckermit80.html#top
52647 + 576. http://www.columbia.edu/kermit/ckermit80.html#contents
52648 + 577. ftp://kermit.columbia.edu/kermit/sredird/
52649 + 578. http://www.columbia.edu/kermit/ckermit.html
52650 + 579. http://www.columbia.edu/kermit/index.html
52651 + 580. http://www.columbia.edu/kermit/ckermi70.htm#x4.22
52652 + 581. http://www.columbia.edu/kermit/ckermit80.html#top
52653 + 582. http://www.columbia.edu/kermit/ckermit80.html#contents
52654 + 583. http://www.columbia.edu/kermit/ckermit.html
52655 + 584. http://www.columbia.edu/kermit/index.html
52656 + 585. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
52657 + 586. http://www.columbia.edu/kermit/cuiksd.html
52658 + 587. http://www.columbia.edu/kermit/ckermit80.html#top
52659 + 588. http://www.columbia.edu/kermit/ckermit80.html#contents
52660 + 589. http://www.columbia.edu/kermit/ckermit.html
52661 + 590. http://www.columbia.edu/kermit/index.html
52662 + 591. http://www.columbia.edu/kermit/ckermit80.html#top
52663 + 592. http://www.columbia.edu/kermit/ckermit80.html#contents
52664 + 593. http://www.columbia.edu/kermit/ckermit.html
52665 + 594. http://www.columbia.edu/kermit/index.html
52666 + 595. http://www.columbia.edu/kermit/index.html
52667 --- /dev/null
52668 +++ ckermit-301/ckcplm.txt
52669 @@ -0,0 +1,3046 @@
52670 +
52671 +   [1]The Columbia Crown The Kermit Project | Columbia University
52672 +   612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
52673 +   ...since 1981
52674 +   [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
52675 +   [10]Support
52676 +
52677 +C-Kermit Program Logic Manual
52678 +
52679 +     Frank da Cruz
52680 +     [11]The Kermit Project
52681 +     [12]Columbia University
52682 +
52683 +   As of: C-Kermit 9.0.300, 30 June 2011
52684 +   Last update: Tue Jun 28 08:59:18 2011
52685 +
52686 +     IF YOU ARE READING A PLAIN-TEXT version of this document, note that
52687 +     this file is a plain-text dump of a Web page. You can visit the
52688 +     original (and possibly more up-to-date) Web page here:
52689 +
52690 +  [13]http://www.columbia.edu/kermit/ckcplm.html
52691 +
52692 +   [ [14]C-Kermit Home ] [ [15]Kermit Home ]
52693 +
52694 +CONTENTS
52695 +
52696 +  1. [16]INTRODUCTION
52697 +  2. [17]FILES
52698 +  3. [18]SOURCE CODE PORTABILITY AND STYLE
52699 +  4. [19]MODULES
52700 +     4.A. [20]Group A: Library Routines
52701 +     4.B. [21]Group B: Kermit File Transfer
52702 +     4.C. [22]Group C: Character-Set Conversion
52703 +     4.D. [23]Group D: User Interface
52704 +     4.E. [24]Group E: Platform-Dependent I/O
52705 +     4.F. [25]Group F: Network Support
52706 +     4.G. [26]Group G: Formatted Screen Support
52707 +     4.H. [27]Group H: Pseudoterminal Support
52708 +     4.I. [28]Group I: Security
52709 +  I. [29]APPENDIX I: FILE PERMISSIONS
52710 +
52711 +1. INTRODUCTION
52712 +
52713 +   The Kermit Protocol is specified in the book Kermit, A File Transfer
52714 +   Protocol by Frank da Cruz, Digital Press / Butterworth Heinemann,
52715 +   Newton, MA, USA (1987), 379 pages, ISBN 0-932376-88-6. It is assumed
52716 +   the reader is familiar with the Kermit protocol specification.
52717 +
52718 +   This file describes the relationship among the modules and functions of
52719 +   C-Kermit 5A and later, and other programming considerations. C-Kermit
52720 +   is designed to be portable to any kind of computer that has a C
52721 +   compiler. The source code is broken into many files that are grouped
52722 +   according to their function, as shown in the [30]Contents.
52723 +
52724 +   C-Kermit has seen constant development since 1985. Throughout its
52725 +   history, there has been a neverending tug-of-war among:
52726 +
52727 +    a. Functionality: adding new features, fixing bugs, improving
52728 +       performance.
52729 +    b. Adding support for new platforms.
52730 +    c. "Buzzword 1.0 compliance".
52731 +
52732 +   The latter category is the most frustrating, since it generally
52733 +   involves massive changes just to keep the software doing what it did
52734 +   before in some new setting: e.g. the K&R-to-ANSIC conversion (which had
52735 +   to be done, of course, without breaking K&R); Y2K (not a big deal in
52736 +   our case); the many and varied UNIX and other API "standards"; IPv6.
52737 +
52738 +   [ [31]Contents ] [ [32]C-Kermit ] [ [33]Kermit Home ]
52739 +
52740 +2. FILES
52741 +
52742 +   C-Kermit source files begin with the two letters "ck", for example
52743 +   ckutio.c. Filenames are kept short (6.3) for maximum portability and
52744 +   (obviously I hope) do not contain spaces or more than one period. The
52745 +   third character in the name denotes something about the function group
52746 +   and the expected level of portability:
52747 +
52748 +     a     General descriptive material and documentation (text)
52749 +     b     BOO file encoders and decoders (obsolete)
52750 +     c     All platforms with C compilers (*)
52751 +     d     Data General AOS/VS
52752 +     e     Reserved for "ckermit" files, like ckermit.ini, ckermit2.txt
52753 +     f     (reserved)
52754 +     g     (reserved)
52755 +     h     (reserved)
52756 +     i     Commodore Amiga (Intuition)
52757 +     j     (unused)
52758 +     k     (unused)
52759 +     l     Stratus VOS
52760 +     m     Macintosh with Mac OS 1-9
52761 +     n     Microsoft Windows NT/2000/XP
52762 +     o     OS/2 and/or Microsoft Windows 9x/ME/NT/2000/XP
52763 +     p     Plan 9 from Bell Labs
52764 +     q     (reserved)
52765 +     r     DEC PDP-11 with RSTS/E (never used, open for reassigment)
52766 +     s     Atari ST GEMDOS (last supported in version 5A(189))
52767 +     t     DEC PDP-11 with RT-11 (never used, open for reassigment)
52768 +     u     Unix-based operating systems (*)
52769 +     v     VMS and OpenVMS
52770 +     w     Wart (Lex-like preprocessor, platform independent)
52771 +     x     (reserved)
52772 +     y     (reserved)
52773 +     z     (reserved)
52774 +     0-3   (reserved)
52775 +     4     IBM AS/400
52776 +     5-8   (reserved)
52777 +     9     Microware OS-9
52778 +     _     Encryption modules
52779 +
52780 +   (*) In fact there is little distinction between the ckc*.* and cku*.*
52781 +   categories. It would make more sense for all cku*.* modules to be
52782 +   ckc*.* ones, except ckufio.c, ckutio.c, ckucon.c, ckucns.c, and
52783 +   ckupty.c, which truly are specific to Unix. The rest (ckuus*.c,
52784 +   ckucmd.c, etc) are quite portable.
52785 +
52786 +   One hint before proceeding: functions are scattered all over the ckc*.c
52787 +   and cku*.c modules, where function size has begun to take precedence
52788 +   over the desirability of grouping related functions together, the aim
52789 +   being to keep any particular module from growing disproportionately
52790 +   large. The easiest way (in UNIX) to find out in what source file a
52791 +   given function is defined is like this (where the desired function is
52792 +   foo()...):
52793 +
52794 +  grep ^foo\( ck*.c
52795 +
52796 +   This works because the coding convention has been to make function
52797 +   names always start on the left margin with their contents indented, for
52798 +   example:
52799 +
52800 +static char *
52801 +foo(x,y) int x, y; {
52802 +    ...
52803 +}
52804 +
52805 +   Also note the style for bracket placement. This allows bracket-matching
52806 +   text editors (such as EMACS) to help you make sure you know which
52807 +   opening bracket a closing bracket matches, particularly when the
52808 +   opening bracket is above the visible screen, and it also makes it easy
52809 +   to find the end of a function (search for '}' on the left margin).
52810 +
52811 +   Of course EMACS tags work nicely with this format too:
52812 +
52813 +  $ cd kermit-source-directory
52814 +  $ etags ck[cu]*.c
52815 +  $ emacs
52816 +  Esc-X Visit-Tags-Table<CR><CR>
52817 +
52818 +   (but remember that the source file for ckcpro.c is [34]ckcpro.w!)
52819 +
52820 +   Also:
52821 +
52822 +     * Tabs should be set every 8 spaces, as on a VT100.
52823 +     * All lines must no more than 79 characters wide after tab expansion.
52824 +     * Note the distinction between physical tabs (ASCII 9) and the
52825 +       indentation conventions, which are: 4 for block contents, 2 for
52826 +       most other stuff (obviously this is not a portability issue, just
52827 +       style).
52828 +
52829 +   [ [35]Contents ] [ [36]C-Kermit ] [ [37]Kermit Home ]
52830 +
52831 +3. SOURCE CODE PORTABILITY AND STYLE
52832 +
52833 +   C-Kermit was designed in 1985 as a platform-independent replacement for
52834 +   the earlier Unix Kermit. c-Kermit's design was expected to promote
52835 +   portability, and judging from the number of platforms to which it has
52836 +   been adapted since then, the model is effective, if not ideal
52837 +   (obviously if we had it all to do over, we'd change a few things). To
52838 +   answer the oft-repeated question: "Why are there so many #ifdefs?",
52839 +   it's because:
52840 +
52841 +     * Many of them are related to feature selection and program size, and
52842 +       so need to be there anyway.
52843 +     * Those that treat compiler, library, platform, header-file, and
52844 +       similar differences have built up over time as hundreds of people
52845 +       all over the world adapted C-Kermit to their particular
52846 +       environments and sent back their changes. There might be more
52847 +       politically-correct ways to achieve portability, but this one is
52848 +       natural and proven. The basic idea is to introduce changes that can
52849 +       be selected by defining a symbol, which, if not defined, leaves the
52850 +       program exactly as it was before the changes.
52851 +     * Although it might be possible to "clean up" the "#ifdef mess",
52852 +       nobody has access to all the hundreds of platforms served by the
52853 +       #ifdefs to check the results.
52854 +
52855 +   And to answer the second-most-oft-repeated question: "Why don't you
52856 +   just use GNU autoconfig / automake / autowhatever instead of
52857 +   hard-coding all those #ifdefs?" Answers:
52858 +
52859 +     * The GNU tools are not available on all the platforms where C-Kermit
52860 +       must be built and I wouldn't necessarily trust them if they were.
52861 +     * Each platform is a moving target, so the tools themselves would
52862 +       need to updated before Kermit could be updated.
52863 +     * It would only add another layer of complexity to an already complex
52864 +       process.
52865 +     * Conversion at this point would not be practical unless there was a
52866 +       way to test the results on all the hundreds of platforms where
52867 +       C-Kermit is supposed to build.
52868 +
52869 +   When writing code for the system-indendent C-Kermit modules, please
52870 +   stick to the following coding conventions to ensure portability to the
52871 +   widest possible variety of C preprocessors, compilers, and linkers, as
52872 +   well as certain network and/or email transports. The same holds true
52873 +   for many of the "system dependent" modules too; particularly the Unix
52874 +   ones, since they must be buildable by a wide variety of compilers and
52875 +   linkers, new and old.
52876 +
52877 +   This list does not purport to be comprehensive, and although some items
52878 +   on it might seem far-fetched, they would not be listed unless I had
52879 +   encountered them somewhere, some time. I wish I had kept better records
52880 +   so I could cite specific platforms and compilers.
52881 +
52882 +     * Try to keep variable and function names unique within 6 characters,
52883 +       especially if they are used across modules, since 6 is the maximum
52884 +       for some old linkers (actually, this goes back to TOPS-10 and -20
52885 +       and other old DEC OS's where C-Kermit never ran anyway; a more
52886 +       realistic maximum is probably somewhere between 8 and 16). We know
52887 +       for certain that VAX C has a 31-character max because it complains
52888 +       -- others might not complain, but just silently truncate, thus
52889 +       folding two or more routines/variables into one.
52890 +     * Keep preprocessor symbols unique within 8 characters; that's the
52891 +       max for some preprocessors (sorry, I can't give a specific example,
52892 +       but in 1988 or thereabouts, I had to change character-set symbols
52893 +       like TC_LATIN1 and TC_LATIN2 to TC_1LATIN and TC_2LATIN because the
52894 +       digits were being truncated and ignored on a platform where I
52895 +       actually had to build C-Kermit 5A; unfortunately I didn't note
52896 +       which platform -- maybe some early Ultrix version?)
52897 +     * Don't create preprocessor symbols, or variable or function names,
52898 +       that start with underscore (_). These are usually reserved for
52899 +       internal use by the compiler and header files.
52900 +     * Don't put #include directives inside functions or { blocks }.
52901 +     * Don't use the #if or #elif preprocessor constructions, only use
52902 +       #ifdef, #ifndef, #define, #undef, and #endif.
52903 +     * Put tokens after #endif in comment brackets, e.g. #endif /* FOO */.
52904 +     * Don't indent preprocessor statements - # must always be first char
52905 +       on line.
52906 +     * Don't put whitespace after # in preprocessor statements.
52907 +     * Don't use #pragma, even within #ifdefs -- it makes some
52908 +       preprocessors give up.
52909 +     * Same goes for #module, #if, etc - #ifdefs do NOT protect them.
52910 +     * Don't use logical operators in preprocessor constructions.
52911 +     * Avoid #ifdefs inside argument list to function calls (I can't
52912 +       remember why this one is here, but probably needn't be; we do this
52913 +       all the time).
52914 +     * Always cast strlen() in expressions to int:
52915 +       if ((int)strlen(foo) < x)...
52916 +     * Any variable whose value might exceed 16383 should be declared as
52917 +       long, or if that is not possible, then as unsigned.
52918 +     * Avoid typedefs; they might be portable but they are very confusing
52919 +       and there's no way to test for their presence or absence at compile
52920 +       time. Use preprocessor symbols instead if possible; at least you
52921 +       can test their definitions.
52922 +     * Unsigned long is not portable; use a preprocessor symbol (Kermit
52923 +       uses ULONG for this).
52924 +     * Long long is not portable. If you really need it, be creative.
52925 +     * Similarly 1234LL is not portable, nor almost any other constant
52926 +       modifier other than L.
52927 +     * Unsigned char is not portable, use CHAR (a preprocessor symbol
52928 +       defined in the Kermit header files) and always take precautions
52929 +       against character signage (more about this [38]below).
52930 +     * Don't use initializers with automatic arrays or structs: it's not
52931 +       portable.
52932 +     * Don't use big automatic arrays or structs in functions that might
52933 +       be called recursively; some platforms have fixed-size stacks (e.g.
52934 +       Windows 9x: 256K) and recursive functions crash with stack
52935 +       overflow. Even when there is not a compiler limitation, this causes
52936 +       memory to be consumed without bound, and can end up filling swap
52937 +       space.
52938 +     * Don't assume that struct assignment performs a copy, or that it
52939 +       even exists.
52940 +     * Don't use sizeof to get the size of an array; someone might come
52941 +       along later and and change it from static to malloc'd. Always use a
52942 +       symbol to refer to the array's size.
52943 +     * Don't put prototypes for static functions into header files that
52944 +       are used by modules that don't contain that function; the link step
52945 +       can fail with unresolved references (e.g. on AOS/VS).
52946 +     * Avoid the construction *++p (the order of evaluation varies; it
52947 +       shouldn't but at least one compiler had a bug that made me include
52948 +       this item).
52949 +     * Don't use triple assignments, like a = b = c = 0; (or quadruple,
52950 +       etc). Some compilers generate bad code for these, or crash, etc
52951 +       (some version of DEC C as I recall).
52952 +     * Some compilers don't allow structure members to have the same names
52953 +       as other identifiers. Try to give structure members unique names.
52954 +     * Don't assume anything about order of evaluation in boolean
52955 +       expressions, or that they will stop early if a required condition
52956 +       is not true, e.g.:
52957 +  if (i > 0 && p[i-1] == blah)
52958 +
52959 +       can still dump core if i == 0 (hopefully this is not true of any
52960 +       modern compiler, but I would not have said this if it did not
52961 +       actually happen somewhere).
52962 +     * Don't have a switch() statement with no cases (e.g. because of
52963 +       #ifdefs); this is a fatal error in some compilers.
52964 +     * Don't put lots of code in a switch case; move it out to a separate
52965 +       function; some compilers run out of memory when presented with a
52966 +       huge switch() statement -- it's not the number of cases that
52967 +       matters; it's the overall amount of code.
52968 +     * Some compilers might also limit the number of switch() cases, e.g.
52969 +       to 254.
52970 +     * Don't put anything between "switch() {" and "case:" -- switch
52971 +       blocks are not like other blocks.
52972 +     * Don't jump into or out of switches.
52973 +     * Don't make character-string constants longer than about 250 bytes.
52974 +       Longer strings should be broken up into arrays of strings.
52975 +     * Don't write into character-string constants (obviously). Even when
52976 +       you know you are not writing past the end; the compiler or linker
52977 +       might have put them into read-only and/or shared memory, and/or
52978 +       coalesced multiple equal constants so if you change one you change
52979 +       them all.
52980 +     * Don't depend on '\r' being carriage return.
52981 +     * Don't depend on '\n' being linefeed or for that matter any SINGLE
52982 +       character.
52983 +     * Don't depend on '\r' and '\n' being different (e.g. as separate
52984 +       switch() cases).
52985 +     * In other words, don't use \n or \r to stand for specific
52986 +       characters; use \012 and \015 instead.
52987 +     * Don't code for "buzzword 1.0 compliance", unless "buzzword" is K&R
52988 +       and "1.0" is the first edition.
52989 +     * Don't use or depend on anything_t (size_t, pid_t, etc), except
52990 +       time_t, without #ifdef protection (time_t is the only one I've
52991 +       found that is accepted everywhere). This is a tough one because the
52992 +       same function might require (say) a size_t arg on one platform,
52993 +       whereas size_t is unheard of on another; or worse, it might require
52994 +       a totally different data type, like int or long or some other
52995 +       typedef'd thing. It has often proved necessary to define a symbol
52996 +       to stand for the type of a particular argument to a particular
52997 +       library or system function to get around this problem.
52998 +     * Don't use or depend on internationalization ("i18n") features,
52999 +       wchar_t, locales, etc, in portable code; they are not portable.
53000 +       Anyway, locales are not the right model for Kermit's
53001 +       multi-character-set support. Kermit does all character-set
53002 +       conversion itself and does not use any external libraries or
53003 +       functions.
53004 +     * In particular, don't use any library functions that deal with wide
53005 +       characters or Unicode in any form. These are not only nonportable,
53006 +       but a constantly shifting target (e.g. the ones in glibc).
53007 +     * Don't make any assumption about signal handler type. It can be
53008 +       void, int, long, or anything else. Always declare signal handlers
53009 +       as SIGTYP (see definition in ckcdeb.h and augment it if necessary)
53010 +       and always use SIGRETURN at exit points from signal handlers.
53011 +     * Signals should always be re-armed to be used again (this barely
53012 +       scratches the surface -- the differences between BSD/V7 and System
53013 +       V and POSIX signal handling are numerous, and some platforms do not
53014 +       even support signals, alarms, or longjmps correctly or at all --
53015 +       avoid all of this if you can).
53016 +     * On the other hand, don't assume that signals are disarmed after
53017 +       being raised. In some platforms you have to re-arm them, in others
53018 +       they stay armed.
53019 +     * Don't call malloc() and friends from a signal handler; don't do
53020 +       anything but setting integer global variables in a signal handler.
53021 +     * malloc() does not initialize allocated memory -- it never said it
53022 +       did. Don't expect it to be all 0's.
53023 +     * Did You Know: malloc() can succeed and the program can still dump
53024 +       core later when it attempts to use the malloc'd memory? (This
53025 +       happens when allocation is deferred until use and swap space is
53026 +       full.)
53027 +     * memset(), memmove(), and memcpy() are not portable, don't use them
53028 +       without protecting them in ifdefs (we have USE_MEMCPY for this).
53029 +       bzero()/bcopy() too, except we're guaranteed to have
53030 +       bzero()/bcopy() when using the sockets library (not really). See
53031 +       examples in the source.
53032 +     * Don't assume that strncpy() stops on the first null byte -- most
53033 +       versions always copy the number of bytes given in arg 3, padding
53034 +       out with 0's and overwriting whatever was there before. Use
53035 +       C-Kermit ckstrncpy() if you want predictable non-padding behavior,
53036 +       guaranteed NUL-termination, and a useful return code.
53037 +     * DID YOU KNOW.. that some versions of inet_blah() routines return IP
53038 +       addresses in network byte order, while others return them local
53039 +       machine byte order? So passing them to ntohs() or whatever is not
53040 +       always the right thing to do.
53041 +     * Don't use ANSI-format function declarations without #ifdef
53042 +       CK_ANSIC, and always provide an #else for the non-ANSI case.
53043 +     * Use the Kermit _PROTOTYP() macro for declaring function prototypes;
53044 +       it works in both the ANSI and non-ANSI cases.
53045 +     * Don't depend on any other ANSI preprocessor features like "pasting"
53046 +       -- they are often missing or nonoperational.
53047 +     * Don't assume any C++ syntax or semantics.
53048 +     * Don't use // as a comment introducer. C is not C++.
53049 +     * Don't declare a string as "char foo[]" in one module and "extern
53050 +       char * foo" in another, or vice-versa: this causes core dumps.
53051 +     * With compiler makers falling all over themselves trying to outdo
53052 +       each other in ANSI strictness, it has become increasingly necessary
53053 +       to cast EVERYTHING. This is increasingly true for char vs unsigned
53054 +       char. We need to use unsigned chars if we want to deal with 8-bit
53055 +       character sets, but most character- and string-oriented APIs want
53056 +       (signed) char arguments, so explicit casts are necessary. It would
53057 +       be nice if every compiler had a -funsigned-char option (as gcc
53058 +       does), but they don't.
53059 +     * a[x], where x is an unsigned char, can produce a wild memory
53060 +       reference if x, when promoted to an int, becomes negative. Cast it
53061 +       to (unsigned), even though it ALREADY IS unsigned.
53062 +     * Be careful how you declare functions that have char or long
53063 +       arguments; for ANSI compilers you MUST use ANSI declarations to
53064 +       avoid promotion problems, but you can't use ANSI declarations with
53065 +       non-ANSI compilers. Thus declarations of such functions must be
53066 +       hideously entwined in #ifdefs. Example: latter:
53067 +  int                          /*  Put character in server command buffer  */
53068 +  #ifdef CK_ANSIC
53069 +  putsrv(char c)
53070 +  #else
53071 +  putsrv(c) char c;
53072 +  #endif /* CK_ANSIC */
53073 +  /* putsrv */ {
53074 +      *srvptr++ = c;
53075 +      *srvptr = '\0';           /* Make sure buffer is null-terminated */
53076 +      return(0);
53077 +  }
53078 +
53079 +     * Be careful how you return characters from functions that return int
53080 +       values -- "getc-like functions" -- in the ANSI world. Unless you
53081 +       explicitly cast the return value to (unsigned), it is likely to be
53082 +       "promoted" to an int and have its sign extended.
53083 +     * At least one compiler (the one on DEC OSF/1 1.3) treats "/*" and
53084 +       "*/" within string constants as comment begin and end. No amount of
53085 +       #ifdefs will get around this one. You simply can't put these
53086 +       sequences in a string constant, e.g. "/usr/local/doc/*.*".
53087 +     * Avoid putting multiple macro references on a single line, e.g.:
53088 +  putchar(BS); putchar(SP); putchar(BS)
53089 +
53090 +   This overflows the CPP output buffer of more than a few C preprocessors
53091 +   (this happened, for example, with SunOS 4.1 cc, which evidently has a
53092 +   1K macro expansion buffer).
53093 +
53094 +   C-Kermit needs constant adjustment to new OS and compiler releases.
53095 +   Every new OS release shuffles header files or their contents, or
53096 +   prototypes, or data types, or levels of ANSI strictness, etc. Every
53097 +   time you make an adjustment to remove a new compilation error, BE VERY
53098 +   CAREFUL to #ifdef it on a symbol unique to the new configuration so
53099 +   that the previous configuration (and all other configurations on all
53100 +   other platforms) remain as before.
53101 +
53102 +   Assume nothing. Don't assume header files are where they are supposed
53103 +   to be, that they contain what you think they contain, that they define
53104 +   specific symbols to have certain values -- or define them at all! Don't
53105 +   assume system header files protect themselves against multiple
53106 +   inclusion. Don't assume that particular system or library calls are
53107 +   available, or that the arguments are what you think they are -- order,
53108 +   data type, passed by reference vs value, etc. Be conservative when
53109 +   attempting to write portable code. Avoid all advanced features.
53110 +
53111 +   If you see something that does not make sense, don't assume it's a
53112 +   mistake -- it might be there for a reason, and changing it or removing
53113 +   is likely to cause compilation, linking, or runtime failures sometime,
53114 +   somewhere. Some huge percentage of the code, especially in the
53115 +   platform-dependent modules, is workarounds for compiler, linker, or API
53116 +   bugs.
53117 +
53118 +   But finally... feel free to violate any or all of these rules in
53119 +   platform-specific modules for environments in which the rules are
53120 +   certain not to apply. For example, in VMS-specific code, it is OK to
53121 +   use #if, because VAX C, DEC C, and VMS GCC all support it.
53122 +
53123 +   [ [39]Contents ] [ [40]C-Kermit ] [ [41]Kermit Home ]
53124 +
53125 +3.1. Memory Leaks
53126 +
53127 +   The C language and standard C library are notoriously inadequate and
53128 +   unsafe. Strings are arrays of characters, usually referenced through
53129 +   pointers. There is no native string datatype. Buffers are fixed size,
53130 +   and C provides no runtime bounds checking, thus allowing overwriting of
53131 +   other data or even program code. With the popularization of the
53132 +   Internet, the "buffer exploit" has become a preferred method for
53133 +   hackers to hijack privileged programs; long data strings are fed to a
53134 +   program in hopes that it uses unsafe C library calls such as strcpy()
53135 +   or sprintf() to copy strings into automatic arrays, thus overwriting
53136 +   the call stack, and therefore the routine's return address. When such a
53137 +   hole is discovered, a "string" can be constructed that contains machine
53138 +   code to hijack the program's privileges and penetrate the system.
53139 +
53140 +   This problem is partially addressed by the strn...() routines, which
53141 +   should always be used in preference to their str...() equivalents
53142 +   (except when the copy operation has already been prechecked, or there
53143 +   is a good reason for not using them, e.g. the sometimes undesirable
53144 +   side effect of strncpy() zeroing the remainder of the buffer). The most
53145 +   gaping whole, however, is sprintf(), which performs no length checking
53146 +   on its destination buffer, and is not easy to replace. Although
53147 +   snprintf() routines are starting to appear, they are not yet
53148 +   widespread, and certainly not universal, nor are they especially
53149 +   portable, or even full-featured.
53150 +
53151 +   For these reasons, we have started to build up our own little library
53152 +   of C Library replacements, ckclib.[ch]. These are safe and highly
53153 +   portable primitives for memory management and string manipulation, such
53154 +   as:
53155 +
53156 +   ckstrncpy()
53157 +          Like strncpy but returns a useful value, doesn't zero buffer.
53158 +
53159 +   ckitoa()
53160 +          Opposite of atoi()
53161 +
53162 +   ckltoa()
53163 +          Opposite of atol()
53164 +
53165 +   ckctoa()
53166 +          Returns character as string
53167 +
53168 +   ckmakmsg()
53169 +          Used with ck?to?() as a safe sprintf() replacement for up to 4
53170 +          items
53171 +
53172 +   ckmakxmsg()
53173 +          Like ckmakmsg() but accepts up to 12 items
53174 +
53175 +   More about library functions in [42]Section 4.A.
53176 +
53177 +   [ [43]Contents ] [ [44]C-Kermit ] [ [45]Kermit Home ]
53178 +
53179 +3.2. The "char" vs "unsigned char" Dilemma
53180 +
53181 +   This is one of the most aggravating and vexing characteristics of the C
53182 +   language. By design, chars (and char *'s) are SIGNED. But in the modern
53183 +   era, however, we need to process characters that can have (or include)
53184 +   8-bit values, as in the ISO Latin-1, IBM CP 850, or UTF-8 character
53185 +   sets, so this data must be treated as unsigned. But some C compilers
53186 +   (such as those based on the Bell UNIX V7 compiler) do not support
53187 +   "unsigned char" as a data type. Therefore we have the macro or typedef
53188 +   CHAR, which we use when we need chars to be unsigned, but which,
53189 +   unfortunately, resolves itself to "char" on those compilers that don't
53190 +   support "unsigned char". AND SO... We have to do a lot of fiddling at
53191 +   runtime to avoid sign extension and so forth.
53192 +
53193 +   Some modern compilers (e.g. IBM, DEC, Microsoft) have options that say
53194 +   "make all chars be unsigned" (e.g. GCC "-funsigned-char") and we use
53195 +   them when they are available. Other compilers don't have this option,
53196 +   and at the same time, are becoming increasingly strict about type
53197 +   mismatches, and spew out torrents of warnings when we use a CHAR where
53198 +   a char is expected, or vice versa. We fix these one by one using casts,
53199 +   and the code becomes increasingly ugly. But there remains a serious
53200 +   problem, namely that certain library and kernel functions have
53201 +   arguments that are declared as signed chars (or pointers to them),
53202 +   whereas our character data is unsigned. Fine, we can can use casts here
53203 +   too -- but who knows what happens inside these routines.
53204 +
53205 +   [ [46]Contents ] [ [47]C-Kermit ] [ [48]Kermit Home ]
53206 +
53207 +4. MODULES
53208 +
53209 +   When C-Kermit is on the far end of a connection, it is said to be in
53210 +   remote mode. When C-Kermit has made a connection to another computer,
53211 +   it is in local mode. (If C-Kermit is "in the middle" of a multihop
53212 +   connection, it is still in local mode.)
53213 +
53214 +   On another axis, C-Kermit can be in any of several major states:
53215 +
53216 +   Command State
53217 +          Reading and writing from the job's controlling terminal or
53218 +          "console". In this mode, all i/o is handled by the Group E
53219 +          conxxx() (console i/o) routines.
53220 +
53221 +   Protocol State
53222 +          Reading and writing from the communicatons device. In this mode,
53223 +          all i/o is handled by the Group E ttxxx() (terminal i/o)
53224 +          routines.
53225 +
53226 +   Terminal State
53227 +          Reading from the keyboard with conxxx() routines and writing to
53228 +          the communications device with ttxxx() routines AND vice-versa.
53229 +
53230 +   When in local mode, the console and communications device are distinct.
53231 +   During file transfer, Kermit may put up a file-transfer display on the
53232 +   console and sample the console for interruption signals.
53233 +
53234 +   When in remote mode, the console and communications device are the
53235 +   same, and therefore there can be no file-transfer display on the
53236 +   console or interruptions from it (except for "in-band" interruptions
53237 +   such as ^C^C^C).
53238 +
53239 +   [ [49]Contents ] [ [50]C-Kermit ] [ [51]Kermit Home ]
53240 +
53241 +4.A. Group A: Library Functions
53242 +
53243 +   Library functions, strictly portable, can be used by all modules on all
53244 +   platforms: [52]ckclib.h, [53]ckclib.c.
53245 +
53246 +   (To be filled in... For now, see [54]Section 3.1 and the comments in
53247 +   ckclib.c.)
53248 +
53249 +   [ [55]Contents ] [ [56]C-Kermit ] [ [57]Kermit Home ]
53250 +
53251 +4.B. Group B: Kermit File Transfer
53252 +
53253 +   The Kermit protocol kernel. These files, whose names start with "ckc
53254 +   are supposed to be totally portable C, and are expected to compile
53255 +   correctly on any platform with any C compiler. "Portable" does not mean
53256 +   the same as as "ANSI" -- these modules must compile on 10- and 20-year
53257 +   old computers, with C preprocessors, compilers, and/or linkers that
53258 +   have all sorts of restrictions. The Group B modules do not include any
53259 +   header files other than those that come with Kermit itself. They do not
53260 +   contain any library calls except from the standard C library (e.g.
53261 +   printf()). They most certainly do not contain any system calls. Files:
53262 +
53263 +   [58]ckcsym.h
53264 +          For use by C compilers that don't allow -D on the command line.
53265 +
53266 +   [59]ckcasc.h
53267 +          ASCII character symbol definitions.
53268 +
53269 +   [60]ckcsig.h
53270 +          System-independent signal-handling definitions and prototypes.
53271 +
53272 +   [61]ckcdeb.h
53273 +          Originally, debugging definitions. Now this file also contains
53274 +          all definitions and prototypes that are shared by all modules in
53275 +          all groups.
53276 +
53277 +   [62]ckcker.h
53278 +          Kermit protocol symbol definitions.
53279 +
53280 +   [63]ckcxla.h
53281 +          Character-set-related symbol definitions (see next section).
53282 +
53283 +   [64]ckcmai.c
53284 +          The main program. This module contains the declarations of all
53285 +          the protocol-related global variables that are shared among the
53286 +          other modules.
53287 +
53288 +   [65]ckcpro.w
53289 +          The protocol module itself, written in "wart", a lex-like
53290 +          preprocessor that is distributed with Kermit under the name
53291 +          CKWART.C.
53292 +
53293 +   [66]ckcfns.c, [67]ckcfn2.c, [68]ckcfn3.c
53294 +          The protocol support functions used by the protocol module.
53295 +
53296 +   [69]Group B modules may call upon functions from [70]Group E, but not
53297 +   from [71]Group D modules (with the single exception that the main
53298 +   program invokes the user interface, which is in Group D). (This last
53299 +   assertion is really only a conjecture.)
53300 +
53301 +   [ [72]Contents ] [ [73]C-Kermit ] [ [74]Kermit Home ]
53302 +
53303 +4.C. Group C: Character-Set Conversion
53304 +
53305 +   Character set translation tables and functions. Used by the [75]Group
53306 +   B, protocol modules, but may be specific to different computers. (So
53307 +   far, all character character sets supported by C-Kermit are supported
53308 +   in [76]ckuxla.c and [77]ckuxla.h, including Macintosh and IBM character
53309 +   sets). These modules should be completely portable, and not rely on any
53310 +   kind of system or library services.
53311 +
53312 +   [78]ckcxla.h
53313 +          Character-set definitions usable by all versions of C-Kermit.
53314 +
53315 +   ck?xla.h
53316 +          Character-set definitions for computer "?", e.g. [79]ckuxla.h
53317 +          for UNIX, [80]ckmxla.h for Macintosh.
53318 +
53319 +   [81]ck?xla
53320 +          Character-set translation tables and functions for computer "?",
53321 +          For example, CKUXLA.C for UNIX, CKMXLA.C for Macintosh. So far,
53322 +          these are the only two such modules. The UNIX module is used for
53323 +          all versions of C-Kermit except the Macintosh version.
53324 +
53325 +   [82]ckcuni.h
53326 +          Unicode definitions
53327 +
53328 +   [83]ckcuni.c
53329 +          Unicode module
53330 +
53331 +   Here's how to add a new file character set in the original (non-Unicode
53332 +   modules). Assuming it is based on the Roman (Latin) alphabet. Let's
53333 +   call it "Barbarian". First, in ck?xla.h, add a definition for FC_BARBA
53334 +   (8 chars maximum length) and increase MAXFCSETS by 1. Then, in
53335 +   ck?xla.c:
53336 +
53337 +     * Add a barbarian entry into the fcsinfo array.
53338 +     * Add a "barbarian" entry to file character set keyword table,
53339 +       fcstab.
53340 +     * Add a "barbarian" entry to terminal character set keyword table,
53341 +       ttcstab.
53342 +     * Add a translation table from Latin-1 to barbarian: yl1ba[].
53343 +     * Add a translation table from barbarian to Latin-1: ybal1[].
53344 +     * Add a translation function from Barbarian to ASCII: xbaas().
53345 +     * Add a translation function from Barbarian to Latin-1: xbal1().
53346 +     * Add a translation function from Latin-1 to Barbarian: xl1ba().
53347 +     * etc etc for each transfer character set...
53348 +     * Add translation function pointers to the xls and xlr tables.
53349 +
53350 +   Other translations involving Barbarian (e.g. from Barbarian to
53351 +   Latin-Cyrillic) are performed through these tables and functions. See
53352 +   ckuxla.h and ckuxla.c for extensive examples.
53353 +
53354 +   To add a new Transfer Character Set, e.g. Latin Alphabet 9 (for the
53355 +   Euro symbol), again in the "old" character-set modules:
53356 +
53357 +   In ckcxla.h:
53358 +
53359 +          + Add a TC_xxxx definition and increase MAXTCSETS accordingly.
53360 +
53361 +   In ck?xla.h (since any transfer charset is also a file charset):
53362 +
53363 +          + Add an FC_xxxx definition and increase MAXFCSETS accordingly.
53364 +
53365 +   In ck?xla.c:
53366 +
53367 +          + Add a tcsinfo[] entry.
53368 +          + Make a tcstab[] keyword table entry.
53369 +          + Make an fcsinfo[] table entry.
53370 +          + Make an fcstab[] keyword table entry.
53371 +          + Make a tcstab[] keyword table entry.
53372 +          + If necessary, make a langinfo[] table entry.
53373 +          + Make entries in the function pointer arrays.
53374 +          + Provide any needed functions.
53375 +
53376 +   As of C-Kermit 7.0, character sets are also handled in parallel by the
53377 +   new (and very large) Unicode module, ckcuni.[ch]. Eventually we should
53378 +   phase out the old way, described just above, and operate entirely in
53379 +   (and through) Unicode. The advantages are many. The disadvantages are
53380 +   size and performance. To add a character to the Unicode modules:
53381 +
53382 +   In ckcuni.h:
53383 +
53384 +          + (To be filled in...)
53385 +
53386 +   In ckcuni.c:
53387 +
53388 +          + (To be filled in...)
53389 +
53390 +   [ [84]Contents ] [ [85]C-Kermit ] [ [86]Kermit Home ]
53391 +
53392 +4.D. Group D: User Interface
53393 +
53394 +   This is the code that communicates with the user, gets her commands,
53395 +   informs her of the results. It may be command-line oriented,
53396 +   interactive prompting dialog, menus and arrow keys, windows and mice,
53397 +   speech recognition, telepathy, etc. The one provided is command-and
53398 +   prompt, with the ability to read commands from various sources: the
53399 +   console keyboard, a file, or a macro definition. The user interface has
53400 +   three major functions:
53401 +
53402 +    1. Sets the parameters for the file transfer and then starts it. This
53403 +       is done by setting certain (many) global variables, such as the
53404 +       protocol machine start state, the file specification, file type,
53405 +       communication parameters, packet length, window size, character
53406 +       set, etc.
53407 +    2. Displays messages on the user's screen during the file transfer,
53408 +       using the screen() function, which is called by the group-1
53409 +       modules.
53410 +    3. Executes any commands directly that do not require Kermit protocol,
53411 +       such as the CONNECT command, local file management commands,
53412 +       parameter-setting commands, FTP client commands, etc.
53413 +
53414 +   If you plan to imbed the [87]Group B, files into a program with a
53415 +   different user interface, your interface must supply an appropriate
53416 +   screen() function, plus a couple related ones like chkint() and
53417 +   intmsg() for handling keyboard (or mouse, etc) interruptions during
53418 +   file transfer. The best way to find out about this is to link all the
53419 +   C-Kermit modules together except the ckuu*.o and ckucon.o modules, and
53420 +   see which missing symbols turn up.
53421 +
53422 +   C-Kermit's character-oriented user interface (as opposed to the
53423 +   Macintosh version's graphical user interface) consists of the following
53424 +   modules. C-Kermit can be built with an interactive command parser, a
53425 +   command-line-option-only parser, a graphical user interface, or any
53426 +   combination, and it can even be built with no user interface at all (in
53427 +   which case it runs as a remote-mode Kermit server).
53428 +
53429 +   [88]ckucmd.h
53430 +   [89]ckucmd.c
53431 +          The command parsing primitives used by the interactive command
53432 +          parser to parse keywords, numbers, filenames, etc, and to give
53433 +          help, complete fields, supply defaults, allow abbreviations and
53434 +          editing, etc. This package is totally independent of Kermit, but
53435 +          does depend on the [90]Group E functions.
53436 +
53437 +   [91]ckuusr.h
53438 +          Definitions of symbols used in Kermit's commands.
53439 +
53440 +   ckuus*.c
53441 +          Kermit's interactive command parser, including the script
53442 +          programming language: [92]ckuusr.c (includes top-level keyword
53443 +          tables); [93]ckuus2.c (HELP command text); [94]ckuus3.c (most of
53444 +          the SET command); [95]ckuus4.c (includes variables and
53445 +          functions); ckuus[567].c (miscellaneous);
53446 +
53447 +   [96]ckuusy.c
53448 +          The command-line-option parser.
53449 +
53450 +   [97]ckuusx.c
53451 +          User interface functions common to both the interactive and
53452 +          command-line parsers.
53453 +
53454 +   [98]ckuver.h
53455 +          Version heralds for different implementations.
53456 +
53457 +   [99]ckuscr.c
53458 +          The (old, uucp-like) SCRIPT command
53459 +
53460 +   [100]ckudia.c
53461 +          The DIAL command. Includes specific knowledge of many types of
53462 +          modems.
53463 +
53464 +   Note that none of the above files is actually Unix-specific. Over time
53465 +   they have proven to be portable among all platforms where C-Kermit is
53466 +   built: Unix, VMS, AOS/VS, Amiga, OS-9, VOS, etc etc. Thus the third
53467 +   letter should more properly be "c", but changing it would be too
53468 +   confusing.
53469 +
53470 +   ck?con.c, ckucns.c
53471 +          The CONNECT command. Terminal connection, and in some cases
53472 +          (Macintosh, Windows) also terminal emulation. NOTE: As of
53473 +          C-Kermit 7.0, there are two different CONNECT modules for UNIX:
53474 +          [101]ckucon.c -- the traditional, portable, fork()-based version
53475 +          -- and [102]ckucns.c, a new version that uses select() rather
53476 +          than forks so it can handle encryption. ckucns.c is the
53477 +          preferred version for Unix; ckucon.c is not likely to keep pace
53478 +          with it in terms of upgrades, etc. However, since select() is
53479 +          not portable to every platform, ckucon.c will be kept
53480 +          indefinitely for those platforms that can't use ckucns.c. NOTE:
53481 +          SunLink X.25 support is available only in ckucon.c.
53482 +
53483 +   ck_*.*, ckuat*.*
53484 +          Modules having to do with authentication and encryption. Since
53485 +          the relaxation of USA export laws, they are included with the
53486 +          general source-code distribution. Secure C-Kermit binaries can
53487 +          be built using special targets in the standard makefile.
53488 +          However, secure prebuilt binaries may not be distributed.
53489 +
53490 +   For other implementations, the files may, and probably do, have
53491 +   different names. For example, the Macintosh graphical user interface
53492 +   filenames start with "ckm". Kermit 95 uses the ckucmd and ckuus*
53493 +   modules, but has its own CONNECT command modules. And so on.
53494 +
53495 +   Here is a brief description of C-Kermit's "user interface interface",
53496 +   from ckuusr.c. It is nowhere near complete; in particular, hundreds of
53497 +   global variables are shared among the many modules. These should, some
53498 +   day, be collected into classes or structures that can be passed around
53499 +   as needed; not only for purity's sake, but also to allow for multiple
53500 +   simultaneous communication sessions and or user interfaces. Our list of
53501 +   things to do is endless, and reorganizing the source is almost always
53502 +   at the bottom.
53503 +
53504 +   The ckuus*.c modules (like many of the ckc*.c modules) depend on the
53505 +   existence of C library features like fopen, fgets, feof, (f)printf,
53506 +   argv/argc, etc. Other functions that are likely to vary among operating
53507 +   systems -- like setting terminal modes or interrupts -- are invoked via
53508 +   calls to functions that are defined in the [103]Group E
53509 +   platform-dependent modules, ck?[ft]io.c. The command line parser
53510 +   processes any arguments found on the command line, as passed to main()
53511 +   via argv/argc. The interactive parser uses the facilities of the cmd
53512 +   package (developed for this program, but, in theory, usable by any
53513 +   program). Any command parser may be substituted for this one. The only
53514 +   requirements for the Kermit command parser are these:
53515 +
53516 +    1. Set parameters via global variables like duplex, speed, ttname,
53517 +       etc. See [104]ckcmai.c for the declarations and descriptions of
53518 +       these variables.
53519 +    2. If a command can be executed without the use of Kermit protocol,
53520 +       then execute the command directly and set the sstate (start state)
53521 +       variable to 0. Examples include SET commands, local directory
53522 +       listings, the CONNECT command.
53523 +    3. If a command requires the Kermit protocol, set the following
53524 +       variables:
53525 + sstate                             string data
53526 +   'x' (enter server mode)            (none)
53527 +   'r' (send a 'get' command)         cmarg, cmarg2
53528 +   'v' (enter receive mode)           cmarg2
53529 +   'g' (send a generic command)       cmarg
53530 +   's' (send files)                   nfils, cmarg & cmarg2 OR cmlist
53531 +   'c' (send a remote host command)   cmarg
53532 +
53533 +
53534 +       cmlist is an array of pointers to strings.
53535 +       cmarg, cmarg2 are pointers to strings.
53536 +       nfils is an integer (hmmm, probably should be an unsigned long).
53537 +
53538 +        cmarg can be:
53539 +                A filename string (possibly wild), or:
53540 +                a pointer to a prefabricated generic command string, or:
53541 +                a pointer to a host command string.
53542 +
53543 +        cmarg2 is:
53544 +                The name to send a single file under, or:
53545 +                the name under which to store an incoming file; must not
53546 +                be wild.
53547 +                If it's the name for receiving, a null value means to
53548 +                store the file under the name it arrives with.
53549 +
53550 +        cmlist is:
53551 +                A list of nonwild filenames, such as passed via argv.
53552 +
53553 +        nfils is an integer, interpreted as follows:
53554 +                -1: filespec (possibly wild) in cmarg, must be expanded
53555 +                internally.
53556 +                0: send from stdin (standard input).
53557 +                >0: number of files to send, from cmlist.
53558 +
53559 +   The screen() function is used to update the screen during file
53560 +   transfer. The tlog() function writes to a transaction log (if TLOG is
53561 +   defined). The debug() function writes to a debugging log (if DEBUG is
53562 +   defined). The intmsg() and chkint() functions provide the user i/o for
53563 +   interrupting file transfers.
53564 +
53565 +   [ [105]Contents ] [ [106]C-Kermit ] [ [107]Kermit Home ]
53566 +
53567 +4.E. Group E: Platform-Dependent I/O
53568 +
53569 +   Platform-dependent function definitions. All the Kermit modules,
53570 +   including the command package, call upon these functions, which are
53571 +   designed to provide system-independent primitives for controlling and
53572 +   manipulating devices and files. For Unix, these functions are defined
53573 +   in the files [108]ckufio.c (files), [109]ckutio.c (communications), and
53574 +   [110]ckusig.c (signal handling).
53575 +
53576 +   For VMS, the files are [111]ckvfio.c, ckvtio.c, and [112]ckusig.c (VMS
53577 +   can use the same signal handling routines as Unix). It doesn't really
53578 +   matter what the files are called, except for Kermit distribution
53579 +   purposes (grouping related files together alphabetically), only that
53580 +   each function is provided with the name indicated, observes the same
53581 +   calling and return conventions, and has the same type.
53582 +
53583 +   The Group E modules contain both functions and global variables that
53584 +   are accessed by modules in the other groups. These are now described.
53585 +
53586 +   (By the way, I got this list by linking all the C-Kermit modules
53587 +   together except ckutio and ckufio. These are the symbols that ld
53588 +   reported as undefined. But that was a long time ago, probably circa
53589 +   Version 6.)
53590 +
53591 +4.E.1. Global Variables
53592 +
53593 +   char *DELCMD;
53594 +          Pointer to string containing command for deleting files.
53595 +          Example: char *DELCMD = "rm -f "; (UNIX)
53596 +          Example: char *DELCMD = "delete "; (VMS)
53597 +          Note trailing space. Filename is concatenated to end of this
53598 +          string. NOTE: DELCMD is used only in versions that do not
53599 +          provide their own built-in DELETE command.
53600 +
53601 +   char *DIRCMD;
53602 +          Pointer to string containing command for listing files when a
53603 +          filespec is given.
53604 +          Example: char *DIRCMD = "/bin/ls -l "; (UNIX)
53605 +          Example: char *DIRCMD = "directory "; (VMS)
53606 +          Note trailing space. Filename is concatenated to end of this
53607 +          string. NOTE: DIRCMD is used only in versions that do not
53608 +          provide their own built-in DIRECTORY command.
53609 +
53610 +   char *DIRCM2;
53611 +          Pointer to string containing command for listing files when a
53612 +          filespec is not given. (currently not used, handled in another
53613 +          way.)
53614 +          Example: char *DIRCMD2 = "/bin/ls -ld *";
53615 +          NOTE: DIRCMD2 is used only in versions that do not provide their
53616 +          own built-in DIRECTORY command.
53617 +
53618 +   char *PWDCMD;
53619 +          Pointer to string containing command to display current
53620 +          directory.
53621 +          Example: char *PWDCMD = "pwd ";
53622 +          NOTE: PWDCMD is used only in versions that do not provide their
53623 +          own built-in PWD command.
53624 +
53625 +   char *SPACMD;
53626 +          Pointer to command to display free disk space in current
53627 +          device/directory.
53628 +          Example: char *SPACMD = "df .";
53629 +          NOTE: SPACMD is used only in versions that do not provide their
53630 +          own built-in SPACE command.
53631 +
53632 +   char *SPACM2;
53633 +          Pointer to command to display free disk space in another
53634 +          device/directory.
53635 +          Example: char *SPACM2 = "df ";
53636 +          Note trailing space. Device or directory name is added to this
53637 +          string. NOTE: SPACMD2 is used only in versions that do not
53638 +          provide their own built-in SPACE command.
53639 +
53640 +   char *TYPCMD;
53641 +          Pointer to command for displaying the contents of a file.
53642 +          Example: char *TYPCMD = "cat ";
53643 +          Note trailing space. Device or directory name is added to this
53644 +          string. NOTE: TYPCMD is used only in versions that do not
53645 +          provide their own built-in TYPE command.
53646 +
53647 +   char *WHOCMD;
53648 +          Pointer to command for displaying logged-in users.
53649 +          Example: char *WHOCMD = "who ";
53650 +          Note trailing space. Specific user name may be added to this
53651 +          string.
53652 +
53653 +   int backgrd = 0;
53654 +          Flag for whether program is running in foreground (0) or
53655 +          background (nonzero). Background operation implies that screen
53656 +          output should not be done and that all errors should be fatal.
53657 +
53658 +   int ckxech;
53659 +          Flag for who is to echo console typein:
53660 +          1: The program (system is not echoing).
53661 +          0: The OS, front end, terminal, etc (not this program).
53662 +
53663 +   char *ckxsys;
53664 +          Pointer to string that names the computer and operating system.
53665 +          Example: char *ckxsys = " NeXT Mach 1.0";
53666 +          Tells what computer system ckxv applies to. In UNIX Kermit, this
53667 +          variable is also used to print the program herald, and in the
53668 +          SHOW VERSION command.
53669 +
53670 +   char *ckxv;
53671 +          Pointer to version/edit info of ck?tio.c module.
53672 +          Example: char *ckxv = "UNIX Communications Support, 6.0.169, 6
53673 +          Sep 96";
53674 +          Used by SHOW VERSION command.
53675 +
53676 +   char *ckzsys;
53677 +          Like ckxsys, but briefer.
53678 +          Example: char *ckzsys = " 4.3 BSD";
53679 +          Tells what platform ckzv applies to. Used by the SHOW VERSION
53680 +          command.
53681 +
53682 +   char *ckzv;
53683 +          Pointer to version/edit info of ck?fio.c module.
53684 +          Example: char *ckzv = "UNIX File support, 6.0.113, 6 Sep 96";
53685 +          Used by SHOW VERSION command.
53686 +
53687 +   int dfflow;
53688 +          Default flow control. 0 = none, 1 = Xon/Xoff, ... (see FLO_xxx
53689 +          symbols in ckcdeb.h)
53690 +          Set by Group E module. Used by [113]ckcmai.c to initialize flow
53691 +          control variable.
53692 +
53693 +   int dfloc;
53694 +          Default location. 0 = remote, 1 = local. Set by Group E module.
53695 +          Used by ckcmai.c to initialize local variable. Used in various
53696 +          places in the user interface.
53697 +
53698 +   int dfprty;
53699 +          Default parity. 0 = none, 'e' = even, 'o' = odd, 'm' = mark, 's'
53700 +          = space. Set by Group E module. Used by ckcmai.c to initialize
53701 +          parity variable.
53702 +
53703 +   char *dftty;
53704 +          Default communication device. Set by Group E module. Used in
53705 +          many places. This variable should be initialized the the symbol
53706 +          CTTNAM, which is defined in ckcdeb.h, e.g. as "/dev/tty" for
53707 +          UNIX, "TT:" for VMS, etc. Example: char *dftty = CTTNAM;
53708 +
53709 +   char *mtchs[];
53710 +          Array of string pointers to filenames that matched the most
53711 +          recent wildcard match, i.e. the most recent call to zxpand().
53712 +          Used (at least) by command parsing package for partial filename
53713 +          completion.
53714 +
53715 +   int tilde_expand;
53716 +          Flag for whether to attempt to expand leading tildes in
53717 +          directory names (used in UNIX only, and then only when the
53718 +          symbol DTILDE is defined.
53719 +
53720 +   int ttnproto;
53721 +          The protocol being used to communicate over a network device.
53722 +          Values are defined in ckcnet.h. Example: NP_TELNET is network
53723 +          protocol "telnet".
53724 +
53725 +   int maxnam;
53726 +          The maximum length for a filename, exclusive of any device or
53727 +          directory information, in the format of the host operating
53728 +          system.
53729 +
53730 +   int maxpath;
53731 +          The maximum length for a fully specified filename, including
53732 +          device designator, directory name, network node name, etc, in
53733 +          the format of the host operating system, and including all
53734 +          punctuation.
53735 +
53736 +   int ttyfd;
53737 +          File descriptor of the communication device. -1 if there is no
53738 +          open or usable connection, including when C-Kermit is in remote
53739 +          mode. Since this is not implemented everywhere, references to it
53740 +          are in #ifdef CK_TTYFD..#endif.
53741 +
53742 +   [ [114]Contents ] [ [115]C-Kermit ] [ [116]Kermit Home ]
53743 +
53744 +4.E.2. Functions
53745 +
53746 +   These are divided into three categories: file-related functions (B.1),
53747 +   communication functions (B.2), and miscellaneous functions (B.3).
53748 +
53749 +4.E.2.1. File-Related Functions
53750 +
53751 +   In most implementations, these are collected together into a module
53752 +   called ck?fio.c, where ? = "u" ([117]ckutio.c for Unix), "v"
53753 +   ([118]ckvtio.c for VMS), [119]etc. To be totally platform-independent,
53754 +   C-Kermit maintains its own file numbers, and provides the functions
53755 +   described in this section to deal with the files associated with them.
53756 +   The file numbers are referred to symbolically, and are defined as
53757 +   follows in ckcker.h:
53758 +
53759 +  #define ZCTERM      0           /* Console terminal */
53760 +  #define ZSTDIO      1           /* Standard input/output */
53761 +  #define ZIFILE      2           /* Current input file for SEND command */
53762 +  #define ZOFILE      3           /* Current output file for RECEIVE command */
53763 +  #define ZDFILE      4           /* Current debugging log file */
53764 +  #define ZTFILE      5           /* Current transaction log file */
53765 +  #define ZPFILE      6           /* Current packet log file */
53766 +  #define ZSFILE      7           /* Current session log file */
53767 +  #define ZSYSFN      8           /* Input from a system function (pipe) */
53768 +  #define ZRFILE      9           /* Local file for READ command */  (NEW)
53769 +  #define ZWFILE     10           /* Local file for WRITE command */ (NEW)
53770 +  #define ZMFILE     11           /* Auxilliary file for internal use */ (NEW)
53771 +  #define ZNFILS     12           /* How many defined file numbers */
53772 +
53773 +   In the descriptions below, fn refers to a filename, and n refers to one
53774 +   of these file numbers. Functions are of type int unless otherwise
53775 +   noted, and are listed mostly alphabetically.
53776 +
53777 +   int
53778 +          chkfn(n) int n;
53779 +          Checks the file number n. Returns:
53780 +           -1: File number n is out of range
53781 +            0: n is in range, but file is not open
53782 +            1: n in range and file is open
53783 +
53784 +   int
53785 +          iswild(filspec) char *filespec;
53786 +          Checks if the file specification is "wild", i.e. contains
53787 +          metacharacters or other notations intended to match multiple
53788 +          filenames. Returns:
53789 +            0: not wild
53790 +            1: wild.
53791 +
53792 +   int
53793 +          isdir(string) char *string;
53794 +          Checks if the string is the name of an existing directory. The
53795 +          idea is to check whether the string can be "cd'd" to, so in some
53796 +          cases (e.g. DOS) it might also indicate any file structured
53797 +          device, such as a disk drive (like A:). Other nonzero returns
53798 +          indicate system-dependent information; e.g. in VMS
53799 +          isdir("[.FOO]") returns 1 but isdir("FOO.DIR;1") returns 2 to
53800 +          indicate the directory-file name is in a format that needs
53801 +          conversion before it can be combined with a filename. Returns:
53802 +            0: not a directory (including any kind of error)
53803 +            1: it is an existing directory
53804 +
53805 +   char *
53806 +          zfcdat(name) char *name;
53807 +          Returns modification (preferably, otherwise creation) date/time
53808 +          of file whose name is given in the argument string. Return value
53809 +          is a pointer to a string of the form yyyymmdd hh:mm:ss, for
53810 +          example 19931231 23:59:59, which represents the local time (no
53811 +          timezone or daylight savings time finagling required). Returns
53812 +          the null string ("") on failure. The text pointed to by the
53813 +          string pointer might be in a static buffer, and so should be
53814 +          copied to a safe place by the caller before any subsequent calls
53815 +          to this function.
53816 +
53817 +   struct zfnfp *
53818 +          zfnqfp(fn, buflen, buf) char * fn; int buflen; char * buf;
53819 +          Given the filename fn, the corresponding fully qualified,
53820 +          absolute filename is placed into the buffer buf, whose length is
53821 +          buflen. On failure returns a NULL pointer. On success returns a
53822 +          pointer to a struct zfnfp containing pointers to the full
53823 +          pathname and to just the filename, and an int giving the length
53824 +          of the full pathname. All references to this function in
53825 +          mainline code must be protected by #ifdef ZFNQFP..#endif,
53826 +          because it is not present in all of the ck*fio.c modules. So if
53827 +          you implement this function in a version that did not have it
53828 +          before, be sure to add #define ZFNQFP in the appropriate spot in
53829 +          ckcdeb.h or in the build-procedure CFLAGS.
53830 +
53831 +   int
53832 +          zcmpfn(s1,s2) char * s2, * s2;
53833 +          Compares two filenames to see if they refer to the same.
53834 +          Internally, the arguments can be converted to fully qualified
53835 +          pathnames, e.g. with zfnqfp(), realpath(), or somesuch. In Unix
53836 +          or other systems where symbolic links exist, the link should be
53837 +          resolved before making the comparison or looking at the inodes.
53838 +          Returns:
53839 +            0: Files are not identical.
53840 +            1: Files are identical.
53841 +
53842 +   int
53843 +          zfseek(pos) long pos;
53844 +          Positions the input pointer on the current input file to the
53845 +          given position. The pos argument is 0-based, the offset
53846 +          (distance in bytes) from beginning of the file. Needed for
53847 +          RESEND, PSEND, and other recovery operations. This function is
53848 +          not necessarily possible on all systems, e.g. record-oriented
53849 +          systems. It should only be used on binary files (i.e. files we
53850 +          are sending in binary mode) and stream-oriented file systems.
53851 +          Returns:
53852 +           -1: on failure.
53853 +            0: On success.
53854 +
53855 +   int
53856 +          zchdir(dirnam) char *dirnam;
53857 +          Changes current or default directory to the one given in dirnam.
53858 +          Returns:
53859 +            0: On failure.
53860 +            1: on success.
53861 +
53862 +   long
53863 +          zchki(fn) char *fn;
53864 +          Check to see if file with name fn is a regular, readable,
53865 +          existing file, suitable for Kermit to send -- not a directory,
53866 +          not a symbolic link, etc. Returns:
53867 +           -3: if file exists but is not accessible (e.g. read-protected);
53868 +           -2: if file exists but is not of a readable type (e.g. a
53869 +          directory);
53870 +           -1: on error (e.g. file does not exist, or fn is garbage);
53871 +          >=0: (length of file) if file exists and is readable.
53872 +          Also see isdir(), zgetfs().
53873 +
53874 +   int
53875 +          zchkpid(pid) unsigned long pid;
53876 +          Returns:
53877 +            1: If the given process ID (e.g. pid in UNIX) is valid and
53878 +          active
53879 +            0: otherwise.
53880 +
53881 +   long
53882 +          zgetfs(fn) char *fn;
53883 +          Gets the size of the given file, regardless of accessibility.
53884 +          Used for directory listings. Unlike zchki(), should return the
53885 +          size of any kind of file, even a directory. zgetfs() also should
53886 +          serve as a mini "get file info" function that can be used until
53887 +          we design a better one, by also setting some global variables:
53888 +            int zgfs_link   = 1/0 = file is (not) a symbolic link.
53889 +            int zgfs_dir    = 1/0 = file is (not) a directory.
53890 +            char linkname[] = if zgfs_link != 0, name of file link points
53891 +          to.
53892 +          Returns:
53893 +           -1: on error (e.g. file does not exist, or fn is garbage);
53894 +          >=0: (length of file) if file exists and is readable.
53895 +
53896 +   int
53897 +          zchko(fn) char *fn;
53898 +          Checks to see if a file of the given name can be created.
53899 +          Returns:
53900 +           -1: if file cannot be created, or on any kind of error.
53901 +            0: if file can be created.
53902 +
53903 +   int
53904 +          zchkspa(fn,len) char *f; long len;
53905 +          Checks to see if there is sufficient space to store the file
53906 +          named fn, which is len bytes long. If you can't write a function
53907 +          to do this, then just make a dummy that always returns 1; higher
53908 +          level code will recover from disk-full errors. The receiving
53909 +          Kermit uses this function to refuse an incoming file based on
53910 +          its size, via the attribute mechanism. Returns:
53911 +           -1: on error.
53912 +            0: if there is not enough space.
53913 +            1: if there is enough space.
53914 +
53915 +   int
53916 +          zchin(n,c) int n; int *c;
53917 +          Gets a character from file number n, return it in c (call with
53918 +          &c). Returns:
53919 +           -1: on failure, including EOF.
53920 +            0: on success with character in c.
53921 +
53922 +   int
53923 +          zchout(n,c) int n; char c;
53924 +          Writes the character c to file number n. Returns:
53925 +           -1: on error.
53926 +            0: on success.
53927 +
53928 +   int
53929 +          zclose(n) int n;
53930 +          Closes file number n. Returns:
53931 +           -1: on error.
53932 +            1: on success.
53933 +
53934 +   int
53935 +          zdelet(fn) char *name;
53936 +          Attempts to delete (remove, erase) the named file. Returns:
53937 +           -1: on error.
53938 +            1: if file was deleted successfully.
53939 +
53940 +   char *
53941 +          zgperm(char * f)
53942 +          Returns a pointer to the system-dependent numeric
53943 +          permissions/protection string for file f, or NULL upon failure.
53944 +          Used if CK_PERMS is defined.
53945 +
53946 +   char *
53947 +          ziperm(char * f)
53948 +          Returns a pointer to the system-dependent symbolic
53949 +          permissions/protection string for file f, or NULL upon failure.
53950 +          Used if CK_PERMS is defined. Example: In UNIX zgperm(f) might
53951 +          return "100770", but ziperm() might return "-rwxrwx---". In VMS,
53952 +          zgperm() would return a hexadecimal string, but ziperm() would
53953 +          return something like "(RWED,RWED,RE,)".
53954 +
53955 +   char *
53956 +          zgtdir()
53957 +          Returns a pointer to the name of the current directory, folder,
53958 +          etc, or a NULL pointer if the current directory cannot be
53959 +          determined. If possible, the directory specification should be
53960 +          (a) fully specified, e.g. as a complete pathname, and (b) be
53961 +          suitable for appending a filename. Thus, for example, Unix
53962 +          directory names should end with '/'. VMS directory names should
53963 +          look like DEV:[NAME] (rather than, say, NAME.DIR;1).
53964 +
53965 +   char *
53966 +          zhome()
53967 +          Returns a pointer to a string containing the user's home
53968 +          directory, or NULL upon error. Should be formatted like zgtdir()
53969 +          (q.v.).
53970 +
53971 +   int
53972 +          zinfill()
53973 +          Fill buffer from input file. This function is used by the macro
53974 +          zminchar(), which is defined in ckcker.h. zminchar() manages its
53975 +          own buffer, and calls zinfill() to fill it whenever it becomes
53976 +          empty. It is used only for sending files, and reads characters
53977 +          only from file number ZIFILE. zinfill() returns -1 upon end of
53978 +          file, -2 upon fatal error, and -3 upon timeout (e.g. when
53979 +          reading from a pipe); otherwise it returns the first character
53980 +          from the buffer it just read.
53981 +
53982 +   int
53983 +          zkself()
53984 +          Kills the current job, session, process, etc, logs out,
53985 +          disappears. Used by the Kermit server when it receives a BYE
53986 +          command. On failure, returns -1. On success, does not return at
53987 +          all! This function should not be called until all other steps
53988 +          have been taken to close files, etc.
53989 +
53990 +   VOID
53991 +          zstrip(fn,&fn2) char *fn1, **fn2;
53992 +          Strips device and directory, etc, from file specification fn,
53993 +          leaving only the filename (including "extension" or "filetype"
53994 +          -- the part after the dot). For example DUA0:[PROGRAMS]OOFA.C;3
53995 +          becomes OOFA.C, or /usr/fdc/oofa.c becomes oofa.c. Returns a
53996 +          pointer to result in fn2.
53997 +
53998 +   int
53999 +          zsetperm(char * file, unsigned int code)
54000 +          Set permissions of file to given system-dependent code.   0: On
54001 +          failure.
54002 +            1: on success.
54003 +
54004 +   int
54005 +          zsetroot(char * dir)
54006 +          Sets the root for the user's file access, like Unix chroot(),
54007 +          but does not require privilege. In Unix, this must be
54008 +          implemented entirely by Kermit's own file access routines.
54009 +          Returns:
54010 +            1: Success
54011 +           -1: Invalid argument
54012 +           -2:
54013 +           -3: Internal error
54014 +           -4: Access to given directory denied
54015 +           -5: New root not within old root
54016 +
54017 +   int
54018 +          zinroot(char * file)
54019 +          If no root is set (zsetroot()), returns 1.
54020 +          Otherwise, if given file is in the root, returns 1.
54021 +          Otherwise, returns 0.
54022 +
54023 +   VOID
54024 +          zltor(fn,fn2) char *fn1, *fn2;
54025 +          Local-To-Remote filename translation. OBSOLETE: replaced by
54026 +          nzltor() (q.v.). Translates the local filename fn into a format
54027 +          suitable for transmission to an arbitrary type of computer, and
54028 +          copies the result into the buffer pointed to by fn2. Translation
54029 +          may involve (a) stripping the device and/or directory/path name,
54030 +          (b) converting lowercase to uppercase, (c) removing spaces and
54031 +          strange characters, or converting them to some innocuous
54032 +          alphabetic character like X, (d) discarding or converting extra
54033 +          periods (there should not be more than one). Does its best.
54034 +          Returns no value. name2 is a pointer to a buffer, furnished by
54035 +          the caller, into which zltor() writes the resulting name. No
54036 +          length checking is done.
54037 +
54038 +   #ifdef NZLTOR
54039 +          VOID
54040 +          nzltor(fn,fn2,convert,pathnames,max) char *fn1,*fn2; int
54041 +          convert,pathnames,max;
54042 +          Replaces zltor(). This new version handles pathnames and checks
54043 +          length. fn1 and fn2 are as in zltor(). This version is called
54044 +          unconditionally for each file, rather than only when filename
54045 +          conversion is enabled. Pathnames can have the following values:
54046 +
54047 +            PATH_OFF: Pathname, if any, is to be stripped
54048 +            PATH_REL: The relative pathname is to be included
54049 +            PATH_ABS: The full pathname is to be included
54050 +
54051 +          After handling pathnames, conversion is done to the result as in
54052 +          the zltor() description if convert != 0; if relative or absolute
54053 +          pathnames are included, they are converted to UNIX format, i.e.
54054 +          with slash (/) as the directory separator. The max parameter
54055 +          specifies the maximum size of fn2. If convert > 0, the regular
54056 +          conversions are done; if convert < 0, minimal conversions are
54057 +          done (we skip uppercasing the letters, we allow more than one
54058 +          period, etc; this can be used when we know our partner is UNIX
54059 +          or similar).
54060 +
54061 +   #endif /* NZLTOR */
54062 +
54063 +   int
54064 +          nzxpand(fn,flags) char *fn; int flags;
54065 +          Replaces zxpand(), which is obsolete as of C-Kermit 7.0.
54066 +          Call with:
54067 +            fn = Pointer to filename or pattern.
54068 +            flags = option bits:
54069 +              flags & ZX_FILONLY  Match regular files
54070 +              flags & ZX_DIRONLY  Match directories
54071 +              flags & ZX_RECURSE  Descend through directory tree
54072 +              flags & ZX_MATCHDOT Match "dot files"
54073 +              flags & ZX_NOBACKUP Don't match "backup files"
54074 +              flags & ZX_NOLINKS  Don't follow symlinks.
54075 +
54076 +          Returns the number of files that match fn, with data structures
54077 +          set up so the first file (if any) will be returned by the next
54078 +          znext() call. If ZX_FILONLY and ZX_DIRONLY are both set, or
54079 +          neither one is set, files and directories are matched. Notes:
54080 +
54081 +         1. It is essential that the number returned by nzxpand() reflect
54082 +            the actual number of filenames that will be returned by
54083 +            znext() calls. In other words:
54084 +  for (n = nzxpand(string,flags); n > 0; n--) {
54085 +      znext(buf);
54086 +      printf("%s\n", buf);
54087 +  }
54088 +
54089 +            should print all the file names; no more, no less.
54090 +         2. In UNIX, DOS, OS-9, etc, where directories contain entries for
54091 +            themselves (.) and the superior directory (..), these should
54092 +            NOT be included in the list under any circumstances, including
54093 +            when ZX_MATCHDOT is set.
54094 +         3. Additional option bits might be added in the future, e.g. for
54095 +            sorting (sort by date/name/size, reverse/ascending, etc).
54096 +            Currently this is done only in higher level code (through a
54097 +            hack in which the nzxpand() exports its filename array, which
54098 +            is not portable because not all OS's can use this mechanism).
54099 +
54100 +   int
54101 +          zmail(addr,fn) char *addr, fn;
54102 +          Send the local, existing file fn as e-mail to the address addr.
54103 +          Returns:
54104 +            0: on success
54105 +            2: if mail delivered but temp file can't be deleted
54106 +           -2: if mail can't be delivered
54107 +
54108 +   int
54109 +          zmkdir(path) char *path;
54110 +          The path can be a file specification that might contain
54111 +          directory information, in which the filename is expected to be
54112 +          included, or an unambiguous directory specification (e.g. in
54113 +          UNIX it must end with "/"). This routine attempts to create any
54114 +          directories in the given path that don't already exist. Returns
54115 +          0 or greater success: no directories needed creation, or else
54116 +          all directories that needed creation were created successfully;
54117 +          the return code is the number of directories that were created.
54118 +          Returns -1 on failure to create any of the needed directories.
54119 +
54120 +   int
54121 +          zrmdir(path) char *path;
54122 +          Attempts to remove the given directory. Returns 0 on success, -1
54123 +          on failure. The detailed semantics are open -- should it fail if
54124 +          the directory contains any files or subdirectories, etc. It is
54125 +          probably best for this routine to behave in whatever manner is
54126 +          customary on the underlying platform; e.g. in UNIX, VMS, DOS,
54127 +          etc, where directories can not be removed unless they are empty.
54128 +
54129 +   VOID
54130 +          znewn(fn,s) char *fn, **s;
54131 +          Transforms the name fn into a filename that is guaranteed to be
54132 +          unique. If the file fn does not exist, then the new name is the
54133 +          same as fn; Otherwise, it's different. this function does its
54134 +          best, returns no value. New name is created in caller's space.
54135 +          Call like this: znewn(old,&new);. The second parameter is a
54136 +          pointer to the new name. This pointer is set by znewn() to point
54137 +          to a static string in its own space, so be sure to the result to
54138 +          a safe place before calling this function again.
54139 +
54140 +   int
54141 +          znext(fn) char *fn;
54142 +          Copies the next file name from a file list created by zxpand()
54143 +          into the string pointed to by fn (see zxpand). If no more files,
54144 +          then the null string is placed there. Returns 0 if there are no
54145 +          more filenames, with 0th element the array pointed to by fn set
54146 +          to NUL. If there is a filename, it is stored in the array
54147 +          pointed to by fn and a positive number is returned. NOTE: This
54148 +          is a change from earlier definitions of this function
54149 +          (pre-1999), which returned the number of files remaining; thus 0
54150 +          was the return value when returning the final file. However, no
54151 +          mainline code ever depended on the return value, so this change
54152 +          should be safe.
54153 +
54154 +   int
54155 +          zopeni(n,fn) int n; char *fn;
54156 +          Opens the file named fn for input as file number n. Returns:
54157 +            0: on failure.
54158 +            1: on success.
54159 +
54160 +   int
54161 +          zopeno(n,fn,zz,fcb) int n; char *name; struct zattr *zz; struct
54162 +          filinfo *fcb;
54163 +          Attempts to open the named file for output as file number n. zz
54164 +          is a Kermit file attribute structure as defined in ckcdeb.h,
54165 +          containing various information about the file, including its
54166 +          size, creation date, and so forth. This function should attempt
54167 +          to honor as many of these as possible. fcb is a "file control
54168 +          block" in the traditional sense, defined in ckcdeb.h, containing
54169 +          information relevant to complicated file systems like VMS (RMS),
54170 +          IBM MVS, etc, like blocksize, record length, organization,
54171 +          record format, carriage control, etc. Returns:
54172 +            0: on failure.
54173 +            1: on success.
54174 +
54175 +   int
54176 +          zoutdump()
54177 +          Dumps a file output buffer. Used with the macro zmchout()
54178 +          defined in ckcker.h. Used only with file number ZOFILE, i.e. the
54179 +          file that is being received by Kermit during file transfer.
54180 +          Returns:
54181 +           -1: on failure.
54182 +            0: on success.
54183 +
54184 +   int
54185 +          zprint(p,fn) char *p, *f;
54186 +          Prints the file with name fn on a local printer, with options p.
54187 +          Returns:
54188 +            0: on success
54189 +            3: if file sent to printer but can't be deleted
54190 +           -3: if file can't be printed
54191 +
54192 +   int
54193 +          zrename(fn,fn2) char *fn, *fn2;
54194 +          Changes the name of file fn to fn2. If fn2 is the name of an
54195 +          existing directory, or a file-structured device, then file fn is
54196 +          moved to that directory or device, keeping its original name. If
54197 +          fn2 lacks a directory separator when passed to this function, an
54198 +          appropriate one is supplied. Returns:
54199 +           -1: on failure.
54200 +            0: on success.
54201 +
54202 +   int
54203 +          zcopy(source,dest) char * source, * dest;
54204 +          Copies the source file to the destination. One file only. No
54205 +          wildcards. The destination string may be a filename or a
54206 +          directory name. Returns:
54207 +            0: on success.
54208 +           <0: on failure:
54209 +            -2: source file is not a regular file.
54210 +            -3: source file not found.
54211 +            -4: permission denied.
54212 +            -5: source and destination are the same file.
54213 +            -6: i/o error.
54214 +            -1: other error.
54215 +
54216 +   char *
54217 +          zlocaltime(char *)
54218 +          Call with: "yyyymmdd hh:mm:ss" GMT/UTC date-time. Returns
54219 +          pointer to local date-time string "yyyymmdd hh:mm:ss" on
54220 +          success, NULL on failure.
54221 +
54222 +   VOID
54223 +          zrtol(fn,fn2) char *fn, *fn2;
54224 +          Remote-To-Local filename translation. OBSOLETE: replaced by
54225 +          nzrtol(). Translates a "standard" filename to a local filename.
54226 +          For example, in Unix this function might convert an
54227 +          all-uppercase name to lowercase, but leave lower- or mix-case
54228 +          names alone. Does its best, returns no value. New name is in
54229 +          string pointed to by fn2. No length checking is done.
54230 +
54231 +   #ifdef NZLTOR
54232 +   int
54233 +          nzrtol(fn,fn2,convert,pathnames,max) char *fn1,*fn2; int
54234 +          convert,pathnames,max;
54235 +          Replaces zrtol. Like zrtol but handles pathnames and checks
54236 +          length. See nzltor for detailed description of parameters.
54237 +
54238 +   #endif /* NZLTOR */
54239 +
54240 +   int
54241 +          zsattr(xx) struct zattr *xx;
54242 +          Fills in a Kermit file attribute structure for the file which is
54243 +          to be sent, namely the currently open ZIFILE. Note that this is
54244 +          not a very good design, but we're stuck with it. Callers must
54245 +          ensure that zsattr() is called only on real files, not on pipes,
54246 +          internally generated file-like objects such as server REMOTE
54247 +          command responses, etc. Returns:
54248 +           -1: on failure.
54249 +            0: on success with the structure filled in.
54250 +          If any string member is null, it should be ignored by the
54251 +          caller.
54252 +          If any numeric member is -1, it should be ignored by the caller.
54253 +
54254 +   int
54255 +          zshcmd(s) char *s;
54256 +          s contains to pointer to a command to be executed by the host
54257 +          computer's shell, command parser, or operating system. If the
54258 +          system allows the user to choose from a variety of command
54259 +          processors (shells), then this function should employ the user's
54260 +          preferred shell. If possible, the user's job (environment,
54261 +          process, etc) should be set up to catch keyboard interruption
54262 +          signals to allow the user to halt the system command and return
54263 +          to Kermit. The command must run in ordinary, unprivileged user
54264 +          mode. If possible, this function should return -1 on failure to
54265 +          start the command, or else it should return 1 if the command
54266 +          succeeded and 0 if it failed.
54267 +
54268 +   int
54269 +          pexitstatus
54270 +          zshcmd() and zsyscmd() should set this to the command's actual
54271 +          exit status code if possible.
54272 +
54273 +   int
54274 +          zsyscmd(s) char *s;
54275 +          s contains to pointer to a command to be executed by the host
54276 +          computer's shell, command parser, or operating system. If the
54277 +          system allows the user to choose from a variety of command
54278 +          processors (shells), then this function should employ the system
54279 +          standard shell (e.g. /bin/sh for Unix), so that the results will
54280 +          always be the same for everybody. If possible, the user's job
54281 +          (environment, process, etc) should be set up to catch keyboard
54282 +          interruption signals to allow the user to halt the system
54283 +          command and return to Kermit. The command must run in ordinary,
54284 +          unprivileged user mode. If possible, this function should return
54285 +          -1 on failure to start the command, or else it should return 1
54286 +          if the command succeeded and 0 if it failed.
54287 +
54288 +   VOID
54289 +          z_exec(s,args) char * s; char * args[];
54290 +          This one executes the command s (which is searched for using the
54291 +          system's normal searching mechanism, such as PATH in UNIX), with
54292 +          the given argument vector, which follows the conventions of UNIX
54293 +          argv[]: the name of the command pointed to by element 0, the
54294 +          first arg by element 1, and so on. A null args[] pointer
54295 +          indicates the end of the arugment list. All open files must
54296 +          remain open so the exec'd process can use them. Returns only if
54297 +          unsuccessful.
54298 +
54299 +   int
54300 +          zsinl(n,s,x) int n, x; char *s;
54301 +          Reads a line from file number n. Writes the line into the
54302 +          address s provided by the caller. Writing terminates when
54303 +          newline is read, but with newline discarded. Writing also
54304 +          terminates upon EOF or if length x is exhausted. Returns:
54305 +           -1: on EOF or error.
54306 +            0: on success.
54307 +
54308 +   int
54309 +          zsout(n,s) int n; char *s;
54310 +          Writes the string s out to file number n. Returns:
54311 +           -1: on failure.
54312 +            0: on success.
54313 +
54314 +   int
54315 +          zsoutl(n,s) int n; char *s;
54316 +          Writes the string s out to file number n and adds a line
54317 +          (record) terminator (boundary) appropriate for the system and
54318 +          the file format. Returns:
54319 +           -1: on failure.
54320 +            0: on success.
54321 +
54322 +   int
54323 +          zsoutx(n,s,x) int n, x; char *s;
54324 +          Writes exactly x characters from string s to file number n. If s
54325 +          has fewer than x characters, then the entire string s is
54326 +          written. Returns:
54327 +           -1: on failure.
54328 +          >= 0: on success, the number of characters actually written.
54329 +
54330 +   int
54331 +          zstime(fn,yy,x) char *fn; struct zattr *yy; int x;
54332 +          Sets the creation date (and other attributes) of an existing
54333 +          file, or compares a file's creation date with a given date. Call
54334 +          with:
54335 +
54336 +   fn: pointer to name of existing file.
54337 +   yy: Pointer to a Kermit file attribute structure in which yy->date.val
54338 +   is a date of the form yyyymmdd hh:mm:ss, e.g. 19900208 13:00:00, which
54339 +   is to be used for setting or comparing the file date. Other attributes
54340 +   in the struct can also be set, such as the protection/permission (See
54341 +   [120]Appendix I), when it makes sense (e.g. "yy->lprotect.val" can be
54342 +   set if the remote system ID matches the local one).
54343 +    x: A function code: 0 means to set the file's creation date as given.
54344 +   1 means compare the date from the yy struct with the file's date.
54345 +
54346 +          Returns:
54347 +           -1: on any kind of error.
54348 +            0: if x is 0 and the file date was set successfully.
54349 +            0: if x is 1 and date from attribute structure > file creation
54350 +          date.
54351 +            1: if x is 1 and date from attribute structure <= file
54352 +          creation date.
54353 +
54354 +   VOID
54355 +          zstrip(name,name2) char *name, **name2;
54356 +          Strips pathname from filename "name". Constructs the resulting
54357 +          string in a static buffer in its own space and returns a pointer
54358 +          to it in name2. Also strips device name, file version numbers,
54359 +          and other "non-name" material.
54360 +
54361 +   int
54362 +          zxcmd(n,s) char *s;
54363 +          Runs a system command so its output can be accessed as if it
54364 +          were file n. The command is run in ordinary, unprivileged user
54365 +          mode.
54366 +          If n is ZSTDIO or ZCTERM, returns -1.
54367 +          If n is ZIFILE or ZRFILE, then Kermit reads from the command,
54368 +          otherwise Kermit writes to the command.
54369 +          Returns 0 on error, 1 on success.
54370 +
54371 +   int
54372 +          zxpand(fn) char *fn;
54373 +          OBSOLETE: Replaced by nzxpand(), q.v.
54374 +
54375 +   #ifdef ZXREWIND
54376 +   int
54377 +          zxrewind()
54378 +          Returns the number of files returned by the most recent
54379 +          nzxpand() call, and resets the list to the beginning so the next
54380 +          znext() call returns the first file. Returns -1 if zxpand has
54381 +          not yet been called. If this function is available, ZXREWIND
54382 +          should be defined; otherwise it should not be referenced.
54383 +
54384 +   #endif /* ZXREWIND */
54385 +
54386 +   int
54387 +          xsystem(cmd) char *cmd;
54388 +          Executes the system command without redirecting any of its i/o,
54389 +          similar (well, identical) to system() in Unix. But before
54390 +          passing the command to the system, xsystem() ensures that all
54391 +          privileges are turned off, so that the system command executes
54392 +          in ordinary unprivileged user mode. If possible, xsystem()
54393 +          returns the return code of the command that was executed.
54394 +
54395 +4.E.2.2. IKSD Variables and Functions
54396 +
54397 +   These must be implemented in any C-Kermit version that is to be
54398 +   installed as an Internet Kermit Service Daemon (IKSD). IKSD is expected
54399 +   to be started by the Internet Daemon (e.g. inetd) with its standard i/o
54400 +   redirected to the incoming connection.
54401 +
54402 +   int ckxanon;
54403 +          Nonzero if anonymous logins allowed.
54404 +
54405 +   extern int inserver;
54406 +          Nonzero if started in IKSD mode.
54407 +
54408 +   extern int isguest;
54409 +          Nonzero if IKSD and user logged in anonymously.
54410 +
54411 +   extern char * homdir;
54412 +          Pointer to user's home directory.
54413 +
54414 +   extern char * anonroot;
54415 +          Pointer to file-system root for anonymous users.
54416 +
54417 +   Existing functions must make "if (inserver && isguest)" checks for
54418 +   actions that would not be legal for guests: zdelete(), zrmdir(),
54419 +   zprint(), zmail(), etc.
54420 +
54421 +   int
54422 +          zvuser(name) char * name;
54423 +          Verifies that user "name" exists and is allowed to log in. If
54424 +          the name is "ftp" or "anonymous" and ckxanon != 0, a guest login
54425 +          is set up. Returns 0 if user not allowed to log in, nonzero if
54426 +          user may log in.
54427 +
54428 +   int
54429 +          zvpass(string) char * string;
54430 +          Verifies password of the user from the most recent zvuser()
54431 +          call. Returns nonzero if password is valid for user, 0 if it
54432 +          isn't. Makes any appropriate system log entries (IKSD logins,
54433 +          failed login attempts, etc). If password is valid, logs the user
54434 +          in as herself (if real user), or sets up restricted anonymous
54435 +          access if user is guest (e.g. changes file-system root to
54436 +          anonroot and sets isguest = 1).
54437 +
54438 +   VOID
54439 +          zsyslog()
54440 +          Begins any desired system logging of an IKSD session.
54441 +
54442 +   VOID
54443 +          zvlogout()
54444 +          Terminates an IKSD session. In most cases this is simply a
54445 +          wrapper for exit() or doexit(), with some system logging added.
54446 +
54447 +4.E.2.3. Privilege Functions
54448 +
54449 +   These functions are used by C-Kermit to adapt itself to operating
54450 +   systems where the program can be made to run in a "privileged" mode,
54451 +   e.g. setuid or setgid in Unix. C-Kermit should NOT read and write files
54452 +   or start subprocesses as a privileged program. This would present a
54453 +   serious threat to system security. The security package has been
54454 +   installed to prevent such security breaches by turning off the
54455 +   program's special privileges at all times except when they are needed.
54456 +
54457 +   In UNIX, the only need Kermit has for privileged status is access to
54458 +   the UUCP lockfile directory, in order to read, create, and destroy
54459 +   lockfiles, and to open communication devices that are normally
54460 +   protected against the user (see the [121]Unix C-Kermit Installation
54461 +   Instructions for discussion). Therefore, privileges should only be
54462 +   enabled for these operations and disabled at all other times. This
54463 +   relieves the programmer of the responsibility of putting expensive and
54464 +   unreliable access checks around every file access and subprocess
54465 +   creation.
54466 +
54467 +   Strictly speaking, these functions are not required in all C-Kermit
54468 +   implementations, because their use (so far, at least) is internal to
54469 +   the Group E modules. However, they should be included in all C-Kermit
54470 +   implementations for operating systems that support the notion of a
54471 +   privileged program (UNIX, RSTS/E, what others?).
54472 +
54473 +   int
54474 +          priv_ini()
54475 +          Determine whether the program is running in privileged status.
54476 +          If so, turn off the privileges, in such a way that they can be
54477 +          turned on again when needed. Called from sysinit() at program
54478 +          startup time. Returns:
54479 +            0 on success
54480 +            nonzero on failure, in which case the program should halt
54481 +          immediately.
54482 +
54483 +   int
54484 +          priv_on()
54485 +          If the program is not privileged, this function does nothing. If
54486 +          the program is privileged, this function returns it to
54487 +          privileged status. priv_ini() must have been called first.
54488 +          Returns:
54489 +            0 on success
54490 +            nonzero on failure
54491 +
54492 +   int
54493 +          priv_off()
54494 +          Turns privileges off (if they are on) in such a way that they
54495 +          can be turned back on again. Returns:
54496 +            0 on success
54497 +            nonzero on failure
54498 +
54499 +   int
54500 +          priv_can()
54501 +          Turns privileges off in such a way that they cannot be turned
54502 +          back on. Returns:
54503 +            0 on success
54504 +            nonzero on failure
54505 +
54506 +   int
54507 +          priv_chk()
54508 +          Attempts to turns privileges off in such a way that they can be
54509 +          turned on again later. Then checks to make sure that they were
54510 +          really turned off. If they were not really turned off, then they
54511 +          are cancelled permanently. Returns:
54512 +            0 on success
54513 +            nonzero on failure
54514 +
54515 +4.E.2.4. Console-Related Functions
54516 +
54517 +   These relate to the program's "console", or controlling terminal, i.e.
54518 +   the terminal that the user is logged in on and types commands at, or on
54519 +   a PC or workstation, the actual keyboard and screen.
54520 +
54521 +   int
54522 +          conbin(esc) char esc;
54523 +          Puts the console into "binary" mode, so that Kermit's command
54524 +          parser can control echoing and other treatment of characters
54525 +          that the user types. esc is the character that will be used to
54526 +          get Kermit's attention during packet mode; puts this in a global
54527 +          place. Sets the ckxech variable. Returns:
54528 +           -1: on error.
54529 +            0: on success.
54530 +
54531 +   int
54532 +          concb(esc) char esc;
54533 +          Put console in "cbreak" (single-character wakeup) mode. That is,
54534 +          ensure that each console character is available to the program
54535 +          immediately when the user types it. Otherwise just like
54536 +          conbin(). Returns:
54537 +           -1: on error.
54538 +            0: on success.
54539 +
54540 +   int
54541 +          conchk()
54542 +          Returns a number, 0 or greater, the number of characters waiting
54543 +          to be read from the console, i.e. the number of characters that
54544 +          the user has typed that have not been read yet by Kermit.
54545 +
54546 +   long
54547 +          congspd();
54548 +          Returns the speed ("baud rate") of the controlling terminal, if
54549 +          known, otherwise -1L.
54550 +
54551 +   int
54552 +          congks(timo) int timo;
54553 +          Get Keyboard Scancode. Reads a keyboard scan code from the
54554 +          physical console keyboard. If the timo parameter is greater than
54555 +          zero, then times out and returns -2 if no character appears
54556 +          within the given number of seconds. Upon any other kind of
54557 +          error, returns -1. Upon success returns a scan code, which may
54558 +          be any positive integer. For situations where scan codes cannot
54559 +          be read (for example, when an ASCII terminal is used as the
54560 +          job's controlling terminal), this function is identical to
54561 +          coninc(), i.e. it returns an 8-bit character value. congks() is
54562 +          for use with workstations whose keyboards have Alternate,
54563 +          Command, Option, and similar modifier keys, and Function keys
54564 +          that generate codes greater than 255.
54565 +
54566 +   int
54567 +          congm()
54568 +          Console get modes. Gets the current console terminal modes and
54569 +          saves them so that conres() can restore them later. Returns 1 if
54570 +          it got the modes OK, 0 if it did nothing (e.g. because Kermit is
54571 +          not connected with any terminal), -1 on error.
54572 +
54573 +   int
54574 +          coninc(timo) int timo;
54575 +          Console Input Character. Reads a character from the console. If
54576 +          the timo parameter is greater than zero, then coninc() times out
54577 +          and returns -2 if no character appears within the given number
54578 +          of seconds. Upon any other kind of error, returns -1. Upon
54579 +          success, returns the character itself, with a value in the range
54580 +          0-255 decimal.
54581 +
54582 +   VOID
54583 +          conint(f,s) SIGTYP (*f)(), (*s)();
54584 +          Sets the console to generate an interrupt if the user types a
54585 +          keyboard interrupt character, and to transfer control the
54586 +          signal-handling function f. For systems with job control, s is
54587 +          the address of the function that suspends the job. Sets the
54588 +          global variable "backgrd" to zero if Kermit is running in the
54589 +          foreground, and to nonzero if Kermit is running in the
54590 +          background. See ckcdeb.h for the definition of SIGTYP. No return
54591 +          value.
54592 +
54593 +   VOID
54594 +          connoi()
54595 +          Console no interrupts. Disable keyboard interrupts on the
54596 +          console. No return value.
54597 +
54598 +   int
54599 +          conoc(c) char c;
54600 +          Writes character c to the console terminal. Returns:
54601 +          0 on failure, 1 on success.
54602 +
54603 +   int
54604 +          conol(s) char *s;
54605 +          Writes string s to the console. Returns -1 on error, 0 or
54606 +          greater on success.
54607 +
54608 +   int
54609 +          conola(s) char *s[]; {
54610 +          Writes an array of strings to the console. Returns -1 on error,
54611 +          0 or greater on success.
54612 +
54613 +   int
54614 +          conoll(s) char *s;
54615 +          Writes string s to the console, followed by the necessary line
54616 +          termination characters to put the console cursor at the
54617 +          beginning of the next line. Returns -1 on error, 0 or greater on
54618 +          success.
54619 +
54620 +   int
54621 +          conres()
54622 +          Restores the console terminal to the modes obtained by congm().
54623 +          Returns: -1 on error, 0 on success.
54624 +
54625 +   int
54626 +          conxo(x,s) int x; char *s;
54627 +          Write x characters from string s to the console. Returns 0 or
54628 +          greater on success, -1 on error.
54629 +
54630 +   char *
54631 +          conkbg();
54632 +          Returns a pointer to the designator of the console keyboard
54633 +          type. For example, on a PC, this function would return "88",
54634 +          "101", etc. Upon failure, returns a pointer to the empty string.
54635 +
54636 +4.E.2.5. Communications Functions
54637 +
54638 +   The communication device is the device used for terminal emulation and
54639 +   file transfer. It may or may not be the same device as the console, and
54640 +   it may or may not be a terminal (serial-port) device; it could also be
54641 +   a network connection. For brevity, the communication device is referred
54642 +   to here as the "tty". When the communication device is the same as the
54643 +   console device, Kermit is said to be in remote mode. When the two
54644 +   devices are different, Kermit is in local mode.
54645 +
54646 +   int
54647 +          ttchk()
54648 +          Returns the number of characters that have arrived at the
54649 +          communication device but have not yet been read by ttinc(),
54650 +          ttinl(), and friends. If communication input is buffered (and it
54651 +          should be), this is the sum of the number of unread characters
54652 +          in Kermit's buffer PLUS the number of unread characters in the
54653 +          operating system's internal buffer. The call must be
54654 +          nondestructive and nonblocking, and as inexpensive as possible.
54655 +          Returns:
54656 +            0: or greater on success,
54657 +            0: in case of internal error,
54658 +           -1: or less when it determines the connection has been broken,
54659 +          or there is no connection.
54660 +
54661 +          That is, a negative return from ttchk() should reliably indicate
54662 +          that there is no usable connection. Furthermore, ttchk() should
54663 +          be callable at any time to see if the connection is open. When
54664 +          the connection is open, every effort must be made to ensure that
54665 +          ttchk returns an accurate number of characters waiting to be
54666 +          read, rather than just 0 (no characters) or 1 (1 or more
54667 +          characters), as would be the case when we use select(). This
54668 +          aspect of ttchk's operation is critical to successful operation
54669 +          of sliding windows and streaming, but "nondestructive buffer
54670 +          peeking" is an obscure operating system feature, and so when it
54671 +          is not available, we have to do it ourselves by managing our own
54672 +          internal buffer at a level below ttinc(), ttinl(), etc, as in
54673 +          the UNIX version (non-FIONREAD case).
54674 +
54675 +          An external global variable, clsondisc, if nonzero, means that
54676 +          if a serial connection drops (carrier on-to-off transition
54677 +          detected by ttchk()), the device should be closed and released
54678 +          automatically.
54679 +
54680 +   int
54681 +          ttclos()
54682 +          Closes the communication device (tty or network). If there were
54683 +          any kind of exclusive access locks connected with the tty, these
54684 +          are released. If the tty has a modem connection, it is hung up.
54685 +          For true tty devices, the original tty device modes are
54686 +          restored. Returns:
54687 +           -1: on failure.
54688 +            0: on success.
54689 +
54690 +   int
54691 +          ttflui()
54692 +          Flush communications input buffer. If any characters have
54693 +          arrived but have not yet been read, discard these characters. If
54694 +          communications input is buffered by Kermit (and it should be),
54695 +          this function flushes Kermit's buffer as well as the operating
54696 +          system's internal input buffer. Returns:
54697 +           -1: on failure.
54698 +            0: on success.
54699 +
54700 +   int
54701 +          ttfluo()
54702 +          Flush tty output buffer. If any characters have been written but
54703 +          not actually transmitted (e.g. because the system has been
54704 +          flow-controlled), remove them from the system's output buffer.
54705 +          (Note, this function is not actually used, but it is recommended
54706 +          that all C-Kermit programmers add it for future use, even if it
54707 +          is only a dummy function that returns 0 always.)
54708 +
54709 +   int
54710 +          ttgmdm()
54711 +          Looks for the modem signals CTS, DSR, and CTS, and returns those
54712 +          that are on in as its return value, in a bit mask as described
54713 +          for ttwmdm, in which a bit is on (1) or off (0) according to
54714 +          whether the corresponding signal is on (asserted) or off (not
54715 +          asserted). Return values:
54716 +           -3: Not implemented
54717 +           -2: if the line does not have modem control
54718 +           -1: on error
54719 +          >=0: on success, with bit mask containing the modem signals.
54720 +
54721 +   long
54722 +          ttgspd()
54723 +          Returns the current tty speed in BITS (not CHARACTERS) per
54724 +          second, or -1 if it is not known or if the tty is really a
54725 +          network, or upon any kind of error. On success, the speed
54726 +          returned is the actual number of bits per second, like 1200,
54727 +          9600, 19200, etc.
54728 +
54729 +   int
54730 +          ttgwsiz()
54731 +          Get terminal window size. Returns -1 on error, 0 if the window
54732 +          size can't be obtained, 1 if the window size has been
54733 +          successfully obtained. Upon success, the external global
54734 +          variables tt_rows and tt_cols are set to the number of screen
54735 +          rows and number of screen columns, respectively. As this
54736 +          function is not implemented in all ck*tio.c modules, calls to it
54737 +          must be wrapped in #ifdef CK_TTGWSIZ..#endif. NOTE: This
54738 +          function must be available to use the TELNET NAWS feature
54739 +          (Negotiate About Window Size) as well as Rlogin.
54740 +
54741 +   int
54742 +          tthang()
54743 +          Hang up the current tty device. For real tty devices, turn off
54744 +          DTR for about 1/3-1/2 second (or other length of time, depending
54745 +          on the system). If the tty is really a network connection, close
54746 +          it. Returns:
54747 +           -1: on failure.
54748 +            0: if it does not even try to hang up.
54749 +            1: if it believes it hung up successfully.
54750 +
54751 +   VOID
54752 +          ttimoff()
54753 +          Turns off all pending timer interrupts.
54754 +
54755 +   int
54756 +          ttinc(timo) int timo; (function is old, return codes are new)
54757 +          Reads one character from the communication device. If timo is
54758 +          greater than zero, wait the given number of seconds and then
54759 +          time out if no character arrives, otherwise wait forever for a
54760 +          character. Returns:
54761 +           -3: internal error (e.g. tty modes set wrong)
54762 +           -2: communications disconnect
54763 +           -1: timeout or other error
54764 +          >=0: the character that was read.
54765 +          It is HIGHLY RECOMMENDED that ttinc() be internally buffered so
54766 +          that calls to it are relatively inexpensive. If it is possible
54767 +          to to implement ttinc() as a macro, all the better, for example
54768 +          something like:
54769 +
54770 +  #define ttinc(t) ( (--txbufn >= 0) ? txbuf[ttbufp++] : txbufr(t) )
54771 +
54772 +          (see description of txbufr() below)
54773 +
54774 +   int
54775 +          ttinl(dest,max,timo,eol,start,turn) int max,timo,turn; CHAR
54776 +          *dest, eol, start;
54777 +          ttinl() is Kermit's packet reader. Reads a packet from the
54778 +          communications device, or up to max characters, whichever occurs
54779 +          first. A line is a string of characters starting with the start
54780 +          character up to and including the character given in eol or
54781 +          until the length is exhausted, or, if turn != 0, until the line
54782 +          turnaround character (turn) is read. If turn is 0, ttinl()
54783 +          *should* use the packet length field to detect the end, to allow
54784 +          for the possibility that the eol character appears unprefixed in
54785 +          the packet data. (The turnaround character is for half-duplex
54786 +          linemode connections.)
54787 +
54788 +          If timo is greater than zero, ttinl() times out if the eol
54789 +          character is not encountered within the given number of seconds
54790 +          and returns -1.
54791 +
54792 +          The characters that were input are copied into "dest" with their
54793 +          parity bits stripped if parity is not none. The first character
54794 +          copied into dest should be the start character, and the last
54795 +          should be the final character of the packet (the last block
54796 +          check character). ttinl() should also absorb and discard the eol
54797 +          and turn characters, and any other characters that are waiting
54798 +          to be read, up until the next start character, so that
54799 +          subsequent calls to ttchk() will not succeed simply because
54800 +          there are some terminators still sitting in the buffer that
54801 +          ttinl() didn't read. This operation, if performed, MUST NOT
54802 +          BLOCK (so if it can't be performed in a guaranteed nonblocking
54803 +          way, don't do it).
54804 +
54805 +          On success, ttinl() returns the number of characters read.
54806 +          Optionally, ttinl() can sense the parity of incoming packets. If
54807 +          it does this, then it should set the global variable ttprty
54808 +          accordingly. ttinl() should be coded to be as efficient as
54809 +          possible, since it is at the "inner loop" of packet reception.
54810 +          ttinl() returns:
54811 +           -1: Timeout or other possibly correctable error.
54812 +           -2: Interrupted from keyboard.
54813 +           -3: Uncorrectable i/o error -- connection lost, configuration
54814 +          problem, etc.
54815 +          >=0: on success, the number of characters that were actually
54816 +          read and placed in the dest buffer, not counting the trailing
54817 +          null.
54818 +
54819 +   int
54820 +          ttoc(c) char c;
54821 +          Outputs the character c to the communication line. If the
54822 +          operation fails to complete within two seconds, this function
54823 +          returns -1. Otherwise it returns the number of characters
54824 +          actually written to the tty (0 or 1). This function should only
54825 +          be used for interactive, character-mode operations, like
54826 +          terminal connection, script execution, dialer i/o, where the
54827 +          overhead of the signals and alarms does not create a bottleneck.
54828 +          (THIS DESCRIPTION NEEDS IMPROVEMENT -- If the operation fails
54829 +          within a "certain amount of time"... which might be dependent on
54830 +          the communication method, speed, etc. In particular,
54831 +          flow-control deadlocks must be accounted for and broken out of
54832 +          to prevent the program from hanging indefinitely, etc.)
54833 +
54834 +   int
54835 +          ttol(s,n) int n; char *s;
54836 +          Kermit's packet writer. Writes the n characters of the string
54837 +          pointed to to by s. NOTE: It is ttol's responsibility to write
54838 +          ALL of the characters, not just some of them. Returns:
54839 +           -1: on a possibly correctable error (so it can be retried).
54840 +           -3: on a fatal error, e.g. connection lost.
54841 +          >=0: on success, the actual number of characters written (the
54842 +          specific number is not actually used for anything).
54843 +
54844 +   int
54845 +          ttopen(ttname,lcl,modem,timo) char *ttname; int *lcl, modem,
54846 +          timo;
54847 +          Opens a tty device, if it is not already open. ttopen must check
54848 +          to make sure the SAME device is not already open; if it is,
54849 +          ttopen returns successfully without doing anything. If a
54850 +          DIFFERENT device is currently open, ttopen() must call ttclos()
54851 +          to close it before opening the new one.
54852 +
54853 +        Parameters:
54854 +
54855 +              ttname:
54856 +                      character string - device name or network host name.
54857 +
54858 +              lcl:
54859 +                      If called with lcl < 0, sets value of lcl as
54860 +                      follows:
54861 +                      0: the terminal named by ttname is the job's
54862 +                      controlling terminal.
54863 +                      1: the terminal named by ttname is not the job's
54864 +                      controlling terminal.
54865 +                      If the device is already open, or if the requested
54866 +                      device can't be opened, then lcl remains (and is
54867 +                      returned as) -1.
54868 +
54869 +              modem:
54870 +                      Less than zero: this is the negative of the network
54871 +                      type, and ttname is a network host name. Network
54872 +                      types (from [122]ckcnet.h:
54873 +
54874 +  NET_TCPB 1   TCP/IP Berkeley (socket)  (implemented in [123]ckutio.c)
54875 +  NET_TCPA 2   TCP/IP AT&T (streams)     (not yet implemented)
54876 +  NET_DEC  3   DECnet                    (not yet implemented)
54877 +
54878 +                      Zero or greater: ttname is a terminal device name.
54879 +                      Zero means a direct connection (don't use modem
54880 +                      signals). Positive means use modem signals depending
54881 +                      on the current setting of ttcarr (see ttscarr()).
54882 +
54883 +              timo:
54884 +                      > 0: number of seconds to wait for open() to return
54885 +                      before timing out.
54886 +                      <=0: no timer, wait forever (e.g. for incoming
54887 +                      call).
54888 +                      For real tty devices, ttopen() attempts to gain
54889 +                      exclusive access to the tty device, for example in
54890 +                      UNIX by creating a "lockfile" (in other operating
54891 +                      systems, like VMS, exclusive access probably
54892 +                      requires no special action).
54893 +
54894 +        Side effects:
54895 +                Copies its arguments and the tty file descriptor to global
54896 +                variables that are available to the other tty-related
54897 +                functions, with the lcl value altered as described above.
54898 +                Gets all parameters and settings associated with the line
54899 +                and puts them in a global area, so that they can be
54900 +                restored by ttres(), e.g. when the device is closed.
54901 +
54902 +        Returns:
54903 +                  0: on success
54904 +                 -5: if device is in use
54905 +                 -4: if access to device is denied
54906 +                 -3: if access to lock mechanism denied
54907 +                 -2: upon timeout waiting for device to open
54908 +                 -1: on other error
54909 +
54910 +   int
54911 +          ttpkt(speed,flow,parity) long speed; int flow, parity;
54912 +          Puts the currently open tty device into the appropriate modes
54913 +          for transmitting and receiving Kermit packets.
54914 +
54915 +        Arguments:
54916 +
54917 +              speed:
54918 +                      if speed > -1, and the device is a true tty device,
54919 +                      and Kermit is in local mode, ttpkt also sets the
54920 +                      speed.
54921 +
54922 +              flow:
54923 +                      if in the range 0-3, ttpkt selects the corresponding
54924 +                      type of flow control. Currently 0 is defined as no
54925 +                      flow control, 1 is Xon/Xoff, and no other types are
54926 +                      defined. If (and this is a horrible hack, but it
54927 +                      goes back many years and will be hard to eradicate)
54928 +                      flow is 4, then the appropriate tty modes are set
54929 +                      for modem dialing, a special case in which we talk
54930 +                      to a modem-controlled line without requiring
54931 +                      carrier. If flow is 5, then we require carrier.
54932 +
54933 +              parity:
54934 +                      This is simply copied into a global variable so that
54935 +                      other functions (like ttinl, ttinc, etc) can use it.
54936 +
54937 +        Side effects:
54938 +                Copies its arguments to global variables, flushes the
54939 +                terminal device input buffer.
54940 +
54941 +        Returns:
54942 +                 -1: on error.
54943 +                  0: on success.
54944 +
54945 +   int
54946 +          ttsetflow(int)
54947 +          Enables the given type of flow control on the open serial
54948 +          communications device immediately. Arguments are the FLO_xxx
54949 +          values from ckcdeb.h, except FLO_DIAL, FLO_DIAX, or FLO_AUTO,
54950 +          which are not actual flow-control types. Returns 0 on success,
54951 +          -1 on failure.
54952 +
54953 +   #ifdef TTSPDLIST
54954 +   long *
54955 +          ttspdlist()
54956 +          Returns a pointer to an array of longs, or NULL on failure. On
54957 +          success, element 0 of the array contains number, n, indicating
54958 +          how many follow. Elements 1-n are serial speeds, expressed in
54959 +          bits per second, that are legal on this platform. The user
54960 +          interface may use this list to construct a menu, keyword table,
54961 +          etc.
54962 +
54963 +   #endif /* TTSPDLIST */
54964 +
54965 +   int
54966 +          ttres()
54967 +          Restores the tty device to the modes and settings that were in
54968 +          effect at the time it was opened (see ttopen). Returns:
54969 +           -1: on error.
54970 +            0: on success.
54971 +
54972 +   int
54973 +          ttruncmd(string) char * string;
54974 +          Runs the given command on the local system, but redirects its
54975 +          input and output to the communication (SET LINE, SET PORT, or
54976 +          SET HOST) device. Returns:
54977 +            0: on failure.
54978 +            1: on success.
54979 +
54980 +   int
54981 +          ttscarr(carrier) int carrier;
54982 +          Copies its argument to a variable that is global to the other
54983 +          tty-related functions, and then returns it. The values for
54984 +          carrier are defined in ckcdeb.h: CAR_ON, CAR_OFF, CAR_AUTO.
54985 +          ttopen(), ttpkt(), and ttvt() use this variable when deciding
54986 +          how to open the tty device and what modes to select. The
54987 +          meanings are these:
54988 +
54989 +   CAR_OFF: Ignore carrier at all times.
54990 +   CAR_ON: Require carrier at all times, except when dialing. This means,
54991 +   for example, that ttopen() could hang forever waiting for carrier if it
54992 +   is not present.
54993 +   CAR_AUTO: If the modem type is zero (i.e. the connection is direct),
54994 +   this is the same as CAR_OFF. If the modem type is positive, then heed
54995 +   carrier during CONNECT (ttvt mode), but ignore it at other times
54996 +   (packet mode, during SET LINE, etc). Compatible with pre-5A versions of
54997 +   C-Kermit. This should be the default carrier mode.
54998 +
54999 +          Kermit's DIAL command ignores the carrier setting, but ttopen(),
55000 +          ttvt(), and ttpkt() all honor the carrier option in effect at
55001 +          the time they are called. None of this applies to remote mode
55002 +          (the tty device is the job's controlling terminal) or to network
55003 +          host connections (modem type is negative).
55004 +
55005 +   int
55006 +          ttsndb()
55007 +          Sends a BREAK signal on the tty device. On a real tty device,
55008 +          send a real BREAK lasting approximately 275 milliseconds. If
55009 +          this is not possible, simulate a BREAK by (for example) dropping
55010 +          down some very low baud rate, like 50, and sending a bunch of
55011 +          null characters. On a network connection, do the appropriate
55012 +          network protocol for BREAK. Returns:
55013 +           -1: on error.
55014 +            0: on success.
55015 +
55016 +   int
55017 +          ttsndlb()
55018 +          Like ttsndb(), but sends a "Long BREAK" (approx 1.5 seconds).
55019 +          For network connections, it is identical to ttsndb(). Currently,
55020 +          this function is used only if CK_LBRK is defined (as it is for
55021 +          UNIX and VMS).
55022 +
55023 +   int
55024 +          ttsspd(cps) int cps;
55025 +          For serial devices only, set the device transmission speed to
55026 +          (note carefully) TEN TIMES the argument. The argument is in
55027 +          characters per second, but transmission speeds are in bits per
55028 +          second. cps are used rather than bps because high speeds like
55029 +          38400 are not expressible in a 16-bit int but longs cannot be
55030 +          used because keyword-table values are ints and not longs. If the
55031 +          argument is 7, then the bps is 75, not 70. If the argument is
55032 +          888, this is a special code for 75/1200 split-speed operation
55033 +          (75 bps out, 1200 bps in). Returns:
55034 +           -1: on error, meaning the requested speed is not valid or
55035 +          available.
55036 +          >=0: on success (don't try to use this value for anything).
55037 +
55038 +   int
55039 +          ttvt(speed,flow) long speed; int flow;
55040 +          Puts the currently open tty device into the appropriate modes
55041 +          for terminal emulation. The arguments are interpreted as in
55042 +          ttpkt(). Side effects: ttvt() stores its arguments in global
55043 +          variables, and sets a flag that it has been called so that
55044 +          subsequent calls can be ignored so long as the arguments are the
55045 +          same as in the last effective call. Other functions, such as
55046 +          ttopen(), ttclose(), ttres(), ttvt(), etc, that change the tty
55047 +          device in any way must unset this flag. In UNIX Kermit, this
55048 +          flag is called tvtflg.
55049 +
55050 +   int
55051 +          ttwmdm(mdmsig,timo) int mdmsig, timo;
55052 +          Waits up to timo seconds for all of the given modem signals to
55053 +          appear. mdmsig is a bit mask, in which a bit is on (1) or off
55054 +          (0) according to whether the corresponding signal is to be
55055 +          waited for. These symbols are defined in ckcdeb.h:
55056 +            BM_CTS (bit 0) means wait for Clear To Send
55057 +            BM_DSR (bit 1) means wait for Data Set Ready
55058 +            BM_DCD (bit 2) means wait for Carrier Detect
55059 +          Returns:
55060 +           -3: Not implemented.
55061 +           -2: This line does not have modem control.
55062 +           -1: Timeout: time limit exceeded before all signals were
55063 +          detected.
55064 +            1: Success.
55065 +
55066 +   int
55067 +          ttxin(n,buf) int n; CHAR *buf;
55068 +          Reads x characters from the tty device into the specified buf,
55069 +          stripping parity if parity is not none. This call waits forever,
55070 +          there is no timeout. This function is designed to be called only
55071 +          when you know that at least x characters are waiting to be read
55072 +          (as determined, for example, by ttchk()). This function should
55073 +          use the same buffer as ttinc().
55074 +
55075 +   int
55076 +          txbufr(timo) int timo;
55077 +          Reads characters into the internal communications input buffer.
55078 +          timo is a timeout interval, in seconds. 0 means no timeout, wait
55079 +          forever. Called by ttinc() (and possibly ttxin() and ttinl())
55080 +          when the communications input buffer is empty. The buffer should
55081 +          be called ttxbuf[], its length is defined by the symbol TXBUFL.
55082 +          The global variable txbufn is the number of characters available
55083 +          to be read from ttxbuf[], and txbufp is the index of the next
55084 +          character to be read. Should not be called if txbufn > 0, in
55085 +          which case the buffer does not need refilling. This routine
55086 +          returns:
55087 +            -2: Communications disconnect
55088 +            -1: Timeout
55089 +          >=0: A character (0 - 255) On success, the first character that
55090 +          was read, with the variables txbufn and txbufp set appropriately
55091 +          for any remaining characters.
55092 +          NOTE: Currently this routine is used internally only by the UNIX
55093 +          and VMS versions. The aim is to make it available to all
55094 +          versions so there is one single coherent and efficient way of
55095 +          reading from the communications device or network.
55096 +
55097 +4.E.2.6. Miscellaneous system-dependent functions
55098 +
55099 +   VOID
55100 +          ztime(s) char **s;
55101 +          Returns a pointer, s, to the current date-and-time string in s.
55102 +          This string must be in the fixed-field format associated with
55103 +          the C runtime asctime() function, like: "Sun Sep 16 13:23:45
55104 +          1973\n" so that callers of this function can extract the
55105 +          different fields. The pointer value is filled in by ztime, and
55106 +          the data it points to is not safe, so should be copied to a safe
55107 +          place before use. ztime() has no return value. As a side effect,
55108 +          this routine can also fill in the following two external
55109 +          variables (which must be defined in the system-dependendent
55110 +          modules for each platform):
55111 +            long ztusec: Fraction of seconds of clock time, microseconds.
55112 +            long ztmsec: Fraction of seconds of clock time, milliseconds.
55113 +          If these variables are not set by zstime(), they remain at their
55114 +          initial value of -1L.
55115 +
55116 +   int
55117 +          gtimer()
55118 +          Returns the current value of the elapsed time counter in seconds
55119 +          (see rtimer), or 0 on any kind of error.
55120 +
55121 +   #ifdef GFTIMER
55122 +          CKFLOAT
55123 +          gftimer()
55124 +          Returns the current value of the elapsed time counter in
55125 +          seconds, as a floating point number, capable of representing not
55126 +          only whole seconds, but also the fractional part, to the
55127 +          millisecond or microsecond level, whatever precision is
55128 +          available. Requires a function to get times at subsecond
55129 +          precision, as well as floating-point support. That's why it's
55130 +          #ifdef'd.
55131 +
55132 +   #endif /* GFTIMER */
55133 +
55134 +   int
55135 +          msleep(m) int m;
55136 +          Sleeps (pauses, does nothing) for m milliseconds (a millisecond
55137 +          is one thousandth of a second). Returns:
55138 +           -1: on failure.
55139 +            0: on success.
55140 +
55141 +   VOID
55142 +          rtimer()
55143 +          Sets the elapsed time counter to zero. If you want to time how
55144 +          long an operation takes, call rtimer() when it starts and gtimer
55145 +          when it ends. rtimer() has no return value.
55146 +
55147 +   #ifdef GFTIMER
55148 +          VOID
55149 +          rftimer()
55150 +          Sets the elapsed time counter to zero. If you want to time how
55151 +          long an operation takes, call rftimer() when it starts and
55152 +          gftimer when it ends. rftimer() has no return value. Note:
55153 +          rftimer() is to be used with gftimer() and rtimer() is to be
55154 +          used with gtimer(). See the rftimer() description.
55155 +
55156 +   #endif /* GFTIMER */
55157 +
55158 +   int
55159 +          sysinit()
55160 +          Does whatever needs doing upon program start. In particular, if
55161 +          the program is running in any kind of privileged mode, turns off
55162 +          the privileges (see priv_ini()). Returns:
55163 +           -1: on error.
55164 +            0: on success.
55165 +
55166 +   int
55167 +          syscleanup()
55168 +          Does whatever needs doing upon program exit. Returns:
55169 +           -1: on error.
55170 +            0: on success.
55171 +
55172 +   int
55173 +          psuspend()
55174 +          Suspends the Kermit process, puts it in the background so it can
55175 +          be continued ("foregrounded") later. Returns:
55176 +           -1: if this function is not supported.
55177 +            0: on success.
55178 +
55179 +   [ [124]Contents ] [ [125]C-Kermit ] [ [126]Kermit Home ]
55180 +
55181 +4.F. Group F: Network Support
55182 +
55183 +   As of version 5A, C-Kermit includes support for several networks.
55184 +   Originally, this was just worked into the ttopen(), ttclos(), ttinc(),
55185 +   ttinl(), and similar routines in [127]ckutio.c. But this made it
55186 +   impossible to share this code with non-UNIX versions, like VMS, AOS/VS,
55187 +   OS/2, etc. So as of edit 168, network code has been separated out into
55188 +   its own module and header file, ckcnet.c and ckcnet.h:
55189 +
55190 +     [128]ckcnet.h: Network-related symbol definitions.
55191 +     [129]ckcnet.c: Network i/o (TCP/IP, X.25, etc), shared by most
55192 +   platforms.
55193 +     [130]cklnet.c: Network i/o (TCP/IP, X.25, etc) specific to Stratus
55194 +   VOS.
55195 +
55196 +   The routines and variables in these modules fall into two categories:
55197 +
55198 +    1. Support for specific network packages like SunLink X.25 and TGV
55199 +       MultiNet, and:
55200 +    2. support for specific network virtual terminal protocols like CCITT
55201 +       X.3 and TCP/IP Telnet.
55202 +
55203 +   Category (1) functions are analogs to the tt*() functions, and have
55204 +   names like netopen, netclos, nettinc, etc. Group A-D modules do not
55205 +   (and must not) know anything about these functions -- they continue to
55206 +   call the old Group E functions (ttopen, ttinc, etc). Category (2)
55207 +   functions are protocol specific and have names prefixed by a protocol
55208 +   identifier, like tn for telnet x25 for X.25.
55209 +
55210 +   ckcnet.h contains prototypes for all these functions, as well as symbol
55211 +   definitions for network types, protocols, and network- and protocol-
55212 +   specific symbols, as well as #includes for the header files necessary
55213 +   for each network and protocol.
55214 +
55215 +   The following functions are to be provided for networks that do not use
55216 +   normal system i/o (open, read, write, close):
55217 +
55218 +   int
55219 +          netopen()
55220 +          To be called from within ttopen() when a network connection is
55221 +          requested. Calling conventions and purpose same as Group E
55222 +          ttopen().
55223 +
55224 +   int
55225 +          netclos()
55226 +          To be called from within ttclos() when a network connection is
55227 +          being closed. Calling conventions and purpose same as Group E
55228 +          ttclos().
55229 +
55230 +   int
55231 +          nettchk()
55232 +          To be called from within ttchk(). Calling conventions and
55233 +          purpose same as Group E ttchk().
55234 +
55235 +   int
55236 +          netflui()
55237 +          To be called from within ttflui(). Calling conventions and
55238 +          purpose same as Group E ttflui().
55239 +
55240 +   int
55241 +          netbreak()
55242 +          To send a network break (attention) signal. Calling conventions
55243 +          and purpose same as Group E ttsndbrk().
55244 +
55245 +   int
55246 +          netinc()
55247 +          To get a character from the network. Calling conventions same as
55248 +          Group E ttsndbrk().
55249 +
55250 +   int
55251 +          nettoc()
55252 +          Send a "character" (byte) to the network. Calling conventions
55253 +          same as Group E ttoc().
55254 +
55255 +   int
55256 +          nettol()
55257 +          Send a "line" (sequence of bytes) to the network. Calling
55258 +          conventions same as Group E ttol().
55259 +
55260 +   Conceivably, some systems support network connections simply by letting
55261 +   you open a device of a certain name and letting you do i/o to it.
55262 +   Others (like the Berkeley sockets TCP/IP library on UNIX) require you
55263 +   to open the connection in a special way, but then do normal i/o (read,
55264 +   write). In such a case, you would use netopen(), but you would not use
55265 +   nettinc, nettoc, etc.
55266 +
55267 +   VMS TCP/IP products have their own set of functions for all network
55268 +   operations, so in that case the full range of netxxx() functions is
55269 +   used.
55270 +
55271 +   The technique is to put a test in each corresponding ttxxx() function
55272 +   to see if a network connection is active (or is being requested), test
55273 +   for which kind of network it is, and if necessary route the call to the
55274 +   corresponding netxxx() function. The netxxx() function must also
55275 +   contain code to test for the network type, which is available via the
55276 +   global variable ttnet.
55277 +
55278 +   [ [131]Contents ] [ [132]C-Kermit ] [ [133]Kermit Home ]
55279 +
55280 +4.F.1. Telnet Protocol
55281 +
55282 +   (This section needs a great deal of updating...)
55283 +
55284 +   As of edit 195, Telnet protocol is split out into its own files, since
55285 +   it can be implemented in remote mode, which does not have a network
55286 +   connection:
55287 +
55288 +      [134]ckctel.h: Telnet protocol symbol definitions.
55289 +      [135]ckctel.c: Telnet protocol.
55290 +
55291 +   The Telnet protocol is supported by the following variables and
55292 +   routines:
55293 +
55294 +   int tn_init
55295 +          Nonzero if telnet protocol initialized, zero otherwise.
55296 +
55297 +   int
55298 +          tn_init()
55299 +          Initialize the telnet protocol (send initial options).
55300 +
55301 +   int
55302 +          tn_sopt()
55303 +          Send a telnet option.
55304 +
55305 +   int
55306 +          tn_doop()
55307 +          Receive and act on a telnet option from the remote.
55308 +
55309 +   int
55310 +          tn_sttyp()
55311 +          Send terminal type using telnet protocol.
55312 +
55313 +4.F.2. FTP Protocol
55314 +
55315 +   (To be filled in...)
55316 +
55317 +4.F.3. HTTP Protocol
55318 +
55319 +   (To be filled in...)
55320 +
55321 +4.F.4. X.25 Networks
55322 +
55323 +   These routines were written SunLink X.25 and have since been adapted to
55324 +   at least on one other: IBM AIXLink/X.25.
55325 +
55326 +   int
55327 +          x25diag()
55328 +          Reads and prints X.25 diagnostics
55329 +
55330 +   int
55331 +          x25oobh()
55332 +          X.25 out of band signal handler
55333 +
55334 +   int
55335 +          x25intr()
55336 +          Sends X.25 interrupt packet
55337 +
55338 +   int
55339 +          x25reset()
55340 +          Resets X.25 virtual circuit
55341 +
55342 +   int
55343 +          x25clear()
55344 +          Clear X.25 virtual circuit
55345 +
55346 +   int
55347 +          x25stat()
55348 +          X.25 status
55349 +
55350 +   int
55351 +          setqbit()
55352 +          Sets X.25 Q-bit
55353 +
55354 +   int
55355 +          resetqbit()
55356 +          Resets X.25 Q-bit
55357 +
55358 +   int
55359 +          x25xin()
55360 +          Reads n characters from X.25 circuit.
55361 +
55362 +   int
55363 +          x25inl()
55364 +          Read a Kermit packet from X.25 circuit.
55365 +
55366 +   [ [136]Contents ] [ [137]C-Kermit ] [ [138]Kermit Home ]
55367 +
55368 +4.F.5. Adding New Network Types
55369 +
55370 +   Example: Adding support for IBM X.25 and Hewlett Packard X.25. First,
55371 +   add new network type symbols for each one. There are already some
55372 +   network types defined for other X.25 packages:
55373 +
55374 +  NET_SX25 is the network-type ID for SunLink X.25.
55375 +  NET_VX25 is the network-type ID for VOS X.25.
55376 +
55377 +   So first you should new symbols for the new network types, giving them
55378 +   the next numbers in the sequence, e.g.:
55379 +
55380 +#define NET_HX25 11                     /* Hewlett-Packard X.25 */
55381 +#define NET_IX25 12                     /* IBM X.25 */
55382 +
55383 +   This is in ckcnet.h.
55384 +
55385 +   Then we need symbols to say that we are actually compiling in the code
55386 +   for these platforms. These would be defined on the cc command line:
55387 +
55388 +  -DIBMX25  (for IBM)
55389 +  -DHPX25   (for HP)
55390 +
55391 +   So we can build C-Kermit versions for AIX and HP-UX both with and
55392 +   without X.25 support (since not all AIX and IBM systems have the needed
55393 +   libraries, and so an executable that was linked with them might no
55394 +   load).
55395 +
55396 +   Then in ckcnet.h:
55397 +
55398 +#ifdef IBMX25
55399 +#define ANYX25
55400 +#endif /* IBMX25 */
55401 +
55402 +#ifdef HPX25
55403 +#define ANYX25
55404 +#endif /* HPX25 */
55405 +
55406 +   And then use ANYX25 for code that is common to all of them, and IBMX25
55407 +   or HPX25 for code specific to IBM or HP.
55408 +
55409 +   It might also happen that some code can be shared between two or more
55410 +   of these, but not the others. Suppose, for example, that you write code
55411 +   that applies to both IBM and HP, but not Sun or VOS X.25. Then you add
55412 +   the following definition to ckcnet.h:
55413 +
55414 +#ifndef HPORIBMX25
55415 +#ifdef HPX25
55416 +#define HPORIBMX25
55417 +#else
55418 +#ifdef IBMX25
55419 +#define HPORIBMX25
55420 +#endif /* IBMX25 */
55421 +#endif /* HPX25 */
55422 +#endif /* HPORIBMX25 */
55423 +
55424 +   You can NOT use constructions like "#if defined (HPX25 || IBMX25)";
55425 +   they are not portable.
55426 +
55427 +   [ [139]Contents ] [ [140]C-Kermit ] [ [141]Kermit Home ]
55428 +
55429 +4.G. Group G: Formatted Screen Support
55430 +
55431 +   So far, this is used only for the fullscreen local-mode file transfer
55432 +   display. In the future, it might be extended to other uses. The
55433 +   fullscreen display code is in and around the routine screenc() in
55434 +   [142]ckuusx.c.
55435 +
55436 +   In the UNIX version, we use the curses library, plus one call from the
55437 +   termcap library. In other versions (OS/2, VMS, etc) we insert dummy
55438 +   routines that have the same names as curses routines. So far, there are
55439 +   two methods for simulating curses routines:
55440 +
55441 +    1. In VMS, we use the Screen Management Library (SMG), and insert
55442 +       stubs to convert curses calls into SMG calls.
55443 +    2. In OS/2, we use the MYCURSES code, in which the stub routines
55444 +       actually emit the appropriate escape sequences themselves.
55445 +
55446 +   Here are the stub routines:
55447 +
55448 +   int
55449 +          tgetent(char *buf, char *term)
55450 +          Arguments are ignored. Returns 1 if the user has a supported
55451 +          terminal type, 0 otherwise. Sets a global variable (for example,
55452 +          "isvt52" or "isdasher") to indicate the terminal type.
55453 +
55454 +   VOID
55455 +          move(int row, int col)
55456 +          Sends the escape sequence to position the cursor at the
55457 +          indicated row and column. The numbers are 0-based, e.g. the home
55458 +          position is 0,0.
55459 +
55460 +   int
55461 +          clear()
55462 +          Sends the escape sequence to clear the screen.
55463 +
55464 +   int
55465 +          clrtoeol()
55466 +          Sends the escape sequence to clear from the current cursor
55467 +          position to the end of the line.
55468 +
55469 +   In the MYCURSES case, code must be added to each of the last three
55470 +   routines to emit the appropriate escape sequences for a new terminal
55471 +   type.
55472 +
55473 +   clearok(curscr), wrefresh()
55474 +          In real curses, these two calls are required to refresh the
55475 +          screen, for example after it was fractured by a broadcast
55476 +          message. These are useful only if the underlying screen
55477 +          management service keeps a copy of the entire screen, as curses
55478 +          and SMG do. C-Kermit does not do this itself.
55479 +
55480 +   [ [143]Contents ] [ [144]C-Kermit ] [ [145]Kermit Home ]
55481 +
55482 +4.H. Group H: Pseudoterminal Support
55483 +
55484 +   (To be filled in...)
55485 +
55486 +4.I. Group I: Security
55487 +
55488 +   (To be filled in...)
55489 +
55490 +   [ [146]Contents ] [ [147]C-Kermit ] [ [148]Kermit Home ]
55491 +
55492 +APPENDIX I. FILE PERMISSIONS
55493 +
55494 +I.1. Format of System-Dependent File Permissions in A-Packets
55495 +
55496 +   The format of this field (the "," attribute) is interpreted according
55497 +   to the System ID ("." Attribute).
55498 +
55499 +   For UNIX (System ID = U1), it's the familiar 3-digit octal number, the
55500 +   low-order 9 bits of the filemode: Owner, Group, World, e.g. 660 =
55501 +   read/write access for owner and group, none for world, recorded as a
55502 +   3-digit octal string. High-order UNIX permission bits are not
55503 +   transmitted.
55504 +
55505 +   For VMS (System ID = D7), it's a 4-digit hex string, representing the
55506 +   16-bit file protection WGOS fields (World,Group,Owner,System), in that
55507 +   order (which is the reverse of how they're shown in a directory
55508 +   listing); in each field, Bit 0 = Read, 1 = Write, 2 = Execute, 3 =
55509 +   Delete. A bit value of 0 means permission is granted, 1 means
55510 +   permission is denied. Sample:
55511 +
55512 +  r-01-00-^A/!FWERMIT.EXE'"
55513 +  s-01-00-^AE!Y/amd/watsun/w/fdc/new/wermit.exe.DV
55514 +  r-02-01-^A]"A."D7""B8#119980101 18:14:05!#8531&872960,$A20B-!7(#512@ #.Y
55515 +  s-02-01-^A%"Y.5!
55516 +
55517 +   A VMS directory listing shows the file's protection as (E,RWED,RED,RE)
55518 +   which really means (S=E,O=RWED,G=RED,W=RE), which is reverse order from
55519 +   the internal storage, so (RE,RED,RWED,E). Now translate each letter to
55520 +   its corresponding bit:
55521 +
55522 +  RE=0101, RED=1101, RWED=1111, E=0010
55523 +
55524 +   Now reverse the bits:
55525 +
55526 +  RE=1010, RED=0010, RWED=0000, E=1101
55527 +
55528 +   This gives the 16-bit quantity:
55529 +
55530 +  1010001000001101
55531 +
55532 +   This is the internal representation of the VMS file permission; in hex:
55533 +
55534 +  A20B
55535 +
55536 +   as shown in the sample packet above.
55537 +
55538 +   The VMS format probably would also apply to RSX or any other FILES-11
55539 +   system.
55540 +
55541 +I.2. Handling of Generic Protection
55542 +
55543 +   To be used when the two systems are different (and/or do not recognize
55544 +   or understand each other's local protection codes).
55545 +
55546 +   First of all, the book is wrong. This should not be the World
55547 +   protection, but the Owner protection. The other fields should be set
55548 +   according to system defaults (e.g. UNIX umask, VMS default protection,
55549 +   etc), except that no non-Owner field should give more permissions than
55550 +   the Owner field.
55551 +
55552 +   [ [149]Top ] [ [150]Contents ] [ [151]C-Kermit Home ] [ [152]Kermit
55553 +   Home ]
55554 +     __________________________________________________________________
55555 +
55556 +
55557 +    C-Kermit Program Logic Manual / [153]The Kermit Project /
55558 +    [154]kermit@columbia.edu / 30 June 2011
55559 +
55560 +References
55561 +
55562 +   1. http://www.columbia.edu/
55563 +   2. mailto:kermit@columbia.edu
55564 +   3. http://www.columbia.edu/kermit/index.html
55565 +   4. http://www.columbia.edu/kermit/k95.html
55566 +   5. http://www.columbia.edu/kermit/ckermit.html
55567 +   6. http://www.columbia.edu/kermit/ckscripts.html
55568 +   7. http://www.columbia.edu/kermit/current.html
55569 +   8. http://www.columbia.edu/kermit/whatsnew.html
55570 +   9. http://www.columbia.edu/kermit/ckfaq.html
55571 +  10. http://www.columbia.edu/kermit/support.html
55572 +  11. http://www.columbia.edu/kermit/
55573 +  12. http://www.columbia.edu/
55574 +  13. http://www.columbia.edu/kermit/ckcplm.html
55575 +  14. http://www.columbia.edu/kermit/ckermit.html
55576 +  15. http://www.columbia.edu/kermit/index.html
55577 +  16. http://www.columbia.edu/kermit/ckcplm.html#x1
55578 +  17. http://www.columbia.edu/kermit/ckcplm.html#x2
55579 +  18. http://www.columbia.edu/kermit/ckcplm.html#x3
55580 +  19. http://www.columbia.edu/kermit/ckcplm.html#x4
55581 +  20. http://www.columbia.edu/kermit/ckcplm.html#x4.A
55582 +  21. http://www.columbia.edu/kermit/ckcplm.html#x4.B
55583 +  22. http://www.columbia.edu/kermit/ckcplm.html#x4.C
55584 +  23. http://www.columbia.edu/kermit/ckcplm.html#x4.D
55585 +  24. http://www.columbia.edu/kermit/ckcplm.html#x4.E
55586 +  25. http://www.columbia.edu/kermit/ckcplm.html#x4.F
55587 +  26. http://www.columbia.edu/kermit/ckcplm.html#x4.G
55588 +  27. http://www.columbia.edu/kermit/ckcplm.html#x4.H
55589 +  28. http://www.columbia.edu/kermit/ckcplm.html#x4.I
55590 +  29. http://www.columbia.edu/kermit/ckcplm.html#xa1
55591 +  30. http://www.columbia.edu/kermit/ckcplm.html#contents
55592 +  31. http://www.columbia.edu/kermit/ckcplm.html#contents
55593 +  32. http://www.columbia.edu/kermit/ckermit.html
55594 +  33. http://www.columbia.edu/kermit/index.html
55595 +  34. ftp://kermit.columbia.edu/kermit/c-kermit/ckcpro.w
55596 +  35. http://www.columbia.edu/kermit/ckcplm.html#contents
55597 +  36. http://www.columbia.edu/kermit/ckermit.html
55598 +  37. http://www.columbia.edu/kermit/index.html
55599 +  38. http://www.columbia.edu/kermit/ckcplm.html#x3.2
55600 +  39. http://www.columbia.edu/kermit/ckcplm.html#contents
55601 +  40. http://www.columbia.edu/kermit/ckermit.html
55602 +  41. http://www.columbia.edu/kermit/index.html
55603 +  42. http://www.columbia.edu/kermit/ckcplm.html#x4.A
55604 +  43. http://www.columbia.edu/kermit/ckcplm.html#contents
55605 +  44. http://www.columbia.edu/kermit/ckermit.html
55606 +  45. http://www.columbia.edu/kermit/index.html
55607 +  46. http://www.columbia.edu/kermit/ckcplm.html#contents
55608 +  47. http://www.columbia.edu/kermit/ckermit.html
55609 +  48. http://www.columbia.edu/kermit/index.html
55610 +  49. http://www.columbia.edu/kermit/ckcplm.html#contents
55611 +  50. http://www.columbia.edu/kermit/ckermit.html
55612 +  51. http://www.columbia.edu/kermit/index.html
55613 +  52. ftp://kermit.columbia.edu/kermit/c-kermit/ckclib.h
55614 +  53. ftp://kermit.columbia.edu/kermit/c-kermit/ckclib.c
55615 +  54. http://www.columbia.edu/kermit/ckcplm.html#x3.1
55616 +  55. http://www.columbia.edu/kermit/ckcplm.html#contents
55617 +  56. http://www.columbia.edu/kermit/ckermit.html
55618 +  57. http://www.columbia.edu/kermit/index.html
55619 +  58. ftp://kermit.columbia.edu/kermit/c-kermit/ckcsym.h
55620 +  59. ftp://kermit.columbia.edu/kermit/c-kermit/ckcasc.h
55621 +  60. ftp://kermit.columbia.edu/kermit/c-kermit/ckcsig.h
55622 +  61. ftp://kermit.columbia.edu/kermit/c-kermit/ckcdeb.h
55623 +  62. ftp://kermit.columbia.edu/kermit/c-kermit/ckcker.h
55624 +  63. ftp://kermit.columbia.edu/kermit/c-kermit/ckcxla.h
55625 +  64. ftp://kermit.columbia.edu/kermit/c-kermit/ckcmai.c
55626 +  65. ftp://kermit.columbia.edu/kermit/c-kermit/ckcpro.w
55627 +  66. ftp://kermit.columbia.edu/kermit/c-kermit/ckcfns.c
55628 +  67. ftp://kermit.columbia.edu/kermit/c-kermit/ckcfn2.c
55629 +  68. ftp://kermit.columbia.edu/kermit/c-kermit/ckcfn3.c
55630 +  69. http://www.columbia.edu/kermit/ckcplm.html#x4.B
55631 +  70. http://www.columbia.edu/kermit/ckcplm.html#x4.E
55632 +  71. http://www.columbia.edu/kermit/ckcplm.html#x4.D
55633 +  72. http://www.columbia.edu/kermit/ckcplm.html#contents
55634 +  73. http://www.columbia.edu/kermit/ckermit.html
55635 +  74. http://www.columbia.edu/kermit/index.html
55636 +  75. http://www.columbia.edu/kermit/ckcplm.html#x4.B
55637 +  76. ftp://kermit.columbia.edu/kermit/c-kermit/ckuxla.c
55638 +  77. ftp://kermit.columbia.edu/kermit/c-kermit/ckuxla.h
55639 +  78. ftp://kermit.columbia.edu/kermit/c-kermit/ckcxla.h
55640 +  79. ftp://kermit.columbia.edu/kermit/c-kermit/ckuxla.h
55641 +  80. ftp://kermit.columbia.edu/kermit/c-kermit/ckmxla.h
55642 +  81. ftp://kermit.columbia.edu/kermit/c-kermit/ck?xla
55643 +  82. ftp://kermit.columbia.edu/kermit/c-kermit/ckcuni.h
55644 +  83. ftp://kermit.columbia.edu/kermit/c-kermit/ckcuni.c
55645 +  84. http://www.columbia.edu/kermit/ckcplm.html#contents
55646 +  85. http://www.columbia.edu/kermit/ckermit.html
55647 +  86. http://www.columbia.edu/kermit/index.html
55648 +  87. http://www.columbia.edu/kermit/ckcplm.html#x4.B
55649 +  88. ftp://kermit.columbia.edu/kermit/c-kermit/ckucmd.h
55650 +  89. ftp://kermit.columbia.edu/kermit/c-kermit/ckucmd.c
55651 +  90. http://www.columbia.edu/kermit/ckcplm.html#x4.E
55652 +  91. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusr.h
55653 +  92. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusr.c
55654 +  93. ftp://kermit.columbia.edu/kermit/c-kermit/ckuus2.c
55655 +  94. ftp://kermit.columbia.edu/kermit/c-kermit/ckuus3.c
55656 +  95. ftp://kermit.columbia.edu/kermit/c-kermit/ckuus4.c
55657 +  96. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusy.c
55658 +  97. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusx.c
55659 +  98. ftp://kermit.columbia.edu/kermit/c-kermit/ckuver.h
55660 +  99. ftp://kermit.columbia.edu/kermit/c-kermit/ckuscr.c
55661 + 100. ftp://kermit.columbia.edu/kermit/c-kermit/ckudia.c
55662 + 101. ftp://kermit.columbia.edu/kermit/c-kermit/ckucon.c
55663 + 102. ftp://kermit.columbia.edu/kermit/c-kermit/ckucns.c
55664 + 103. http://www.columbia.edu/kermit/ckcplm.html#x4.E
55665 + 104. ftp://kermit.columbia.edu/kermit/c-kermit/ckcmai.c
55666 + 105. http://www.columbia.edu/kermit/ckcplm.html#contents
55667 + 106. http://www.columbia.edu/kermit/ckermit.html
55668 + 107. http://www.columbia.edu/kermit/index.html
55669 + 108. ftp://kermit.columbia.edu/kermit/c-kermit/ckufio.c
55670 + 109. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
55671 + 110. ftp://kermit.columbia.edu/kermit/c-kermit/ckusig.c
55672 + 111. ftp://kermit.columbia.edu/kermit/c-kermit/ckvfio.c
55673 + 112. ftp://kermit.columbia.edu/kermit/c-kermit/ckusig.c
55674 + 113. ftp://kermit.columbia.edu/kermit/c-kermit/ckcmai.c
55675 + 114. http://www.columbia.edu/kermit/ckcplm.html#contents
55676 + 115. http://www.columbia.edu/kermit/ckermit.html
55677 + 116. http://www.columbia.edu/kermit/index.html
55678 + 117. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
55679 + 118. ftp://kermit.columbia.edu/kermit/c-kermit/ckvtio.c
55680 + 119. http://www.columbia.edu/kermit/ckcplm.html#x2
55681 + 120. http://www.columbia.edu/kermit/ckcplm.html#xa1
55682 + 121. http://www.columbia.edu/kermit/ckuins.html
55683 + 122. ftp://kermit.columbia.edu/kermit/c-kermit/ckcnet.h
55684 + 123. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
55685 + 124. http://www.columbia.edu/kermit/ckcplm.html#contents
55686 + 125. http://www.columbia.edu/kermit/ckermit.html
55687 + 126. http://www.columbia.edu/kermit/index.html
55688 + 127. ftp://kermit.columbia.edu/kermit/c-kermit/ckutio.c
55689 + 128. ftp://kermit.columbia.edu/kermit/c-kermit/ckcnet.h
55690 + 129. ftp://kermit.columbia.edu/kermit/c-kermit/ckcnet.c
55691 + 130. ftp://kermit.columbia.edu/kermit/c-kermit/cklnet.c
55692 + 131. http://www.columbia.edu/kermit/ckcplm.html#contents
55693 + 132. http://www.columbia.edu/kermit/ckermit.html
55694 + 133. http://www.columbia.edu/kermit/index.html
55695 + 134. ftp://kermit.columbia.edu/kermit/c-kermit/ckctel.h
55696 + 135. ftp://kermit.columbia.edu/kermit/c-kermit/ckctel.c
55697 + 136. http://www.columbia.edu/kermit/ckcplm.html#contents
55698 + 137. http://www.columbia.edu/kermit/ckermit.html
55699 + 138. http://www.columbia.edu/kermit/index.html
55700 + 139. http://www.columbia.edu/kermit/ckcplm.html#contents
55701 + 140. http://www.columbia.edu/kermit/ckermit.html
55702 + 141. http://www.columbia.edu/kermit/index.html
55703 + 142. ftp://kermit.columbia.edu/kermit/c-kermit/ckuusx.c
55704 + 143. http://www.columbia.edu/kermit/ckcplm.html#contents
55705 + 144. http://www.columbia.edu/kermit/ckermit.html
55706 + 145. http://www.columbia.edu/kermit/index.html
55707 + 146. http://www.columbia.edu/kermit/ckcplm.html#contents
55708 + 147. http://www.columbia.edu/kermit/ckermit.html
55709 + 148. http://www.columbia.edu/kermit/index.html
55710 + 149. http://www.columbia.edu/kermit/ckcplm.html#top
55711 + 150. http://www.columbia.edu/kermit/ckcplm.html#contents
55712 + 151. http://www.columbia.edu/kermit/ckermit.html
55713 + 152. http://www.columbia.edu/kermit/index.html
55714 + 153. http://www.columbia.edu/kermit/index.html
55715 + 154. mailto:kermit@columbia.edu
55716 --- /dev/null
55717 +++ ckermit-301/ockermod.ini
55718 @@ -0,0 +1,144 @@
55719 +; File CKERMOD.INI, Sample C-Kermit 7.0 customization file.
55720 +;
55721 +; This file, which is ONLY A SAMPLE, should be called:
55722 +;
55723 +;   .mykermrc   (UNIX, OS-9, Aegis, BeBox, Plan 9)
55724 +;   CKERMOD.INI (VMS, OpenVMS, AOS/VS, OS/2, Amiga, Atari ST)
55725 +;   ckermod.ini (Stratus VOS)
55726 +;
55727 +; This file is executed automatically by the standard C-Kermit initialization
55728 +; file, CKERMIT.INI (or .kermrc).  This file is not executed by C-Kermit itself
55729 +; unless the initialization file is not found.
55730 +;
55731 +; MODify this file to suit your needs and preferences, and install it in your
55732 +; home directory.  Or replace it entirely with a new file.
55733 +;
55734 +; The design of this sample customization file lets you fill in a section for
55735 +; each different operating system where you run C-Kermit.
55736 +;
55737 +; In UNIX, if you give this file execute permission and make sure the top
55738 +; line indicates the full path of the C-Kermit 7.0-or-later executable, you
55739 +; can execute this file directly, as if it was a shell script, except it is
55740 +; interpreted by Kermit rather than the shell.  This lets you have as many
55741 +; different startup files as you like, each suited to a particular purpose.
55742 +;
55743 +; Authors:  Christine Gianone, Frank da Cruz, Jeffrey Altman,
55744 +;           The Kermit Project, Columbia University.
55745 +; Creation: 23 November 1992 for C-Kermit 5A(188).
55746 +; Modified: 30 June 1993 for edit 189.
55747 +;           04 October 1994 for edit 190.
55748 +;           17 April 1995 for edit 191.
55749 +;            6 September 1996 for version 6.0, edit 192.
55750 +;            1 January 2000 for version 7.0, edit 196.
55751 +;           14 October 2001 for version 8.0, edit 200.
55752 +
55753 +ECHO
55754 +ECHO Executing SAMPLE C-Kermit customization file \v(cmdfile) for \v(system)...
55755 +ECHO { Please edit this file to reflect your needs and preferences.}
55756 +ECHO
55757 +;
55758 +; ... and then remove the ECHO commands above.
55759 +
55760 +COMMENT - Settings that apply to all the systems I use:
55761 +;
55762 +set delay 1                  ; I escape back quickly
55763 +set dial display on          ; I like to watch C-Kermit dial
55764 +
55765 +; Dialing locale and method
55766 +;
55767 +; SET DIAL COUNTRY-CODE 1    ; Uncomment and replace with yours
55768 +; SET DIAL AREA-CODE 000     ; Uncomment and replace with yours
55769 +; SET DIAL LD-PREFIX 1       ; Uncomment and replace with yours
55770 +; SET DIAL INTL-PREFIX 011   ; Uncomment and replace with yours
55771 +; SET DIAL METHOD TONE       ; Uncomment and replace with PULSE if necessary
55772 +; SET DIAL DIRECTORY ... ... ; List dialing directory files here
55773 +
55774 +if < \v(version) 600192 -
55775 +  stop 1 \v(cmdfile): C-Kermit 6.0.192 or later required.
55776 +
55777 +set take error on            ; Make errors fatal temporarily
55778 +check if                     ; Do we have an IF command?
55779 +set take error off           ; Yes we do, back to normal
55780 +
55781 +; The ON_EXIT macro is executed automatically when C-Kermit exits.
55782 +; Define as desired.
55783 +;
55784 +define ON_EXIT echo Returning you to \v(system) now.
55785 +
55786 +; System-independent quick dialing macro.  Depends on having the
55787 +; macros MYMODEM, MYPORT, and (optionally) MYSPEED defined in the
55788 +; system-dependent sections below.
55789 +;
55790 +define MYDIAL {
55791 +    if not defined MYMODEM end 1 {\%0: Modem type not defined.}
55792 +    set modem type \m(MYMODEM)
55793 +    if fail end 1 {\%0: \m(MYMODEM): Unsupported modem type.}
55794 +    if not defined MYPORT end 1 {\%0: Communication port not defined.}
55795 +    set port \m(MYPORT)
55796 +    if fail end 1 {\%0: SET PORT \m(MYPORT) failed.}
55797 +    if defined MYFLOW set flow \m(MYFLOW)
55798 +    if fail end 1 {\%0: SET FLOW \m(MYFLOW) failed.}
55799 +    if defined MYSPEED set speed \m(MYSPEED)
55800 +    if fail end 1 {\%0: SET SPEED \m(MYSPEED) failed.}
55801 +    dial \%1\%2\%3\%4\%5\%6\%7\%8\%9
55802 +    end \v(status)
55803 +}
55804 +
55805 +forward \v(system)              ; Go execute system-dependent commands
55806 +
55807 +:UNIX                           ; UNIX, all versions...
55808 +define MYPORT /dev/cua          ; My dialing environment
55809 +define MYMODEM usr              ; Replace these by what you actually have
55810 +define MYSPEED 57600
55811 +;
55812 +; If you want all your downloads to go to the same directory, no matter
55813 +; what your current directory is, uncomment and edit the following command:
55814 +;
55815 +;   set file download-directory ~/download ; Download directory for UNIX
55816 +
55817 +; Put other UNIX-specific commands here...
55818 +end                             ; End of UNIX section
55819 +
55820 +:VMS                            ; VMS and OpenVMS
55821 +define MYPORT TXA0:             ; My dialing environment
55822 +define MYMODEM usr              ; Replace these by what you actually have
55823 +define MYSPEED 57600
55824 +; set file download-directory [\$(USER).DOWNLOAD] ; Download directory for VMS
55825 +; Put other VMS-specific commands here...
55826 +end                             ; End of VMS section
55827 +
55828 +:WIN32                          ; Windows and OS/2 customizations...
55829 +:OS/2
55830 +define MYPORT COM1              ; My dialing environment
55831 +define MYMODEM usr              ; Replace these by what you actually have
55832 +define MYSPEED 57600
55833 +set command byte 8              ; Use 8 bits between Kermit and console
55834 +set xfer char latin1            ; Use Latin-1 for text file transfer
55835 +set term char latin1            ; And use Latin-1 during CONNECT mode
55836 +; set file download-directory C:\DOWNLOADS
55837 +end
55838 +
55839 +:OS9/68K                        ; OS-9/68000
55840 +define MYPORT /t3               ; My dialing environment
55841 +define MYMODEM usr              ; Replace these by what you actually have
55842 +define MYSPEED 9600
55843 +; set file download-directory ~/downloads
55844 +end                             ; End of OS-9 section
55845 +
55846 +:AOS/VS                         ; Data General AOS/VS
55847 +define MYPORT @con3             ; My dialing environment
55848 +define MYMODEM usr              ; Replace these by what you actually have
55849 +define MYSPEED 9600
55850 +; set file download-directory \v(home)DOWNLOADS
55851 +end
55852 +
55853 +; And so on, you get the idea...
55854 +; Fill in the sections that apply to you.
55855 +
55856 +:Stratus_VOS                   ; Stratus VOS
55857 +:Amiga                          ; Commodore Amiga
55858 +:Atari_ST                       ; Atari ST
55859 +:Macintosh                      ; Apple Macintosh
55860 +:unknown                        ; Others
55861 +
55862 +; (End of CKERMOD.INI)
55863 --- /dev/null
55864 +++ ckermit-301/ckaaaa.txt
55865 @@ -0,0 +1,380 @@
55866 +ckaaaa.txt                                                        June 2011
55867 +
55868 +                           C-KERMIT VERSION 9.0.300
55869 +                              OVERVIEW OF FILES
55870 +
55871 +               Communications software for UNIX and (Open)VMS.
55872 +
55873 +                       And in former versions also for:
55874 +                          Stratus VOS, AOS/VS, QNX,
55875 +             Plan 9, OS-9, Apollo Aegis, and the Commodore Amiga.
55876 +                      The Apple Macintosh, the Atari ST.
55877 +
55878 +                  The Kermit Project - Columbia University
55879 +
55880 +              http://kermit.columbia.edu/ - kermit@columbia.edu
55881 +
55882 +
55883 +  Copyright (C) 1985, 2011,
55884 +    Trustees of Columbia University in the City of New York.
55885 +    All rights reserved.  See the C-Kermit COPYING.TXT file or the
55886 +    copyright text in the ckcmai.c module for disclaimer and permissions.
55887 +    BRIEFLY: C-Kermit 9.0 has the OPEN SOURCE 3-clause MODIFIED BSD LICENSE.
55888 +
55889 +
55890 +DOCUMENTATION
55891 +
55892 +  C-Kermit is documented in the book "Using C-Kermit", Second Edition, by
55893 +  Frank da Cruz and Christine M. Gianone, Digital Press, ISBN 1-55558-164-1,
55894 +  supplementated by Web-based updates for C-Kermit 7.0, 8.0, and 9.0.
55895 +
55896 +PLATFORMS
55897 +                   Security
55898 +   Name            Included   Last Updated
55899 +
55900 +   Unix               Yes     9.0.300  30 Jun 2011
55901 +   (Open)VMS          Yes     9.0.300  30 Jun 2011
55902 +   Windows (K95)      Yes     8.0.208  14 Mar 2003  (K95 2.1)
55903 +   OS/2 (K95)         Yes     8.0.208  14 Mar 2003  (K95 2.1)
55904 +   DG AOS/VS          No      7.0.196   1 Jan 2000
55905 +   Stratus VOS        No      7.0.196   1 Jan 2000
55906 +   Bell Plan 9        No      7.0.196   1 Jan 2000
55907 +   Microware OS-9     No      7.0.196   1 Jan 2000
55908 +   Commodore Amiga    No      7.0.196   1 Jan 2000
55909 +   Macintosh          No      5A(190)  16 Aug 1994  (Mac Kermit 0.991)
55910 +   Atari ST           No      5A(189)  30 Jun 1993
55911 +
55912 +QUICK START FOR FTP USERS
55913 +
55914 +  If you have a Web browser, go to:
55915 +
55916 +    http://www.columbia.edu/kermit/ckermit.html
55917 +
55918 +  And take it from there.  Otherwise...
55919 +
55920 +  The definitive FTP source for Kermit software is kermit.columbia.edu.
55921 +  Kermit software obtained from other FTP sites is not necessarily complete
55922 +  or up to date, and may have been modified.
55923 +
55924 +C-Kermit for UNIX computers that have a C compiler and 'make' program:
55925 +
55926 +  Directory kermit/archives, binary mode, file cku211.tar.Z or cku211.tar.gz
55927 +
55928 +  This is a compressed tar archive of UNIX C-Kermit source code, makefile, and
55929 +  other files.  It unpacks into its current directory, so download it into a
55930 +  fresh directory.  Transfer in binary mode, uncompress (or gunzip), untar (tar
55931 +  xvf cku211.tar), and then give the appropriate "make" command to build for
55932 +  your UNIX system; read the comments in the makefile and ckuins.txt for
55933 +  further info.
55934 +
55935 +C-Kermit for VMS:
55936 +
55937 +  If you have VMS UNZIP, get the file kermit/archives/ckv211.zip in binary
55938 +  mode, unzip -aa, and build with CKVKER.COM (@ckvker.com).  Read the comments
55939 +  at the top of CKVKER.COM for details.
55940 +
55941 +Others:  In the kermit/f or kermit/test directories under the appropriate
55942 +prefixes, explained below.
55943 +
55944 +
55945 +INSTALLATION
55946 +
55947 +Installation procedures depend on the operating system.  Please read the
55948 +CK?INS.TXT, if any, file for your operating system (?=U for UNIX, V for VMS,
55949 +etc).  Please note the naming and placement for the initialization files:
55950 +
55951 +  CKERMIT.INI
55952 +    .kermrc in the user's home directory (UNIX).
55953 +    CKERMIT.INI in the user's home directory (other OS's).
55954 +
55955 +
55956 +  CKERMOD.INI
55957 +    .mykermrc in the user's home directory (UNIX).
55958 +    CKERMOD.INI elsewhere.
55959 +
55960 +  DIALING DIRECTORIES
55961 +    Dialing directory files can be system-wide, per-group, or per-user, or
55962 +    any combination.  For example, there can be a corporate wide directory
55963 +    shared by all users, a supplemental directory for each division or
55964 +    department, and a personal directory for each user.  Simply be sure the
55965 +    dialing directory files are identified a SET DIAL DIRECTORY command in
55966 +    the user's (or the system-wide) C-Kermit initialization file, or in the
55967 +    environment variable (logical name, symbol) K_DIAL_DIRECTORY.  (The
55968 +    standard initialization file looks by default in the user's home or login
55969 +    directory.)  When installing C-Kermit on multiuser platforms from which
55970 +    users will dial out, you can also set environment variables for area
55971 +    code, country code, and the various dialing prefixes as described on page
55972 +    478 of "Using C-Kermit" (second edition), so users don't have to worry
55973 +    about defining these items themselves.   Network directories and service
55974 +    directories can also be set up in a similar manner.
55975 +
55976 +  DOCUMENTATION
55977 +    In UNIX, the general C-Kermit man page (or one of the versions tailored
55978 +    for a specific platform, like HP-UX or Solaris) should be installed in
55979 +    the appropriate place.  In VMS, the VMS help topic (CKVKER.HLP) should
55980 +    be installed as described in CKVINS.TXT.  Plain-text documentation such
55981 +    as CKERMIT2.TXT should be put in whatever place people are accustomed
55982 +    to looking.
55983 +
55984 +FILES AND FILE NAMING CONVENTIONS
55985 +
55986 +C-Kermit is a family of Kermit programs for many different computer systems.
55987 +The program shares a common set of system-independent file transfer protocol
55988 +modules, written in the C language.  System-dependent operations are collected
55989 +into system-specific modules for each system.
55990 +
55991 +C-Kermit file names all start with the letters "CK", followed by a single
55992 +letter indicating the subgroup.  When referring to these files in the UNIX,
55993 +AOS/VS, or VOS environments, use lowercase letters, rather than the uppercase
55994 +letters shown here.  Subgroups:
55995 +
55996 +  _: Security/Authentication/Encryption code, possibly regulated by law
55997 +  a: General descriptive material and documentation
55998 +  b: BOO file encoders and decoders (obsolete)
55999 +  c: All platforms with C compilers
56000 +  d: Data General AOS/VS
56001 +  e: Reserved for "ckermit" files, like CKERMIT.INI, CKERMIT80.TXT
56002 +  f: (reserved)
56003 +  g: (reserved)
56004 +  h: (reserved)
56005 +  i: Commodore Amiga (Intuition)
56006 +  j: (unused)
56007 +  k: (unused)
56008 +  l: Stratus VOS
56009 +  m: Macintosh with Mac OS
56010 +  n: Microsoft Windows NT
56011 +  o: OS/2 and/or Microsoft Windows 95/98/ME/NT/2000/XP/...
56012 +  p: Bell Labs Plan 9
56013 +  q: (reserved)
56014 +  r: DEC PDP-11 with RSTS/E (reserved)
56015 +  s: Atari ST GEMDOS (last supported in version 5A(189))
56016 +  t: DEC PDP-11 with RT-11 (reserved)
56017 +  u: UNIX or environments with UNIX-like C libraries
56018 +  v: VMS and OpenVMS
56019 +  w: Wart (Lex-like preprocessor, used with all systems)
56020 +  x: (reserved)
56021 +  y: (reserved)
56022 +  z: (reserved)
56023 +  0-3: (reserved)
56024 +  4: IBM AS/400 (reserved but probably never will be used)
56025 +  5-8: (reserved)
56026 +  9: Microware OS-9
56027 +
56028 +Examples:
56029 +
56030 +  ckaaaa.txt - This file
56031 +  ckufio.c   - File i/o for UNIX
56032 +  ckstio.c   - Communications i/o for the Atari ST
56033 +  makefile   - makefile for building UNIX C-Kermit
56034 +  ckpker.mk  - makefile for building Plan 9 C-Kermit
56035 +  ckvker.com - build procedure for VMS C-Kermit
56036 +
56037 +IMPORTANT FILES (use lowercase names on UNIX, VOS, or AOS/VS):
56038 +
56039 +  ckaaaa.txt  - This file (overview of the C-Kermit files).
56040 +                For system-specific distributions, this will normally
56041 +                be replaced by a system-specific READ.ME file.
56042 +
56043 +  ckermit70.txt - Updates: Supplement to "Using C-Kermit", 2nd Ed, for 7.0.
56044 +  ckermit80.txt - Updates: Supplement to "Using C-Kermit", 2nd Ed, for 8.0.
56045 +  ckututor.txt  - C-Kermit Tutorial for Unix (plain text)
56046 +  ckcbwr.txt  - "Beware file" (limitations, known bugs, hints), general.
56047 +  ckermit.ini - Standard initialization file (rename to .kermrc in UNIX, OS-9)
56048 +  ckermod.ini - Sample customization file (rename to .mykermrc in UNIX, OS-9)
56049 +
56050 +The following can be found at the Kermit FTP site:
56051 +
56052 +  ckermit.kdd - Sample dialing directory file (rename to .kdd in UNIX, OS-9)
56053 +  ckermit.knd - Sample dialing directory file (rename to .knd in UNIX, OS-9)
56054 +  ckermit.ksd - Sample services directory file (rename to .ksd in UNIX, OS-9)
56055 +  ckedemo.ksc - Demonstration macros from "Using C-Kermit"
56056 +  ckepage.ksc - Ditto
56057 +  ckevt.ksc   - Ditto
56058 +
56059 +UNIX-specific files:
56060 +
56061 +  ckuins.txt - UNIX-specific installation instructions.
56062 +  ckubwr.txt - UNIX-specific beware file.
56063 +  ckuker.nr  - "man page" for UNIX.
56064 +
56065 +VMS-specific files:
56066 +
56067 +  ckvins.txt - VMS-specific installation instructions.
56068 +  ckvbwr.txt - VMS-specific beware file
56069 +  ckvker.hlp - VMS C-Kermit HELP topic (needs updating).
56070 +
56071 +DG AOS/VS-specific files:
56072 +
56073 +  ckdins.txt - Data General AOS/VS C-Kermit installation instructions
56074 +  ckdbwr.txt - AOS/VS "beware" file
56075 +  ckd*.cli   - Procedures for building AOS/VS C-Kermit
56076 +
56077 +The following files are of interest mainly to programmers and historians
56078 +(find them at the Kermit ftp site in the kermit/f directory):
56079 +
56080 +  ckcker.ann - Release announcements.
56081 +  ckccfg.txt - Configuration information (feature selection), general.
56082 +  ckcplm.txt - Program logic manual (for programmers).
56083 +  ckc300.txt - Program update history for edit 212-300 (C-Kermit 9.0).
56084 +  ckc211.txt - Program update history for edit 201-211.
56085 +  ckc200.txt - Program update history for edit 198-200 (big)
56086 +  ckc197.txt - Program update history for edit 195-197 (big)
56087 +  ckc190.txt - Program update history for edits 189-190 (big).
56088 +  ckc188.txt - Program update history, edits 179-188 (big).
56089 +  ckc178.txt - Program edit history, 5A edits through 178 (very big).
56090 +  ckcv4f.txt - Program edit history, version 4F.
56091 +  ckcv4e.txt - Program edit history, version 4E.
56092 +
56093 +BINARIES
56094 +
56095 +If you have FTP access to kermit.columbia.edu (also known as
56096 +kermit.cc.columbia.edu, ftp.cc.columbia.edu), you can also retrieve various
56097 +C-Kermit binaries from the directory kermit/bin/ck*.*, or more conventiently
56098 +from the web page:
56099 +
56100 +  http://www.columbia.edu/kermit/ck80binaries.html
56101 +
56102 +Test versions would be in kermit/test/bin/ck*.*.  Be sure to transfer these
56103 +files in binary mode.  The READ.ME file in that directory explains what's
56104 +what.
56105 +
56106 +SOURCE FILES
56107 +
56108 +The source files for the UNIX version (all UNIX versions) are available in
56109 +kermit/archives/ckuNNN.tar.Z, approximately 1MB in size.  Transfer this file
56110 +in binary mode.  This is a compressed tar archive.  There is also a gzip'd
56111 +version, cku211.tar.gz.  To get the binary tar archive:
56112 +
56113 +  mkdir kermit                   (at shell prompt, make a Kermit directory)
56114 +  cd kermit                      (make it your current directory)
56115 +
56116 +  ftp kermit.columbia.edu        (make an ftp connection)
56117 +  user: anonymous                (log in as user "anonymous", lower case!)
56118 +  password:                      (use your email id as a password)
56119 +  cd kermit/archives             (go to the archives directory)
56120 +  type binary                    (specify binary file transfer)
56121 +  get cku300.tar.Z               (get the tar archive) (or get cku192.tar.gz)
56122 +  bye                            (disconnect and exit from ftp)
56123 +
56124 +  uncompress cku300.tar.Z        (at the shell prompt, uncompress the archive)
56125 +  tar xvf cku300.tar             (extract the files from the tar archive)
56126 +  make xxx                       (build C-Kermit for your system)
56127 +
56128 +(where "xxx" is the makefile entry appropriate for your system.)
56129 +
56130 +All C-Kermit source and other text files are also kept separately in the
56131 +kermit/f directory.  The files necessary to build a particular implementation
56132 +of C-Kermit are listed in the appropriate makefile or equivalent:
56133 +
56134 +       UNIX: makefile (or rename ckuker.mak to makefile)
56135 +   2.11 BSD: ckubs2.mak (rename to makefile), ckustr.sed
56136 +     Plan 9: ckpker.mk  (rename to mkfile)
56137 +  Macintosh: ckmker.mak (rename to kermit.make, use MPW C 3.2)
56138 +        VMS: CKVKER.COM (DCL) (and optionally also CKVKER.MMS)
56139 +             or CKVOLD.COM (for VMS 4.x)
56140 +      Amiga: CKIKER.MAK (Aztec C) or CKISAS.MAK (SAS C)
56141 +   Atari ST: CKSKER.MAK
56142 +       OS-9: ck9ker.mak or ck9ker.gcc
56143 +     AOS/VS: ckdmak.cli, ckdcc.cli, ckdlnk.cli
56144 +Stratus VOS: cklmak.cm
56145 +
56146 +Minimal source files for building selected versions (these patterns get all
56147 +the files you need, and in some cases maybe a few extra):
56148 +
56149 +   UNIX:   ck[cuw]*.[cwh]   (including QNX, Plan 9, and BeBox)
56150 +   UNIX:   ck[cuw_]*.[cwh]  (Unix with security modules)
56151 +   VMS:    ck[cuwv]*.[cwh]  VMS
56152 +   VMS:    ck[cuwv_]*.[cwh] VMS with SSL/TLS
56153 +   Mac:    ck[cuwm]*.[cwhr] Old Mac OS, not Mac OS X, which is UNIX.
56154 +   AOS/VS: ck[cuwd]*.[cwh]
56155 +   VOS:    ck[cwhl]*.[cwh]
56156 +   Amiga:  ck[cuwi]*.[cwh]
56157 +   Atari:  ck[cuws]*.[cwh]
56158 +   OS-9:   ck[cuw9]*.[cwha]
56159 +
56160 +Finally, here is a more detailed description of the C-Kermit file naming
56161 +conventions.  A C-Kermit filename has the form:
56162 +
56163 +  CK<system><what>.<type>
56164 +
56165 +where:
56166 +
56167 +<system> is described earlier in this file;
56168 +
56169 +<type> is the file type (use lowercase on UNIX, VOS, or AOS/VS):
56170 +
56171 +  c:   C language source
56172 +  h:   Header file for C language source
56173 +  w:   Wart preprocessor source, converted by Wart (or Lex) to a C program
56174 +  r:   Macintosh resource file (8-bit text)
56175 +  a:   Assembler source
56176 +
56177 +  txt: Plain text.
56178 +  nr:  Nroff/Troff text formatter source for UNIX "man page"
56179 +  mss: Scribe text formatter source
56180 +  ps:  Typeset material to be printed on a PostScript printer
56181 +  pdf: An Adobe PDF file
56182 +  hlp: A VMS Help topic
56183 +
56184 +  ini: Initialization file
56185 +  ksc: A Kermit Script to be executed by the TAKE command
56186 +  kdd: A Kermit Dialing Directory
56187 +  knd: A Kermit Network Directory
56188 +  ksd: A Kermit Services Directory
56189 +
56190 +  mak: A Makefile or other build procedure (often needs renaming)
56191 +  com: (VMS only) a DCL command procedure
56192 +  cli: (AOS/VS only) a command procedure
56193 +  cmd: (OS/2 only) a Rexx command procedure
56194 +
56195 +  boo: "boo"-encoded executable program, decode with CKBUNB program.
56196 +  hex: "hex"-encoded executable program, decode with CKVDEH program (VMS only).
56197 +  hqx: BinHex'd Macintosh Kermit program, decode with BinHex version 4.0.
56198 +  uue: A uuencoded binary file, decode with uudecode or (DG only) CKDECO.
56199 +
56200 +  def: An OS/2 linker definitions file.
56201 +  sh:  A UNIX shell script.
56202 +  sed: A UNIX sed (editor) script.
56203 +  str: A file of character strings extracted from C-Kermit (BSD 2.1x only).
56204 +
56205 +<what> is mnemonic (up to 3 characters) for what's in the file:
56206 +
56207 +NOTE: After C-Kermit 6.0, text filetypes such as .DOC and .HLP were changed
56208 +to .TXT to avoid confusion in Windows-based Web browsers, which would
56209 +otherwise mistake them for Microsoft Word or Windows Help documents.
56210 +
56211 +  aaa: A "read-me" file, like this one
56212 +  ins: Installation instructions or procedures
56213 +  bwr: "Beware" file -- things to watch out for, hints and tips
56214 +  plm: Program Logic Manual
56215 +  ker: General C-Kermit definitions, information, documentation
56216 +
56217 +  nnn: Digits: C-Kermit edit number (e.g. cku300.tar.gz)
56218 +  cmd: Command parsing
56219 +  con: CONNECT command
56220 +  cns: CONNECT command (UNIX only - version that uses select(), not fork())
56221 +  deb: Debug/Transaction Log formats, Typedefs
56222 +  dia: Modem/Dialer control
56223 +  fio: System-depdendent File I/O
56224 +  fns: Protocol support functions
56225 +  fn2: More protocol support functions (and FN3, ...)
56226 +  lib: Common library routines module
56227 +  mai: Main program
56228 +  net: Network i/o module
56229 +  pro: Protocol
56230 +  scr: SCRIPT command
56231 +  tel: Telnet protocol module
56232 +  tio: System-dependent communications i/o & control and interrupt handing
56233 +  sig: Signal handling module
56234 +  usr: Interactive/script user interface
56235 +  us2: More user interface (mainly help text)
56236 +  us3: Still more user interface (and USR4, USR5, USR6, USR7)
56237 +  usx: Common user interface functions
56238 +  usy: Command-line parsing
56239 +  xla: Character set translation module
56240 +  uni: Unicode support
56241 +  pty: Pseudoterminal support
56242 +  mdb: Malloc-debugging module (not included in real builds)
56243 +  str: Strings module (only for 2.xBSD)
56244 +
56245 +(End of ckaaaa.txt)