Loading application variables
Sun Jun 11 14:42:43 CEST 2006
On Sun, 2006-06-11 at 14:22 +0200, Ulf Wiger wrote:
> Den 2006-06-11 14:06:50 skrev Pupeno <pupeno@REDACTED>:
> Well, you can also set environment variables via the command line, e.g.
> erl -miselfu echoTCPPort 7 ...
If I was running erl myself I would just run
erl -config /usr/local/etc/miselfu/miselfu.config
and then application:start(miselfu). just works. But the thing is that I
am not running erl myself, Emacs is. And although I can customize the
command line, I don't want to always load the config file, I may not be
codding miselfu itself.
> but in order for them to actually take, you also need to load the miselfu
> application, using application:load(miselfu). If your variables are
> defined in a .config file, I thought it would be easier to write a small
> erlang function that reads it and sets them appropriately. It can be done
> in less than 10 lines of code.
I understand it can be written, but since nobody has written it yet I
suppose people work in other ways, if so, I want to learn that instead
of writing a function (that doesn't belong to my project anyway, but to
> I personally try to use builder
What is builder ?
> in situations like that. It builds a bash
> script that loads all given applications, but doesn't start them (except
> the mandatory kernel and stdlib), essentially so that one could fire up an
> erlang shell, with the code path and all the environment variables set,
> and then do initialization or debugging from the shell.
I think that solution is not quite what I need either.
Pupeno <pupeno@REDACTED> http://pupeno.com
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 191 bytes
Desc: This is a digitally signed message part
More information about the erlang-questions