I am trying to figure out how to pull stdout and stderr from a system subprocess in Erlang. (Not to be confused with the Erlang process.) I realized that I was trying to independently output the output of the streams.
open_port / 2 seems to give me most of the way, however it does not seem to make it possible to distinguish between the two threads. There is a stderr_to_stdout option, but this is not what I want; I want to receive data from both data streams, but be able to distinguish between two streams.
Any suggestions? Thanks.
Update: I am ideally looking for a solution that will work on both Windows and Linux.
source share