Brett McCoy wrote: > Yes, typically, a default config will be kept under /etc or /usr/share > and user specific ones will be kept in the user's home directory. Most > shells provide a mechanism to find the location of an executable (bash > uses the 'which' command), but this may not be completely reliable as > someone could stick another version (maybe a hacked version) in a > different location that is earlier in the PATH than the real > executable. >
I am fairly certain that both Linux and Windows provide OS-specific hooks into gathering this information via the OS itself, which is generally the most robust way of doing this. Not using these hooks generally causes application to behave in ways that annoy users, such as saving data to directories in Windows Vista to which the user does not have permission (program files). As a last resort, just use the ~ directory for saving files, e.g. "~/.myapp". That should work for most if not all userland applications. -- John Gaughan
