Mail Archives: djgpp/1997/12/23/17:28:48
At 11:18 12/23/1997 +0200, Eli Zaretskii wrote:
>
>On Tue, 23 Dec 1997, Gavin Sinclair wrote:
>
>> freopen("ERRORS.LST", "w", stderr);
>>
>> Be warned, though, that when you do this (you can do it with stdout as
>> well), you can't get stderr back!
>
>Why not? I think the following will restore stderr to its original
>settings:
>
> freopen ("CON", "w", stderr);
> setvbuf (stderr, 0, _IONBF, 0);
Well, not strictly. It will send it to the screen, and disregard if somebody
might have redirected stderr.
Nate Eldredge
eldredge AT ap DOT net
- Raw text -