📄 ckcbwr.txt
字号:
patient and let Kermit "drain" them.If C-Kermit is sending a file, remote-mode packet-mode breakout (Ctrl-C Ctrl-Cby default) is not effective until after C-Kermit sends its first packet. IfC-Kermit is receiving a file or is in server mode, it will be effective rightaway. In the former case, the SET DELAY value determines the earliest time atwhich you can break out of packet mode.Some communication programs have errors in their implementation of Kermitattribute packets. If you get an error message from your communicationprogram like "Attribute error", tell C-Kermit to SET ATTRIBUTES OFF. Betteryet, switch to a real Kermit program, such as MS-DOS Kermit.When using C-Kermit to transfer files with the HP48SX calculator, you mustSET FLOW NONE. The HP48SX does not support flow control, and evidently alsobecomes confused if you attempt to use it. You might also need to useSET SEND PAUSE 100 (or other number).The fullscreen file transfer display will not work right if your terminal typeis set incorrectly, or is not known to the host operating system. Even whenit does work, it might slow down your file transfers a bit, especially onhigh-speed network connections. On certain small computers, it has beenreported to cause increased disk activity due to swapping or paging. Thefullscreen display is not particularly useful with speaking or Braille devices.In these cases, use SET FILE DISPLAY CRT or SET FILE DISPLAY SERIAL.If you have trouble transferring files over a TCP/IP connection, give thecommand: SET PARITY SPACEand try again. If that doesn't work, also try a shorter packet length.On the other hand, if file transfers through a TCP/IP connection work, but arevery slow, use a longer packet length, 2000 or more, and also try increasingthe window size. Also, make sure FLOW is NONE since TCP/IP handles flowcontrol itself, and XON/XOFF processing only slows things down.Some communication software claims to implement sliding windows, but does soincorrectly. If sliding window transfers fail, set C-Kermit's window size tothe smallest one that works, for example: SET WINDOW 1The UNIX version of C-Kermit discards carriage returns when receiving filesin text mode. Thus, "bare" carriage returns (sometimes used to achieveoverstriking) are lost.SET FILE COLLISION BACKUP is the default. This means: - If you send the same file lots of times, there will be many backup files. There is no automatic mechanism within Kermit to delete them, no notion of a "version retention count", etc, but you can use the PURGE command to clean them up. - If a file arrives that has the same name as a directory, the file transfer fails because Kermit will not rename a directory. Send the file with another name, or use SET FILE COLLISION RENAME. - If the directory lacks write permission, the file transfer fails even if you have write access to the file that is being backed up; in that case, switch to SET FILE COLLISION OVERWRITE or APPEND, or send to a different directory.SET FILE COLLISION UPDATE depends on the date/time stamp in the attributepacket. However, this is recorded in local time, not Universal Time (GMT),and there is no indication of time zone. The time is expressed to theprecision of 1 second, but some file systems do not record with this precision-- for example, MS-DOS records the file date/time only to the nearest 2seconds. This might cause update operations to send more files thannecessary.(This paragraph does NOT apply to UNIX, where, as of C-Kermit 6.1, C-Kermitpipes incoming mail and print material directly the mail or print program):When C-Kermit is receiving files from another Kermit program that has beengiven the MAIL or REMOTE PRINT command, C-Kermit follows the current filenamecollision action. This can be disconcerting if the action was (for example)BACKUP, because the existing file will be renamed, and the new file will bemailed (or printed) and then deleted. Kermit cannot temporarily change toRENAME because the file collision action occurs when the filename packet isreceived, and the PRINT or MAIL disposition only comes later, in the Attributepacket.Execution of multiple file transfers by C-Kermit from a command file whenin remote mode might exhibit long delays between each transfer. To avoidthis, just include the command "SET DELAY 0" in your command file before anyof the file-transfer commands.(13) SCRIPT PROGRAMMING13.1. Comments Versus the SCRIPT CommandRemember that ";" and "#" introduce comments when (a) they are the firstcharacter on the line, or (b) they are preceded by at least one blank ortab within a line. Thus constructions like: INPUT 5 ; SCRIPT ~0 #--#--#must be coded using backslash notation to keep the data from being ignored: INPUT 5 \59 ; 59 is the decimal ASCII code for ";" SCRIPT ~0 \35--#--# ; 43 is the decimal ASCII code for "#"or, more simply: INPUT 5 \; ; Just quote the semicolon SCRIPT ~0 \#--#--# ; Just quote the "#"13.2. Alphabetic Case and the INPUT CommandINPUT and REINPUT caseless string comparisons do not work for non-ASCII(international) characters. Workaround: SET INPUT CASE OBSERVE. Even then,the "lexically less than" and "lexically greater than" operations (IF LLT, IFLGT) probably won't work as expected. The same is true for thecase-conversion functions \Flower() and \Fupper(). C-Kermit does not know thecollating sequence for different character sets and languages. (On the otherhand, it might work depending on such items as how Kermit was linked, whetheryour operating supports "locales", etc)13.3. NUL (0) Characters in C-Kermit CommandsYou can't include a NUL character (\0) in C-Kermit command text withoutterminating the character string in which it appears. For example: echo In these brackets [\0] is a NULwill echo "In these brackets [". This applies to ECHO, INPUT, OUTPUT, and allother commands (but you can represent NUL by "\N" in an OUTPUT string). Thisis because C-language strings are terminated internally by the NUL character,and it allows all of C-Kermit's string comparison and manipulation functionsto work in the normal "C" way.To illustrate: INPUT 5 \0is equivalent to: INPUT 5and: INPUT 5 ABC\0DEFis equivalent to: INPUT 5 ABCINPUT operations discard and ignore NUL characters that arrive from thecommunication device, meaning that they do not figure into matching operations(e.g. A<NUL>B matches AB); they are not deposited in the INPUT buffer(\v(input)); and they are not counted in \v(incount), with two exceptions: 1. An arriving NUL character restarts the INPUT SILENCE timer. 2. An arriving NUL character terminates the INPUT command with the SUCCESS condition if the INPUT command was given an empty search string. In this case \v(incount) is set to 1.Also, the \v(inchar) variable is null (completely empty) if the last INPUTcharacter was NUL. That is, there is no way to tell only by looking at\v(inchar) the difference between a NUL that was INPUT and no INPUT at all.If the INPUT command succeeded but \v(inchar) is empty, then a NUL characterwas input. Also, \v(incount) will be set to 1.\v(incount) and \v(inchar) are NOT affected by the CLEAR command.13.4. \ffiles() and \fnextfile() PeculiaritiesThe following script program: for \%i 1 \ffiles(oofa.*) 1 { send \fnextfile() }did not work as expected in C-Kermit 6.0 and earlier but does work inC-Kermit 6.1 and later.13.5. Commands That Have Only Local EffectCertain settings are local to each command level, meaning that subordinatecommand levels (macros or command files) can change them without affectingtheir values at higher command levels. When a new command level is invoked,the value is inherited from the previous level. These settings are: CASE COUNT and \v(count) INPUT CASE INPUT TIMEOUT MACRO ERROR TAKE ERRORThis arrangement allows CASE, TIMEOUT, and ERROR settings, which are used tocontrol automatic exit from a command file or macro upon error, to beautomatically restored when the command file or macro exits.The COUNT variable follows this rule too, which permits nested SET COUNT /IF COUNT loops, as in this example in which the inner loop counts down fromthe current COUNT value of the outer loop (try it): DEFINE INNER WHILE COUNT { WRITE SCREEN { Inner:}, SHOW COUNT } SET COUNT 5 WHILE COUNT { WRITE SCREEN Outer:, SHOW COUNT, DO INNER }Keep in mind that an inferior command level cannot manipulate the COUNTvalue held by a higher level. For example: DEFINE OOFA SHOW COUNT, IF COUNT GOTO LOOP SET COUNT 5 :LOOP OOFA ECHO Doneresults in an infinite loop; the COUNT value remains at 5 because it is neverdecremented at the same level at which it was set.NOTE: "WHILE COUNT" did not work prior to edit 095 of ckuusr.c, 19 Jan 93.13.6. Literal Braces in Function CallsSince braces are used in function calls to indicate grouping, there is no wayto pass literal braces to the function itself. Solution: Define a variablecontaining the string that has braces. Example: define \%a ab{cd echo \fsubstring(\%a) ab{cdIf the string is to start with a leading brace and end with a closing brace,then double braces must appear around the string (which itself is enclosed inbraces): define \%a {{{foo}}} echo \fsubstring(\%a) {foo}This also works for any other kind of string: define \%a {{ab{cd}} echo \fsubstring(\%a) ab{cd13.7. Defining Variables on the C-Kermit Command LineTo define variables on the C-Kermit command line, use the -C command-lineoption with one or more DEFINE or ASSIGN commands. Note that the C-Kermitcommand line must cope with the quoting rules of your shell. Examples: kermit -C "define \\%a foo, define phonenumber 7654321"In this case we follow UNIX quoting rules by doubling the backslash. OnceC-Kermit starts, the \%a and \m(phonenumber) variables are defined asindicated and can be used in the normal way.In DOS or Windows or OS/2 the command would be: kermit -C "define \%%a foo, define phonenumber 7654321"Here we need to double the percent sign rather than the backslash becauseof DOS shell quoting rules.13.8. Per-Character Echo Check with the OUTPUT CommandSometimes the OUTPUT command must be used to send commands or data to a devicein "echoplex" mode, meaning that characters must be sent one at a time, andthe next character can not be sent until the echo from the previous one hasbeen received. For example, a certain PBX might have this characteristic.Let's say a Kermit script is used to program the PBX. If characters are senttoo fast, they can be lost. It would seem that the command: SET OUTPUT PACING <milliseconds>could be used to take care of this, but the pacing interval is constant andmust be set large enough to allow even the slowest echo to finish. If thescript is large (an actual example is 14,000 lines long), this can cause itto take hours longer than it needs to.Here is a macro you can use to OUTPUT a string in an Echoplex environment: define XOUTPUT { local \%c \%i set output pacing 0 for \%i 1 \flen(\%*) 1 { asg \%c \fsubstr(\%*,\%i,1) output \%c input 2 \%c } }C-Kermit 7.0 or later is required.It sends one character at a time and then waits up to 2 seconds for thecharacter to be echoed back, but continues to the next character as soonas the echo appears, so no time is wasted. You can add an IF FAIL clauseafter the INPUT in case you want to do something special about failureto detect an echo within the timeout period. Obviously you can also changethe 2-second limit, and adjust the script in any other desired way.13.9. Other...Escape sequences (or any strings that contain control characters) can't beused as labels, GOTO targets, or SWITCH cases.(End of CKCBWR.TXT)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -