I want to create a cross platform (windows, mac, linux) C application that is capable of spawning a subprocess and capturing the stdin, stdout and stderr simultaneously.
I know it's possible to do something like this with popen
in unix, StackOverflow
and in windows with the WinAPI, MSDN
I also understand that it is possible to redirect the outputs to files and read from there, but redirecting the standard pipes does seem like a very basic standard library feature.
Did I miss a basic function and/or is there any lightweight crossplatform library that I can use to achieve this goal without significant complexity?