createDirectoryIfMissing fails to create directory if compiled
I'm seeing really weird behaviour - that I'm sure used to work, and is even broken with older compilers. The fault may lie with my system, or some libraries somewhere, but it's easily checkable, and worth someone else trying.
Given the code:
module Main where
import System.Directory
main = do
print 1
createDirectoryIfMissing True "hello"
print 2
createDirectoryIfMissing True "hello"
I can use runhaskell
:
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.1.20101215
$ runhaskell Main
1
2
$ ghc --make Main
$ main
Main.exe: CreateDirectory "hello": invalid argument (Cannot create a file when that file already exists.)
I would expect the runhaskell
behaviour both times. I have tried this with GHC 6.12.3, where I'm sure I used to rely on this behaviour, and it's broken there too. Is my system going crazy?
Trac metadata
Trac field | Value |
---|---|
Version | 7.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/directory |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |