Forum > General

Library - How to get it's path

(1/1)

EasyTEF Team:
Hi folks  :)

I'm developing a library in Lazarus + Linux and I want to get the fullpath of this library.

On Windows, I have GetModuleName API function, but on Linux there is no such thing. I don't wanna use ParamStr(0) because if a Java program use my library, ParamStr(0) will return the java executable path, right?

So, how can I get my library path?

Thanx

marcov:
Moreover, paramstr(0) doesn't always work on Linux. (e.g. on some filesystem types, specially remote ones).  OS X and FreeBSD also don't.

Since libraries are not memory mapped on *nix, the way they are on Windows, this whole concept doesn't exist. (in Windows you can't delete a loaded .dll, but you can delete an active .so on Linux)

In general it is best to redesign so that this functionality is not necessary.

Navigation

[0] Message Index

Go to full version