LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   when to use environment variables? (http://www.linuxquestions.org/questions/programming-9/when-to-use-environment-variables-149665/)

mark_2811 02-23-2004 04:58 PM

when to use environment variables?
 
I'm developing an application (embedded) that needs some configuration setting to be loaded on startup. The way I've usually done this before is a custom formatted configuration file that the applications reads on startup. I'm wondering if using the environment variables would be a better way? When are environment variables preferred over a configuration file?

I'd like most settings to be loaded one time at startup, but also have some settings that can be changed during runtime, without stopping and restarting the application. Is this something that environment variables can help me to do?

Any info is appreciated!

Thanks,
Mark

Hko 02-23-2004 06:14 PM

Re: when to use environment variables?
 
Quote:

Originally posted by mark_2811
I'm wondering if using the environment variables would be a better way?
You can have both for more flexibility, having env var's override options from the config file.

jtshaw 02-23-2004 07:09 PM

I like Hko's suggestion. And if you really want to get fancy.... do your config files in XML instead of a custom format. This might be completely overboard for your task however, so take it or leave it.


All times are GMT -5. The time now is 04:16 PM.