public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* freopen function
@ 2001-09-20  1:57 Michael Nabarro
  2001-09-20  8:17 ` Phil Edwards
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Nabarro @ 2001-09-20  1:57 UTC (permalink / raw)
  To: gcc

I'm trying to use freopen to redirect stdout to a file.  This works fine but
I then want to redirect stdout back to the console and am having trouble
doing this.  I have used the following two calls.

	freopen("temp","w",stdout);

	freopen("CON","w",stdout);

Apparently CON is meant to be the console but instead a file called CON is
created.

I'd greatly appreciate any suggestions.

Thanks
Michael

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: freopen function
  2001-09-20  1:57 freopen function Michael Nabarro
@ 2001-09-20  8:17 ` Phil Edwards
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Edwards @ 2001-09-20  8:17 UTC (permalink / raw)
  To: Michael Nabarro; +Cc: gcc

On Thu, Sep 20, 2001 at 09:58:05AM +0100, Michael Nabarro wrote:
> I'm trying to use freopen to redirect stdout to a file.  This works fine but
> I then want to redirect stdout back to the console and am having trouble
> doing this.  I have used the following two calls.
> 
> 	freopen("temp","w",stdout);
> 
> 	freopen("CON","w",stdout);
> 
> Apparently CON is meant to be the console but instead a file called CON is
> created.
> 
> I'd greatly appreciate any suggestions.

1)  This has nothing to do with the development of GCC, and so is offtopic
for this list.  I suggest a programming newsgroup.

2)  "CON" == "the console" is only true under MS-DOS, to the best of
my knowledge.  Maybe Windows too.


Phil

-- 
Would I had phrases that are not known, utterances that are strange, in
new language that has not been used, free from repetition, not an utterance
which has grown stale, which men of old have spoken.
                                     - anonymous Egyptian scribe, c.1700 BC

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-20  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-20  1:57 freopen function Michael Nabarro
2001-09-20  8:17 ` Phil Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).