[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: strange question about the io.write
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 19 Nov 2009 08:28:15 -0200
> Different platforms use different definitions for new line.
That's why IO in the standard C library abstracts that and uses only \n
to signal end of line: the library is meant to map that to the local
convention of each platform.
Bottom line: open files in text mode (the default) and output only \n,
never \r. If you want to generate a specific byte sequence, then you need
to open the file in binary mode for writing.