delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/23/17:28:48

Date: Tue, 23 Dec 1997 12:39:26 -0800 (PST)
Message-Id: <199712232039.MAA20617@adit.ap.net>
Mime-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>,
Gavin Sinclair <s2174215 AT cse DOT unsw DOT EDU DOT AU>
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: gcc output redirection
Cc: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019