Xref: utzoo comp.unix.questions:24649 comp.unix.wizards:23436 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!udel!haven!mimsy!fe2o3!michael From: michael@fe2o3.UUCP (Michael Katzmann) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: redirecting standard i/o from an exec'ed programme Keywords: popen, io, exec, system Message-ID: <377@fe2o3.UUCP> Date: 14 Aug 90 17:45:05 GMT Reply-To: michael@fe2o3.UUCP (Michael Katzmann) Followup-To: comp.unix.questions Organization: Rusty's BSD machine at home Lines: 38 I have a task that requires the ability to fork off another programme but to supply it's standard input and output. The SysV manuals describe FILE *popen( command, type ) char *command, *type; which execs the command a la "system()" and creates a pipe. "type" and be "r" if you want to read from the standard output of "command", or "w" if you want to write to standard input. However there doesn't seem to be any way to use this routine to do both similtaneously. What is the usual way to to this? Important points: The exec'ed command must run asynchronously (obvious if the parent is supplying input.) The child process id must be available to the parent. (so that it can be killed if necessary) Any ideas would be appreciated. --------------------------------------------------------------------- email to UUCP: uunet!mimsy!{arinc,fe2o3}!vk2bea!michael _ _ _ _ Amateur | VK2BEA (Australia) ' ) ) ) / // Radio | G4NYV (United Kingdom) / / / o _. /_ __. _ // Stations| NV3Z (United States) / ' (_<_(__/ /_(_/|_