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

From: Marco Morazan (morazanm at gmail.com)
Date: Wed Jan 16 16:03:16 EST 2008

Thanks. That makes sense and it is a great example to drive home the
point to my students that design decisions actually matter.

BTW, I take it that #\newline = \n. Is that how it works under the hood?

Cheers,

Marco

On Jan 16, 2008 3:36 PM, Noel Welsh <noelwelsh at gmail.com> wrote:
> 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.