
1 Dec
2011
1 Dec
'11
1:02 p.m.
On Thu, Dec 01, 2011 at 03:53:37PM -0200, Felipe Almeida Lessa wrote:
On Thu, Dec 1, 2011 at 3:41 PM, Simon Hengel
wrote: How to get this path in Haskell?
If I understand you correctly, you want
takeDirectory `fmap` getProgName
I think getProgName does not give you the full path, but only the program name.
Neither does $0, does it? It depends on how the program is called. $0 depend everything you need to find your program (say, the relative or absolute path used), but getProgName does not. Here is an example:
./foo/foo Here $0 will be "./foo/foo", but getProgName will be "foo". Cheers, Simon