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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to