lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> 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.