
24 May
2007
24 May
'07
10:10 a.m.
Hello, Ketil Malde wrote:
Makes me wonder whether one should have binary be the default? I'm a stranger in Windows-land, but are there cases where you want reading of a file to be terminated on ^Z? Seems pretty awful to me.
The ghc docs state about openBinaryFile:
Like openFile, but open the file in binary mode. On Windows, reading a file in text mode (which is the default) will translate CRLF to LF, and writing will translate LF to CRLF. [...] text mode treats control-Z as EOF
The CRLF-to-LF translation is the more important part. It allows '\n' to stand for the end of a line on windows, too, even if lines are terminated by two characters in windows text files. Tillmann