
15 Dec
2011
15 Dec
'11
9:48 a.m.
Hi I was running into a similar problem while working on GHC not long ago - short version is that it's not even possible to find out the executable path portably from C [1]. Using argv[0] just gave me the path of the GHC wrapper script, for example - as it uses exec without "-a". The whole thing is easiest if you're on Linux: getExePath = readSymbolicLink "/proc/self/exe" On all other operation system, one needs to start mucking around with custom kernel calls. Or, more realistically, try to find a way around requiring it... Greetings, Peter Wortmann [1] http://stackoverflow.com/questions/1023306