Date: Sun, 5 May 1996 18:39:55 +0800 (GMT+0800) From: Orlando Andico To: "Rafael R. Sevilla" cc: DJGPP Mail Server Subject: Re: Screen updates with \b In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 5 May 1996, Rafael R. Sevilla wrote: > backspace character (ASCII 8, or "\b") to standard output until I get back > to the start of the output line and then printed the update. This works > properly with Turbo C under DOS and GCC 2.7.2 under Solaris 5.3, but not > under djgpp. What djgpp does is wait until the _last_ such update before The last update bit is caused by DJGPP's 4-Kb output buffer. I personally prefer using something like this: while (whatever) { printf ("%.4d foos processed\r", foo); fflush (stdout); } You don't have to bother with a lot of backspacing when a single carriage return will do ;-) Just remember to do a \n when you're done so that your next message doesn't crap over the previous stuff. Also, the fflush ensures that the buffer gets emptied and you see what you want. I suppose the 4-Kb crap is 'cause stdio uses DOS interrupts and realmode switches are expensive in terms of CPU cycles. Cheers, Orly