Function: locate-file-internal
locate-file-internal is a function defined in lread.c.
Signature
(locate-file-internal FILENAME PATH &optional SUFFIXES PREDICATE)
Documentation
Search for FILENAME through PATH.
Returns the file's name in absolute form, or nil if not found.
If SUFFIXES is non-nil, it should be a list of suffixes to append to
file name when searching.
If non-nil, PREDICATE is used instead of file-readable-p.
PREDICATE can also be an integer to pass to the faccessat(2) function,
in which case file-name-handlers are ignored.
This function will normally skip directories, so if you want it to find
directories, make sure the PREDICATE function returns dir-ok for them.
Source Code
// Defined in /usr/src/emacs/src/lread.c
{
Lisp_Object file;
int fd = openp (path, filename, suffixes, &file, predicate, false, false);
if (NILP (predicate) && fd >= 0)
emacs_close (fd);
return file;
}