Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang: specifying a working directory for mnesia?

Tags:

erlang

mnesia

How do I specify a working directory for mnesia without resorting to passing the "dir" parameter on the command-line?

In other words, can I specify a "working directory" for mnesia just before calling `mnesia:start()' ?

like image 385
jldupont Avatar asked Dec 03 '09 19:12

jldupont


2 Answers

application:set_env(mnesia, dir, Dir).

like image 150
Zed Avatar answered Sep 21 '22 17:09

Zed


Besides the method call mentioned in other responses here you can also specify this in a system configuration file or .app file specified with the -config parameter. See http://erlang.org/doc/design_principles/applications.html#id2270704 for more information. This allows you keep the configuration seperate from the code and avoid a lot of command line flags.

like image 44
Jeremy Wall Avatar answered Sep 18 '22 17:09

Jeremy Wall