Re: [ROOT] two stupid questions (again)

From: Valeri Fine (fine@bnl.gov)
Date: Wed Dec 26 2001 - 20:47:42 MET


> Unfortunately this is definitely NOT the question that I meant.
> Here it is (I promised to ask it once I remember it again ...).
> Assume you have a shared library somewhere ... you load it ... now assume
> you need to "read" a configuration file which should be placed in the same
> subdirectory that the library comes from. Is there any easy way to learn
> from which subdirectory the shared library has been loaded ?
> Now, typically, you don't even know the name of the library - the only
> assumption is that - this is the same library that provides the function
> which tries to "read" the configuration file - so, first the function
> should find from which shared library it comes, then from which
> subdirectory it has been loaded, then find the configuration file there.
> Now, if it makes anything simpler - assume that this will be done while
> loading the library - just in the constructor of a "global static instance
> of some class" - as in the answer to my question "one" above.
>

  I do not know whether it helps you.
  Microsoft does provide a function:

 " The GetModuleFileName function retrieves the full path and file
   name for the file containing the specified module "

   Hope Linux does this too.

    Thanks, Valeri



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:14 MET