> > You are probably looking for Sys.getcwd : unit -> string If I understood correctly, it is more about the directory of the module at compile time. One (hackish) way to do it is with the value __FILE__ in Pervasives (see http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#6_Debugging for some compile time constant used for debugging). It simply returns the path of the .ml given to the compiler, not an absolute path (except if you called the compiler on an absolute path, of course). I do not think there is any way to get the current directory of an implementation at compile time otherwise. 2016-10-05 16:22 GMT+02:00 Gabriel Scherer : > Filename.current_dir_name is likely to be just ".", it indicates the > (location-agnosti) way to refer to the current directory on your system, to > make it easier to write code that is portable on other operating systems > with different path conventions. > > You are probably looking for > > Sys.getcwd : unit -> string > > which when called returns the current working directory (as the `pwd` > command would do). It may of course change over the time of your program > execution, for example if you called Sys.chdir. There is also > > Sys.executable_name : string > > (or Sys.argv.(0)) which contains the path of the executable, but it may be > a relative path -- it depends on how the program was invoked. > > On Wed, Oct 5, 2016 at 10:11 AM, Gustave Nimant > wrote: > >> Dear list, >> >> I would like to get the path of the current directory where the current >> executed module is implemented. >> Is there any builtin constant ? >> I could not find. >> >> Thanks, >> Gustave >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs >> > >