Quote:
Originally Posted by jasonkb
Still leaves me with the problem of determining where the program is actually located so I could read in config files.
Or why not have a look and see how other applications solve problems like this on UNIX?
Let application name="foo"
UNIX apps typically do the following....
1. check $HOME directory for directory called .foo and finds config in there, such as $HOME/.foo/foo.conf
2. check a package directory, eg /usr/pkg/etc/foo.conf or /opt/MYfoo/etc/foo.conf
3. check the gobals, /etc/foo.conf
4. use sensible defaults
5. have a wrapper script that does the setting up of environment before running the actually binary with exec, allows installation to code directory paths in a shell script outside of the binary.
NB, There is no portable way to determine the filename of a program at startup.