Message from discussion
starting an app with an app.config file
Received: by 10.204.127.19 with SMTP id e19mr677722bks.4.1350777658239;
Sat, 20 Oct 2012 17:00:58 -0700 (PDT)
X-BeenThere: erlang-programming@googlegroups.com
Received: by 10.204.147.6 with SMTP id j6ls2898954bkv.9.gmail; Sat, 20 Oct
2012 17:00:57 -0700 (PDT)
Received: by 10.204.149.65 with SMTP id s1mr676836bkv.3.1350777657865;
Sat, 20 Oct 2012 17:00:57 -0700 (PDT)
Received: by 10.204.149.65 with SMTP id s1mr676835bkv.3.1350777657843;
Sat, 20 Oct 2012 17:00:57 -0700 (PDT)
Return-Path: <erlang-questions-boun...@erlang.org>
Received: from hades.cslab.ericsson.net (hades.cslab.ericsson.net. [192.121.151.104])
by gmr-mx.google.com with ESMTP id v13si580682bkw.0.2012.10.20.17.00.57;
Sat, 20 Oct 2012 17:00:57 -0700 (PDT)
Received-SPF: pass (google.com: domain of erlang-questions-boun...@erlang.org designates 192.121.151.104 as permitted sender) client-ip=192.121.151.104;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of erlang-questions-boun...@erlang.org designates 192.121.151.104 as permitted sender) smtp.mail=erlang-questions-boun...@erlang.org
Received: from hades.cslab.ericsson.net (hades [192.121.151.104])
by hades.cslab.ericsson.net (Postfix) with ESMTP id A828E5C143;
Sun, 21 Oct 2012 02:00:52 +0200 (CEST)
X-Original-To: erlang-questi...@erlang.org
Delivered-To: erlang-questi...@erlang.org
Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com
[209.85.217.181])
by hades.cslab.ericsson.net (Postfix) with ESMTP id 7B84D5C02B
for <erlang-questi...@erlang.org>; Sun, 21 Oct 2012 02:00:50 +0200 (CEST)
Received: by mail-lb0-f181.google.com with SMTP id gg6so980588lbb.40
for <erlang-questi...@erlang.org>; Sat, 20 Oct 2012 17:00:50 -0700 (PDT)
d=google.com; s=20120113;
h=mime-version:sender:in-reply-to:references:date
:x-google-sender-auth:message-id:subject:from:to:cc:content-type
:x-gm-message-state;
bh=StxYmUYLmTvZpUJYKWGSnZqqX2HuxYV+hQqHWAmJb8o=;
b=UQDP1+/UA0OKT65DrQivvTgs2FaYFM9ImeEB+HOiOIn/EDh6NM0n/cxchFxaJT8OcY
KDzA2UZ/gKRJDGNlU6n591rM28/a8sHnztA2HEupjLQqpj4yXvJnSm8O9FWm6MfgTcAg
9hfZGfsL+gIW29uleFAyRKvXw1WfIb9kq+pq9tZsnED7Vk/qoXpZLtVNDenaiR/8R8d1
Z4hrF2fEUdbjEeB9p/+aukpo3p0FpyV9aJKmTQ2CboqbqD8Xk/lFKo09OqHl2HwrLoKw
Qh1RBhxHYDa/tVaB/YSyopLl9beJitckZGtrZQfKKNZnL4QstZ5MaZs9jWmr9zHjF3hq
GpOQ==
MIME-Version: 1.0
Received: by 10.112.103.234 with SMTP id fz10mr2139667lbb.38.1350777650211;
Sat, 20 Oct 2012 17:00:50 -0700 (PDT)
Received: by 10.152.24.226 with HTTP; Sat, 20 Oct 2012 17:00:50 -0700 (PDT)
In-Reply-To: <CAFVMu-rw0Q6sCw+3jgwpOG08geWf2hJU-TBD5K=FnkR8Opf...@mail.gmail.com>
References: <CAM5fRyqnRYj4H9mPZcDyvKsg9fezQ6ai=V2FAacc+QmQAxg...@mail.gmail.com>
<CAM5fRyo5gPbL4-1sRBFYBJymADyuwuV0oWVdwscKT6+sbX0...@mail.gmail.com>
<CAAVAaqCA5=bvLKrFR6rb9C5HYyUXAZeVU_7ynnmm1fZ28yw...@mail.gmail.com>
<CAM5fRyqwVyjd3csRjb=YTWqd7Ya=hL7DmXN25xxSrF6RSy1...@mail.gmail.com>
<CAFVMu-rw0Q6sCw+3jgwpOG08geWf2hJU-TBD5K=FnkR8Opf...@mail.gmail.com>
Date: Sat, 20 Oct 2012 17:00:50 -0700
Message-ID: <CAM5fRypvrSz206W4H-2CTgwfNyfbytk2w+677MHoJ=RRQ6X...@mail.gmail.com>
From: Roberto Ostinelli <robe...@widetag.com>
To: =?ISO-8859-13?Q?Motiejus_Jak=F0tys?= <desired....@gmail.com>
X-Gm-Message-State: ALoCoQkfcGpmXedGTjyMRh40uQq5PxXacgmOU6ga6eaLJ5CDOoapjZiF4O9G95Zzi0Ad0FqlEKz0
Cc: erlang-questi...@erlang.org
Subject: Re: [erlang-questions] starting an app with an app.config file
X-BeenThere: erlang-questi...@erlang.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: General Erlang/OTP discussions <erlang-questions.erlang.org>
List-Unsubscribe: <http://erlang.org/mailman/options/erlang-questions>,
<mailto:erlang-questions-requ...@erlang.org?subject=unsubscribe>
List-Archive: <http://erlang.org/pipermail/erlang-questions>
List-Post: <mailto:erlang-questi...@erlang.org>
List-Help: <mailto:erlang-questions-requ...@erlang.org?subject=help>
List-Subscribe: <http://erlang.org/mailman/listinfo/erlang-questions>,
<mailto:erlang-questions-requ...@erlang.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0975155377051719149=="
Errors-To: erlang-questions-boun...@erlang.org
Sender: erlang-questions-boun...@erlang.org
--===============0975155377051719149==
Content-Type: multipart/alternative; boundary=f46d0401683d02ebba04cc866ec5
--f46d0401683d02ebba04cc866ec5
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi Motiejus,
I'm doing something similar. It just feels weird. (:
r.
On Sat, Oct 20, 2012 at 3:45 PM, Motiejus Jak=C5=A1tys <desired....@gmail.c=
om>wrote:
> On Sat, Oct 20, 2012 at 10:00 PM, Roberto Ostinelli <robe...@widetag.com>
> 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} =3D 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=C5=A1tys
>
--f46d0401683d02ebba04cc866ec5
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi Motiejus,<div><br></div><div>I'm doing something similar. It just fe=
els weird. (:</div><div><br></div><div>r.</div><div><br><div class=3D"gmail=
_quote">On Sat, Oct 20, 2012 at 3:45 PM, Motiejus Jak=C5=A1tys <span dir=3D=
"ltr"><<a href=3D"mailto:desired....@gmail.com" target=3D"_blank">desire=
d....@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">On Sat, Oct 20, 2012 at 10=
:00 PM, Roberto Ostinelli <<a href=3D"mailto:robe...@widetag.com">robert=
o...@widetag.com</a>> wrote:<br>
> Hi,<br>
><br>
> this isn't working. From the docs:<br>
><br>
> load(AppDescr) -> ok | {error, Reason}<br>
> load(AppDescr, Distributed) -> ok | {error, Reason}<br>
><br>
> So application:load/2 actually is not reading from a config file.<br>
><br>
> Any other ideas?<br>
<br>
</div>=C2=A0 =C2=A0 {ok, Config} =3D file:consult(File),<br>
=C2=A0 =C2=A0 [application:set_env(myapp, K, V) | {K, V} <- Config].<br>
<br>
Not tested.<br>
<br>
Config might have to be [Config], you should try this out.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
--<br>
Motiejus Jak=C5=A1tys<br>
</font></span></blockquote></div><br></div>
--f46d0401683d02ebba04cc866ec5--
--===============0975155377051719149==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions
--===============0975155377051719149==--