#4844: createDirectoryIfMissing fails to create directory if compiled
---------------------------------+------------------------------------------
Reporter: NeilMitchell | Owner:
Type: bug | Status: new
Priority: normal | Component: libraries/directory
Version: 7.0.1 | Keywords:
Testcase: | Blockedby:
Os: Windows | Blocking:
Architecture: Unknown/Multiple | Failure: Incorrect result at runtime
---------------------------------+------------------------------------------
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?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4844>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs