[Haskell-cafe] How to determine if a FilePath is a directory name or regular file?

Deniz Dogan deniz.a.m.dogan at gmail.com
Mon Jun 22 08:54:56 EDT 2009

2009/6/22 Max Rabkin <max.rabkin at gmail.com>:
> On Mon, Jun 22, 2009 at 2:09 PM, Deniz Dogan<deniz.a.m.dogan at gmail.com> wrote:
>> I think see what you mean, but I find the argument more of an excuse
>> to the poor naming than a solid argument for it. Following the
>> convention and intuition that most users have should be more important
>> than making the (sometimes unnecessary) distinction between a
>> directory and the path to it.
> I disagree. (isDirectory "/no/such/directory/") should equal true: the
> given FilePath is a directory path (on Unix), since it ends with a
> slash. However (doesDirectoryExist "/no/such/directory") should return
> false, since there is no such directory.

Are you saying that when a function is named "isDirectory" you expect
it to only check for a trailing forward slash character?

Deniz Dogan

More information about the Haskell-Cafe mailing list