[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Cross-platform reading of text files
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 6 Sep 2016 09:59:39 +0200
I found (slightly to my surprise) that io.read under Linux does not
discard the \r character when given files with \r\n line endings.
First issue: is keeping `\r' a bug, an implementation detail, or a feature?
I also found (slightly to my surprise) that io.lines and file.lines have
nothing to do with each other. io.lines does not operate by assigning
a default file if needed and invoking file.lines. Instead, both invoke
an auxiliary function, not exposed at the Lua level.
Second issue: is this an implementation detail, or a feature?