[tex-k] kpathsearch and Octave

John W. Eaton jwe@bevo.che.wisc.edu
Fri, 25 Oct 2002 14:28:26 -0500


On 25-Oct-2002, Olaf Weber <olaf@infovore.xs4all.nl> wrote:

| John W Eaton writes:
| 
| > First, Octave is interactive, and users may change the value of the
| > path used for searching for functions at any time, so I need to be
| > able to clear the directory cache and start fresh.  The patch below
| > adds a new function for this purpose.
| 
| Do you really need to clear the directory cache for this?  I _think_
| just picking a different search path should already work, but I may be
| completely off.  (Unless the resulting "memory leak" is your concern.)

I don't see any code that removes directories from the cache.

Suppose there are two directories /foo and /bar that contain the same
file X.  Then if the user starts out with /foo in the path and looks
up X, they will find /foo/X, and that's fine.  Now they change the
path to /bar, and they should find /bar/X.  Is that what will happen?

What about if /foo/X exists and the user simply removes /foo from the
path?  Does it remain in the cache, so it will still be found, even
though the user has removed /foo from the path?

| Outside of the web2c sources, to be precise.  I do recognize this as a
| problem, but properly disentangling libkpathsea from web2c will take
| some effort.  In particular, there are parts of the build system that
| I'm looking at and would like to change/clean up.  I am also not happy
| with the library interface when looked at as a shared library
| interface, and I'm profoundly unhappy with the headers that have to be
| installed.

OK.

I think that this library could have a lot of uses beyond TeX and
web2c.  It would be nice to extract the basic path searching stuff
into a base library with a nice clean interface that could be used by
lots of different projects, and then build the TeX-specific stuff on
top of that.  I'd be willing to help (as much as I can, given my
limited time) make that happen if it is something that you agree would
be useful.

Thanks,

jwe