[net.wanted] Pipes like tty's ?

dan@rna.UUCP (Dan Ts'o) (02/11/86)

x
	I have a program which insists on having a tty as its standard input.
It is a commercial, binary-only program, so I can't tell you why, but presumably
it is doing stty's or something. I want to drive it from a prepared script.
Any ideas ?
	Seems to me one could write a program which builds a pseudo-tty between
itself and the binary program in the manner of a pipe and feed it from a file
or whatever. However this is probably a bit of work. Anyone written such a
thing ? Any other ideas ?
	Using 4.2BSD script does not work, but perhaps it could be hacked to
work...


					Cheers,
					Dan Ts'o
					Dept. Neurobiology
					Rockefeller Univ.
					1230 York Ave.
					NY, NY 10021
					212-570-7671
					...cmcl2!rna!dan
					rna!dan@cmcl2.arpa

tom@puff.wisc.edu (Thomas Scott Christiansen) (02/25/86)

Does anyone have a nice package that allows you to say something
like
	process("silly_game arg1 arg2",&input_fd,&output_fd,&error_fd)
and start the process running not on a pipe (I have one of these) but
rather on a pty so that the proc can 1) do ioctls 2) have line buffered
output ?

thanks,
--tom

ji@garfield.UUCP (02/26/86)

In article <641@puff.UUCP>, tom@puff.wisc.edu (Thomas Scott Christiansen) writes:
> Does anyone have a nice package that allows you to say something
> like
> 	process("silly_game arg1 arg2",&input_fd,&output_fd,&error_fd)
> and start the process running not on a pipe (I have one of these) but
> rather on a pty so that the proc can 1) do ioctls 2) have line buffered
> output ?
> 

I have hacked popen(3) and used parts of script(1) to do a read-write version
of popen (which I call prwopen!), which also uses pty's instead of pipes.
(popen(3) can be used for either reading or writing to the child, but not 
for both). 

If you people out there think there is no problem with posting modified
unix (tm) sources on the net, I'll gladly post it.


#include <appropriate_disclaimers>

VOICE: 	+1 212 280 5510			ARPA: ioannidis@cs.columbia.EDU
USnail:	John Ioannidis			      ji@garfield.columbia.EDU
	450 Computer Science
	Columbia University,		USENET: ...{seismo|topaz}!
	New York, NY 10027			   columbia!garfield!ji

			... It's all Greek to me!