How can I automatically locate a programs configuration files in the same directory as the executable?

Q

How can I automatically locate a programs configuration files in the same directory as the executable?

✍: Guest

A

It's hard, in general; Even if you can figure out a workable way to do it, you might want to consider making the program's auxiliary (library) directory configurable, perhaps with an environment variable. (It's especially important to allow variable placement of a program's configuration files when the program will be used by several people, e.g. on a multiuser system.)

2015-03-13, 1175👍, 0💬