Loading application variables

Ulf Wiger ulf@REDACTED
Sun Jun 11 14:02:39 CEST 2006


I don't know if there's a standard function for loading the .config file,  
but you can read and parse a .config file with  
file:consult("miselfu.config"), and you can set environment variables with  
application:set_env(AppName, Key, Value).

BR,
Ulf Wiger


Den 2006-06-11 12:30:24 skrev Pupeno <pupeno@REDACTED>:

> Hello,
> I have written an Erlang application called MiSelfu (well, miselfu
> actually). I can start it from the command line with:
>
> erl -sname miselfu -boot miselfu
> -config /usr/local/etc/miselfu/miselfu.config
>
> but I'd like to be able to start it from a already-running emulator,
> that's so I can run it from within my shell running within Emacs.
> I can try:
>
>> application:start(miselfu).
>
> =INFO REPORT==== 11-Jun-2006::12:04:35 ===
>     application: miselfu
>     exited: {shutdown,{miselfu_app,start,[normal,[]]}}
>     type: temporary
> {error,{shutdown,{miselfu_app,start,[normal,[]]}}}
>>
>
> but as you can see, I get a non-very descriptive error (at least, for my
> eyes). I only can think of the missing config file as the problem. How
> do I load that config file[1] to be able to run my application ?
> Am I doing something wrong ?
> As a newbie to Erlang and not knowing anyone else using it (I have never
> seen anyone else codding on Erlang), I am not sure about the best way to
> go thru the development cicle.
> Thank you.



-- 
Ulf Wiger



More information about the erlang-questions mailing list