[erlang-questions] Environment variables in applications

Alexander Lamb <>
Wed Jul 2 17:41:10 CEST 2008


I am writing an OTP application which will create a Mnesia database if  
needed (will check upon init if schema exists on that node).

Since I can't give a path in the mnesia:create_schema(node())  
function, from the documentation I read that it takes the environment  
variable "dir" so I hoped I could pass it in my application file such  
as this:

		{description, "Foundations for handling roles and studies"},
		{modules, [sasl,cs_guuid,cs_mnesia]},
		{registered, [cs_guuid,cs_mnesia,cs_foundations_sup]},
		{applications, [kernel,stdlib,sasl]},
		{mod, {cs_foundations_app,[]}},
		{start_phases, []},
		{env, [{core_dir, "/Users/alamb/Data/Mnesia"},{dir, "/Users/alamb/ 

Unfortunately, it doesn't seem to work. Any workaround?



More information about the erlang-questions mailing list