Module Load_path
: sigend
Management of include directories.
This module offers a high level interface to locating files in the load path, which is constructed from
-I and -H command line flags and a few other parameters.
It makes the assumption that the contents of include directories doesn't change during the execution of
the compiler.
valadd_dir : hidden:bool->string->unit
Add a directory to the end of the load path (i.e. at lowest priority.)
valremove_dir : string->unit
Remove a directory from the load path
valreset : unit->unit
Remove all directories
moduleDir:sigendtypeauto_include_callback = (Dir.t->string->stringoption)->string->string
The type of callback functions on for init~auto_includevalno_auto_include : auto_include_callback
No automatic directory inclusion: misses in the load path raise Not_found as normal.
valinit : auto_include:auto_include_callback->visible:stringlist->hidden:stringlist->unitinit~visible~hidden is the same as reset();List.iteradd_dir(List.revhidden);List.iteradd_dir(List.revvisible)valauto_include_otherlibs : (string->unit)->auto_include_callbackauto_include_otherlibsalert is a callback function to be passed to Load_path.init and automatically adds
-I+lib to the load path after calling alertlib .
valget_path_list : unit->stringlist
Return the list of directories passed to add_dir so far.
typepaths = {
visible : stringlist ;
hidden : stringlist ;
}
valget_paths : unit->paths
Return the directories passed to add_dir so far.
valfind : string->string
Locate a file in the load path. Raise Not_found if the file cannot be found. This function is optimized
for the case where the filename is a basename, i.e. doesn't contain a directory separator.
valfind_normalized : string->string
Same as find , but search also for normalized unit name (see Misc.normalized_unit_filename ), i.e. if
name is Foo.ml , allow /path/Foo.ml and /path/foo.ml to match.
typevisibility =
| Visible
| Hidden
valfind_normalized_with_visibility : string->string*visibility
Same as find_normalized , but also reports whether the cmi was found in a -I directory (Visible) or a -H
directory (Hidden)
valadd : Dir.t->unitDeprecated.
Old name for Load_path.append_dirvalappend_dir : Dir.t->unitappend_dird adds d to the end of the load path (i.e. at lowest priority.
valprepend_dir : Dir.t->unitprepend_dird adds d to the start of the load path (i.e. at highest priority.
valget_visible : unit->Dir.tlist
Same as get_paths() , except that it returns a Dir.tlist , and doesn't include the -H paths.
OCamldoc 2025-06-12 Load_path(3o)