I was downloading a compiler (I think it was MinGW but I'm not sure) on windows 2000 the other day (I'm generally a Mac user, but it wasn't my machine), and the downloader was a MS-DOS command line app that would display a progress bar for the download. Something like this...
|--- | 15%
...
|------ | 30%
...
...
|-------------- | 70%
except that it would continuously update on the same line. I assume the program accomplished this by deleting previously printed characters and reprinting different ones, but I can't seem to figure out how to do this.
I've tried to print a 'delete' character several different ways, like (char)8
and \b
(even \r
, which I heard backtracks to the beginning of the line in some languages), but none of those things worked.
Does anyone know how to do this sort of stuff?
Edit: This question has become platform-specific. I want to know specifically how to accomplish this on a Mac.