home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / old / ckermit4e / ckoker.doc < prev    next >
Text File  |  2020-01-01  |  88KB  |  2,014 lines

  1.  
  2.  
  3.  
  4.                                C-Kermit for OS/2
  5.  
  6.                                  Version 1.0p
  7.  
  8.                              by Chris Adie et al.
  9.  
  10.  
  11.           Copyright (C) 1988 Edinburgh University Computing Service.
  12.         Portions of this document are Copyright (C) 1981, 1988 Trustees
  13.                 of Columbia University in the city of New York.
  14.  
  15.  
  16.      Permission is granted to any individual or institution to use, copy,
  17.           or redistribute this document so long as it is not sold for
  18.             profit, and provided this copyright notice is retained.
  19.  
  20.  
  21. 1 INTRODUCTION
  22.  
  23.  
  24. 1.1 Acknowledgements
  25.  
  26. C-Kermit was written  by Frank da  Cruz, Bill Catchings,  Jeff Damens and  Herm
  27. Fischer, with  contributions by  many others.   It was  originally written  for
  28. computers running the Unix operating system, but it has been ported to the  VAX
  29. running VMS, the Apple  Macintosh and the Commodore  Amiga, among others.   The
  30. program was  ported  to OS/2  by  Chris Adie  (Edinburgh  University  Computing
  31. Service).
  32.  
  33. This documentation is based closely on the C-Kermit manual by Frank da Cruz and
  34. Herm Fischer.  The section on  the OS/2 file system  is based on the  MS-Kermit
  35. manual, by Christine Gianone, Frank da Cruz and Joe Doupnik.  It should be read
  36. in conjunction with a  more general description of  Kermit such as "The  Kermit
  37. File Transfer Protocol" by Frank da  Cruz (Digital Press, ISBN  0-932376-88-6),
  38. or the Kermit User Guide, available in machine readable form from your  nearest
  39. Kermit distribution centre.
  40.  
  41.  
  42. 1.2 OS/2 Kermit Capabilities
  43.  
  44. C-Kermit provides traditional  (Unix-style) command line  operation as well  as
  45. interactive command prompting and execution.  The command line options  provide
  46. access to a basic  subset of C-Kermit's  capabilities; the interactive  command
  47. set is far richer.
  48.  
  49. C-Kermit is a protected-mode program.  It will not run in the DOS compatability
  50. environment.  This means that it will continue running (eg transferring  files)
  51. even when it is not the foreground session.
  52.  
  53. All numbers in the C-Kermit documentation are decimal unless noted otherwise.
  54.  
  55.  
  56. Summary of capabilities:
  57.  
  58.   Local operation:                   Yes
  59.   Remote operation:                  No
  60.   Login scripts:                     Yes (UUCP style)
  61.   Transfer text files:               Yes
  62.   Transfer binary files:             Yes
  63.   Wildcard send:                     Yes
  64.   File transfer interruption:        Yes
  65.   Filename collision avoidance:      Yes
  66.   Can time out:                      Yes
  67.   8th-bit prefixing:                 Yes
  68.   Repeat count prefixing:            Yes
  69.   Alternate block checks:            Yes
  70.   Terminal emulation:                Yes
  71.   Communication settings:            Yes
  72.   Transmit BREAK:                    Yes
  73.   Support for dialout modems:        Yes
  74.   IBM mainframe communication:       Yes
  75.   Transaction logging:               Yes
  76.   Session logging:                   Yes
  77.   Debug logging:                     Yes (Debug logging is disabled.)
  78.   Packet logging:                    Yes
  79.   Act as server:                     Yes
  80.   Talk to server:                    Yes
  81.   Advanced server functions:         Yes
  82.   Local file management:             Yes
  83.   Command/Init files:                Yes
  84.   Long packets:                      Yes
  85.   Sliding Windows:                   No
  86.   File attributes packets:           No
  87.   Command macros:                    No
  88.   Raw file transmit:                 No
  89.  
  90.  
  91. 1.3 Requirements
  92.  
  93.  
  94. C-Kermit will run on a computer with  an 80286 or 80386 processor running  OS/2
  95. version 1.0 or higher.  It runs in character mode - in other words it is not  a
  96. Presentation Manager  application.   However, it  will  run in  a  Presentation
  97. Manager window as a character application.  Normally, though, you would run  it
  98. from the command processor (CMD.EXE) prompt.
  99.  
  100.  
  101. 1.4 The Serial Port
  102.  
  103. Naturally, a serial port (COM1 or COM2) is required.  The OS/2 Standard Edition
  104. comms port device driver must be loaded using a line like one of the  following
  105. in the CONFIG.SYS file:
  106.  
  107.                         DEVICE=COM01.SYS
  108.     or                  DEVICE=COM02.SYS
  109.  
  110.  
  111. COM01.SYS is used for PC/AT - type machines, while for PS/2s COM02.SYS must  be
  112. used.  C-Kermit  will  not work  if  this device  driver  is not  loaded.   (It
  113. provides the Category 1 IOCTLs which are used extensively within the program.)
  114.  
  115. The connecting cable and the  modem (or other computer,  PAD etc to which  your
  116. computer is connected) must satisfy the  requirements of your computer's  RS232
  117. interface.  In particular, the computer will provide two output control signals
  118. (RTS and DTR), and  may expect to see  signals on four  input lines (DCD,  DSR,
  119. CTS, RI).  The precise behaviour of  these lines is software configurable  (for
  120. instance by using the  OS/2 'MODE' command), and  C-Kermit makes no attempt  to
  121. impose a particular method of using them.
  122.  
  123. By default, the DTR and RTS line will both go ON when C-Kermit opens the  comms
  124. port, and they will go OFF when it is closed.
  125.  
  126. The default behaviour for  the input lines is  that DSR and CTS  must be ON  to
  127. enable the port to work.   If the modem you are  connected to does not  provide
  128. these signals, you can 'loop back' the  RTS output signal from the computer  to
  129. DSR and CTS, using  a suitably modified  cable.  An alternative  is to use  the
  130. MODE command to disable  the DSR and CTS  inputs.  To do  this, type a  command
  131. similar to the following at the OS/2 CMD prompt:
  132.  
  133.     MODE COM1:9600,N,8,1,OCTS=OFF,ODSR=OFF,IDSR=OFF
  134.  
  135. You can check the effect using:
  136.  
  137.     MODE COM1
  138.  
  139. which reports  the current  settings  of COM1.   Note  that on  some  machines,
  140. C-Kermit may appear  to work even  although DSR  and CTS are  not connected  to
  141. anything, nor disabled using 'MODE'.   This is because unconnected input  lines
  142. tend to 'float high'.  Although this  situation may not cause any problems,  it
  143. is not good practice - you should explicitly disable the inputs as above.
  144.  
  145. The 'MODE' utility also allows you to  change the baud rate, parity, number  of
  146. data bits and number of stop  bits.  C-Kermit provides facilities for  changing
  147. the baud rate and parity too (see later in this manual), but when it starts up,
  148. it resets the parity to none and the number of data bits to 8.  Any changes  to
  149. baud rate and parity will remain in effect after C-Kermit terminates.
  150.  
  151. If you change the parity within C-Kermit, it will ajust the number of data bits
  152. to cope.  There is no way of changing the number of stop bits within  C-Kermit:
  153. use 'MODE' to do this.
  154.  
  155.  
  156. 1.5 Emergency Exit
  157.  
  158.     EMERGENCY EXIT: The Control-C key cannot be used to terminate C-Kermit.
  159.     The Control-Break key will  always work, but it  takes you back to  the
  160.     Program Selector rather than the CMD.EXE command interpreter from which
  161.     Kermit was invoked.
  162.  
  163.  
  164.  
  165. 2 THE OS/2 FILE SYSTEM
  166.  
  167.  
  168. The features of the OS/2 file system  of greatest interest to Kermit users  are
  169. the form of the file specifications,  and the formats of the files  themselves.
  170. Note that the following discussion refers to the MS-DOS compatible file  system
  171. supported by  initial  versions of  OS/2.   Installable file  systems  are  not
  172. covered here  - they  are  significantly different,  and  the extent  to  which
  173. C-Kermit will work under such file  systems is unknown (because no  installable
  174. file system has been released at the time of writing).
  175.  
  176.  
  177. 2.1 File Specifications
  178.  
  179.  
  180. OS/2 file specifications are of the form
  181.  
  182.  
  183.     DEVICE:\PATHNAME\NAME.TYPE
  184.  
  185.  
  186. where DEVICE stands for a single character identifier (for instance, A for  the
  187. first floppy disk,  C for  the first  fixed disk, D  for a  RAM disk  emulator)
  188. followed by a colon (':'), PATHNAME is up to 63 characters of identifier(s) (up
  189. to 8 characters each) surrounded by backslashes ('\'), NAME is an identifier of
  190. up to 8 characters, and TYPE is an identifier of up to 3 characters in  length.
  191. Device and pathname may be omitted.  The first backslash in the pathname may be
  192. omitted if the  specified path is  relative to the  current directory.  In  the
  193. path field, '.' means the current directory, '..' means the parent directory.
  194.  
  195. Pathname is normally omitted,  but can be specified  in all C-Kermit  commands.
  196. Device and  directory pathnames,  when omitted,  default to  either the  user's
  197. current disk  and  directory,  or  to the  current  directory  search  path  as
  198. specified in the PATH environment variable,  depending on the context in  which
  199. the file name appears.
  200.  
  201. When this document says that a file  is searched for "in the current path,"  it
  202. means that C-Kermit looks on the current  disk and directory first, and if  the
  203. file is not found, then the directories listed in the PATH environment variable
  204. are searched.  If the PATH environment variable is empty, Kermit looks only  at
  205. the current disk and directory.
  206.  
  207. NAME.TYPE is sufficient to  specify a file on  the current disk and  directory,
  208. and only this information is sent along  by C-Kermit with an outgoing file  (by
  209. default).
  210.  
  211. The device, path, name, and type fields may contain uppercase letters,  digits,
  212. and the special characters '-' (dash), '_' (underscore), '$' (dollar sign), '&'
  213. (ampersand), '#'  (number sign),  '@' (at  sign), '!'  (exclamation mark),  '''
  214. (single  quote),  '()'  (parentheses),  '{}'  (curly  braces),  '^'  (caret  or
  215. circumflex), '~' (tilde), and '`' (accent grave).  Normally, you should confine
  216. your filenames to letters and digits  for maximum transportability to  non-OS/2
  217. systems (by default, C-Kermit will translate filenames being sent by converting
  218. non-alphanumeric characters  to  'X').   When you  type  lowercase  letters  in
  219. filenames, they  are  converted  automatically  to  uppercase.   There  are  no
  220. imbedded or trailing spaces.  Other characters may not be included; there is no
  221. mechanism for "quoting" otherwise illegal characters in filenames.  The  fields
  222. of the  file specification  are set  off from  one another  by the  punctuation
  223. indicated above (ie colon, backslash and dot).
  224.  
  225. The name field is the primary identifier  for the file.  The type, also  called
  226. the extension or suffix, is an indicator which, by convention, tells what  kind
  227. of file we have.  For instance FOO.BAS  is the source of a BASIC program  named
  228. FOO; FOO.OBJ  might be  the relocatable  object  module produced  by  compiling
  229. FOO.BAS; FOO.EXE could be  an executable program  produced by loading  FOO.OBJ,
  230. and so forth.  .EXE is the normal suffix for executable programs.
  231.  
  232. OS/2 allows a group of files to be specified in a single file specification  by
  233. including the special "wildcard"  characters, '*' and '?'.   A '*' matches  any
  234. string of  characters  from the  current  position to  the  end of  the  field,
  235. including no characters at all; a  '?' matches any single character.  Here  are
  236. some examples:
  237.  
  238. *.BAS           All files  of type  BAS (BASIC  source  files) in  the  current
  239.                 directory.
  240.  
  241. FOO.*           Files of all types with name FOO.
  242.  
  243. F*.*            All files whose names start with F.
  244.  
  245. *.?             All files with  types exactly  one character long,  or with  no
  246.                 type at all.
  247.  
  248. Wildcard notation is used on many computer  systems in similar ways, and it  is
  249. the mechanism most commonly used to instruct Kermit to send a group of files.
  250.  
  251. You should  bear  in mind  that  other  (non-OS/2) systems  may  use  different
  252. wildcard characters.  For instance VMS and the DEC-20 use '%' instead of '?' as
  253. the single character wildcard; when using  C-Kermit to request a wildcard  file
  254. group from a Kermit-20 server, the OS/2 '?' must be replaced by the DEC-20 '%'.
  255.  
  256.  
  257. 2.2 File Formats
  258.  
  259.  
  260. OS/2 systems  store  files  as  streams of  8-bit  bytes,  with  no  particular
  261. distinction among  text, program  code,  and binary  files.  ASCII  text  files
  262. consist of lines separated  by carriage-return-linefeed sequences (CRLFs),  and
  263. this  conforms  exactly  to  the  way  Kermit  represents  text  files   during
  264. transmission.
  265.  
  266. OS/2 (unlike CP/M) knows the exact end of a file because it keeps a byte  count
  267. in the directory, so one would  expect no particular confusion in this  regard.
  268. However, certain MS-DOS and OS/2 programs  continue to use the CP/M  convention
  269. of terminating a text file with a Control-Z character.  This may cause problems
  270. when the file is transferred elsewhere,  since other systems may object to  the
  271. Control-Z. By default, therefore, C-Kermit treats the first Control-Z it  finds
  272. in the  file  as  being  equivalent  to  end-of-file.   The  Control-Z  is  not
  273. transmitted to  the other  system.   Of course,  this  leads to  problems  when
  274. transferring non-text files, when we do want  any Control-Zs in the file to  be
  275. sent.  To achieve  this, the  C-Kermit 'set file  type binary'  command may  be
  276. used.  The opposite, 'set file type text', is the default.
  277.  
  278. Non-OS/2 systems may be confused by nonstandard ASCII files sent by C-Kermit:
  279.  
  280.    - Files containing any  of the 8-bit  "extended ASCII"  characters may  need
  281.      conversion (or translation) to 7-bit ASCII.
  282.    - Files produced by word processing  programs like Word Perfect or  Wordstar
  283.      may contain special binary formatting codes, and could need conversion  to
  284.      conventional 7-bit  ASCII format  prior  to transmission,  using  commonly
  285.      available "exporter" programs.
  286.    - Spreadsheet or  database  files  usually need  special  formatting  to  be
  287.      meaningful to non-OS/2 recipients (though they can be transmitted  between
  288.      OS/2 and MS-DOS systems with Kermit).
  289.    - BASIC programs  are normally  saved in  a  binary "tokenized"  form.   Use
  290.      BASIC's ",a" option to save them as regular ASCII text, as in
  291.  
  292.                   save"foofa",a
  293.  
  294. In general,  when attempting  to transfer  non-text files  between OS/2  and  a
  295. different kind of system, consult the Kermit manual for that system.
  296.  
  297.  
  298.  
  299. 3 FILE TRANSFER
  300.  
  301.  
  302. When C-Kermit  is  transferring a  file,  the screen  (stdout)  is  continously
  303. updated to show the progress of the  file transer.  A dot is printed for  every
  304. four data packets, other packets are shown by type:
  305.  
  306.     I Exchange Parameter Information
  307.     R Receive Initiate
  308.     S Send Initiate
  309.     F File Header
  310.     G Generic Server Command
  311.     C Remote Host Command
  312.     N Negative Acknowledgement (NAK)
  313.     E Fatal Error
  314.     T Indicates a timeout occurred
  315.     Q Indicates a damaged, undesired, or illegal packet was received
  316.     % Indicates a packet was retransmitted
  317.  
  318. You may type certain "interrupt" commands during file transfer:
  319.  
  320.     Control-F:  Interrupt the current File, and go on to the next (if any).
  321.     Control-B:  Interrupt the entire Batch of files, terminate the transaction.
  322.     Control-R:  Resend the current packet.
  323.     Control-A:  Display a status report for the current transaction.
  324.  
  325. These  interrupt  characters  differ  from  the  ones  used  in  other   Kermit
  326. implementations to  avoid  conflict with  commonly  used Unix  shell  interrupt
  327. characters.  This reason, of course, is not  valid under OS/2, and in a  future
  328. version of C-Kermit for OS/2 it is hoped to rectify this.
  329.  
  330.     CAUTION: If Control-F or Control-B is used to cancel an incoming  file,
  331.     and a file of the same name previously existed, and the "file  warning"
  332.     feature is  not  enabled, then  the  previous  copy of  the  file  will
  333.     disappear.
  334.  
  335.  
  336. The Emergency Exit key (Control-Break) can  be used to terminate Kermit in  the
  337. middle of a file transfer.  This will not terminate the transfer gracefully (it
  338. is a 'brute  force' method),  so the remote  Kermit system  may be  left in  an
  339. undefined state.
  340.  
  341.  
  342.  
  343. 4 COMMAND LINE OPERATION
  344.  
  345.  
  346. The C-Kermit command line syntax conforms to the Proposed Syntax Standards  for
  347. Unix System Commands put  forth by Kathy Hemenway  and Helene Armitage of  AT&T
  348. Bell Laboratories in Unix/World, Vol.1,  No.3, 1984.  The implications of  this
  349. for specifying command-line options are:
  350.  
  351.    - An option name is a single character.
  352.    - Options are delimited by '-'.
  353.    - Options with no arguments may be grouped (bundled) behind one delimiter.
  354.    - Options which take an argument must not have the argument omitted.
  355.    - Arguments immediately follow options, separated by whitespace.
  356.    - The order of options does not matter.
  357.    - A '-' preceded and followed by whitespace means standard input.
  358.    - A group of bundled options may end with an option that has an argument.
  359.  
  360. The following notation is used in command descriptions:
  361.  
  362. fn      An  OS/2  file  specification,   possibly  containing  the   "wildcard"
  363.         characters '*' or '?'.
  364.  
  365. fn1     An OS/2 file specification which may not contain '*' or '?'.
  366.  
  367. rfn     A remote file specification  in the remote  system's own syntax,  which
  368.         may denote a single file or a group of files.
  369.  
  370. rfn1    A remote file specification which should denote only a single file.
  371.  
  372. n       A decimal number between 0 and 94.
  373.  
  374. c       A decimal number between 0 and  127 representing the value of an  ASCII
  375.         character.
  376.  
  377. cc      A decimal number between  0 and 31, or  else exactly 127,  representing
  378.         the value of an ASCII control character.
  379.  
  380. [ ]     Any field in square braces is optional.
  381.  
  382. {x,y,z} Alternatives are listed in curly braces.
  383.  
  384.  
  385. C-Kermit command  line  options may  specify  any combination  of  actions  and
  386. settings.  If  C-Kermit  is invoked  with  a  command line  that  specifies  no
  387. actions, then it  will issue  a prompt  and begin  interactive dialog.   Action
  388. options specify either protocol transactions or terminal connection.
  389.  
  390.  
  391. 4.1 Command Line Options
  392.  
  393. -s fn   Send the specified file.  If fn is '-' then kermit sends from  standard
  394.         input, which may come from a file:
  395.  
  396.             kermit -s - < foo.bar
  397.  
  398.         or a parallel process:
  399.  
  400.             dir *.txt | kermit -s -
  401.  
  402.         You cannot use this mechanism to  send console typein.  If you want  to
  403.         send a file whose  actual name is  '-' you can precede  it with a  path
  404.         name, as in
  405.  
  406.             kermit -s .\-
  407.  
  408.         The argument fn may contain wildcards.  For instance,
  409.  
  410.             kermit -s ck*.h
  411.  
  412.         will send all the files matching the specification 'ck*.h'.
  413.  
  414. -r      Receive a file or files.  Wait passively for files to arrive.
  415.  
  416. -k      Receive (passively) a file or files,  sending them to standard  output.
  417.         This option can be used in several ways:
  418.  
  419.         kermit -k
  420.                 Displays the incoming files on your screen.
  421.  
  422.         kermit -k > fn1
  423.                 Sends the incoming file  or files to the  named file, fn1.   If
  424.                 more than one file arrives, all are concatenated together  into
  425.                 the single file fn1.
  426.  
  427.         kermit -k | command
  428.                 Pipes the  incoming  data (single  or  multiple files)  to  the
  429.                 indicated command, as in
  430.  
  431.                     kermit -k | sort > sorted.txt
  432.  
  433.  
  434. -a fn1  If you have specified a file transfer option, you may give an alternate
  435.         name for a single file with the -a ("as") option.  For example,
  436.  
  437.             kermit -s foo -a bar
  438.  
  439.         sends the file foo telling the receiver that its name is bar.  If  more
  440.         than one file arrives or  is sent, only the  first file is affected  by
  441.         the -a option:
  442.  
  443.             kermit -ra baz
  444.  
  445.         stores the first incoming file under the name baz.
  446.  
  447. -x      Begin server operation.
  448.  
  449.  
  450. Before proceeding, a few words about remote and local operation are  necessary.
  451. Kermit (in general, not  just C-Kermit) is "local"  if it is  running on PC  or
  452. workstation that you are  using directly, or  if it is  running on a  multiuser
  453. system and transferring files over an  external communication line -- not  your
  454. job's controlling terminal or console. Kermit is  remote if it is running on  a
  455. multiuser system and  transferring files  over its  own controlling  terminal's
  456. communication line, connected to your PC or workstation.
  457.  
  458. C-Kermit running under OS/2 is always used in local mode, with the serial  port
  459. at  the  back  of  the  machine  designated  for  file  transfer  and  terminal
  460. connection.  Which serial  port to  use is  determined by  the -l  command-line
  461. option:
  462.  
  463. -l dev  Line -- Specify  a serial line  to use for  file transfer and  terminal
  464.         connection, as in
  465.  
  466.             kermit -l com2
  467.  
  468.         The default line is COM1.
  469.  
  470.  
  471. There are a number of other options associated with the use of the serial port:
  472.  
  473. -b n    Baud -- Specify the baud rate for  the line given in the -l option,  as
  474.         in
  475.  
  476.             kermit -l com2 -b 9600
  477.  
  478.         It is  good practice  to include  this with  the -l  option, since  the
  479.         current speed of the serial port might not be what you expect.
  480.  
  481. -p x    Parity -- x may be one of e,o,m,s,n (even, odd, mark, space, or  none).
  482.         If parity is other than none, then the 8th-bit prefixing mechanism will
  483.         be used  for  transferring 8-bit  binary  data, provided  the  opposite
  484.         Kermit agrees.  The default parity is none.
  485.  
  486. -t      Specifies half  duplex,  line  turnaround with  XON  as  the  handshake
  487.         character.
  488.  
  489.  
  490. The following command line options access a remote Kermit server:
  491.  
  492. -g rfn  Actively request a remote server to  send the named file or files;  rfn
  493.         is a file specification in the remote host's own syntax.
  494.  
  495. -f      Send a 'finish' command to a remote server.
  496.  
  497. The following command  line options  are to do  with connecting  to the  remote
  498. system as a terminal:
  499.  
  500. -c      Establish  a  terminal  connection   over  the  specified  or   default
  501.         communication line, before any  protocol transaction takes place.   Get
  502.         back to  the local  system  by typing  the escape  character  (normally
  503.         Control-]) followed by the letter 'c'.
  504.  
  505. -n      Like -c, but after  a protocol transaction takes  place; -c and -n  may
  506.         both be used in the same command.  The use of -n and -c is  illustrated
  507.         below.
  508.  
  509.  
  510. Several other command-line options are provided:
  511.  
  512. -i      Specifies that files should be sent or received exactly "as is" with no
  513.         conversions.  This option is  necessary for transmitting binary  files,
  514.         and is equivalent to the 'set file type binary' interactive command.
  515.  
  516. -w      Write-Protect -- Avoid filename collisions for incoming files.
  517.  
  518. -e n    Extended packet length -- Specify  that C-Kermit is allowed to  receive
  519.         packets up  to length  n, where  n may  be between  10 and  some  large
  520.         number, like 1000, depending on the system.  The default maximum length
  521.         for received packets is 90.  Packets  longer than 94 will be used  only
  522.         if the other  Kermit supports,  and agrees  to use,  the "long  packet"
  523.         protocol extension.
  524.  
  525. -q      Quiet -- Suppress screen update  during file transfer, for instance  to
  526.         allow a file transfer to proceed in the background.
  527.  
  528. -d      Debug --  Record debugging  information in  the file  debug.log in  the
  529.         current directory.   Use this  option  if you  believe the  program  is
  530.         misbehaving,  and  show  the  resulting   log  to  your  local   Kermit
  531.         maintainer. (Debug logging is disabled.)
  532.  
  533. -h      Help -- Display a brief synopsis of the command line options.
  534.  
  535. -u d    File handle -- The  argument d is the numerical  value of an open  file
  536.         handle which Kermit will use for  its communication line.  This  option
  537.         is for use only by other programs which interface with Kermit, not  for
  538.         typing in  the  command  line  (so  it's  not  described  in  the  help
  539.         information from -h). Further details are given in the Appendix.
  540.  
  541. The command line may contain no more  than one protocol action option (ie  only
  542. one of: -s, -a, -r, -k, -x, -g, -f).
  543.  
  544. Files are sent with their own  names, except that lowercase letters are  raised
  545. to upper, drive specifiers and pathnames are stripped off, and non-alphanumeric
  546. characters (excepting the dot)  are changed to 'X'.  Incoming files are  stored
  547. under their own names.  If -w was specified, a "generation number" is  appended
  548. to the name if it has the same  name as an existing file which would  otherwise
  549. be overwritten.  If the -a option is included, then the same rules apply to its
  550. argument.  The file transfer display  shows any transformations performed  upon
  551. filenames.
  552.  
  553. During transmission, files are encoded as follows:
  554.  
  555.    - Control characters are converted to prefixed printables.
  556.    - Sequences of repeated characters are  collapsed via repeat counts, if  the
  557.      other Kermit is also capable of repeated-character compression.
  558.    - If parity is being  used on the communication  line, data characters  with
  559.      the 8th (parity) bit on are specially prefixed (provided the other  Kermit
  560.      is capable of  8th-bit prefixing;  if not,  8-bit binary  files cannot  be
  561.      successfully transferred).
  562.  
  563.  
  564. 4.2 Command Line Examples
  565.  
  566.  
  567.     kermit -l com1 -b 1200 -cn -r
  568.  
  569. This command connects you to the system on the other end of COM1 at 1200  baud,
  570. where you presumably log in  and run Kermit with  a 'send' command.  After  you
  571. escape back, C-Kermit waits  for a file  (or files) to  arrive.  When the  file
  572. transfer is completed, you are reconnected to the remote system so that you can
  573. logout.
  574.  
  575.  
  576.     kermit -l com2 -b 9600 -cntp m -r -a foo.bar
  577.  
  578. This command is like the preceding one,  except the remote system in this  case
  579. uses half duplex communication with mark  parity.  The first file that  arrives
  580. is stored under the name foo.bar.
  581.  
  582.  
  583.     kermit -nf
  584.  
  585. This command would be used to shut down a remote server and then connect to the
  586. remote system, in order to log out or to make further use of it.  The -n option
  587. is invoked after -f (-c would have been invoked before).  This example  assumes
  588. that the remote server is connected to COM1 (Kermit's default comms port),  and
  589. that the current baud rate of the port is acceptable to the remote server.
  590.  
  591.  
  592.     kermit -wx
  593.  
  594. This command starts up C-Kermit as a server.  Incoming files that have the same
  595. names as existing files are given new, unique names.
  596.  
  597.  
  598.     kermit -l com2 -b 9600
  599.  
  600. This command  sets  the communication  line  and  speed.  Since  no  action  is
  601. specified, C-Kermit issues a prompt and enters an interactive dialog with  you.
  602. Any settings  given on  the command  line remain  in force  during the  dialog,
  603. unless explicitly  changed  (eg in  this  case by  'set  line' or  'set  speed'
  604. commands).
  605.  
  606.  
  607.     kermit
  608.  
  609. This command  starts up  Kermit interactively  with all  default settings.  The
  610. serial line used will be COM1, and the speed used will be the current speed  of
  611. COM1.
  612.  
  613. A final example shows  how a (hypothetical) OS/2  compression utility might  be
  614. used to speed up Kermit file transfers:
  615.  
  616.     compress < file | kermit -is -     (sender)
  617.     kermit -ik | uncompress > file     (receiver)
  618.  
  619.  
  620. 4.3 Exit Status Codes
  621.  
  622.  
  623. C-Kermit returns  an  exit  status  of  zero, except  when  a  fatal  error  is
  624. encountered, when the exit status is set to  one.  This can be used in a  batch
  625. file, to take some  action depending on whether  the operation was  successful.
  626. For instance, suppose the file SEND.CMD contains the following:
  627.  
  628.  
  629.     echo Sending %1 out port %2
  630.     kermit -ql COM%2 -b 9600 -s %1
  631.     if ERRORLEVEL 1 goto badend
  632.     echo Transferred succcessfully!
  633.     goto end
  634.     :badend
  635.     echo Transfer problems!
  636.     :end
  637.  
  638. To send a file FOO.BAS, you could type:
  639.  
  640.  
  641.     send foo.bas 2
  642.  
  643. to send it to another computer running Kermit, connected to port COM2.  If  the
  644. transfer completed OK, you would get the message 'Transferred successfully!'.
  645.  
  646.  
  647.  
  648. 5 INTERACTIVE OPERATION
  649.  
  650.  
  651. C-Kermit's interactive  command prompt  is "C-Kermit>".   In response  to  this
  652. prompt, you may type any valid interactive C-Kermit command.  C-Kermit executes
  653. the command and then  prompts you for another  command.  The process  continues
  654. until you instruct the program to terminate.
  655.  
  656. Commands begin with a keyword, normally  an English verb, such as 'send'.   You
  657. may omit  trailing  characters  from  any  keyword,  so  long  as  you  specify
  658. sufficient characters to distinguish  it from any other  keyword valid in  that
  659. field.  Certain commonly-used keywords  (such as 'send', 'receive',  'connect')
  660. also have special non-unique abbreviations ('s' for 'send', 'r' for  'receive',
  661. 'c' for 'connect').
  662.  
  663. Certain  characters  have  special  functions  during  typein  of   interactive
  664. commands:
  665.  
  666.     ?   Question mark, typed at any point in a command, will produce a  message
  667.         explaining what is possible  or expected at  that point.  Depending  on
  668.         the context, the message may be a brief phrase, a menu of keywords,  or
  669.         a list of files.
  670.  
  671.     ESC (The Escape  key)  -- Request  completion  of the  current  keyword  or
  672.         filename, or insertion of a default  value.  The result will be a  beep
  673.         if the requested operation fails.
  674.  
  675.     BS  (Backspace) -- Delete the previous character from the command.
  676.  
  677.     ^W  (Control-W) -- Erase the rightmost word from the command line.
  678.  
  679.     ^U  (Control-U) -- Erase the entire command.
  680.  
  681.     ^R  (Control-R) -- Redisplay the current command.
  682.  
  683.     SP  (Space) --  Delimits fields  (keywords,  filenames, numbers)  within  a
  684.         command.  The tab key may also be used for this purpose.
  685.  
  686.     CR  (Carriage Return or  Enter) -- Enters  the command  for execution.   LF
  687.         (Linefeed or Control-J) or FF (formfeed or Control-L) may also be  used
  688.         for this purpose.
  689.  
  690.     ^   (Circumflex) -- Enter  any of the  above characters  into the  command,
  691.         literally.  To enter a ^, type two of them in a row (^^).  A circumflex
  692.         at the end of a command  line causes the next line  to be treated as  a
  693.         continuation line; this  is useful  for readability  in command  files,
  694.         especially in the 'script' command.
  695.  
  696. You may type the editing characters (BS, ^W, etc) repeatedly, to delete all the
  697. way back to  the prompt.   No action  will be  performed until  the command  is
  698. entered by typing  carriage return,  linefeed, or  formfeed.  If  you make  any
  699. mistakes, you will  receive an informative  error message and  a new prompt  --
  700. make liberal use of '?' and 'ESC' to  feel your way through the commands.   One
  701. important command  is 'help'  --  you should  use it  the  first time  you  run
  702. C-Kermit.
  703.  
  704. A command line beginning with a percent sign '%' is ignored.  Such lines may be
  705. used to include illustrative commentary in Kermit command dialogs.
  706.  
  707. Interactive C-Kermit accepts commands from files as well as from the  keyboard.
  708. When you  start C-Kermit,  the program  looks  for a  file CKERMIT.INI  in  the
  709. current PATH,  and executes  any  commands it  finds  there.  The  commands  in
  710. CKERMIT.INI must be in interactive format,  not in the command-line format.   A
  711. 'take' command  is also  provided for  use at  any time  during an  interactive
  712. session, to  allow interactive-format  commands to  be  executed from  a  file;
  713. command files may be nested to any reasonable depth.
  714.  
  715. Here is a brief list of C-Kermit interactive commands:
  716.  
  717.               %  Comment
  718.               !  Execute an OS/2 command, or start up CMD.EXE.
  719.             bye  Terminate and log out a remote Kermit server.
  720.           close  Close a log file.
  721.         connect  Establish a terminal connection to a remote system.
  722.             cwd  Change Working Directory.
  723.            dial  Dial a telephone number.
  724.       directory  Display a directory listing.
  725.            echo  Display arguments literally.
  726.            exit  Exit from the program, closing any open files.
  727.          finish  Tell remote Kermit server to exit, but not log out.
  728.             get  Get files from a remote Kermit server.
  729.            help  Display a help message for a given command.
  730.             log  Open log file: debugging, packet, session, transaction.
  731.            quit  Same as 'exit'.
  732.         receive  Passively wait for files to arrive.
  733.          remote  Do some file management on a remote Kermit server.
  734.          script  Execute a login script with a remote system.
  735.            send  Send files.
  736.          server  Begin server operation.
  737.             set  Set various parameters.
  738.            show  Display values of 'set' parameters.
  739.           space  Display current disk space usage.
  740.      statistics  Display statistics about most recent transaction.
  741.            take  Execute commands from a file.
  742.  
  743.  
  744. The 'set' parameters are:
  745.  
  746.     block-check  Level of packet error detection.
  747.           delay  How long to wait before sending first packet.
  748.          duplex  Specify which side echoes during 'connect'.
  749.     escape-character  Prefix for "escape commands" during 'connect'.
  750.            file  Set various file parameters.
  751.    flow-control  Communication line full-duplex flow control.
  752.       handshake  Communication line half-duplex turnaround character.
  753.      incomplete  Disposition for incompletely received files.
  754.            line  Communication line device name.
  755.    modem-dialer  Type of modem-dialer on communication line.
  756.          parity  Communication line character parity.
  757.          prompt  The C-Kermit program's interactive command prompt.
  758.         receive  Parameters for inbound packets.
  759.           retry  Packet retransmission limit.
  760.            send  Parameters for outbound packets.
  761.           speed  Communication line speed.
  762.        terminal  Terminal parameters.
  763.  
  764.  
  765. The 'remote' commands are:
  766.  
  767.             cwd  Change remote working directory.
  768.          delete  Delete remote files.
  769.       directory  Display a listing of remote file names.
  770.            help  Request help from a remote server.
  771.            host  A command to the remote host in its command language.
  772.           space  Display current disk space usage on remote system.
  773.            type  Display a remote file on your screen.
  774.             who  Show who's logged in, or get information about a user.
  775.  
  776.  
  777. Most of these commands are described adequately in the Kermit User Guide or the
  778. Kermit book.  Special aspects of certain C-Kermit commands are described below.
  779.  
  780.  
  781. 5.1 The 'send' command
  782.  
  783. Syntax:     send fn
  784. or          send fn1 rfn1
  785.  
  786. Send the file  or files  denoted by fn  to the  other Kermit,  which should  be
  787. running as a  server, or which  should have been  given the 'receive'  command.
  788. Each file is sent under  its own name (as described  above, or as specified  by
  789. the 'set file names'  command).  If the  second form of  the 'send' command  is
  790. used, i.e.  with fn1 denoting  a single OS/2 file, rfn1  may be specified as  a
  791. name to send  it under.  The  'send' command  may be abbreviated  to 's',  even
  792. though 's' is not a unique abbreviation for a top-level C-Kermit command.
  793.  
  794. The wildcard  characters '*'  and '?'  are accepted  in fn.   If '?'  is to  be
  795. included, it  must  be prefixed  by  '^' to  override  its normal  function  of
  796. providing help.   '*' matches  any string,  '?' matches  any single  character.
  797. When fn contains '*' or '?' characters, there is a limit to the number of files
  798. that can be matched,  which varies depending  on the length  of the file  names
  799. involved.  If you get the  message 'Too many files  match' then you'll have  to
  800. make a more judicious selection.
  801.  
  802.  
  803. 5.2 The 'receive' command
  804.  
  805. Syntax:     receive
  806. or          receive fn1
  807.  
  808. Passively wait for files to arrive from  the other Kermit, which must be  given
  809. the 'send' command -- the 'receive' command does not work in conjunction with a
  810. server (use 'get'  for that).  If  fn1 is specified,  store the first  incoming
  811. file under that name.  The 'receive' command may be abbreviated to 'r'.  If the
  812. second form of  the command is  given, and fn1  contains a path  specification,
  813. then that path must exist -- C-Kermit will not create a directory for the file.
  814.  
  815.  
  816.  
  817. 5.3 The 'get' command
  818.  
  819. Syntax:     get rfn
  820. or          get
  821.             rfn
  822.             fn1
  823.  
  824. Request a remote Kermit server to send the named file or files.  Since a remote
  825. file specification  (or  list) might  contain  spaces, which  normally  delimit
  826. fields of a C-Kermit command, an alternate  form of the command is provided  to
  827. allow the inbound file to be given a new name: type 'get' alone on a line,  and
  828. you will be prompted separately for  the remote and local file  specifications,
  829. for example
  830.  
  831.     C-Kermit>get
  832.      Remote file specification: profile exec
  833.      Local name to store it under: profile.ibm
  834.  
  835. As with 'receive',  if more  than one file  arrives as  a result  of the  'get'
  836. command, only the first will be stored  under the alternate name given by  fn1;
  837. the remaining files will be stored under their own names if possible.  If a '?'
  838. is to be included in the remote file specification, you must prefix it with '^'
  839. to suppress its normal function of providing help.
  840.  
  841. If you have started a multiline 'get'  command, you may escape from its  lower-
  842. level prompts by typing a carriage return in response to the prompt, e.g.
  843.  
  844.     C-Kermit>get
  845.      Remote file specification: foo
  846.      Local name to store it under: (Type a carriage return here)
  847.     (cancelled)
  848.     C-Kermit>
  849.  
  850.  
  851. 5.4 The 'server' command
  852.  
  853.  
  854. The 'server' command places C-Kermit in "server mode" on the currently selected
  855. communication line.  All further commands must  arrive as valid Kermit  packets
  856. from the Kermit on  the other end  of the line.  The  OS/2 C-Kermit server  can
  857. respond to the following commands:
  858.  
  859. Command               Server Response
  860.   get                   Sends files
  861.   send                  Receives files
  862.   bye                   Attempts to log itself out
  863.   finish                Exits to level from which it was invoked
  864.   remote directory      Sends directory lising
  865.   remote delete         Removes files
  866.   remote cwd            Changes working directory
  867.   remote type           Sends files to your screen
  868.   remote space          Reports about its disk usage
  869.   remote help           Lists these capabilities
  870.   remote host           Execute an OS/2 command
  871.  
  872. Note that the 'remote host' command should be used with great care.  It  should
  873. only be used to invoke OS/2 commands which produce their output through  stdio,
  874. and which  require  no  keyboard interaction.   Commands  such  as  'copy'  and
  875. 'rename' are OK (although  they may sometimes produce  output on stderr,  which
  876. will appear on the screen of the OS/2  system).  It is not possible to use  the
  877. 'remote host' command to run a word proccessor, for instance.
  878.  
  879.  
  880. 5.5 The 'remote', 'bye', and 'finish' commands
  881.  
  882.  
  883. C-Kermit may itself request services from a remote Kermit server.  In  addition
  884. to 'send' and 'get', the following commands may also be sent from C-Kermit to a
  885. Kermit server:
  886.  
  887. remote cwd [directory ]
  888.         If the optional remote directory specification is included, you will be
  889.         prompted on a separate line for a password, which will not echo as  you
  890.         type it.  If  the remote system  does not require  a password for  this
  891.         operation, just type a carriage return.
  892.  
  893. remote delete rfn
  894.         delete remote file or files.
  895.  
  896. remote directory [rfn ]
  897.         directory listing of remote files.
  898.  
  899. remote host command
  900.         issue a command in the remote host's own command language.
  901.  
  902. remote space
  903.         disk usage report from the remote host.
  904.  
  905. remote type rfn
  906.         display remote file or files on the screen.
  907.  
  908. remote who [user ]
  909.         display information about who's logged in.
  910.  
  911. remote help
  912.         display remote server's capabilities.
  913.  
  914. bye and finish
  915.         When connected  to a  remote Kermit  server, these  commands cause  the
  916.         remote server to  terminate; 'finish'  returns it to  Kermit or  system
  917.         command level (depending on the implementation  or how the program  was
  918.         invoked); 'bye' also requests it to log itself out.
  919.  
  920.  
  921. 5.6 The 'log' and 'close' commands
  922.  
  923. Syntax:     log {debugging, packets, session, transactions} [fn1 ]
  924.             close {debugging, packets, session, transactions}
  925.  
  926. C-Kermit's progress may be logged in  various ways.  The 'log' command opens  a
  927. log, the 'close' command closes it.  In  addition, all open logs are closed  by
  928. the 'exit' and 'quit' commands.  A name may be specified for a log file; if the
  929. name is omitted, the file is created with a default name as shown below.
  930.  
  931. log debugging
  932.         This produces a voluminous log of the internal workings of C-Kermit, of
  933.         use to Kermit developers or maintainers in tracking down suspected bugs
  934.         in the C-Kermit program.  Use of  this feature dramatically slows  down
  935.         the Kermit  protocol.   Default  name:  debug.log.  (Debug  logging  is
  936.         disabled.)
  937.  
  938. log packets
  939.         This produces a record  of all the packets  that go in  and out of  the
  940.         communication port.  This log is of  use to Kermit maintainers who  are
  941.         tracking down protocol problems in either  C-Kermit or any Kermit  that
  942.         C-Kermit is connected to.  Default name: packet.log.
  943.  
  944. log session
  945.         This log  will contain  a copy  of everything  you see  on your  screen
  946.         during the 'connect' command, except for local messages or  interaction
  947.         with local escape commands.  Default name: session.log.
  948.  
  949. log transactions
  950.         The transaction log  is a record  of all  the files that  were sent  or
  951.         received while transaction  logging was  in effect.   It includes  time
  952.         stamps and  statistics, filename  transformations, and  records of  any
  953.         errors that may have occurred.  The transaction log allows you to  have
  954.         long unattended file  transfer sessions  without fear  of missing  some
  955.         vital screen message.  Default name: transact.log.
  956.  
  957.  
  958. The 'close' command explicitly closes a log, e.g. 'close debug'.
  959.  
  960. Note: Debug and  Transaction logs are  a compile-time option;  C-Kermit may  be
  961. compiled without these logs, in which case it will run faster, it will take  up
  962. less space on the disk, and the commands relating to them will not be present.
  963.  
  964.  
  965. 5.7 Local File Management Commands
  966.  
  967. OS/2 Kermit  allows  some degree  of  local file  management  from  interactive
  968. command level:
  969.  
  970. directory [fn ]
  971.         Displays a listing of the names, sizes, and dates of files matching  fn
  972.         (which defaults to '*.*').  Equivalent to 'dir'.
  973.  
  974. cwd directory-name
  975.         Changes Kermit's working  directory to  the one  given.  The  directory
  976.         specification may be preceeded by a drive specifier, in which case that
  977.         becomes the  current  drive.   This command  affects  only  the  Kermit
  978.         process and any processes it may subsequently create.
  979.  
  980. space
  981.         Display information  about  disk  space and/or  quota  in  the  current
  982.         directory and device.  Equivalent to 'chkdsk'.
  983.  
  984. ! [command ]
  985.         The command is executed by the OS/2 command interpreter CMD.EXE.  If no
  986.         command is specified, then CMD.EXE itself is started; terminating it by
  987.         typing 'exit' will return you to  C-Kermit command level.  Use the  '!'
  988.         command to provide  file management or  other functions not  explicitly
  989.         provided  by   C-Kermit  commands.    The  '!'   command  has   certain
  990.         peculiarities:
  991.  
  992.            - At least one space must separate the '!' from the command.
  993.            - A 'cd'  or 'chdir'  (change directory)  command executed  in  this
  994.              manner will  have no  effect on  returning to  Kermit --  use  the
  995.              C-Kermit 'cwd' command instead.
  996.  
  997.  
  998. 5.8 The 'set' Command
  999.  
  1000. Syntax:     set parameter [parameter] value
  1001.  
  1002. Since Kermit is designed to allow  diverse systems to communicate, it is  often
  1003. necessary to  issue special  instructions  to allow  the  program to  adapt  to
  1004. peculiarities  of  the  another  system  or  the  communication  path.    These
  1005. instructions are accomplished by the 'set' command.  The 'show' command may  be
  1006. used to  display  current settings.   Here  is  a brief  synopsis  of  settings
  1007. available in the current release of C-Kermit:
  1008.  
  1009. block-check {1, 2, 3}
  1010.         Determines the level of per-packet error  detection.  "1" is a  single-
  1011.         character 6-bit checksum, folded to include the values of all bits from
  1012.         each character.   "2" is  a 2-character,  12-bit  checksum.  "3"  is  a
  1013.         3-character, 16-bit  cyclic redundancy  check  (CRC).  The  higher  the
  1014.         block check,  the better  the error  detection and  correction and  the
  1015.         higher the resulting  overhead.  Type 1  is most commonly  used; it  is
  1016.         supported by all Kermit implementations, and it has proven adequate  in
  1017.         most circumstances.   Types 2  or 3  would be  used to  advantage  when
  1018.         transferring 8-bit binary files over noisy lines.
  1019.  
  1020. delay n
  1021.         How many seconds to wait before sending the first packet after a 'send'
  1022.         command, in remote mode only.  It is irrelevant for OS/2 Kermit,  since
  1023.         it is always in local mode.
  1024.  
  1025. duplex {full, half}
  1026.         For use during 'connect'.  Specifies which  side is doing the  echoing;
  1027.         'full' means the  other side,  'half' means C-Kermit  must echo  typein
  1028.         itself.
  1029.  
  1030. escape-character cc
  1031.         For use  during  'connect' to  get  C-Kermit's attention.   The  escape
  1032.         character acts as  a prefix  to an  'escape command',  for instance  to
  1033.         close the connection and return to C-Kermit or OS/2 command level.  The
  1034.         normal escape character is Control-] (29).
  1035.  
  1036. file {display, names, type, warning}
  1037.         Establish various file-related parameters:
  1038.  
  1039.         display {on, off}
  1040.                 Normally 'on'; when  in local  mode, display  progress of  file
  1041.                 transfers on the  screen (stdout), and  listen to the  keyboard
  1042.                 for interruptions.   If 'off'  (equivalent to  '-q' on  command
  1043.                 line) none of this is done,  and the file transfer may  proceed
  1044.                 in the background oblivious to any other work concurrently done
  1045.                 at the console terminal.
  1046.  
  1047.         names {converted, literal}
  1048.                 Normally 'converted, which means  that outbound filenames  have
  1049.                 path specifications  stripped and  non-alphanumeric  characters
  1050.                 changed to X's (except for the dot).  'literal' means that none
  1051.                 of these conversions  are done; therefore,  any directory  path
  1052.                 appearing in a  received file specification  must exist and  be
  1053.                 write-accessible.  When  literal  naming  is  being  used,  the
  1054.                 sender should  not use  path names  in the  file  specification
  1055.                 unless the  same  path  exists  on the  target  system  and  is
  1056.                 writable.
  1057.  
  1058.         type {binary, text} [{7, 8}]
  1059.                 The file type is normally text, which means that any  control-Z
  1060.                 in a file being transmitted is treated as an end-of-file  mark.
  1061.                 Binary means transmit file contents without conversion.  Binary
  1062.                 ('-i' in command line notation) is necessary for binary files.
  1063.  
  1064.                 The optional  trailing parameter  tells the  bytesize for  file
  1065.                 transfer. It is 8 by default.  If you specify 7, the high order
  1066.                 bit will be stripped from each byte of sent and received files.
  1067.                 This is  useful  for  transferring text  files  that  may  have
  1068.                 extraneous high  order bits  set in  their disk  representation
  1069.                 (e.g.  Wordstar or similar word processor files).
  1070.  
  1071.         warning {on, off}
  1072.                 Normally 'off', which means  that incoming files will  silently
  1073.                 overwrite existing files of the same name.  When 'on' ('-w'  on
  1074.                 command line)  Kermit  will check  if  an arriving  file  would
  1075.                 overwrite an existing file; if so, it will construct a new name
  1076.                 for the arriving file, of the  form FZZn.BAR, where FZZ.BAR  is
  1077.                 the name they share and n is a "generation number"; if  FZZ.BAR
  1078.                 exists, then  the new  file will  be called  FZZ00001.BAR.   If
  1079.                 FZZ.BAR  and  FZZ00001.BAR   exist,  the  new   file  will   be
  1080.                 FZZ00002.BAR, and so on.  If the  common name were more than  6
  1081.                 characters long (eg  GOODDATA.DAT), then the  new name for  the
  1082.                 arriving file would be GOODD001.DAT and so on.
  1083.  
  1084.                     CAUTION: If Control-F or Control-B is used to cancel an
  1085.                     incoming file, and a file  of the same name  previously
  1086.                     existed, and the "file warning" feature is not enabled,
  1087.                     then the previous copy of the file will disappear.
  1088.  
  1089.  
  1090. flow-control {none, xon/xoff}
  1091.         Normally 'xon/xoff' for  full duplex  flow control.  Should  be set  to
  1092.         'none' if the other system cannot  do xon/xoff flow control, or if  you
  1093.         have issued  a 'set  handshake' command.   If set  to 'xon/xoff',  then
  1094.         'handshake' should be set to 'none'.  This setting applies during  both
  1095.         terminal connection and file transfer.
  1096.  
  1097. incomplete {discard, keep}
  1098.         Disposition for incompletely  received files.  If  an incoming file  is
  1099.         interrupted or  an error  occurs during  transfer,  the part  that  was
  1100.         received so far is  normally discarded.  If  you 'set incomplete  keep'
  1101.         then such file fragments will be kept.
  1102.  
  1103. handshake {xon, xoff, cr, lf, bell, esc, none}
  1104.         Normally 'none'.  Otherwise, half-duplex communication line  turnaround
  1105.         handshaking is done,  which means  Kermit will  not reply  to a  packet
  1106.         until it has received  the indicated handshake  character or has  timed
  1107.         out waiting  for it;  the handshake  setting applies  only during  file
  1108.         transfer.  If you  'set handshake'  to other than  'none', then  'flow'
  1109.         should be set to 'none'.
  1110.  
  1111. line [dev ]
  1112.         The device name for the communication line to be used for file transfer
  1113.         and terminal  connection, e.g.  COM2.  If  you  omit the  device  name,
  1114.         Kermit will revert to its default device, COM1.
  1115.  
  1116. modem-dialer {direct, hayes, racalvadic, ventel, ...}
  1117.         The type of modem dialer on the communication line.  'direct' indicates
  1118.         either there is no dialout modem, or that if the line requires  carrier
  1119.         detection to open, then  'set line' will hang  waiting for an  incoming
  1120.         call.  'hayes', 'ventel', and the others  indicate that 'set line'  (or
  1121.         the '-l' argument) will prepare for a subsequent 'dial' command for the
  1122.         given dialer.  Support for new dialers  is added from time to time,  so
  1123.         type 'set  modem ?'  for a  list of  those supported  in your  copy  of
  1124.         Kermit. See the description of the 'dial' command.
  1125.  
  1126. parity {even, odd, mark, space, none}
  1127.         Specify character parity  for use in  packets and terminal  connection,
  1128.         normally 'none'.  If other than 'none',  C-Kermit will seek to use  the
  1129.         8th-bit prefixing mechanism for  transferring 8-bit binary data,  which
  1130.         can be used successfully only if the other Kermit agrees; if not, 8-bit
  1131.         binary data cannot be successfully transferred.
  1132.  
  1133. prompt [string ]
  1134.         The given string will be substituted for 'C-Kermit>' as this  program's
  1135.         prompt.   If  the  string  is  omitted,  the  prompt  will  revert   to
  1136.         'C-Kermit>'.  If the string  is enclosed in  double quotes, the  quotes
  1137.         will be stripped and any leading and trailing blanks will be retained.
  1138.  
  1139. send parameter
  1140.         Establish parameters to  use when  sending packets.  These  will be  in
  1141.         effect only for  the initial packet  sent, since the  other Kermit  may
  1142.         override  these  parameters  during  the  protocol  parameter  exchange
  1143.         (unless noted below).
  1144.  
  1145.         end-of-packet cc
  1146.                 Specifies the control character needed  by the other Kermit  to
  1147.                 recognize the end of a  packet.  C-Kermit sends this  character
  1148.                 at the  end of  each packet.   Normally 13  (carriage  return),
  1149.                 which  most  Kermit  implementations  require.   Other  Kermits
  1150.                 require no  terminator  at  all, still  others  may  require  a
  1151.                 different terminator, like linefeed (10).
  1152.  
  1153.         packet-length n
  1154.                 Specify the  maximum  packet  length  to  send.   Normally  90.
  1155.                 Shorter packet lengths can  be useful on  noisy lines, or  with
  1156.                 systems or front ends or networks that have small buffers.  The
  1157.                 shorter the packet, the higher the overhead, but the lower  the
  1158.                 chance of a packet being corrupted by noise, and the less  time
  1159.                 to retransmit corrupted  packets.  This  command overrides  the
  1160.                 value requested by the other Kermit during protocol  initiation
  1161.                 unless the other Kermit requests a shorter length.
  1162.  
  1163.         pad-character cc
  1164.                 Designate a character  to send before  each packet.   Normally,
  1165.                 none is  sent.  Outbound  padding  is sometimes  necessary  for
  1166.                 communicating with  slow half  duplex systems  that provide  no
  1167.                 other means of line turnaround control.  It can also be used to
  1168.                 send special characters to communications equipment that  needs
  1169.                 to be put in "transparent" or "no echo" mode, when this can  be
  1170.                 accomplished in by feeding it a certain control character.
  1171.  
  1172.         padding n
  1173.                 How many pad characters to send, normally 0.
  1174.  
  1175.         start-of-packet cc
  1176.                 The normal Kermit packet prefix is Control-A (1); this  command
  1177.                 changes the prefix C-Kermit puts on outbound packets.  The only
  1178.                 reasons this should  ever be changed  would be:  Some piece  of
  1179.                 equipment somewhere between  the two Kermit  programs will  not
  1180.                 pass through  a  Control-A;  or, some  piece  of  of  equipment
  1181.                 similarly placed is echoing its input.  In the latter case, the
  1182.                 recipient of  such an  echo can  change the  packet prefix  for
  1183.                 outbound packets to be different from that of arriving packets,
  1184.                 so that  the  echoed packets  will  be ignored.   The  opposite
  1185.                 Kermit must also be told to  change the prefix for its  inbound
  1186.                 packets.
  1187.  
  1188.         timeout n
  1189.                 Specifies the number of  seconds you want  the other Kermit  to
  1190.                 wait  for  a  packet  before  timing  it  out  and   requesting
  1191.                 retransmission.  Defaults to 10 seconds.
  1192.  
  1193.  
  1194. receive parameter
  1195.         Establish parameters to request  the other Kermit  to use when  sending
  1196.         packets.
  1197.  
  1198.         end-of-packet cc
  1199.                 Requests the other  Kermit to  terminate its  packets with  the
  1200.                 specified character.
  1201.  
  1202.         packet-length n
  1203.                 Specify the maximum packet  length to that  you want the  other
  1204.                 Kermit to send, normally 90.  If you specify a length of 95  or
  1205.                 greater, then it will be used if the other Kermit supports, and
  1206.                 agrees to use, the Kermit protocol extension for long  packets.
  1207.                 In this  case,  the maximum  length  depends upon  the  systems
  1208.                 involved, but there would normally be no reason for packets  to
  1209.                 be more  than  about  1000 characters  in  length.   The  'show
  1210.                 parameters' command  displays  C-Kermit's current  and  maximum
  1211.                 packet lengths.
  1212.  
  1213.         pad-character cc
  1214.                 C-Kermit normally  does  not  need  to  have  incoming  packets
  1215.                 preceded with pad characters.  This command allows C-Kermit  to
  1216.                 request the other Kermit to use cc as a pad character.  Default
  1217.                 cc is NUL, ASCII 0.
  1218.  
  1219.         padding n
  1220.                 How many pad characters to ask for, normally 0.
  1221.  
  1222.         start-of-packet cc
  1223.                 Change the  prefix C-Kermit  looks for  on inbound  packets  to
  1224.                 correspond with what the other Kermit is sending.
  1225.  
  1226.         timeout n
  1227.                 Normally, each Kermit partner sets its packet timeout  interval
  1228.                 based on  what  the  opposite Kermit  requests.   This  command
  1229.                 allows you  to  override the  normal  procedure and  specify  a
  1230.                 timeout interval  for  OS/2  Kermit to  use  when  waiting  for
  1231.                 packets from  the other  Kermit.  If  you  specify 0,  then  no
  1232.                 timeouts will  occur, and  OS/2 Kermit  will wait  forever  for
  1233.                 expected packets to arrive.
  1234.  
  1235.  
  1236. speed {0, 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200}
  1237.         The baud rate  for the external  communication line.  'set  baud' is  a
  1238.         synomym for 'set speed'.  19200 baud may not be available, depending on
  1239.         your communications hardware.
  1240.  
  1241. terminal parameter value
  1242.         Used for specifying terminal parameters.  Currently, 'bytesize' is  the
  1243.         only parameter provided, and it  can be set to  7 or 8.  This  controls
  1244.         the width of the  data path between the  console and the remote  system
  1245.         when C-Kermit is in  connect (ie terminal emulation)  mode.  It's 7  by
  1246.         default.
  1247.  
  1248.  
  1249. 5.9 The 'show' Command
  1250.  
  1251. Syntax:     show {parameters, versions}
  1252.  
  1253. The 'show'  command with  the default  argument  of 'parameters'  displays  the
  1254. values of  all  the  'set'  parameters described  above.   If  you  type  'show
  1255. versions', then C-Kermit will display the version numbers and dates of all  its
  1256. internal modules.  You should use the 'show versions' command to ascertain  the
  1257. vintage of your Kermit program before reporting problems to Kermit maintainers.
  1258.  
  1259.  
  1260. 5.10 The 'statistics' Command
  1261.  
  1262. The statistics  command  displays  information about  the  most  recent  Kermit
  1263. protocol transaction, including  file and  communication line  i/o, timing  and
  1264. efficiency, as well as  what encoding options were  in effect (such as  8th-bit
  1265. prefixing, repeat-count compression).
  1266.  
  1267.  
  1268. 5.11 The 'take' and 'echo' Commands
  1269.  
  1270. Syntax:     take fn1
  1271.             echo [text to be echoed]
  1272.  
  1273. The 'take' command instructs C-Kermit to execute commands from the named  file.
  1274. The file  may  contain any  interactive  C-Kermit commands,  including  'take';
  1275. command files may be  nested to any  reasonable depth, but  it may not  contain
  1276. text to be sent to  a remote system during  the 'connect' command.  This  means
  1277. that a command file like this:
  1278.  
  1279.  
  1280.     set speed 9600
  1281.     connect
  1282.     login myuserid
  1283.     mypassword
  1284.     etc
  1285.  
  1286. will not  send "login  myserid" or  any of  the following  text to  the  remote
  1287. system.  To  carry on  a canned  dialog, use  the 'script'  command,  described
  1288. later.
  1289.  
  1290. The '%' command is useful for including comments in take-command files.  It may
  1291. only be used at the beginning of a line.
  1292.  
  1293. The 'echo'  command  may be  used  within  command files  to  issue  greetings,
  1294. announce progress, ring the terminal  bell, etc.  This command simply  displays
  1295. its text argument (almost) literally at the terminal; the argument may  contain
  1296. octal escapes of the form \ooo, where o is an octal digit (0-7), and there  may
  1297. be 1, 2, or 3 such digits, whose value specify an ASCII character, such as \007
  1298. (or \07 or just \7) for beep, \012 for newline, etc.
  1299.  
  1300. Take-command files  are in  exactly the  same syntax  as interactive  commands.
  1301. Note that this  implies that  if you want  to include  special characters  like
  1302. question mark or circumflexes that you would  have to quote with ^ when  typing
  1303. interactive commands, you must quote these  characters the same way in  command
  1304. files.  Long lines may be continued by ending them with a single ^.
  1305.  
  1306. Command files  may be  used in  lieu of  command macros,  which have  not  been
  1307. implemented in this version of C-Kermit.  For instance, if you commonly connect
  1308. to a system called 'B' that is connected to com2 at 4800 baud, you could create
  1309. a file called b containing the commands
  1310.  
  1311.     % C-Kermit command file to connect to System B thru com2
  1312.     set line com2
  1313.     set speed 4800
  1314.     % Beep and give message
  1315.     echo \007Connecting to System B...
  1316.     connect
  1317.  
  1318. and then simply type 'take b' (or 't b' since no other commands begin with  the
  1319. letter 't') whenever you  wish to connect to  system B. Note the comment  lines
  1320. and the beep inserted into the 'echo' command.
  1321.  
  1322. For connecting to  IBM mainframes,  a number  of 'set'  commands are  required;
  1323. these, too, can be conveniently collected into a 'take' file like this one:
  1324.  
  1325.     % Sample C-Kermit command file to set up current line
  1326.     % for IBM mainframe communication
  1327.     %
  1328.     set parity mark
  1329.     set handshake xon
  1330.     set flow-control none
  1331.     set duplex half
  1332.  
  1333.  
  1334. Note that no single command is available to wipe out all of these settings  and
  1335. return C-Kermit  to its  default startup  state;  to do  that, you  can  either
  1336. restart the program, or  else make a command  file that executes the  necessary
  1337. 'set' commands:
  1338.  
  1339.     % Sample C-Kermit command file to restore normal settings
  1340.     %
  1341.     set parity none
  1342.     set handshake none
  1343.     set flow-control xon/xoff
  1344.     set duplex full
  1345.  
  1346.  
  1347. An implicit 'take' command is executed upon your CKERMIT.INI file when C-Kermit
  1348. starts up, upon either interactive or command-line invocation.  The CKERMIT.INI
  1349. file should contain 'set'  or other commands you  want to be  in effect at  all
  1350. times.  For instance, you might want override the default action when  incoming
  1351. files have the same names as existing files -- in that case, put the command
  1352.  
  1353.     set file warning on
  1354.  
  1355. in your CKERMIT.INI file.
  1356.  
  1357. Errors encountered during execution of take files (such as failure to  complete
  1358. dial or script operations) cause termination of the current take file,  popping
  1359. to the level  that invoked  it (take file,  interactive level,  or the  command
  1360. interpreter).
  1361.  
  1362. You may  also  use the  redirection  mechanism  to cause  C-Kermit  to  execute
  1363. commands from a file:
  1364.  
  1365.     kermit < cmdfile
  1366.  
  1367. or you can even pipe commands in from another process:
  1368.  
  1369.     genkcmds | kermit
  1370.  
  1371.  
  1372. 5.12 The 'connect' Command
  1373.  
  1374.  
  1375. The 'connect' command ('c' is an acceptable non-unique abbreviation) links your
  1376. terminal to another computer as if it  were a local terminal to that  computer,
  1377. through the  device specified  in  the most  recent  'set line'  command.   All
  1378. characters you type at your keyboard  are sent out the communication line  (and
  1379. if you have 'set duplex half',  also displayed on your screen), and  characters
  1380. arriving at  the  communication port  are  displayed on  the  screen.   Current
  1381. settings of speed, parity, duplex, and  flow-control are honored, and the  data
  1382. connection is  7 bits  wide unless  you have  given the  command 'set  terminal
  1383. bytesize 8'.  If you have issued a 'log session' command, everything you see on
  1384. your screen will also be recorded to your session log.  This provides a way  to
  1385. "capture" files from remote systems that don't have Kermit programs available.
  1386.  
  1387. To get back to your  own system, you must type  the escape character, which  is
  1388. Control-] (^]) (unless  you have  changed it  with the  'set escape'  command),
  1389. followed by a  single-character command, such  as 'c'  for "close  connection".
  1390. Single-character commands include:
  1391.  
  1392.   c     Close the connection
  1393.   b     Send a BREAK signal for about 1 second
  1394.   0     (zero) send a null
  1395.   ?     Display help information about these options
  1396.   h     Hangup the phone
  1397.   ^]    Send Control-] itself (whatever you  have defined the escape  character
  1398.         to be, typed twice in a row sends one copy of it).
  1399.  
  1400. Uppercase and  control  equivalents  for  (most  of)  these  letters  are  also
  1401. accepted.  A space  typed after  the escape  character is  ignored.  Any  other
  1402. character will produce a beep.
  1403.  
  1404. In connect  mode, C-Kermit  emulates a  DEC VT102  terminal.  See  the  section
  1405. "Terminal Emulation" for details of how the emulation works.
  1406.  
  1407. Note that when in interactive command  mode, C-Kermit reads its keyboard  input
  1408. from stdin  and  writes its  screen  output to  stdout,  allowing  command-line
  1409. redirection to  be used  as described  in the  previous section.   However,  in
  1410. connect mode, keyboard input is obtained through the KBD subsystem, and  screen
  1411. output is through the  VIO subsystem.  It is  therefore impossible to  redirect
  1412. terminal I/O.
  1413.  
  1414.  
  1415. 5.13 The 'dial' command
  1416.  
  1417. Syntax:     dial telephone-number-string
  1418.  
  1419. This command controls  dialout modems; you  should have already  issued a  'set
  1420. line' and  'set speed'  command to  identify the  terminal device,  and a  'set
  1421. modem' command to identify the  type of modem to be  used for dialing.  In  the
  1422. 'dial' command, you supply the phone number and the Kermit program feeds it  to
  1423. the modem in the appropriate format and then interprets dialer return codes and
  1424. modem signals to  inform you whether  the call was  completed.  The  telephone-
  1425. number-string may contain  imbedded modem-dialer  commands, such  as comma  for
  1426. Hayes pause, or '&' for Ventel dialtone wait and '%' for Ventel pause  (consult
  1427. your modem manual for details).
  1428.  
  1429. At the time of this writing, support is included for the following modems:
  1430.  
  1431.    - AT&T 7300 Internal Modem
  1432.    - Cermetek Info-Mate 212A
  1433.    - Concord Condor CDS 220
  1434.    - DEC DF03-AC
  1435.    - DEC DF100 Series
  1436.    - DEC DF200 Series
  1437.    - General DataComm 212A/ED
  1438.    - Hayes Smartmodem 1200 and compatibles
  1439.    - Penril
  1440.    - Racal Vadic
  1441.    - US Robotics 212A
  1442.    - Ventel
  1443.  
  1444. A number of these modems  are not generally found  connected to PCs.  The  most
  1445. common modem type used with an OS/2 system is "Hayes compatible".  Support  for
  1446. new modems is added to the program from time to time; you can check the current
  1447. list by typing 'set modem ?'.
  1448.  
  1449. The device used for  dialing out is  the one selected in  the most recent  'set
  1450. line' command.
  1451.  
  1452. Example:
  1453.  
  1454.     kermit -l com1 -b 1200
  1455.     C-Kermit>set modem-dialer hayes         hint: abbreviate set m h
  1456.     C-Kermit>dial 9,5551212
  1457.     Connected!
  1458.     C-Kermit>connect                        hint: abbreviate c
  1459.     logon, request remote server, etc.
  1460.     ^]c                                     escape back
  1461.     C-Kermit> ...
  1462.     C-Kermit>quit                           hint: abbreviate q
  1463.  
  1464. this disconnects modem, and hangs up the line.
  1465.  
  1466. C-Kermit requires that  the modem track  the computer's  "data terminal  ready"
  1467. (DTR) signal.  If a switch setting is available to simulate DTR asserted within
  1468. the modem, then it should normally not be in that setting.  Otherwise the modem
  1469. will be unable to hang up at the end of a call.
  1470.  
  1471. For Hayes dialers, two important switch settings  are no. 1 and no. 6.   Switch
  1472. no. 1 should  be normally be  UP so that  the modem can  act according to  your
  1473. computer's DTR signal.  Switch no. 6  should normally be  UP so  carrier-detect
  1474. functions properly (but put it DOWN if you have trouble with the UP  position).
  1475. Switches no. 2  (English versus  digit result codes)  and no.  4 (Hayes  echoes
  1476. modem commands) may be in either position.
  1477.  
  1478.  
  1479. 5.14 The 'script' Command
  1480.  
  1481. Syntax:     script expect send [expect send] . . .
  1482.  
  1483. "expect" has the syntax: expect[-send-expect[-send-expect[...]]]
  1484.  
  1485. The 'script' command  carries on  a "canned dialog"  with a  remote system,  in
  1486. which data is sent according to the remote system's responses.  The typical use
  1487. is for logging in to a remote system automatically.
  1488.  
  1489. C-Kermit's script facility operates in a  manner similar to that commonly  used
  1490. by the Unix UUCP system's 'L.sys' file  entries.  A login script is a  sequence
  1491. of the form:
  1492.  
  1493.     expect send [expect send] . . .
  1494.  
  1495. where expect is a prompt or message to  be issued by the remote site, and  send
  1496. is the string (names, numbers, etc)  to return, and expects are separated  from
  1497. sends by spaces.  The send may also be  the keyword EOT, to send Control-D,  or
  1498. BREAK, to send a break signal.  Letters in sends may be prefixed by '~' to send
  1499. special characters, including:
  1500.  
  1501. ~b        backspace
  1502. ~s        space
  1503. ~q        '?'(trapped by Kermit's command interpreter)
  1504. ~n        linefeed
  1505. ~r        carriage return
  1506. ~t        tab
  1507. ~'        single quote
  1508. ~~        tilde
  1509. ~"        double quote
  1510. ~x        XON (Control-Q)
  1511. ~c        don't append a carriage return
  1512. ~d        delay approx 1/3 second during send
  1513. ~o[o[o]]  an octal character
  1514. ~w[d[d]]  wait specified interval during expect, then time out
  1515.  
  1516. As with some UUCP systems, sent strings are  followed by ~r unless they have  a
  1517. ~c.
  1518.  
  1519. Only the last 7 characters in each expect are matched.  A null expect, e.g.  ~0
  1520. or two adjacent dashes, causes a short delay before proceeding to the next send
  1521. sequence.  A null expect always succeeds.
  1522.  
  1523. As with UUCP, if the expect string  does not arrive, the script attempt  fails.
  1524. If you  expect that  a sequence  might not  arrive, as  with UUCP,  conditional
  1525. sequences may be expressed in the form:
  1526.  
  1527.     -send-expect[-send-expect[...]]
  1528.  
  1529. where dashed sequences are followed as long as previous expects fail.  Timeouts
  1530. for expects can be specified using ~w; ~w with no arguments waits 15 seconds.
  1531.  
  1532. Expect/send transactions can  be easily  be debugged  by logging  transactions.
  1533. This records all  exchanges, both  expected and actual.   The script  execution
  1534. will also be logged in the session log, if that is activated.
  1535.  
  1536. Note that '^' characters in login scripts, as in any other C-Kermit interactive
  1537. commands, must  be doubled  up.  A  line may  be ended  with a  single '^'  for
  1538. continuation.
  1539.  
  1540. Example:
  1541.  
  1542. Using a Hayes-compatible  modem, dial  up a  PAD, simulating  pressing CR  four
  1543. times to get the 'PAD>' prompt.  (Note how '~0' stands for a null expect string
  1544. and for a null send string - ie just send a carriage return.) Call a VAX system
  1545. named 'ERCVAX'.  Get  the ..name: prompt,  and respond with  the user name  and
  1546. password.  Notice that the '^' character is used to continue the script command
  1547. onto the next line.
  1548.  
  1549.     set modem hayes
  1550.     set line com2
  1551.     set baud 1200
  1552.     dial 0319871234
  1553.     script ~0 ~0 ~0 ~0 ~0 ~0 ~0 ~0 PAD> CALL~sERCVAX ^
  1554.     name: SMITH word: SECRET
  1555.  
  1556. Note that 'set  line' is issued  after 'set  modem', but before  'set baud'  or
  1557. other line-related parameters.
  1558.  
  1559.  
  1560. 5.15 The 'help' Command
  1561.  
  1562. Syntax:     help
  1563. or          help keyword
  1564. or          help {set, remote} keyword
  1565.  
  1566. Brief help messages or menus are always available at interactive command  level
  1567. by typing a question mark at any  point.  A slightly more verbose form of  help
  1568. is available through the 'help' command.  The 'help' command with no  arguments
  1569. prints a brief summary of  how to enter commands and  how to get further  help.
  1570. 'help' may be followed by one of the top-level C-Kermit command keywords,  such
  1571. as 'send', to request information about a command.  Commands such as 'set'  and
  1572. 'remote' have a further level of help.   Thus you may type 'help', 'help  set',
  1573. or 'help set parity'; each will  provide a successively more detailed level  of
  1574. help.
  1575.  
  1576.  
  1577. 5.16 The 'exit' and 'quit' Commands
  1578.  
  1579.  
  1580. These two commands are identical.  Both of them do the following:
  1581.  
  1582.    - Relinquish access to any communication line assigned via 'set line'.
  1583.    - Hang up the modem, if any, by dropping DTR.
  1584.    - Close any open logs or other files.
  1585.    - Exit the program.
  1586.  
  1587. After exit from C-Kermit, your current directory  will be the same as when  you
  1588. started the program.  The 'exit' command is issued implicitly whenever C-Kermit
  1589. halts normally, e.g. after a command line invocation.
  1590.  
  1591.  
  1592.  
  1593. 6 TERMINAL EMULATION
  1594.  
  1595.  
  1596. When you issue a  'connect' command the first  time after starting Kermit,  the
  1597. screen clears and the  cursor is positioned at  the top left-hand corner.   You
  1598. can log into the remote host computer as normal.  In this mode, the PC emulates
  1599. a DEC VT102 terminal,  so any control codes  or escape sequences received  from
  1600. the host will be actioned appropriately.
  1601.  
  1602. The 25th line on the screen  is used as a status  line, giving the name of  the
  1603. comms port, the current baud rate and how to obtain help.
  1604.  
  1605. Some keys on the VT102 keyboard have  no direct equivalent on the PC  keyboard.
  1606. The following table shows the mapping  which obtains between VT102 keys and  PC
  1607. keys.  Note that the Alt n combinations  use the number keys along the top  row
  1608. of the keyboard, not the numeric keypad.
  1609.  
  1610. VT102               IBMPC
  1611.  
  1612. Delete              Del
  1613. PF1                 F1
  1614. PF2                 F2
  1615. PF3                 F3
  1616. PF4                 F4
  1617. Keypad 0            Alt 0
  1618. Keypad 1            Alt 1
  1619. Keypad 2            Alt 2
  1620. Keypad 3            Alt 3
  1621. Keypad 4            Alt 4
  1622. Keypad 5            Alt 5
  1623. Keypad 6            Alt 6
  1624. Keypad 7            Alt 7
  1625. Keypad 8            Alt 8
  1626. Keypad 9            Alt 9
  1627. Keypad minus        F5 or F6
  1628. Keypad comma        F7 or F8
  1629. Keypad dot          F9
  1630. Keypad enter        F10
  1631. No Scroll           Home
  1632.  
  1633.  
  1634. The PC's 'Home' key (equivalent to the VT102 'No Scroll' key) freezes the  data
  1635. on the screen.   It is  typically used  when listing  a long  file, to  prevent
  1636. information being scrolled off the top of the screen.  Note that the  Control-S
  1637. and Control-Q (Xon/Xoff) keys should not be used for this purpose if 'flow'  is
  1638. set to 'xon/xoff',  because they interfere  with the correct  operation of  the
  1639. comms device driver flow  control.  When the 'Home'  key is pressed, an  'xoff'
  1640. will be sent automatically  when the device driver's  receive buffer fills  up,
  1641. and an 'xon' will be sent as it empties after the 'Home' key has been pressed a
  1642. second time to unfreeze the screen.  All other keys are ignored when the screen
  1643. is frozen.  The status line indicates when the emulator is in this state.
  1644.  
  1645. Information which scrolls off the top of the screen is not in fact lost, but is
  1646. stored in an "extended display buffer",  which can be examined by pressing  the
  1647. 'PgUp' key.  The extended display buffer can contain a number of screenfulls of
  1648. data, and the 'PgUp' and 'PgDn' keys can  be used to range freely through  this
  1649. data.  If  any  other key  is  pressed while  the  extended display  buffer  is
  1650. visible, the current screen contents are redisplayed and the keystroke is  sent
  1651. to the host.   The 'PgUp' and  'PgDn' keys may  be used even  when the host  is
  1652. still sending data.  If  Xon/Xoff flow control  is in effect,  no data will  be
  1653. lost.
  1654.  
  1655. The following VT102 features are not implemented:
  1656.  
  1657.    - Smooth scrolling
  1658.    - 132-column mode
  1659.    - Alternate character ROM
  1660.    - LED lamps
  1661.  
  1662. The VT102 keyboard autorepeat mode is always enabled.
  1663.  
  1664. When in connect mode, typing the  escape character (Control-]) followed by a  ?
  1665. for help will display a "pop-up" help window, indicating the options available.
  1666. These options are detailed in  the section on the  connect command.  If ^]c  is
  1667. typed to close the  connection, the screen  is restored to  its state when  the
  1668. 'connect' command was issued.  A subsequent 'connect' will re-display the VT102
  1669. screen.
  1670.  
  1671. The control codes and  escape sequences recognised by  the VT102 emulation  are
  1672. listed below.  For full details of  the effects of these codes, please  consult
  1673. the VT102 manual.
  1674.  
  1675. ENQ           5     Send answerback message "OS/2 Kermit"
  1676. BEL           7     Sound beep
  1677. BS            8     Cursor left
  1678. TAB           9     Cursor to next tab stop
  1679. LF            10    Cursor down
  1680. VT            11    As LF
  1681. FF            12    As LF
  1682. CR            13    Cursor to left margin
  1683. SO            14    Select G1 character set
  1684. SI            15    Select G0 character set
  1685. CAN           24    Cancel escape sequence
  1686. SUB           26    As CAN
  1687. ESC           26    See below
  1688. Others              Ignored
  1689.  
  1690. ESC 7         Save cursor position
  1691. ESC 8         Restore cursor position
  1692. ESC D         Index
  1693. ESC E         Next line
  1694. ESC H         Set tab at current column
  1695. ESC M         Reverse index
  1696. ESC Z         Identify terminal
  1697. ESC c         Reset
  1698. ESC =         Enter application keypad mode
  1699. ESC >         Exit application keypad mode
  1700. ESC # 3       Double height and width emulation - top half of line
  1701. ESC # 4       Double height and width emulation - bottom half of line
  1702. ESC # 5       Single height and width
  1703. ESC # 6       Single height and double width emulation
  1704. ESC # 8       Screen alignment display
  1705. ESC ( g       G0 designator - g = A,B or 0 only
  1706. ESC ) g       G1 designator - g = A,B or 0 only
  1707. ESC [ Pn A    Cursor up
  1708. ESC [ Pn B    Cursor down
  1709. ESC [ Pn C    Cursor right
  1710. ESC [ Pn D    Cursor left
  1711. ESC [ Pl ;Pc H      Direct cursor address
  1712. ESC [ Pl ;Pc f      Direct cursor address
  1713. ESC [ Pn c    Identify report - response is ESC [ ? 6 ; 2 c
  1714. ESC [ 3 g     Clear all tabs
  1715. ESC [ 0 g     Clear tabs at current column
  1716. ESC [ ? Pn h  Set DEC private mode - modes supported as shown below
  1717. ESC [ ? Pn l  Reset DEC private mode - modes supported as shown below
  1718.  
  1719.     mode no.        mode            set           reset
  1720.  
  1721.         1           Cursor key      Application   Cursor
  1722.         2           ANSI/VT52       N/A           VT52
  1723.         5           Screen          Reverse       Normal
  1724.         6           Origin          Relative      Absolute
  1725.         7           Wraparound      On            Off
  1726.  
  1727. ESC [ Pn h    Set mode - modes supported as shown below
  1728. ESC [ Pn l    Reset mode - modes supported as shown below
  1729.  
  1730.     mode no.        mode            set           reset
  1731.  
  1732.         2           Keyboard lock   On            Off
  1733.         4           Insert          Insert        Replace
  1734.        20           Newline         CR LF         CR
  1735.  
  1736. ESC Pn i      Printer/screen on/off - 4 to 7 supported
  1737. ESC [ 5 n     Status report
  1738. ESC [ 6 n     Cursor position report
  1739. ESC [ Pn x    Request terminal parameter
  1740. ESC [ Pn ;Pn r      Set top and bottom margins
  1741. ESC [ 0 J     Erase to end of screen
  1742. ESC [ 1 J     Erase from beginning of screen
  1743. ESC [ 2 J     Erase all of screen
  1744. ESC [ 0 K     Erase to end of line
  1745. ESC [ 1 K     Erase from beginning of line
  1746. ESC [ 2 K     Erase all of line
  1747. ESC [ Pn L    Insert blank lines
  1748. ESC [ Pn M    Delete lines
  1749. ESC [ Pn @    Insert blank characters
  1750. ESC [ Pn P    Delete characters
  1751. ESC [ Ps ;Ps ; ..;Ps m                                                         Character attributes or
  1752. ESC [ Ps ;Ps ; ..;Ps }                                                         Character attributes, as below:
  1753. 0       Default settings
  1754. 1       High intensity
  1755. 4       Underline
  1756. 5       Blink
  1757. 7       Reverse
  1758. 8       Invisible
  1759. 30-37   sets foreground colour to be as shown
  1760.         30      black
  1761.         31      red
  1762.         32      green
  1763.         33      yellow
  1764.         34      blue
  1765.         35      magenta
  1766.         36      cyan
  1767.         37      white
  1768. 40-47   sets background colour to be as shown
  1769.         40      black
  1770.         41      red
  1771.         42      green
  1772.         43      yellow
  1773.         44      blue
  1774.         45      magenta
  1775.         46      cyan
  1776.         47      white
  1777.  
  1778. Note that the  default character  set for  both G0  and G1  is 'A',  ie the  UK
  1779. character set.
  1780.  
  1781. The following escape  sequences are recognised  when the emulator  is put  into
  1782. VT52 mode by receiving the sequence ESC [ ? 2 l.
  1783.  
  1784. ESC A       Cursor up
  1785. ESC B       Cursor down
  1786. ESC C       Cursor right
  1787. ESC D       Cursor leftup
  1788. ESC F       Enter graphics mode
  1789. ESC G       Exit graphics mode
  1790. ESC H       Cursor to home
  1791. ESC I       Reverse line feed
  1792. ESC J       Erase to end of screen
  1793. ESC K       Erase to end of line
  1794. ESC Y l c   Direct cursor address
  1795. ESC Z       Identify
  1796. ESC =       Enter application keypad mode
  1797. ESC >       Exit application keypad mode
  1798. ESC <       Enter ANSI mode
  1799.  
  1800. The escape sequences below are accepted but ignored.
  1801.  
  1802. ESC O x     where x is any character
  1803. ESC ? x     where x is any character
  1804. ESC [ Pn q  Load LEDs
  1805.  
  1806.  
  1807.  
  1808. 7 C-KERMIT RESTRICTIONS AND KNOWN BUGS
  1809.  
  1810.  
  1811. If you find any bugs which are not documented here, please send details to  the
  1812. author:
  1813.  
  1814.           Dr C J Adie
  1815.           Edinburgh University Computing Service
  1816.           George Square
  1817.           Edinburgh
  1818.           EH8 9JU
  1819.           United Kingdom
  1820.  
  1821. or   (preferably)   by   electronic   mail    on   the   Janet   network    to:
  1822. C.J.Adie@UK.AC.EDINBURGH
  1823.  
  1824. 1. Server breakout:  There is  no way  of stopping  server operation  from  the
  1825.    keyboard, short of Control-Break.
  1826.  
  1827. 2. Debugging log: There is  very little debugging  information logged from  the
  1828.    OS/2-specific parts of the program (it was developed using Codeview).
  1829.  
  1830. 3. Set Delay: This should default to zero.  Currently it has no effect.
  1831.  
  1832. 4. Dial: The DIAL command has not  been tested.  It is impossible to  terminate
  1833.    the dialling process short of pressing Control-Break.
  1834.  
  1835. 5. Keyboard handling: In interactive command mode (as opposed to connect mode),
  1836.    the keyboard has  only the  natural key-to-ascii-code  mapping.  This  means
  1837.    that (for instance) the Del key does not  produce code 127, but a code of  0
  1838.    followed by 224.   A keyboard remapping  feature (perhaps incorporating  key
  1839.    macros) would be useful in many ways.
  1840.  
  1841.    In connect mode, it would be more logical to use the Scroll Lock key as  the
  1842.    equivalent of the  VT102 No Scroll  key, but this  means writing a  keyboard
  1843.    monitor, as Scroll Lock is not placed in the keyboard input buffer.
  1844.  
  1845. 6. Terminal emulation:  If  the host  sends  the  escape sequence  to  put  the
  1846.    terminal into  132-column  mode, and  subsequently  sends data  which  would
  1847.    appear in the rightmost 52  columns, this may mess  up the existing data  on
  1848.    the screen.  Really the emulator should ignore any data for these columns.
  1849.  
  1850. 7. Answerback: We should have a 'set terminal answerback ...' command to let us
  1851.    change the VT102 answerback message.
  1852.  
  1853. 8. Character set: We  should have a  'set terminal characterset'  to allow  the
  1854.    default character set to be  either the UK or the  US set.  At present,  the
  1855.    default is UK.
  1856.  
  1857. 9. File type: The way Control-Z is handled could be better.  There should be no
  1858.    'set file type  {binary, text}';  instead we want  a 'set  ctrlz {on,  off}'
  1859.    rather like  Kermit-MS.  A  better  display of  progress  of a  transfer  is
  1860.    needed, and  the interrupt  keystrokes should  conform to  the usual  Kermit
  1861.    conventions.
  1862.  
  1863. 10. Hangup: There  should be  a 'hangup'  command  (as well  as the  ^]h  escape
  1864.    sequence), which would drop DTR  and RTS, thus hanging  up a call through  a
  1865.    modem.
  1866.  
  1867. 11. Login Scripts: The  present login  scripts implementation  follows the  Unix
  1868.    conventions of UUCP's 'L.sys'  file, rather than  the normal Kermit  'INPUT/
  1869.    OUTPUT' style.
  1870.  
  1871.  
  1872.  
  1873.                                   APPENDIX A
  1874.                      INVOKING C-KERMIT FROM ANOTHER PROGRAM
  1875.  
  1876.  
  1877.  
  1878.  
  1879. If you are writing a communications program and wish to incorporate the  Kermit
  1880. protocol within it, one way is to use the OS/2 function call DosExecPgm to call
  1881. up C-Kermit.  You would supply  the instructions for Kermit using  command-line
  1882. options, and Kermit would do the transfer, returning back to your program  when
  1883. it had finished.
  1884.  
  1885. The only problem with this  scenario is that you  might already have opened  up
  1886. the COM port within your program, so that  when Kermit tries to do the same  it
  1887. gets an error code back  from DosOpen.  The -u  command line option gets  round
  1888. this problem.  It uses  the fact that  a child process  inherits the open  file
  1889. handles of its parent.  -u takes one  numeric parameter which is the handle  of
  1890. the COM port in question, and it must occur in front of any other  command-line
  1891. parameter which accesses the COM port.   The following is a complete C  program
  1892. written using  the Microsoft  C compiler  version 5.1  and the  Microsoft  OS/2
  1893. Software Development Toolkit, which illustrates how to use the -u  command-line
  1894. option.
  1895.  
  1896. #define INCL_BASE
  1897. #include <os2.h>
  1898. /*
  1899.  * Example of how to use the C-Kermit -u option to invoke
  1900.  * Kermit from another program under OS/2.
  1901.  */
  1902. main(int argc, char *argv[]) {
  1903. HFILE ttyfd;
  1904. USHORT action;
  1905. int err,i;
  1906. char failname[80];
  1907. char args[80];
  1908. RESULTCODES res;
  1909. struct dcb {   /* Device control block */
  1910.  USHORT write_timeout;
  1911.  USHORT read_timeout;
  1912.  BYTE flags1, flags2, flags3;
  1913.  BYTE error_replacement;
  1914.  BYTE break_replacement;
  1915.  BYTE xon_char;
  1916.  BYTE xoff_char;
  1917. } ttydcb;
  1918.  
  1919.  /*** Open a file ***/
  1920.  if (err=DosOpen(argv[1],&ttyfd,&action,0L,0,1,0x0012,0L)) {
  1921.   printf("Error %d opening %s\n",err,argv[1]);
  1922.   exit(1);
  1923.  }
  1924.  if (err=DosDevIOCtl(&ttydcb,NULL,0x0073,1,ttyfd)) {
  1925.   printf("Error %d from IOCTL on %s\n",err,argv[1]);
  1926.       exit(1);
  1927.  }
  1928.  ttydcb.flags3 &= 0xF9;
  1929.  ttydcb.flags3 |= 0x04; /* Read "some" data from line */
  1930.  DosDevIOCtl(NULL,&ttydcb,0x0053,1,ttyfd);
  1931.  
  1932.  /*** Call kermit ***/
  1933.  strcpy(args,"ckoker");
  1934.  i = strlen(args);
  1935.  args[i++]=0;
  1936.  sprintf(&args[i],"-u %d -q -s test.c",ttyfd);
  1937.  i += strlen(&args[i]);
  1938.  args[i++]=0;
  1939.  args[i++]=0;
  1940.  if (err=DosExecPgm(failname,80,EXEC_SYNC,args,NULL,&res,
  1941.           "KERMIT.EXE")) {
  1942.   printf("Error %d executing Kermit\n",err);
  1943.   exit(1);
  1944.  }
  1945.  
  1946.  /*** Print out return code ***/
  1947.  printf("Termination code %d\n",res.codeTerminate);
  1948.  printf("Result code %d\n",res.codeResult);
  1949.  
  1950.  /*** Close the file ***/
  1951.  if (err=DosClose(ttyfd)) {
  1952.   printf("Error %d closing %s\n",err,argv[1]);
  1953.  }
  1954. }
  1955.  
  1956.  
  1957.                                      INDEX
  1958.  
  1959.  
  1960.  
  1961. Dialout Modems  1
  1962.  
  1963. Emergency Exit  1
  1964.  
  1965. File Warning  1
  1966.  
  1967. Hayes Modem  1
  1968.                                         IBM  1
  1969.  
  1970.                                         Modems  1
  1971.  
  1972.                                         Warning  1
  1973.  
  1974.  
  1975.                                TABLE OF CONTENTS
  1976.  
  1977.  
  1978.  
  1979. 1 Introduction                                                              1
  1980. 1.1 Acknowledgements                                                      1
  1981. 1.2 OS/2 Kermit Capabilities                                              1
  1982. 1.3 Requirements                                                          1
  1983. 1.4 The Serial Port                                                       1
  1984. 1.5 Emergency Exit                                                        1
  1985. 2 The OS/2 File System                                                      1
  1986. 2.1 File Specifications                                                   1
  1987. 2.2 File Formats                                                          1
  1988. 3 File Transfer                                                             1
  1989. 4 Command Line Operation                                                    1
  1990. 4.1 Command Line Options                                                  1
  1991. 4.2 Command Line Examples                                                 1
  1992. 4.3 Exit Status Codes                                                     1
  1993. 5 Interactive Operation                                                     1
  1994. 5.1 The 'send' command                                                    1
  1995. 5.2 The 'receive' command                                                 1
  1996. 5.3 The 'get' command                                                     1
  1997. 5.4 The 'server' command                                                  1
  1998. 5.5 The 'remote', 'bye', and 'finish' commands                            1
  1999. 5.6 The 'log' and 'close' commands                                        1
  2000. 5.7 Local File Management Commands                                        1
  2001. 5.8 The 'set' Command                                                     1
  2002. 5.9 The 'show' Command                                                    1
  2003. 5.10 The 'statistics' Command                                             1
  2004. 5.11 The 'take' and 'echo' Commands                                       1
  2005. 5.12 The 'connect' Command                                                1
  2006. 5.13 The 'dial' command                                                   1
  2007. 5.14 The 'script' Command                                                 1
  2008. 5.15 The 'help' Command                                                   1
  2009. 5.16 The 'exit' and 'quit' Commands                                       1
  2010. 6 Terminal Emulation                                                        1
  2011. 7 C-Kermit Restrictions and Known Bugs                                      1
  2012. A Invoking C-Kermit from Another Program                                 1
  2013.  
  2014.