popen3 not works with xterm???

Donn Cave donn at u.washington.edu
Tue Jul 20 11:59:17 EDT 1999


"Sven Drescher" <Sven.Drescher at dlr.de> writes:
| I have a question to the following situation.
| I wrote a little C-programm to test the popen3() class.
| That works fine. I write into the pipe and I can read from the pipe, what my
| programm wants to print to stdout.
| But now I thought it's also possible with the xterm. But nothing happens.
| There was only a comment: "pipe was broken - error", but with my C-programm
| it works errorless.
| What did I wrong???

It's xterm.  If you want to display the output of your program on an
xterm window, xterm wants to run the program.  Xterm sets up its own
simulated terminal device (pseudo-tty, or pty), and runs some program,
usually a shell, with input and output connected to the tty side of
that pty.  And of course it opens a connection to the X11 server to
draw its window.  But it just ignores the input and output units it
was started with.  That's why you get the broken pipe, you can't talk
to it that way.

If you're bound and determined, you might be able to start an xterm
running "cat", reading from a named pipe that you create in a convenient
location (see mkfifo.)

	Donn Cave, University Computing Services, University of Washington
	donn at u.washington.edu




More information about the Python-list mailing list