[erlang-questions] starting application after a set_env variable

Roberto Ostinelli roberto@REDACTED
Sat Jun 20 11:49:50 CEST 2009

hi michal,

unfortunately this is not working.

as per my previous email, when i read get_env within the my_app:start/ 
2 function, i am correctly getting the value, so apparently the  
set_env did work. thus i do not understand what's going on.

thank you for your response i've to deliver before tonight and this is  
my last open point, and unfortunately it does sound strange to me.


On 20/giu/09, at 11:33, Michal Ptaszek wrote:

> Hello Roberto,
> .app file is read when you load the application into
> your system, that is - during its start.
> The env variables from the .app override their previous
> values - so you will not find their original value anymore.
> However, there is a simple workaround - try something like
> that:
> application:load(my_app). %% here you will load also the .app file
> application:set_env(my_app, Key, Val).
> application:start(my_app). %% .app will not be parsed here
> Best regards,
> -- 
> Michal Ptaszek
> www.erlang-consulting.com

More information about the erlang-questions mailing list