[comp.unix.questions] how to popen telnet ???

mike@penguin.gatech.edu (Mike Gourlay) (11/30/90)

Hi.

	I want to use telnet from another program, but it seems that telnet
does not use stdin.  How do you get telnet to take input from stdin, especially
when using popen?

	In case there's another way to do what I want, here's my plan:

	There is a modem sitting on a telnet port on some computer.
I want to connect to that modem and send and receive data to and from
that modem.

	Eventually, once I get a program to do that, I will make that
program a character special file named pipe (FIFO) and pu it in /dev/modem
so that it could be used by other programs (UUCP for example) transparently.
There is no reason that a program using /dev/modem should know that it is
a telnet connection to someplace.

	I know this is possible.  Why does telnet not take stdin?  In case it's
supposed
to, and it's just my system, I'm running HPUX 7.0 on an HP9000s370.

	Thanks,
	Mike Gourlay
	mike@penguin.gatech.edu

wht@n4hgf.Mt-Park.GA.US (Warren Tucker) (12/01/90)

In article <1990Nov30.033708@dali.gatech.edu> mike@penguin.gatech.edu (Mike Gourlay) writes:
>Hi.
>
>	I want to use telnet from another program, but it seems that telnet
>does not use stdin.  How do you get telnet to take input from stdin, especially
>when using popen?

I have a telnet package that opens sockets and impliments a sort
of "byte stream" read and write capability.  It lets you send
strings and read lines, read until delimiter, read with timeout, etc.

Want it?
 
----------------------------------------------------------------------------
Warren Tucker                     emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
"I was 35 years old before I knew a pie was meant to be eaten." - Moe Howard