Date: Thu, 17 May 2001 18:28:31 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Michiel de Bondt cc: djgpp AT delorie DOT com Subject: Re: how to flush cprintf output In-Reply-To: <3B03E465.818D17B8@sci.kun.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 17 May 2001, Michiel de Bondt wrote: > Strange. What I do is removing the bar of progress asterisks by cprintf ("\b > \b")'s > Then, I do printf("Some message.\n "). That is a bad idea. You should not mix cprintf and printf, since they use different methods to deliver data to the screen. Simply print the message via cprintf. > The cprintf ("\b \b")'s might be done in a procedure > called by an alarm event. This just adds to complexity. I'd advise against such complex design, just to print and remove a message. > > And what do you want to do with progress indicator and search path? IN > > particular, what do you want to do with them if stdout is redirected? > > I wish them to be printed to the screen. Then print those with fprintf to stderr. > > > The program dvips distinguishes console output and > > > standard output as well, i.e. it seems so at least. How can that be? > > > > Perhaps because it prints part of the text to stderr and the rest to > > stdout. > > But can stderr and stdout not conflict since they are both the screen? No, the device driver takes care of that. In addition, you could use fflush to force all data to go out, if you want to be sure.