Re: finding locations of many files via kpse

Erik Nijenhuis <[email protected]>
Newsgroups gmane.comp.tex.texhax
Message-ID <[email protected]>
Hi Norbert,

The first would lead to a significant change in the CLI implementation, I
assume. As every path then needs its own option set being preceded/post-ceded,
or all options simply apply to every path given. Both options are tricky to
conclude I guess.

The second I know of, as I also had some challenges finding and checking the
right file(s) in Lua.

I ended up using `kpse.in_name_ok` function in order to check if it's OK to
open, like on line 37 of the following file:
        https://github.com/Xerdi/gitinfo-lua/blob/master/scripts/gitinfo-lua-recorder.lua

However, unsure about the performance you may gain. The documentation states
that `kpse.lookup` tends to be 'slower'. Also, if the overhead of error messages
to stdout/err isn't needed, you could also try `kpse.in_name_ok_silent_extended`
to lose some logging overhead.

Hope it helps.

Kind regards, Erik Nijenhuis

On Tue, 2024-07-02 at 12:00 +0200, [email protected] wrote:
> Send texhax mailing list submissions to
>         [email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://tug.org/mailman/listinfo/texhax
> or, via email, send a message with subject or body 'help' to
>         [email protected]
> 
> You can reach the person managing the list at
>         [email protected]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of texhax digest..."
> 
> 
> Today's Topics:
> 
>    1. finding locations of many files via kpse (Norbert Preining)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 2 Jul 2024 18:01:56 +0900
> From: Norbert Preining <[email protected]>
> To: [email protected]
> Subject: finding locations of many files via kpse
> Message-ID: <ZoPCBF4enFRw9Piy@bulldog>
> Content-Type: text/plain; charset=us-ascii
> 
> Hi everyone,
> 
> For a given set of input file names (arguments to includegraphics or
> usepackage or ...), I would like to check the availability/location
> quickly.
> 
> Of course I could call
>         kpsewhich $i
> for each and every file, but I think this is not the most effective way.
> 
> My ideas are in decreasing preference:
> * call kpsewhich with as many arguments as possible, reducing the
>   calling overhead
>         kpsewhich file1 file2 file3 ...
>   (up to maximal possible)
> * use a lua script and the built-in kpse module
> * write a C program that links to libkpathsea and does that
> 
> Any other suggestions?
> 
> Thanks a lot
> 
> Norbert
> 
> --
> PREINING Norbert                              https://www.preining.info
> arXiv / Cornell University   +   IFMGA Guide   +   TU Wien  +  TeX Live
> GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
> 
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> texhax mailing list
> [email protected]
> https://tug.org/mailman/listinfo/texhax
> 
> 
> ------------------------------
> 
> End of texhax Digest, Vol 2024, Issue 95
> ****************************************


Met vriendelijke groet,


Erik Nijenhuis | Xerdi
Softwaremaker

A:​ Frans Halsstraat 38
 8932 JC, Leeuwarden
T: +31 (0) 6 46 277 908
E: [email protected]
W: www.xerdi.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.