
11 Nov
2011
11 Nov
'11
1:59 p.m.
System.Environment exports:
getProgName :: IO String
maybe System.Posix.ByteString should export a similar function:
getProgName :: IO ByteString
Yeah, that's actually not the same as argv[0], it has the path to the binary stripped. So you can't really use it to restart yourself because you have no way to know what directory the binary was in. It's frustrating because you can see in the source that it's going to some effort to intentionally strip off information that you can't get elsewhere. Anyway, it probably would make sense to have the ByteString version since it's hand-in-hand with getArgs and is a FilePath.