System queries with Lua: l3sys-query

Reinhard Kotucha reinhard.kotucha at gmx.de
Wed Mar 6 05:12:17 CET 2024


On 2024-03-06 at 00:21:07 +0000, David Carlisle wrote:

 > If openin_any = p is in force the calling tex system wouldn't be able to
 > > read .foo but (currently at least)  it shows in the directory listing.
 >
 > I think that's compatible with openin_any=p (which actually is in force
 > above) otherwise we would (I think) have to add a call to
 >
 > kpsewhich -var-value 'openin_any'
 >
 > to disable --all in that case.
 >
 > or using the lua interface rather than calling the command
 >
 >  kpse.set_program_name("kpsewhich")
 >   if (kpse.var_value('open_in') ~= 'a')
 >   then
 >      is_all=false
 >   end

The latter variant is preferred. Using the kpse library is much more
efficient than forking sub-processes.

Executing "kpsewhich -var-value 'openin_any'" means that all texmf.cnf
and ls-R files have to be read and processed again.

luatex's kpse library has to do the same but only once when a script
is executed.  Accessing a kpathsea variable in luatex doesn't take
more time than accessing any other variable.

Regards,
  Reinhard

--
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at gmx.de
------------------------------------------------------------------



More information about the tex-live mailing list.