[comp.sys.att] xmodem on unixpc

vern@zebra.UUCP (Vernon C. Hoxie) (02/27/89)

	I'm having some trouble getting 'xmodem' as distributed on the
net, to receive files from ms-dos machines using ProComm.  They can
transfer down from me but get fatal stops when trying to send files to
my machine.  This is 'xmodem 3.6' by Steve Grandi with a unix-pc patch by
Emmet Grey.

	When reviewing the xmodem.log, I find that the file is received
here but the program doesn't seem to recognize it.  One of the curious
entries in the log is that it is receiving at 1200 baud when the sender
is operating at 300.  Looking into the code I find that the message is
generated as the result of the following entry:

	if (ioctl(0,TCGETA,&ttystemp) < 0)	/* get tty structure */
                  ^
That zero is supposed to be a file descriptor but there is no open()
etc. performed that returns a 'fildes'.  If I assume that since they are
logged in on a port that that port will be their 'stdin'.  Does 'stdin'
always equal 'fildes = 0'?

	Looking elsewhere in the code, I find that all the 'read()'s
use 'fildes = 0' and the 'write()'s use 'fildes = 1'.

	How do I use this from my terminal?  There is no way to tell it
which port I want to use! (ph0, ph1, tty000, etc).  In this case, it
assuredly should have other 'fildes's wouldn't it?

	If 'stdin' = 'fildes'0, then why doesn't the 'struct termio'
have the correct value?  This should be set during loggin even if they
are not 'unices'.  After all, the OBM did adjust to the proper setting
or else they couldn't have communicated at all.

	Are there other patches or how have others using this code got
it to work?

	By the way, another person tried to use this from a different
machine and also using ProComm, but at 1200 baud and he couldn't send
in files either.

-- 
Vernon C. Hoxie		       {ncar,nbires,boulder,isis}!scicom!zebra!vern
3975 W. 29th Ave.					voice: 303-477-1780
Denver, Colo., 80212					 uucp: 303-455-2670

lenny@icus.islp.ny.us (Lenny Tropiano) (03/01/89)

In article <157@zebra.UUCP> vern@zebra.UUCP (Vernon C. Hoxie) writes:
|>
|>	I'm having some trouble getting 'xmodem' as distributed on the
|>net, to receive files from ms-dos machines using ProComm.  They can
...
Since I don't use Xmodem 3.6 that was distributed by Emmet,  I cannot
answer your question on what problems you are actually having with
it.  For xmodem transfers, why not use what you already have on the
UNIX pc?  That's the program that the Asynchronous Terminal Emulator uses,
that's umodem.  

$ umodem

UMODEM Version 2.8a
UNIX-Based Remote File Transfer Facility

Usage:  
umodem -[rb!rt!sb!st][q][l][m][d][y][7] filename


rb <-- Receive Binary
rt <-- Receive Text
sb <-- Send Binary
st <-- Send Text
q  <-- Quiet mode
l  <-- (ell) Turn on LOG File Entries
m  <-- Allow file overwiting on receive
d  <-- Delete umodem.log File before starting
y  <-- Display file status (size) information only
7  <-- Enable 7-bit transfer mask

It basically handles all the necessary options you should need.

...
|>	if (ioctl(0,TCGETA,&ttystemp) < 0)	/* get tty structure */
|>                  ^
|>That zero is supposed to be a file descriptor but there is no open()
|>etc. performed that returns a 'fildes'.  If I assume that since they are
|>logged in on a port that that port will be their 'stdin'.  Does 'stdin'
|>always equal 'fildes = 0'?
|>
|>	Looking elsewhere in the code, I find that all the 'read()'s
|>use 'fildes = 0' and the 'write()'s use 'fildes = 1'.
|>
...
Yes, file descriptor 0 is standard input, 1 is standard output, and
2 is standard error. 

|>	How do I use this from my terminal?  There is no way to tell it
|>which port I want to use! (ph0, ph1, tty000, etc).  In this case, it
|>assuredly should have other 'fildes's wouldn't it?
|>
I don't see any reason on why you couldn't redirect the standard input
from some other terminal.

$ xmodem [options] < /dev/somedevice

Although from my experience, you would normally be letting the user
who wanted to send or receive start the xmodem process from their
terminal, and not doing it for them.

-Lenny
-- 
Lenny Tropiano             ICUS Software Systems         [w] +1 (516) 582-5525
lenny@icus.islp.ny.us      Telex; 154232428 ICUS         [h] +1 (516) 968-8576
{talcott,decuac,boulder,hombre,pacbell,sbcs}!icus!lenny  attmail!icus!lenny
        ICUS Software Systems -- PO Box 1; Islip Terrace, NY  11752