Ticket #2709 (closed bug: fixed)
System.Directory.doesDirectoryExist "\\" is False on Windows
| Reported by: | Deewiant | Owned by: | igloo |
|---|---|---|---|
| Priority: | high | Milestone: | 6.10.2 |
| Component: | libraries/directory | Version: | 6.10.1 |
| Keywords: | Cc: | ndmitchell@… | |
| Operating System: | Windows | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
import System.Directory main = do print =<< doesDirectoryExist "\\" print =<< doesDirectoryExist "\\."
The above prints False followed by True, and both should definitely be True. It seems like it might even be a bug in MinGW or the MSVCRT.
The following does work, giving both as True:
import Data.Bits import System.Win32.Types import System.Win32.File doesDirectoryExist = flip withTString $ \s -> do a <- c_GetFileAttributes s return (a /= 0xffffffff && a.&.fILE_ATTRIBUTE_DIRECTORY /= 0) main = do print =<< doesDirectoryExist "\\" print =<< doesDirectoryExist "\\."
Change History
Note: See
TracTickets for help on using
tickets.
