Addition to unix: raw ByteString APIs
qdunkan at gmail.com
Fri Nov 11 19:59:42 CET 2011
> 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, 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
Anyway, it probably would make sense to have the ByteString version
since it's hand-in-hand with getArgs and is a FilePath.
More information about the Libraries