[erlang-questions] [Erlang-Q] Why can not create a Mnesia schema directory indicated by a full path

Daniel Dormont dan@REDACTED
Sun Apr 24 19:22:10 CEST 2011


As a relative newbie to Erlang but experienced Unix user, this was confusing
to me at first. I'm very familiar with Unix shell escapes. What was
surprising to me when I started working with Erlang was that command line
options to Erlang modules require full-fledged Erlang terms: so if you want
a string literal, such as in this case, the argument itself needs to include
double quotes.

Dan

On Sun, Apr 24, 2011 at 8:00 AM, Ulf Wiger
<ulf.wiger@REDACTED>wrote:

>
> The issue is with quoting in the unix shell. Try:
>
> erl -mnesia dir \"/home/myname/tmp/schemas\"
>
> The reason why it worked with a single directory name was that it parsed as
> a valid atom, and the file module allows atoms as file names.
>
> That is, for any environment variables given as -App Key Value  on the
> command line, Value will be parsed as an Erlang term. Anything with special
> meaning to the command shell needs to be escaped.
>
> BR,
> Ulf W
>
> On 24 Apr 2011, at 13:04, Barco You wrote:
>
> > When I tried to indicate Mnesia schema directory with command: erl
> -mnesia dir "/home/myname/tmp/schemas", I got error while calling
> "mnesia:create_schema([node()|nodes()])" in erlang shell.
> >
> > But if I start erlang shell with just a string as the schema directory
> name such as " erl -mnesa dir location", I could correctly create schema in
> erlang shell.
> >
> > Seemingly Mnesia schema directory can not be indicated as a full path.
> >
> > {erts, "5.8"},
> > {kernel,"2.14"},
> > {stdlib,"1.17"}.
> >
> >
> > Best regards,
> > Barco
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
>
> Ulf Wiger, CTO, Erlang Solutions, Ltd.
> http://erlang-solutions.com
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110424/cbb50c49/attachment.htm>


More information about the erlang-questions mailing list