G
Guillaume Dargaud
Hello all,
a while ago I was pointed towards freopen as a way to redirect stderr to a
log file. It works great, but apparently the app also writes a few lines to
stdout. Now I could redirect to 2 separate files, but would rather keep the
2 flows together.
Is it correct to do this:
stderr=freopen(LogFile, "w", stderr);
stdout=freopen(LogFile, "a", stdout);
I can see plenty of reasons why it would fail (buffering and flushes come to
mind).
Any advice ?
--
Guillaume Dargaud
http://www.gdargaud.net/Climbing/
"Faith can move mountains but let them happily fall down on the heads of
other people. What's the point in moving mountains when it's so simple to
climb over them ?" - Boris Vian, surrealist French writer and singer, En
verve.
a while ago I was pointed towards freopen as a way to redirect stderr to a
log file. It works great, but apparently the app also writes a few lines to
stdout. Now I could redirect to 2 separate files, but would rather keep the
2 flows together.
Is it correct to do this:
stderr=freopen(LogFile, "w", stderr);
stdout=freopen(LogFile, "a", stdout);
I can see plenty of reasons why it would fail (buffering and flushes come to
mind).
Any advice ?
--
Guillaume Dargaud
http://www.gdargaud.net/Climbing/
"Faith can move mountains but let them happily fall down on the heads of
other people. What's the point in moving mountains when it's so simple to
climb over them ?" - Boris Vian, surrealist French writer and singer, En
verve.