I have a question that has two parts. I am trying to spawn a process of a terminal app and wait for it to finish and returns its output.
So, for example I want to spawn a process that runs "ls -la" and puts the output into a string variable. I am doing this for windows and linux. I have been working on the linux code. Right now I am fork()ing, exec()ing, then wait()ing. I just don't know how to capture the output of the child process.
My second problem is that when I do a wait()... I need some kind of timer on it so I don't get deadlock in my parent.
Does anyone have any good links or code examples for this?
Thanks.




Reply With Quote