Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!eagle!mhuxi!houxm!ihnp4!zehntel!hplabs!sri-unix!RICH.GVT@office-3 From: RICH.GVT%office-3@sri-unix.UUCP Newsgroups: net.unix Subject: Re: reading and writing to another process Message-ID: <12146@sri-arpa.UUCP> Date: Thu, 29-Sep-83 12:14:00 EDT Article-I.D.: sri-arpa.12146 Posted: Thu Sep 29 12:14:00 1983 Date-Received: Thu, 6-Oct-83 23:03:58 EDT Lines: 16 In general, you create the pipe, close stdin (or stdout, or stderr), then "dup" the appropriate input or output pipe fd which will cause it to reuse the std* number you just closed. You do this for each file you want connected via a pipe, then execl the child process. The parent and child processes can each close any unused pipe fd's. I have an example of exactly this in a program on an off-net computer, and can send the actual code later if really needed, but I'd have to read it from one terminal and retype it in on another... You can also specify redirection in the execl command line, using the pipe fd number instead of going through the close/dup stuff ( >&4 for instance). This lets you keep the parent's std* connections intact. Cheers, Rich