lua-users home
lua-l archive

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


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
end