new version of popen(3)
John Ioannidis
ji at garfield.columbia.edu
Mon Apr 7 03:59:25 AEST 1986
In article <201 at dcc1.UUCP>, douglas at dcc1.UUCP (Douglas B. Jones) writes:
>
> Hi,
>
> In the routine popen(3), a program can open either a read pipe
> or a write pipe to a sub-process (usually a program, like more).
> Does any one have a similar routine that will allow a person to
> have a read/write pipe to a sub-process.
....
> This would be a very helpful program. I imagine it would have
> to deal with sockets().
Quite some time ago I had posted to net.unix-wizards my version
of a read-and-write popen. It had a slightly different calling sequence,
and used pty's instead of either pipes or socketpairs. This has some
advantages, like being able to get back prompts from the child process;
some programs check isatty(1) and don't output a prompt if it is not.
(for example, ftp(1)).
Anyway, check older postings for my program.
> What would be really nice, is if two version
> of this popen2() could be written. One to allow the calling program
> to work with a child process on the local system, and secondly to
> allow it (the calling program) to work with a child process on
> another system (in the local network).
>
I guess, you can just use /usr/ucb/rsh instead of /bin/sh for the shell
in popen or whatever. This also takes care of security; you won't have
to implement Yet Another security/user authorization/whatever scheme.
Hope all that helps,
- john
#include <appropriate_disclaimers>
VOICE: +1 212 280 5510 ARPA: ioannidis at cs.columbia.EDU
USnail: John Ioannidis ji at garfield.columbia.EDU
450 Computer Science
Columbia University, USENET: ...{seismo|topaz}!
New York, NY 10027 columbia!garfield!ji
... It's all Greek to me!
More information about the Comp.unix.wizards
mailing list