[plt-scheme] Help on newline when writing to a file

From: Noel Welsh (noelwelsh at gmail.com)
Date: Wed Jan 16 15:36:04 EST 2008

The basic issue is the difference between the representation on a
newline on Unix and Windows.

On Unix a newline is always just "\n".  Windows, for some reason I
cannot fathom, decided that a newline should be the two characters
"\r\n".  However, when a file is opened in text mode Windows processes
the port so this two character sequence is read and written as the
single "\n" as in Unix.  If a file is opened in binary mode this is
not the case.  All this confusion comes from this design decision.

N.


Posted on the users mailing list.