[erlang-questions] application:get_env return undefined

Fred Hebert mononcqc@REDACTED
Wed Jan 9 14:54:38 CET 2013


If I recall correctly, submitting 'app.config' will look for
'app.config' on disk, and if it is not found, only then will the VM
append the '.config' extension and look for 'app.config.config' for the
configuration file.

It's fine to leave the .config extension in the path for that one.

Regards,
Fred.

On 01/09, Bengt Kleberg wrote:
> Greetings,
> 
> Is this not the problem that the file app.config must have .config
> extension on the file itself, but must not have .config extension on the
> command line ("-config app")?
> 
> 
> bengt
> 
> On Wed, 2013-01-09 at 19:13 +0600, Alexander 0xAX wrote:
> > Hello,
> > 
> > 
> > 
> > I have simple test application with test.app.src file, test_app.erl
> > and test_sup.erl
> > 
> > 
> > Also i want to read config in my application. I have app.config:
> > 
> > 
> > [
> >  {my_app_config, 
> >   [{key1, "val"}]}
> > ].
> > 
> > 
> > I run my application:
> > 
> > 
> > erl -boot start_sasl -config app.config -s test_app
> > 
> > 
> > And now, after application successful starting i try to read my
> > config:
> > 
> > 
> > >application:get_env(test_app, my_app_config).
> > undefined
> > 
> > 
> > Why? How can i correctly read config file?
> > 
> > 
> > Thank you.
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list