[erlang-questions] Path of the current module

Edward Stow ed.stow@REDACTED
Tue Feb 3 11:27:25 CET 2009


2009/2/3 Bjorn Gustavsson <bgustavsson@REDACTED>:
> On Tue, Feb 3, 2009 at 10:33 AM, Edward Stow <ed.stow@REDACTED> 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))

That was just what I was looking for.  It was the ?MODULE that I
didn't know about.

Thanks

-- 

Edward Stow



More information about the erlang-questions mailing list