Is there a standard place to put the mnesia database within erlang? At the moment I am putting it in the priv directory.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By default, Mnesia will create the schema in a subdirectory called
Mnesia.<node name>of the current directory of the emulator process.If that’s not what you want, all you need to do is set Mnesia’s
dirapplication variable with something likeAs for where to place the database: that depends on your deployment scenario. Since application
variables can also be set using release config files or command line arguments, you can delay that
decision until you ship (or install on your own servers). For use in production, a standard directory like
/var/lib/<your application>/mnesia-<node name>(on unix) should do.For playing around, i’d recommend using a dedicated directory under the code root (NOT the priv directory) and setting that location within your application’s startup section.
In my pet projects, i often use code such as
for exactly that purpose.