J
John Devereux
Hi,
I am a bit confused about the behaviour of freopen() and the standard
i/o streams.
I am trying to redirect a stream (stderr) to a particular "file". But,
if the call fails I want it to stay as it was, or at least be able to
redirect it somewhere else (e.g. stdout).
For example I would like to do,
..
stderr = freopen("/dev/errors","w", stderr); /* may fail */
if(!stderr) freopen("/dev/screen", "w", stderr);
I am a bit confused about the behaviour of freopen() and the standard
i/o streams.
I am trying to redirect a stream (stderr) to a particular "file". But,
if the call fails I want it to stay as it was, or at least be able to
redirect it somewhere else (e.g. stdout).
For example I would like to do,
..
stderr = freopen("/dev/errors","w", stderr); /* may fail */
if(!stderr) freopen("/dev/screen", "w", stderr);