Load\_path(3) OCaml library Load\_path(3)

# [NAME](#NAME)

Load\_path - Management of include directories.

# [Module](#Module)

Module Load\_path

# [Documentation](#Documentation)

Module **Load\_path**  
: **sig end**

Management of include directories.

This module offers a high level interface to locating files in the load path, which is constructed from **-I** 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.

*val add\_dir* : **string -&gt; unit**

Add a directory to the end of the load path (i.e. at lowest priority.)

*val remove\_dir* : **string -&gt; unit**

Remove a directory from the load path

*val reset* : **unit -&gt; unit**

Remove all directories

*val init* : **string list -&gt; unit**

**init l** is the same as **reset (); List.iter add\_dir (List.rev l)**

*val get\_paths* : **unit -&gt; string list**

Return the list of directories passed to **add\_dir** so far.

*val find* : **string -&gt; 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.

*val find\_uncap* : **string -&gt; string**

Same as **find** , but search also for uncapitalized name, i.e. if name is Foo.ml, allow /path/Foo.ml and /path/foo.ml to match.

*module Dir :* **sig end**

*val add* : **Dir.t -&gt; unit**

Old name for **Load\_path.append\_dir**

*val append\_dir* : **Dir.t -&gt; unit**

**append\_dir d** adds **d** to the end of the load path (i.e. at lowest priority.

*val prepend\_dir* : **Dir.t -&gt; unit**

**prepend\_dir d** adds **d** to the start of the load path (i.e. at highest priority.

*val get* : **unit -&gt; Dir.t list**

Same as **get\_paths ()** , except that it returns a **Dir.t list** .

2026-10-27 OCamldoc

---

Document: Load_path(3o) from ocaml-4 4.14.4-r4 (Chainguard OS)
Source: https://github.com/ocaml/ocaml
