Getting a process's output

Is there any easy way to get all the output of a process? Ideally, the
function takes parameters like exec(), calls fork(), wait()s for the
process to complete, and returns the process's stdout, stderr, and exit
status. By stdout and stderr I don't mean file objects or
descriptors... I mean strings containing the entire output.

I would try to do it myself, but I'm not sure how to interleave the
operations.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!