[luatex] Wildcard expansion by texlua on Windows
luigi scarso
luigi.scarso at gmail.com
Mon Mar 11 08:52:01 CET 2024
On Thu, 7 Mar 2024 at 19:38, Joseph Wright <joseph at texdev.net> wrote:
> Hello all,
>
> I wonder if the handling of wildcard arguments by LuaTeX running as
> texlua is documented anywhere, and if it's controllable.
>
> With LuaTeX, irrespective of platform, arguments are passed 'as is' to
> Lua, so if we have a test.tex file
>
> \directlua{for _,v in ipairs(arg) do print(v) end}
> \end
>
> and run
>
> luatex test.tex '*' -- macOS/Linux
> luatex test.tex * -- Windows
>
> we print "*". On the other hand, if we have test.lua file
>
> for _,v in ipairs(arg) do print(v) end
>
> and try
>
> texlua test.lua '*' -- macOS/Linux
> texlua test.lua * -- Windows
>
> we get "*" on macOS/Linux and ... whatever is in the current directory
> on Windows. If we use '*' there, that's *exactly* what gets shown - no
> expansion, but also no loss of the ' chars (of course we can clean up).
>
> I *think* that the only expansion is the same as e.g. dir would do -
> only "*" and "?", and if there are no matches things are passed on as-is.
>
> I can't see that this behaviour is documented anywhere, nor if it's at
> all controllable.
>
> Does anyone have any insight?
>
> Joseph
>
>
$ ls -1 *
boo
foo
test.lua
$ texlua test.lua *
boo
foo
test.lua
$ texlua test.lua '*'
*
$ texlua test.lua "*"
*
$ texlua test.lua '"*"'
"*"
$ texlua test.lua "'*'"
'*'
and the same with luatex. I guess that it's not what you expect
under windows, but at the moment I cannot test.
--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20240311/42dc6f00/attachment.htm>
More information about the luatex
mailing list.