doesDirectoryExist is always returning False

Hi, I'm having currently a problem with System.Directory in my mac os. System Version: Mac OS X 10.6.5 Kernel Version: Darwin 10.5.0 Prelude System.Directory> let dirTest = do {dir <- getCurrentDirectory; doesDirectoryExist dir} Prelude System.Directory> dirTest False I noticed also that I can't change the searchable field in the permissions record. Prelude System.Directory> getPermissions "." Permissions {readable = True, writable = True, executable = True, searchable = False} I tried different versions of directory and filepath packages but with no success at the moment. Any suggestions?! Regards, Marcelo Sousa

On Sat, Nov 20, 2010 at 6:55 AM, Marcelo Sousa
Hi, I'm having currently a problem with System.Directory in my mac os. System Version: Mac OS X 10.6.5 Kernel Version: Darwin 10.5.0 Prelude System.Directory> let dirTest = do {dir <- getCurrentDirectory; doesDirectoryExist dir} Prelude System.Directory> dirTest False
What's the output of getCurrentDirectory? I just tried that on OS X 10.6.4 and dirTest returned True for me. -Judah

On 11/20/10 9:55 AM, Marcelo Sousa wrote:
Hi,
I'm having currently a problem with System.Directory in my mac os. System Version: Mac OS X 10.6.5 Kernel Version: Darwin 10.5.0
Prelude System.Directory> let dirTest = do {dir<- getCurrentDirectory; doesDirectoryExist dir} Prelude System.Directory> dirTest False
For comparison, I do not get this behavior on: Mac OS X: 10.5.8 Darwin: 9.8.0 GHC: 6.12.1 directory: 1.0.1.0
I noticed also that I can't change the searchable field in the permissions record.
Prelude System.Directory> getPermissions "." Permissions {readable = True, writable = True, executable = True, searchable = False}
Again for comparison, the following works fine for me: getPermissions "." >>= \x -> return x {searchable = True} -- Live well, ~wren

On Sat, Nov 20, 2010 at 4:55 PM, Marcelo Sousa wrote:
I'm having currently a problem with System.Directory in my mac os. System Version: Mac OS X 10.6.5 Kernel Version: Darwin 10.5.0 Prelude System.Directory> let dirTest = do {dir <- getCurrentDirectory; doesDirectoryExist dir} Prelude System.Directory> dirTest False
This did not happen on my Mac, but now it started happening, right after I upgraded some packages. I suspect the unix package. See: http://hackage.haskell.org/trac/ghc/ticket/4812 Thanks, Yitz

Marcelo Sousa wrote:
I'm having currently a problem with System.Directory in my mac os. Prelude System.Directory> let dirTest = do {dir <- getCurrentDirectory; doesDirectoryExist dir} Prelude System.Directory> dirTest False
I.e., System.Directory.doesDirectoryExist always returns False. I wrote:
It looks like this problem happens when you upgrade or reinstall the directory package (any version) after upgrading the unix package to version 2.4.1.0 on Mac OS X. Note that the directory package does depend on unix or Win32, as obviously it must. That dependency can be seen in directory.cabal, even though it does not show up on hackage. Thanks to Simon Marlow for clarifying that point. So a work-around for this problem is: cabal install --reinstall --constraint='unix == 2.4.0.2' directory If you originally upgraded or reinstalled directory using the --global flag, you must add it to the above also. Thanks to Duncan Coutts for this work-around. Regards, Yitz
participants (4)
-
Judah Jacobson
-
Marcelo Sousa
-
wren ng thornton
-
Yitzchak Gale