filepath
Duncan Coutts
duncan.coutts at worc.ox.ac.uk
Sun Dec 9 10:57:17 EST 2007
On Sun, 2007-12-09 at 13:34 +0000, Ian Lynagh wrote:
> Hi Neil,
>
> I'm having some problems using filepath in GHC. I think some of these we
> might have discussed before, but if so I've forgotten what the
> conclusion was, if any, and I can't see the answers in the docs.
>
>
> The first is this:
> Prelude System.FilePath> "." </> "foo"
> "./foo"
> which means we get things like
> [2 of 2] Compiling GHC.Foo ( ./GHC/Foo.hs, ./GHC/Foo.o )
> rather than
> [2 of 2] Compiling GHC.Foo ( GHC/Foo.hs, GHC/Foo.o )
> Is there a reason the result shouldn't be "foo"?
The function that does that is normalise. It strips leading . and
colapses things like foo/../
> Possibly relatedly, the current directory seems to be "" rather than
> ".". This turns up in at least a couple of areas:
> Prelude System.FilePath> normalise "."
> ""
That's just a bug. I've reported that before. I though it was fixed but
seems not. We had that problem in Cabal where people specified . as one
of the search dirs.
Duncan
More information about the Libraries
mailing list