Re: [GHC] #1278: filepath’s makeRelative does not work for relative directories
Neil Mitchell
ndmitchell at gmail.com
Tue Apr 17 12:23:03 EDT 2007
Hi
> > I'd expect something like this:
> > org </> makeRelative org x == x
> > or at least something like
> > normalise (org </> makeRelative org x) == normalise x
> > at least on a best effort basis.
>
> Alas thats not true, because makeRelative can insert ".." paths which
> can't be removed by normalise as they might be symlinks elsewhere. I
> wonder if makeRelative should insert .. paths - any thoughts?
Now makeRelative can no longer insert ".." paths, they have a habit of
going wrong with symlinks etc so best to play it safe.
The new code has been checked in. Joachim - please test and check that
this meets you needs. The example you gave is now one of the
properties in the interface.
http://www.cs.york.ac.uk/fp/haddock/filepath/System-FilePath-Posix.html#v%3AmakeRelative
The two basic QuickCheck properties are:
takeDrive x == x || makeRelative x (x `combine` y) == y
isRelative x || y `combine` makeRelative y x == x
Thanks
Neil
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
More information about the Glasgow-haskell-bugs
mailing list