filepath

Neil Mitchell ndmitchell at gmail.com
Tue Jan 22 09:18:35 EST 2008


Hi Simon

> I've just come across this again.  It's quite inconvenient that
>
>    takeDirectory "foo" == ""
>
> because it means that you can't say
>
>    doesDirectoryExist (takeDirectory f)

Yes, I came across this the other day. And am leaning towards agreeing with you.

I think its reasonable if splitFileName keeps the same behaviour, and
dropFileName as well, but takeDirectory follows the new behaviour. So:

takeDirectory "foo" = "."
takeDirectory "foo/bar" = "foo"

dropFileName "foo" = ""
dropFilename "foo/bar" = "foo/"

Does that sound like a plan that suits everyone?

Thanks

Neil


More information about the Libraries mailing list