[Haskell-cafe] File path programme

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sun Jan 23 16:04:06 EST 2005


Isaac Jones <ijones at syntaxpolice.org> writes:

> You might be interested in the new FilePath module that's in the
> works.  There's been a lot of work to make these functions portable.
>
> http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/base/System/FilePath.hs

splitFileExt "foo" = ("foo", "")
splitFileExt "foo." = ("foo", "")

I think the second case should be changed to give ("foo.", "")
so joinFileExt could undo splitFileExt. On Windows "foo" and "foo."
are equivalent, but on Unix they are not.

What about splitFileExt "foo.bar."? ("foo", "bar.") or ("foo.bar.", "")?

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Haskell-Cafe mailing list