delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/23/04:43:24

Date: Tue, 23 Dec 1997 11:18:43 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Gavin Sinclair <s2174215 AT cse DOT unsw DOT EDU DOT AU>
cc: djgpp AT delorie DOT com
Subject: Re: gcc output redirection
In-Reply-To: <Pine.GSO.3.95.971223143024.9377B-100000@flute03.orchestra.cse.unsw.EDU.AU>
Message-ID: <Pine.SUN.3.91.971223111817.13745N-100000@is>
MIME-Version: 1.0

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);

- Raw text -


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