finds the file with the specified name that would be loaded by Get[name] and related functions.


  • FindFile[name] successively searches for a file with the specified name in each of the directories given in $Path.
  • FindFile returns full absolute file names.
  • FindFile returns $Failed if it cannot find a file with the specified name.
  • In FindFile[name], the name can be specified with / path separators (or \\ on Windows). It can also be specified with ` context separators.
  • For names of the form "name`", FindFile searches for files "" and "name.m".
  • If FindFile resolves to a directory, it will search for a file named Kernel/init.m or init.m in that directory.
  • If FindFile resolves to an object of the form "" which corresponds to a directory, it will search for a file with a name like$SystemID/
  • Get, Needs, OpenRead, Install and other functions effectively use FindFile to find files to read.
  • FindFile[File["file"]] is also supported.


open allclose all

Basic Examples  (3)

Find which initialization file is loaded:

Find initialization file for a package:

Find a file used for examples:

Scope  (1)

Find the file specified by the File object:

Introduced in 2008
Updated in 2016