"Andrej Mitrovic" <[email protected]> wrote in message
news:[email protected]...
> Have you tried using rawWrite ? There's a unittest in the definition
> which looks like something you need:
>
> unittest
> {
> auto f = File("deleteme", "w");
> scope(exit) std.file.remove("deleteme");
> f.rawWrite("\r\n\n\r\n");
> f.close();
> assert(std.file.read("deleteme") == "\r\n\n\r\n");
> }
>
Leave it to me to overlook the obvious :) This seems to work:
-------------------------------------------------
import std.stdio;
import std.string;
void main()
{
// Writes "A\rB\r\nC" on windows
//write("A\rB\nC");
// Writes "A\rB\nC"
stdout.rawWrite("A\rB\nC");
// format doesn't mess it up either, which is good
stdout.rawWrite("A\rB\nC".format());
stdout.rawWrite("%s".format("A\rB\nC"));
}
-------------------------------------------------
That wouldn't potentially interfere with any sort of buffering in write*,
would it? I assume any buffering would be at or below the "stdout" level,
rather than in the "write*" functions, but figure I should ask.