How to Find Application executable Path on Linux

Linux specific forum
pamen
Enthusiast
Enthusiast
Posts: 193
Joined: Sat Dec 31, 2022 12:24 pm
Location: Cyprus
Contact:

How to Find Application executable Path on Linux

Post by pamen »

Hi
On Linux , as opposed to MacOS and Windows, the function GetCurrentDirectory() returns true current directory, which can be different from application executable path.
Knowing where the app resides is more than useful, if application is portable and does not store data in user directory (/home/user/...)

How do I ensure I get correct application executable path on Linux at application start-up?
Last edited by pamen on Thu Sep 14, 2023 12:47 pm, edited 1 time in total.
S.T.V.B.E.E.V.
juergenkulow
Enthusiast
Enthusiast
Posts: 581
Joined: Wed Sep 25, 2019 10:18 am

Re: How to Find Application executable Path on Linux

Post by juergenkulow »

Code: Select all

; Executable Path on Linux
Debug GetPathPart(ProgramFilename()) 
; /tmp/
pamen
Enthusiast
Enthusiast
Posts: 193
Joined: Sat Dec 31, 2022 12:24 pm
Location: Cyprus
Contact:

Re: How to Find Application executable Path on Linux

Post by pamen »

Argh. Newbie issues, shame on me.
Apologies - this is documented.
Thank you !
S.T.V.B.E.E.V.
Post Reply