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 <simon.hen...@wiktory.org> 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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to