[GHC] #7971: doesDirectoryExist description differs from its behavior

GHC ghc-devs at haskell.org
Sat Jun 8 17:49:32 CEST 2013


#7971: doesDirectoryExist description differs from its behavior
----------------------------------------+-----------------------------------
Reporter:  dsf                          |          Owner:                     
    Type:  bug                          |         Status:  new                
Priority:  normal                       |      Component:  libraries/directory
 Version:  7.6.3                        |       Keywords:                     
      Os:  Unknown/Multiple             |   Architecture:  Unknown/Multiple   
 Failure:  Incorrect result at runtime  |      Blockedby:                     
Blocking:                               |        Related:                     
----------------------------------------+-----------------------------------

Comment(by Fuuzetsu):

 Where are you getting these docs from?
 http://hackage.haskell.org/packages/archive/directory/latest/doc/html
 /System-Directory.html#v:doesDirectoryExist says nothing about symlinks
 (and even the docs for 7.4.2 said nothing). The source (HEAD) states:

 {{{
 #ifdef __GLASGOW_HASKELL__
 {- |The operation 'doesDirectoryExist' returns 'True' if the argument file
 exists and is a directory, and 'False' otherwise.
 -}

 doesDirectoryExist :: FilePath -> IO Bool
 doesDirectoryExist name =
 #ifdef mingw32_HOST_OS
    (withFileStatus "doesDirectoryExist" name $ \st -> isDirectory st)
 #else
    (do stat <- Posix.getFileStatus name
        return (Posix.isDirectory stat))
 #endif
    `E.catch` ((\ _ -> return False) :: IOException -> IO Bool)

 }}}

 so I just can't see where you are getting this from.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7971#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list