I am loading a dll
with ctypes
under Cygwin with the following:
import ctypes
ctypes.cdll.LoadLibrary('foo.dll')
How can I get the absolute path of my dll?
The problem is that I have absolutely no clues where the dll is located. Can I relate on the following to get this information?
subprocess.Popen(["which", lib], stdout=subprocess.PIPE).stdout.read().strip()
In Unix, the path of a loaded shared library can be determined by calling
dladdr
with the address of a symbol in the library, such as a function.Example:
Output: