I'm getting normal newlines here (XP): C:\output>test.exe import std.file: readText; import std.stdio: write; void main() { string s = readText("test.d"); write(s); }
The text used CR+LF newlines. I also tried them using LF newlines, which worked fine. But I've then tried with CR and that gives out weird output like so: } write(s);= readText("test.d"); bearophile Wrote: > I think there is a bug here, but can you please try it a bit? > The name of this program is "test.d", so it loads its souce code: > > import std.file: readText; > import std.stdio: write; > void main() { > string s = readText("test.d"); > write(s); > } > > > On windows the output is: > import std.file: readText; > > import std.stdio: write; > > void main() { > > string s = readText("test.d"); > > write(s); > > } > > > So it shows extra newlines (on Windows newlines are two chars). > > On Windows a similar Python program doesn't show the doubled newlines: > s = open("test.d").read() > print s > > Bye, > bearophile