[Issue 9776] Make raw write mode the default

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 15 19:02:31 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=9776

--- Comment #3 from Nick Sabalausky <cbkbbejeap at mailinator.com> ---
Another way of putting it. Do this on a Windows machine:

---------------------------------------
> type test.d
import std.file, std.stdio;
void main() {
    auto str = cast(string) std.file.read("input.txt");
    stdout.write(str);
}

> echo line1 > input.txt

> echo line2 >> input.txt

> dmd -run test.d > output.txt
---------------------------------------

Then notice that "input.txt" and "output.txt" are DIFFERENT (Check in a hex
viewer or any decent editor that supports visible line endings.) The input has
\r\n, but the output has \r\r\n. Some editors will actually display it like
this:

---------------
line1

line2
---------------

--


More information about the Digitalmars-d-bugs mailing list