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

2009-06-23 Thread Brandon S. Allbery KF8NH
On Jun 22, 2009, at 07:37 , Duncan Coutts wrote: One explanation is that isBlah asks is this thing a blah, but we're not asking that because there is an indirection via the filepath. We're asking does this filepath refer to a directory not is this filename a directory. The latter could be a

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

2009-06-23 Thread Duncan Coutts
On Tue, 2009-06-23 at 09:31 -0400, Brandon S. Allbery KF8NH wrote: On Jun 22, 2009, at 07:37 , Duncan Coutts wrote: One explanation is that isBlah asks is this thing a blah, but we're not asking that because there is an indirection via the filepath. We're asking does this filepath refer

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

2009-06-23 Thread Bulat Ziganshin
Hello Duncan, Tuesday, June 23, 2009, 6:34:17 PM, you wrote: import System.Posix.Files (getFileStatus, isDirectory) Yeah, if we could make a standard portable variant of this, that'd be great. isdir - withFileStatus isdir? filename isDirectory module System.Directory withFileStatus ::

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

2009-06-23 Thread Brandon S. Allbery KF8NH
On Jun 23, 2009, at 10:34 , Duncan Coutts wrote: On Tue, 2009-06-23 at 09:31 -0400, Brandon S. Allbery KF8NH wrote: Hypothetical? import System.Posix.Files (getFileStatus, isDirectory) Yeah, if we could make a standard portable variant of this, that'd be great. I've wanted to do that

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

2009-06-22 Thread Colin Paul Adams
I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter. -- Colin Adams Preston Lancashire ___

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

2009-06-22 Thread Judah Jacobson
On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul Adamsco...@colina.demon.co.uk wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter.

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

2009-06-22 Thread Erik de Castro Lopo
Colin Paul Adams wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter. The first example in this chapter of Real World Haskell

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

2009-06-22 Thread Bulat Ziganshin
Hello Colin, Monday, June 22, 2009, 10:12:57 AM, you wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter. isdir -

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

2009-06-22 Thread Colin Paul Adams
Judah == Judah Jacobson judah.jacob...@gmail.com writes: Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul Judah Adamsco...@colina.demon.co.uk wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns

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

2009-06-22 Thread Deniz Dogan
2009/6/22 Colin Paul Adams co...@colina.demon.co.uk: Judah == Judah Jacobson judah.jacob...@gmail.com writes:    Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul    Judah Adamsco...@colina.demon.co.uk wrote:     I've been hoogling like bad to try to determine if a function     like this

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

2009-06-22 Thread Duncan Coutts
On Mon, 2009-06-22 at 08:53 +0200, Deniz Dogan wrote: 2009/6/22 Colin Paul Adams co...@colina.demon.co.uk: Judah == Judah Jacobson judah.jacob...@gmail.com writes: Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul Judah Adamsco...@colina.demon.co.uk wrote: I've been hoogling

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

2009-06-22 Thread Deniz Dogan
2009/6/22 Duncan Coutts duncan.cou...@worc.ox.ac.uk: On Mon, 2009-06-22 at 08:53 +0200, Deniz Dogan wrote: 2009/6/22 Colin Paul Adams co...@colina.demon.co.uk: Judah == Judah Jacobson judah.jacob...@gmail.com writes:    Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul    Judah

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

2009-06-22 Thread Max Rabkin
On Mon, Jun 22, 2009 at 2:09 PM, Deniz Dogandeniz.a.m.do...@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

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

2009-06-22 Thread Deniz Dogan
2009/6/22 Max Rabkin max.rab...@gmail.com: On Mon, Jun 22, 2009 at 2:09 PM, Deniz Dogandeniz.a.m.do...@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

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

2009-06-22 Thread Ketil Malde
Deniz Dogan deniz.a.m.do...@gmail.com writes: One explanation is that isBlah asks is this thing a blah, but we're not asking that because there is an indirection via the filepath. We're asking does this filepath refer to a directory not is this filename a directory. I think see what you

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

2009-06-22 Thread Max Rabkin
On Mon, Jun 22, 2009 at 2:54 PM, Deniz Dogandeniz.a.m.do...@gmail.com wrote: Are you saying that when a function is named isDirectory you expect it to only check for a trailing forward slash character? No. I'm saying that *if* isDirectory existed, then (isDirectory /no/such/directory/) should