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

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Jun 22 02:24:52 EDT 2009

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 <- withFileStatus "isdir?" filename isDirectory

module System.Directory
  withFileStatus :: String -> FilePath -> (Ptr CStat -> IO a) -> IO a
  isDirectory :: Ptr CStat -> IO Bool

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list