digitalmars.D - Suggestion for writef/writefln (or can this be already done now?)
- Id (6/6) Aug 28 2004 Some commandline programs write, per example, percentage of completion i...
- Andy Friesen (4/11) Aug 28 2004 You can achieve this by writing a \r (instead of \n) at the end of line....
Some commandline programs write, per example, percentage of completion in the screen. Those programs usually write a line, and update the numbers by overwriting over the same line continuously. Is this possible with writef/writefln or another function already made in Phobos?
Aug 28 2004
Id wrote:Some commandline programs write, per example, percentage of completion in the screen. Those programs usually write a line, and update the numbers by overwriting over the same line continuously. Is this possible with writef/writefln or another function already made in Phobos?You can achieve this by writing a \r (instead of \n) at the end of line. I don't know if this works the same way in Linux, though. -- andy
Aug 28 2004
In article <cgqcmd$31fg$1 digitaldaemon.com>, Andy Friesen says...You can achieve this by writing a \r (instead of \n) at the end of line. I don't know if this works the same way in Linux, though.Works exactly the same in Linux. A problem is the writef-doesn't-flush thing, thing though. Unless you write out a newline somewhere, your writefs won't do anything at all. You can get around this by using stdout.writeString from std.string instead. Nick
Aug 28 2004
"Nick" <Nick_member pathlink.com> wrote in message news:cgqde2$4q$1 digitaldaemon.com...In article <cgqcmd$31fg$1 digitaldaemon.com>, Andy Friesen says...write outYou can achieve this by writing a \r (instead of \n) at the end of line. I don't know if this works the same way in Linux, though.Works exactly the same in Linux. A problem is the writef-doesn't-flush thing, thing though. Unless youa newline somewhere, your writefs won't do anything at all. You can getaroundthis by using stdout.writeString from std.string instead.or calling std.c.stdio.fflush(stdout) should work.
Aug 28 2004
In article <cgqio8$20p$3 digitaldaemon.com>, Walter says...Yes, but that's so... C-ish :-P NickWorks exactly the same in Linux. A problem is the writef-doesn't-flush thing, thing though. Unless you write out a newline somewhere, your writefs won't do anything at all. You can get around this by using stdout.writeString from std.string instead.or calling std.c.stdio.fflush(stdout) should work.
Aug 28 2004