open
is a language feature that doesn't know anything about the file system. You'll have to use a special directive instead to load the module from a file.
utop
/rtop
mostly uses the same directives as the ocaml
toplevel, which are documented in the OCaml manual, here.
If the module has been compiled, you can load the .cmo
or .cma
using the #load
directive:
#load "filename";;
If that module depends on other modules, you can use #load_rec
instead to load them recursively.
If your code has not been compiled, and since you open
it immediately, you can also use the #use
directive:
#use "filename";;
Or if you want to load it as if was a top-level module, use #mod_use
instead.