Erlang: specify working directory for mnesia?

How to 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 () '?

+6
erlang mnesia
source share
2 answers

application:set_env(mnesia, dir, Dir).

+12
source share

In addition to calling the method mentioned in other answers, here you can also specify this in the system configuration file or in the .app file specified by the -config parameter. See http://erlang.org/doc/design_principles/applications.html#id2270704 for more details. This allows you to save the configuration separately from the code and avoid a large number of command line flags.

+2
source share

All Articles