On Wed, Jun 13, 2012 at 2:05 AM, Simon Marlow
I suggest we should have a
getExecutablePath :: IO FilePath
in System.Environment. We have an implementation for Windows in GHC that we use to find GHC's files relative to ghc.exe. This SO question has some good references for ways to do it on different platforms:
http://stackoverflow.com/questions/1023306/finding-current-executables-path-...
I'm up for doing this instead of adding getFullProgName.
We should also have something in System.Posix to return the original argv[0], unfortunately we forgot about this when adding System.Posix.ByteString.getArgs which returns argv[1..].
How long ago was this added. Is there a chance we can make a breaking change without affecting lots of programs? -- Johan