Call a program & still capture cmds
I have a program which runs steps, calls another program, and runs more steps if the program call was successful. The program I call is (and needs to remain) interactive, so I used system(). The child program allows the user to abort the process at any time by hitting <esc> <esc> 1. Unfortunately, the program exits with a 0 (OK) status when this is happens.
Is there a way to capture the abort sequence within the parent program?
Not the actual code...but this should give the basic idea.
while(scanf(file_in, "%s", buffer))
printf("file_out, "%s\n", buffer);
if(system(run_program)!=0)
return;
while(scanf(new_file, "%s", buffer)
printf(report, "%s\n", buffer);