From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/111778 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hans van der Meer Newsgroups: gmane.comp.tex.context Subject: Bug in Luatex file handling? Date: Tue, 15 Jun 2021 14:38:38 +0200 Message-ID: <9F0DB6E4-5588-4829-8642-931F14EF472B@ziggo.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Content-Type: multipart/mixed; boundary="===============4582182438985206391==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33900"; mail-complaints-to="usenet@ciao.gmane.io" To: NTG ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Tue Jun 15 14:39:15 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lt8La-0008bo-6a for gctc-ntg-context-518@m.gmane-mx.org; Tue, 15 Jun 2021 14:39:14 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 787B6284603; Tue, 15 Jun 2021 14:38:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3N7SdKbGLN_k; Tue, 15 Jun 2021 14:38:42 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 426B72846C0; Tue, 15 Jun 2021 14:38:42 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 293072846BE for ; Tue, 15 Jun 2021 14:38:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bk-D0uYqcxQ7 for ; Tue, 15 Jun 2021 14:38:39 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=212.54.42.166; helo=smtpq3.tb.mail.iss.as9143.net; envelope-from=havdmeer@ziggo.nl; receiver= Original-Received: from smtpq3.tb.mail.iss.as9143.net (smtpq3.tb.mail.iss.as9143.net [212.54.42.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3A4CE284603 for ; Tue, 15 Jun 2021 14:38:39 +0200 (CEST) Original-Received: from [212.54.42.106] (helo=smtp2.tb.mail.iss.as9143.net) by smtpq3.tb.mail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1lt8L0-00052B-M8 for ntg-context@ntg.nl; Tue, 15 Jun 2021 14:38:38 +0200 Original-Received: from [192.168.178.20] ([84.106.134.200]) by smtp2.tb.mail.iss.as9143.net with ESMTPA id t8L0lOs1vQDu0t8L0lSk2q; Tue, 15 Jun 2021 14:38:38 +0200 X-Env-Mailfrom: havdmeer@ziggo.nl X-Env-Rcptto: ntg-context@ntg.nl X-SourceIP: 84.106.134.200 X-CNFS-Analysis: v=2.4 cv=N8BKq0xB c=1 sm=1 tr=0 ts=60c89f4e cx=a_exe a=wCstmS+ZHA3zSJXjQC+ubA==:117 a=wCstmS+ZHA3zSJXjQC+ubA==:17 a=U9skWan3VpBu68Wey2gA:9 a=CjuIK1q_8ugA:10 a=O2IkDzEPT3ppyhzRlsQA:9 a=F-HFZgxFayTLVisB:21 a=_W_S_7VecoQA:10 X-Authenticated-Sender: havdmeer@ziggo.nl DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ziggo.nl; s=202002corplgsmtpnl; t=1623760718; bh=8Z/0wlRJ3bVxasIZECXA+mbOFjbj6mQ9khVUTwNkN5s=; h=From:Subject:Date:To; b=ZBHuVK64pvruz5A9Md2jmO5lkIZhjiLH4qCFFem/fI6n9rMGhhvxlQt1RbyGFiPxa ax6sI+vpzma83zfNwUDQx0hEobKV388f/ETdKLgsmgniU+KYrb4HopqZPnzIdfnQqj ixAQpjJ1KwxXEtgFtqHSmcsHUXPCAwEk0+urf8pWYI9BuzMKHaMfmYk70IhcmHDcac QwgL9yCIOi5nO3MJ+g3wvIr4dtACdwmeUEywRaAOl6UH+ZnYzUSwhvph6+HWZQojpC kQWYXnPs1MCBkhcrmZY293/c/9G9OpuH9LwLHZJuHv70vt3rqcGX+FwtqRzLllJMYO shGrw1fgXT1+Q== X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CMAE-Envelope: MS4xfAqt7mWWlaZhbcHZlPm+ZGNDIpC4oE3LpJg7IuV/P0KrTAF3p5NhyG7wp4IFzc306TNAN24WL3bQTLxsSp7R+dunTbRw/q/t9bqkz/N7yBiELbXMn8gD BDcg1zxFh9HA8UHWquV0DqxQDZBLX/9oA+nJVAGQCEdO9QK6CaXZ7GVoL7fAFaxWVP+5otnNEHQacw== X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:111778 Archived-At: --===============4582182438985206391== Content-Type: multipart/alternative; boundary="Apple-Mail=_51E9EF07-7DB7-41BF-B66C-B67340C90B0F" --Apple-Mail=_51E9EF07-7DB7-41BF-B66C-B67340C90B0F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii This I cannot explain. Opening a file directly from its full name in a = string succeeds. But doing the same from a parameter transferred from = ConteXt to Lua succeeds if the file is in one directory deeper but fails = if the file is two directories deeper. I suspect there is something not ok in LuaTeX. The lines with .... and >>>> directly come from print statements = inserted in the Lua code. dr. Hans van der Meer Open file in directory 1 and 2 levels deep - direct call succeeds ..........io.open("events/hga-0372-345-62.xml","r")=3D>file = (0x7fff97415f88) ..........io.open("events/transcripten/hga-0372-345-62.xml","r")=3D>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=3Devents/hga-0372-1764-63.xml=3D>file (0x7fff974160b8) Open file two levels deeper fails: >>>>>>>>>>io.open(filename,"r") = filename=3Devents/transcripten/hga-0372-1764-63.xml=3D>nil Caller: \def\FileExist#1{\cldcontext{hvdm.existfile([=3D=3D=3D[#1]=3D=3D=3D])}} Lua code: hvdm.existfile =3D function (filename) -- The test code was inserted here -- local file =3D io.open(filename, "r") if file then file:close() end return file ~=3D nil and "true" or "false" end --Apple-Mail=_51E9EF07-7DB7-41BF-B66C-B67340C90B0F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii This = I cannot explain. Opening a file directly from its full name in a string = succeeds. But doing the same from a parameter transferred from ConteXt = to Lua succeeds if the file is in one directory deeper but fails if the = file is two directories deeper.
I suspect there is = something not ok in LuaTeX.
The lines with .... and = >>>> directly come from print statements inserted in the Lua = code.

dr. Hans van der Meer

Open file in directory = 1 and 2 levels deep - direct call succeeds
..........io.open("events/hga-0372-345-62.xml","r")=3D>file = (0x7fff97415f88)
..........io.open("events/transcripten/hga-0372-345-62.xml","r"= )=3D>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=3Devents/hga-0372-1764-63.xml=3D>file = (0x7fff974160b8)
Open file two levels deeper fails:
>>>>>>>>>>io.open(filename,"r") = filename=3Devents/transcripten/hga-0372-1764-63.xml=3D>nil
=

Caller:
\def\FileExist#1{\cldcontext{hvdm.existfile([=3D=3D=3D[#1]=3D=3D= =3D])}}
Lua = code:
hvdm.existfile =3D function (filename)
-- The test code was = inserted here --
= local file =3D io.open(filename, "r")
= if file then
= file:close()
end
= return file ~=3D nil and "true" or "false"
= end

= --Apple-Mail=_51E9EF07-7DB7-41BF-B66C-B67340C90B0F-- --===============4582182438985206391== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============4582182438985206391==--