On Mon, Feb 2, 2009 at 7:38 AM, John Matthews <[email protected]> wrote:
> --- In [email protected], Praveen S <mailprave...@...> wrote:
>>
>> Hi All,
>> I have a executable file at a particular location in the filesystem.
> From
>> root directory i run this exe. This exe will load a shared object from
>> another location (say /usr/lib). Now the shared object wants to read a
>> config file which is in the directory where the exe is located. How
> can it
>> get that path.
>
> Don't know- perhaps this is why application config files are usually
> in the user's home directory? Can you do that instead, or perhaps
> create a symbolic link to the config file from the user's home directory?

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.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to