Extra Carriage Returns using write

Dave G via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 2 07:14:11 PDT 2014


Hello,

Why does the following add an extra CR in front of the CRLF's

auto outf = new File("out.txt", "w");
outf.write("this\r\nis\r\na\r\ntest");
outf.close;

If I make the file binary
auto outf = new File("out.txt", "wb");

it works as expected.

I am using 2.065 and windows 7

Thanks,
Dave G


More information about the Digitalmars-d mailing list