Date: Tue, 23 Dec 1997 12:39:26 -0800 (PST) Message-Id: <199712232039.MAA20617@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Eli Zaretskii , Gavin Sinclair From: Nate Eldredge Subject: Re: gcc output redirection Cc: djgpp AT delorie DOT com Precedence: bulk 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