The file.find
function attempts to find a file based on
a full or partial file name. The file name is passed
on the pattern
parameter.
The pattern
accepts both the single character question mark
wild card (?), and the asterisk multi-character wild card (*).
Searches are case-insensitive.
Starting from the base path specified in the path
parameter,
the function searches
both above and below the base path in an alternating
pattern. The function will first search the base path, then up one level,
then down one level, and so on. The boundaries of
the search can be controlled by the up
and down
parameters.
You can control whether or not you want files from the base directory
included in the results. To include these files, ensure both up
and down
parameters are zero or greater. If either of these
parameters is set to -1, the base path will be excluded. For example,
up = 3, down = 1
will search up three levels, and down one level.
up = 3, down = 0
will search up three levels and not search down,
but will include the base directory. up = 3, down = -1
will search
up three levels, not search down, and not include the base directory in
the results.