[erlang-questions] starting an app with an app.config file

Roberto Ostinelli roberto@REDACTED
Sun Oct 21 02:00:50 CEST 2012


Hi Motiejus,

I'm doing something similar. It just feels weird. (:

r.

On Sat, Oct 20, 2012 at 3:45 PM, Motiejus Jakštys <desired.mta@REDACTED>wrote:

> On Sat, Oct 20, 2012 at 10:00 PM, Roberto Ostinelli <roberto@REDACTED>
> wrote:
> > Hi,
> >
> > this isn't working. From the docs:
> >
> > load(AppDescr) -> ok | {error, Reason}
> > load(AppDescr, Distributed) -> ok | {error, Reason}
> >
> > So application:load/2 actually is not reading from a config file.
> >
> > Any other ideas?
>
>     {ok, Config} = file:consult(File),
>     [application:set_env(myapp, K, V) | {K, V} <- Config].
>
> Not tested.
>
> Config might have to be [Config], you should try this out.
>
> --
> Motiejus Jakštys
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121020/98fc4fa2/attachment.htm>


More information about the erlang-questions mailing list