Mail Archives: djgpp/2001/05/17/11:27:03
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.
- Raw text -