Re: finding locations of many files via kpse

Mike Marchywka <[email protected]>
Newsgroups gmane.comp.tex.texhax
Message-ID <BL3PR11MB6338F5D9DD418C6C1DBA974CBEDC2@BL3PR11MB6338.namprd11.prod.outlook.com>



________________________________________
From: texhax <[email protected]> on behalf of Norbert Preining <[email protected]>
Sent: Tuesday, July 2, 2024 5:01 AM
To: [email protected]
Subject: finding locations of many files via kpse

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?


[ using stupid browser reply in hotmail arrh ]

If the search path is static, you could write a script to 
expand the kpse path to explicit directories 
and then list all the files in each dir in search order into a new file  . Repeated grepping
of this file could be pretty fast as it should stay buffered
in memory. Kind of a kluge but it may be faster than
kpse all the time.



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
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.