cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/14/14:53:08

Date: Sun, 14 Sep 1997 11:42:34 -0700 (PDT)
Message-Id: <199709141842.LAA12554@adit.ap.net>
Mime-Version: 1.0
To: baudy AT total DOT net (Benjamin Audy), djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Redirection

At 02:25  9/13/1997 GMT, Benjamin Audy wrote:
>Hi!
>
>I don't think this is a problem for DJGPP specifically, but here it
>is:
>
>In my program I use the "getchar" and "printf" functions. "getchar"
>returns a character from stdin (the keyboard in my case), which is
>also echoed to the screen (line buffered). But when I redirect the
>output at the command prompt (eg.: "program.exe > file.txt"), "printf"
>output is sent to the file, but "getchar" output is still sent to the
>screen. Why?
The echo always goes directly to the screen. If you want it to go to stdout
as well, you'll have to putchar() or printf() it explicitly.
>
>Normally, everything should be sent to the file, like when I redirect
>the "debug" program output.
>
>Benjamin Audy
>baudy AT total DOT net
>
>

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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