Hi,
I'm writting a testing framework and need to spawn new Unix process.
However I need to redirect the StdOut of the Unix Process to a flat file for
storage. For instance for the code below:
if ((pid = fork ()) < 0) {
err_sys("fork error");
}
if (pid == 0) {
err_ret ("Couldn't execute : %s", buf);Quote:>>> execlp (buf, buf, (char *) 0);
exit (127);
}
I want to beable to redirect the StdIn and StdOut for the line
execlp (buf, buf, (char *) 0);
so I can output char to the process and receive the output from the process
and store it.
Does anybody have any suggestions? So far I have been looking around on the
net and couldn't find anything at all.
Thanks,
The Poor Programmer