home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
277_01
/
xmodem.doc
< prev
next >
Wrap
Text File
|
1988-11-15
|
2KB
|
61 lines
Xmodem Under Xenix/Unix
copyright 1986 Ronald Florence
The module xmodem.c is written to be compiled with a modified version
of cu.c and/or with xr.c, using the defines specified in the Makefile
and the headers of the appropriate files.
Remote Xmodem
When compiled with xr.c, xmodem.c provides standalone programs, xr
and xt (actually a link) which enable a remote computer logged onto
the host (unix) machine to transmit to or receive from the unix machine
using Xmodem protocol.
The options are the same for both send and receive:
-c crc mode (checksum is the default)
-d fn debug messages to fn
-t text (CR-NL <-> NL conversions)
To transfer TO the unix host give the command
xr [-ct] [-d errfile] filename
on the unix host, wait for xr to announce it is ready, then begin the
Xmodem send from the remote machine. To transfer FROM the unix host,
give the command
xt [-ct] [-d errfile] filename
on the unix host, wait for xt to announce it is ready, then begin the
Xmodem receive on the remote machine. xt will adjust to the sync
character of the Xmodem receiver (match crc or checksum).
Both xt and xr ignore signals, and should be terminated by sending a
Ctrl-X <CAN>, which is the signal Xmodem programs normally send to
cancel a transfer. If the remote machine screws up, the Ctrl-X can be
sent manually.
The byte counts of text files transferred from ms-dos machines with the
"-t" option will be shorter on the unix machine because the <CR>s have
been dropped.
Xmodem with cu or other terminal programs
If you have a unix/xenix source license, xmodem.c can be compiled with
cu.c to provide a version of cu that can receive and transmit to
bulletin boards, Compuserve, etc., using Xmodem (Modem 7) protocol in
either crc or checksum mode.
The xmodem.c module can also be compiled with other terminal programs,
such as kermit, to provide xmodem transfer capabilities. One easy way
to use the module with a program like cu is to kill the receive process
in cu, condition the line to
~(ISTRIP | IXON | IXOFF | PARENB) , CS8
then fork to start xget() or xput(). When the child is finished,
do a longjmp to restart the receive process.