Hi,
I want to call a command using C programmatically using execv, but I
also want to capture the standard output and standard error to files I
specify through command line args. I want to use the file descriptors
0, 1, and 2 appropriately for this, and I understand I should probably
call a fork()
when calling the execv so my program can return successfully. But
from there,
I'm not sure where to start. I think I want to probably use dup2 so I
can redirect the descriptors to files I open. Maybe create a pipe
from the child process to the parent process, where I pass through the
pipe are the results of the command call ?? Just need some guidance
and want to make sure I'm in the right direction. Thanks.