[erlang-questions] specifying directory for mnesia database
t x
txrev319@REDACTED
Mon Apr 7 11:45:58 CEST 2014
I've tried:
{env, [{mnesia, "/home/x/code/data/"}]}
this compiles, but does not change the directory.
I've also tried:
{env, [{mnesia, dir, "/home/x/code/data/"}]}
but this does not compile.
Reading: http://stackoverflow.com/questions/1842462/erlang-specifying-a-working-directory-for-mnesia
it says I should try application:set_env(mnesia, dir, Dir)
How do I encode that into my app.src?
Thanks!
On Sun, Apr 6, 2014 at 8:21 PM, t x <txrev319@REDACTED> wrote:
> Hi,
>
> * I'm learning to use Mnesia (until I run into 2GB table issues.)
>
> * I'm using erlang.mk + relx.
>
> * Everything appears to be working, _EXCEPT_
>
> * mnesia appears to be storing its tables in _rel/'node()'
>
> * these tables appear to get wiped when I type "make"
>
> * I'm not happy when my db gets wiped when I recompile my code.
>
>
> I've done some googling, and it appears my options are:
>
>
> ## 1) specify directory on erl commandline
>
> example: erl -mnesia dir '"/tmp/funky"'
> documentation: http://www.erlang.org/doc/apps/mnesia/Mnesia_chap2.html
>
> I'd prefer to not take this approach, as I don't want to hack erlang.mk/relx.
>
>
> ## 2) specify in env config in app.src
>
> documentation: http://www.erlang.org/doc/man/app.html
>
> I think this is the approach I want. I also think there's a one line fix.
>
> Can someone tell me how to, via app.src, tell mnesia to store all it's
> dbs in "/tmp/mnesia" ?
>
> Thanks!
More information about the erlang-questions
mailing list