[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Windows query
- From: Paul Merrell <marbux@...>
- Date: Thu, 28 Jan 2016 22:53:35 -0800
On Thu, Jan 28, 2016 at 10:34 PM, Dirk Laurie <email@example.com> wrote:
> I'm developing a Lua program under Linux that may in some
> not totally unforeseeable future need to run under Windows.
> Do line endings get standardized when Lua reads a text file?
> More precisely, in the following code snippet, will "line"
> contain "\r" characters?
> infile = io.open"filename.txt"
> source = infile:read"*a"
> for line in source:gmatch"[^\n]+" do
> -- whatever
I don't know the answer to that question, Dirk, but my understanding
is that "\r" is unnecessary on any of Linux/Unix, Windows, or the
recent releases of OS X. I write and share lots of multi-OS scripts
for NoteCase Pro and stopped including the carriage return token years
ago without any subsequent complaint from any users (regarding the
As I understand the situation, only the early versions of OS X that
ran on a RISC processor wanted the "\r" and Apple did away with that
when they rebuilt OS X on Unix.
[Notice not included in the above original message: The U.S. National
Security Agency neither confirms nor denies that it intercepted this