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

Bulat Ziganshin bulat.ziganshin at gmail.com
Tue Jun 23 11:42:55 EDT 2009

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 :: 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