In documentation there is info about additional streams besides standard stdin, stdout and stderr. ( http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true )
UNDEFINED 3-9 - These handles are defined individually by the application and are specific to each tool.
So what I want to accomplish is to create by own output stream let's say on slot 3 and use it for debug. (I see there is no stddbg stream provided by the system.)
So my question is - Is it possible to check that a nonstandard output stream is waiting for data, like I do with stderr:
isatty(fileno(stderr)) == 0
And then I have option to choose a different kind of error information format more friendly to log file. The code above is true when using command in this way:
myApp.exe param1 param2 2> error.log
but when I need to differentiate between debug (or performance) and error messages it's tempting to use another stream like:
myApp.exe param1 param2 3> debug.log
but how do I check that this stream is connected to the application, what name should I use as parameter to the fileno()
function ?