5 Dec
2017
5 Dec
'17
9:47 p.m.
Dear devs, This was asked on TeX.SX: https://tex.stackexchange.com/questions/404617 The example below runs perfectly fine in the normal Lua interpreter, but crashes in texlua because the maximum number of open file handles is exceeded. This seems to be a peculiarity of io.lines in texlua. Is there anything special to the implementation of it in LuaTeX? Cheers, Henri -- Create the file (once) local filename = 'luatexfilelimit.txt' local file = io.open(filename, "w") file:write("hello world\n") file:close() -- Print its contents (many times) for i = 1, 3000000 do print(string.format('Attempt %d', i)) for line in io.lines(filename) do print(line) end end