www.delorie.com/gnu/docs/octave/kpathsea_69.html   search  
Buy GNU books!

Kpathsea: A library for path searching

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2 File lookup

This section describes how Kpathsea searches for most files (bitmap font searches are the exception, as described in the next section).

Here is the search strategy for a file name:

  1. If the file format defines default suffixes, and the suffix of name name is not already a known suffix for that format, try the name with each default appended, and use alternative names found in the fontmaps if necessary. We postpone searching the disk as long as possible. Example: given `foo.sty', look for `foo.sty.tex' before `foo.sty'. This is unfortunate, but allows us to find `foo.bar.tex' before `foo.bar' if both exist and we were given `foo.bar'.

  2. Search for name, and if necssary for alternative names found in the fontmaps. Again we avoid searching the disk if possible. Example: given `foo', we look for `foo'.

  3. If the file format defines a program to invoke to create missing files, run it (see section 2.2.9 `mktex' scripts).

This is implemented in the routine kpse_find_file in `kpathsea/tex-file.c'. You can watch it in action with the debugging options (see section 2.6.3 Debugging).

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003