[luatex] \openin with extensionless files.
David Carlisle
d.p.carlisle at gmail.com
Wed Jan 22 22:08:25 CET 2020
With a file with no extension in the same directory (say "test") then
\input test
and
\input{test}
both work but
\openin test
and
\openin{test}
do not work the same way, it only sees the file if the luatex-specific
braced form is used.
That means for example the LaTeX \IfFileExists macro reports the file
as not existing with luatex and existing with pdftex and xetex.
We could (and probably will) have a luatex-specific code branch here
to add the braces, but is this difference from pdftex intentional? It
has been this way since at least texlive 2017, but still seems strange
and not what one would expect from the documentation
This causes some problems in end-user documents, for example
https://tex.stackexchange.com/questions/511684/inputting-extension-less-files-with-luatex-fails-after-recent-latex-update/511688?noredirect=1#comment1293990_511688
This test file:
\openin0 test
\ifeof0
\immediate\write20{NO FILE test}
\else
\immediate\write20{FILE test}
\fi
\ifx\directlua\undefined\else
\openin2{test}
\ifeof2
\immediate\write20{NO FILE test}
\else
\immediate\write20{FILE test}
\fi
\fi
\end
Produces the terminal output below
$ cat test
hello
$ luatex noext
This is LuaTeX, Version 1.10.0 (TeX Live 2019)
restricted system commands enabled.
(./noext.tex
NO FILE test
FILE test
)
and with pdftex
$ pdftex noext
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020)
(preloaded format=pdftex)
restricted \write18 enabled.
entering extended mode
(./noext.tex
FILE test
David
More information about the luatex
mailing list