Loading application variables
Sun Jun 11 14:39:42 CEST 2006
On 11 Jun 2006, at 13:06, Pupeno wrote:
> On Sun, 2006-06-11 at 14:02 +0200, Ulf Wiger wrote:
>> 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).
> So, you don't normally work that way ? Opening up a shell on Emacs,
> running the application and re-loading code as it is modified ?
I would think that most more serious erlang applications use the
sys.config file for a few parameters that are only required at
startup and not subject to change. Parameters that should change at
runtime would typically be stored in a database or opened up as APIs
so they can be changed without restarting the application.
Of course your application might be such that it can be restarted
after every config change, in which case sys.config might be sufficient.
More information about the erlang-questions