[tex-live] path search

Hans Hagen pragma at wxs.nl
Sun Jan 18 22:12:56 CET 2004


When i say

   \input ./whateverfile

(or \openin) i expect tex (or mp) to take that literally, i.e. when no file 
is found, it should see an empty file.

This used to work (at least some tex lives back, when i wrote the context 
file handlers). I went to a lot of trouble to make sure that i could bypass 
the path searching in controlled situations, but now it seems that in the 
case of an explicit path ( here ./ ) still the path searching is used. I 
think that when one provides an explicit path, i.e. when the filename 
starts with one of


no path searching should take place. (unless maybe a filename end with // -)

reason: imagine that i generate a mp graphic [or whatever temp file; 
context loves buffers] at runtime, and that graphic is empty, for instance 
because there is an error in the mp code; in that case i now get any file 
that matches the name, instead of no result (and therefore no indication of 
an error);

reason: when i started with mp support, i used temp files called 
mpgraph.mp; this worked ok, till tex distributions started to distribute 
hobbies manual and documentation which had a file with the same name; then, 
i suddenly got side effects (i.e. i had to generate empty files, just to 
make sure that a run that didn't have graphics embedded, didn't result in 
hobbies manual to be processed); explicit filenames (./mpgraph) were a way 
out; but now ...

Can someone shed some light on this (was it changed, when, how do i find 
out, how to prevent, etc)

Btw, there are situations when one would like to be more specific in the 
path search; i fear the moment that files with the same names end up in 
context trees, which is possible when users have their own extensions (e.g. 
symbol definitions, typescripts, modules); currently i can handle that with 
a rigurous name scheme but ...; maybe there should be some option like

\input [tex/context/private/]thisorthatfile

(not an explicit path since it has [] which are not used by tex users for 
filenames i guess)

i.e. [...] tells the kpse library that tex/context/private/thisorthat is to 
be searched (in the tree), not to be confused with an explicit path under 
the current directory.


   \input thisorthat                           : search controlled by kpse 
   \input ./thisorthat                         : search controlled by user 
(first example)
   \input ../figures/thisorthat                : search controlled by user 
(second example)
   \input [somewhere;somewhereelse]/thisorthat : a combination

I can even imagine:

   \input [*somewhere]/thisorthat              : with *somewhere being 
$somehwere, i.e. an env/kpse variable

[ ] and * are not used in filenames normally so ...


                                   Hans Hagen | PRAGMA ADE | pragma at wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf

More information about the tex-live mailing list