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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to