I suspect there is something not ok in LuaTeX.
The lines with .... and >>>> directly come from print statements inserted in the Lua code.
Open file in directory 1 and 2 levels deep - direct call succeeds
..........io.open("events/hga-0372-345-62.xml","r")=>file (0x7fff97415f88)
..........io.open("events/transcripten/hga-0372-345-62.xml","r")=>file (0x7fff97416020)
Idem but now from parameter filename transferred from ConTeXt into Lua:
Open file one level deeper succeeds (printed filename comes from the call):
>>>>>>>>>>io.open(filename,"r") filename=events/hga-0372-1764-63.xml=>file (0x7fff974160b8)
Open file two levels deeper fails:
>>>>>>>>>>io.open(filename,"r") filename=events/transcripten/hga-0372-1764-63.xml=>nil
Caller:
\def\FileExist#1{\cldcontext{hvdm.existfile([===[#1]===])}}
Lua code:
hvdm.existfile = function (filename)
-- The test code was inserted here --
local file = io.open(filename, "r")
if file then
file:close()
end
return file ~= nil and "true" or "false"
end