[erlang-questions] Path of the current module

Bjorn Gustavsson <>
Tue Feb 3 11:03:55 CET 2009


On Tue, Feb 3, 2009 at 10:33 AM, Edward Stow <> wrote:
> Hi
>
>
> My question simple, but I could not find the answer:  What function
> will return the path of the currently executing module?

code:which(?MODULE)

If you only want the directory part, use

filename:dirname(code:which(?MODULE))

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list