⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 使用Kermit协议传输文件的程序
💻
📖 第 1 页 / 共 3 页
字号:
is not effective in this case.  When the transfer is complete, you'll needto instruct your emulator to return to its terminal screen.4.3. Getting FilesIf your terminal emulator supports Kermit autodownloads AND server mode, youcan use GET ("gkermit -g files...") rather than RECEIVE ("gkermit -r"), andthe rest happens automatically, as when G-Kermit is sending.5. INTERRUPTING FILE TRANSFERG-Kermit supports file and group interruption.  The method for interruptinga transfer depends on your terminal emulator.  For example, while thefile-transfer display is active, you might type the letter 'x' to cancel thecurrent file and go on to the next one (if any), and the letter 'z' tocancel the group.  Or there might be buttons you can click with your mouse.When G-Kermit is in packet mode and your terminal emulator is in itsterminal screen, you can also type three (3) Ctrl-C characters in a row tomake G-Kermit exit and restore the normal terminal modes.6. TEXT AND BINARY TRANSFER MODEWhen sending files in binary mode, G-Kermit sends every byte exactly as itappears in the file.  This mode is appropriate for program binaries,graphics files, tar archives, compressed files, etc, and is G-Kermit'sdefault file-transfer mode when sending.  When receiving files in binarymode, G-Kermit simply copies each byte to disk.  (Obviously the bytes areencoded for transmission, but the encoding and decoding procedures give areplica of the original file after transfer.)When sending files in text mode, G-Kermit converts the record format to thecommon one that is defined for the Kermit protocol, namely lines terminatedby carriage return and linefeed (CRLF); the receiver converts the CRLFs towhatever line-end or record-format convention is used on its platform.  Whenreceiving files in text mode, G-Kermit simply strips carriage returns,leaving only a linefeed at the end of each line, which is the Unixconvention.When receiving files, the sender's transfer mode (text or binary)predominates if the sender gives this information to G-Kermit in a KermitFile Attribute packet, which of course depends on whether your terminalemulator's Kermit protocol has this feature.  Otherwise, if you gave a -i or-T option on the gkermit command line, the corresponding mode is used;otherwise the default mode (binary) is used.Furthermore, when either sending or receiving, G-Kermit and your terminalemulator's Kermit can inform each other of their OS type (Unix in G-Kermit'scase).  If your emulator supports this capability, which is called"automatic peer recognition", and it tells G-Kermit that its platform isalso Unix, G-Kermit and the emulator's Kermit automatically switch intobinary mode, since no record-format conversion is necessary in this case.Automatic peer recognition is disabled automatically if you include the -i(image) or -T (text) option.When sending, G-Kermit sends all files in the same mode, text or binary.There is no automatic per-file mode switching.  When receiving, however,per-file switching occurs automatically based on the incoming Attributepackets, if any (explained below), that accompany each file, so if thefile sender switches types between files, G-Kermit follows along.7. PATHNAMESWhen SENDING a file, G-Kermit obtains the filenames from the command line.It depends on the shell to expand metacharacters (wildcards and tilde).G-Kermit uses the full pathname given to find and open the file, but thenstrips the pathname before sending the name to the receiver.  For example:  $ gkermit -s /etc/hostsresults in an arriving file called "HOSTS" or "hosts" (the directory part,"/etc/", is stripped; see next section about capitalization).However, if a pathname is included in the -a option, the directory partis not stripped:  $ gkermit -s /etc/hosts -a /tmp/hostsThis example sends the /etc/hosts file but tells the receiver that its nameis "/tmp/hosts".  What the receiver does with the pathname is, of course, upto the receiver, which might have various options for dealing with incomingpathnames.When RECEIVING a file, G-Kermit does NOT strip the pathname, since incomingfiles normally do not include a pathname unless you told your terminal toinclude them or gave an "as-name" including a path when sending to G-Kermit.If the incoming filename includes a path, G-Kermit tries to store the filein the specified place.  If the path does not exist, the transfer fails.The incoming filename can, of course, be superseded with the -a option.8. FILENAME CONVERSIONWhen sending a file, G-Kermit normally converts outbound filenames tocommon form: uppercase, no more than one period, and no funny characters.So, for example, gkermit.tar.gz would be sent as GKERMIT_TAR.GZ.When receiving a file, if the name is all uppercase, G-Kermit converts itto all lowercase.  If the name contains any lowercase letters, G-Kermitleaves the name alone.  Otherwise G-Kermit accepts filename characters asthey are, since Unix allows filenames to contain practically any characters.If the automatic peer recognition feature is available in the terminalemulator, and G-Kermit recognizes the emulator's platform as Unix, G-Kermitautomatically disables filename conversion and sends and accepts filenamesliterally.You can force literal filenames by including the -P option on the commandline.9. FILENAME COLLISIONSWhen G-Kermit receives a file whose name is the same as that of an existingfile, G-Kermit backs up the existing file by adding a unique suffix to itsname.  The suffix is ".~n~", where n is a number between 1 and 999.  Thisthe same kind of backup suffix used by GNU EMACS and C-Kermit (both of whichcan be used to prune excess backup files).  But since G-Kermit does not readdirectories (see Implementation Notes below), it can not guarantee that thenumber chosen will be higher than any other backup prefix number for thesame file.  In fact, the first free number, starting from 1, is chosen.  Ifan incoming file already has a backup suffix, G-Kermit strips it beforeadding a new one, rather than creating a file that has two backup suffixes.To defeat the backup feature and have incoming files overwrite existingfiles of the same name, include the -w (writeover) option on the commandline.If G-Kermit has not been been given the -w option and it fails to create abackup file, the transfer fails.10. KERMIT PROTOCOL DETAILSBlock check  G-Kermit uses the 3-byte, 16-bit CRC by default.  If the other Kermit  does not agree, both Kermits automatically drop down to the single-byte  6-bit checksum that is required of all Kermit implementations.Attributes  When sending files, G-Kermit conveys the file transfer mode and file  size in bytes to the receiver in an Attribute (A) packet if the use of  A-packets was negotiated.  This allows the receiver to switch to the  appropriate mode automatically, and to display the percent done, estimated  time left, and/or a thermometer bar if it has that capability.  When  receiving, G-Kermit looks in the incoming A-packet, if any, for the  transfer mode (text or binary) and switches itself accordingly on a  per-file basis.Handling of the Eighth Bit  G-Kermit normally treats the 8th bit of each byte as a normal data bit.  But if you have a 7-bit connection, transfers of 8-bit files fail unless  you tell one or both Kermits to use the appropriate kind of parity, in  which case Kermit uses single-shift escaping for 8-bit bytes.  Generally,  telling either Kermit is sufficient; it tells the other.  Use the -p  option to tell G-Kermit which parity to use.  Locking shifts are not  included in G-Kermit.Control-Character Encoding  G-Kermit escapes all control characters when sending (for example,  Ctrl-A becomes #A).  When receiving, it accepts both escaped and bare  control characters, including NUL (0).  However, unescaped control  characters always present a danger, so if uploads to G-Kermit fail, tell  your terminal emulator's Kermit to escape most or all control characters  (in C-Kermit and Kermit 95 the command is SET PREFIXING CAUTIOUS or SET  PREFIXING ALL).Packet Length  All legal packet lengths, 40-9020, are supported although a lower  maximum might be imposed on platforms where it is known that bigger ones  don't work.  When receiving, G-Kermit sends its receive packet length to  the sender, and the sender must not send packets any longer than this  length.  The default length for most platforms is 4000 and it may be  overridden with the -e command-line option.Sliding Windows  G-Kermit does not support sliding windows.  Streaming is used instead.  If the other Kermit bids to use sliding windows, G-Kermit declines.Streaming  If the terminal emulator's Kermit informs G-Kermit that it has a  reliable connection (such as TCP/IP or X.25), and the emulator's Kermit  supports streaming, then a special form of the Kermit protocol is used  in which data packets are not acknowledged; this allows the sender to  transmit a steady stream of (framed and checksummed) data to the  receiver without waiting for acknowledgements, allowing the fastest  possible transfers.  Streaming overcomes such obstacles as long round  trip delays, unnecessary retransmissions on slow network connections,  and most especially the TCP/IP Nagle and Delayed ACK heuristics which  are deadly to a higher-level ACK/NAK protocol.  When streaming is in use  on a particular connection, Kermit speeds are comparable to FTP.  The  drawback of streaming is that transmission errors are fatal; that's why  streaming is only used on reliable connections, which, by definition,  guarantee there will be no transmission errors.  However, watch out for  the relatively rare circumstance in which emulator thinks it has a  reliable connection when it doesn't -- for example a Telnet connection  to a terminal server, and a dialout from the terminal server to the  host.  Use the -S option on the command line to defeat streaming in such  situations.Using all defaults on a TCP/IP connection on 10BaseT (10Mbps) Ethernet froma modern Kermit program like C-Kermit 7.0 or Kermit 95, typical transferrates are 150-500Kcps.11. PROBLEMS, BUGS, ERRORSIf file transfers fail: . Make sure your terminal emulator is not unprefixing control characters;   various control characters might cause trouble along the communication   path.  When in doubt, instruct the file sender to prefix all control   characters. . Make sure your Unix terminal is conditioned for the appropriate kind   of flow control. . Use command-line options to back off on performance and transparency;   use -S to disable streaming, -e to select a shorter packet length, -p   to select space or other parity, -b to increase or disable the timeout,   and/or establish the corresponding settings on your emulator.When receiving files in text mode, G-Kermit strips all carriage returns,even if they aren't part of a CRLF pair.If you have a TCP/IP connection (e.g. Telnet or Rlogin) to Unix from aterminal emulator whose Kermit protocol does not support streaming,downloads from G-Kermit are likely to be as much as 10 or even 100 timesslower than uploads if the TCP/IP stack engages in Nagle or Delayed ACKheuristics; typically, when your terminal emulator's Kermit protocol sendsan acknowledgment, the TCP stack holds on to it for (say) 1/5 second beforesending it, because it is "too small" to send right away.As noted in Section 9, the backup prefix is not guaranteed to be the highestnumber.  For example, if you have files oofa.txt, oofa.txt.~1~, andoofa.txt.~3~ in your directory, and a new oofa.txt file arrives, the oldoofa.txt is backed up to oofa.txt.~2~, rather than oofa.txt.~4~ as you mightexpect.  This is because gkermit lacks directory reading capabilities, forreasons noted in Section 14, and without this, finding the highest existingbackup number for a file is impractical.If you send a file to G-Kermit with streaming active when the connection isnot truly reliable, all bets are off.  A fatal error should occur promptly,but if huge amounts of data are lost, G-Kermit might never recognize a singledata packet and therefore not diagnose a single error; yet your terminalemulator keeps sending packets since no acknowledgments are expected; thetransfer eventually hangs at the end of file.  Use -S on G-Kermit's commandline to disable streaming in situations where the terminal emulator requestsit in error.You can use G-Kermit's debug log for troubleshooting; this is useful mainlyin conjunction with the source code.  But even if you aren't a C programmer,it should reveal any problem in enough detail to help pinpoint the cause ofthe failure.  "gkermit -d" (with no action options) writes a short debug.logfile that shows the build options and settings.The debug log is also a packet log; to extract the packets from it, use:  grep ^PKT debug.logPackets in the log are truncated to avoid wrap-around on your screen, andthey have the Ctrl-A packet-start converted to ^ and A to avoid triggeringa spurious autodownload when displaying the log on your screen.In certain circumstances it is not desirable or possible to use -d to createa log file called debug.log in the current directory; for example, if youdon't have write access to the current directory, or you already have adebug.log file that you want to keep (or transfer).  In this case, you caninclude a filename argument after -d:  gkermit -d /tmp/testing.log -s *.c(This is an exception to the rule that option arguments are not optional.)If all else fails, you can contact the Kermit Project for technical support;see:  http://www.columbia.edu/kermit/supportfor instructions.12. BUILDING G-KERMITG-Kermit is written to require the absolute bare minimum in system servicesand C-language features and libraries, and therefore should be portable topractically any Unix platform at all with any C compiler.The source files are:  makefile   The build procedure  gwart.c    Source code for a mini-lex substitute  gproto.w   G-Kermit protocol state machine to be preprocessed by gwart  gkermit.h  G-Kermit header file  gkermit.c  G-Kermit main module and routines  gcmdline.c G-Kermit command-line parser  gunixio.c  Unix-specific i/o routinesA simple makefile is provided, which can be used with make or gmake.  Thereare three main targets in the makefile:  posix    Build for any POSIX.1 compliant platform (termios).  This is the    default target, used if you type "make" (or "gmake") alone.  This    target works for most modern Unixes, including GNU/Linux, FreeBSD,    OpenBSD, NetBSD, BSDI, HP-UX, Solaris, SunOS, Unixware, AIX, etc.  sysv    Build for almost any AT&T System V platform (termio).  Examples    include AT&T Unix releases, e.g. for the AT&T 7300, HP-UX versions    prior to 7.00.  bsd    Build for any BSD (pre-4.4) or Unix V7 platform (sgtty).  Examples    include NeXTSTEP 3.x, OSF/1, and 4.3BSD or earlier.Note that the target names are all lowercase; "posix" is the default target(the one used if you just type "make").  If the build fails with a messagelike:  gunixio.c: 65: Can't find include file termios.h  *** Error code 1then try "make sysv" or "make bsd".  See the build list below for examples.Some special build targets are also provided:  sysvx    Like sysv but uses getchar()/putchar() for packet i/o rather than    buffered nonblocking read()/write(); this is necessary for certain    very old System V platforms (see description of USE_GETCHAR below).  stty    When none of the other targets compiles successfully, try this one,    which runs the external stty program rather than trying to use    API calls to get/set terminal modes (system("stty raw -echo") and    system("stty -raw echo")).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -