redirecting standard i/o from an exec'ed programme

Michael Katzmann michael at fe2o3.UUCP
Wed Aug 15 03:45:05 AEST 1990


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)	 / ' (_<_(__/ /_(_/|_</_</_

Michael Katzmann
Broadcast Sports Technology.
2135 Espey Ct. #4
Crofton Md. 21114 USA

Ph: +1 301 721 5151



More information about the Comp.unix.wizards mailing list