|
|
| Author |
Message |
< Erlang ~ How to get folder of the current module? |
| jacek99 |
Posted: Tue May 26, 2009 6:25 pm |
|
|
|
User
Joined: 26 May 2009
Posts: 27
Location: Montreal, Canada
|
I know I get get the current module name using ?MODULE...but how do I get the current folder in which the module .erl file is located?
thanks |
|
|
| Back to top |
|
| seanmc |
Posted: Wed May 27, 2009 7:27 am |
|
|
|
User
Joined: 03 Aug 2007
Posts: 10
|
Hi Jacek,
?MODULE:module_info() might be able to help you.
You can match out the compile, source element:
mod:module_info().
[{exports,[{init,0},
{cmds,0},
{stop,0},
{start,0}]},
{imports,[]},
{attributes,[{vsn,[277449438541699252019369955108873496019]}]},
{compile,[{options,[export_all,export_all]},
{version,"4.6"},
{time,{2009,5,26,13,3,34}},
{source,"/home/user/mod.erl"}]}]
//Sean. |
|
|
| Back to top |
|
| jacek99 |
Posted: Tue Jun 02, 2009 2:03 pm |
|
|
|
User
Joined: 26 May 2009
Posts: 27
Location: Montreal, Canada
|
Thanks Sean, was a good reason to do some pattern matching  |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|