id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
4968,openTempFile fails on Windows if a directory exists with the file name it tries,ganesh,pcapriotti,"The program below works on Linux but fails on Windows with ""permission denied"" from the second openTempFile.

I think the reason is that findTempName in the openTempFile source doesn't get eEXIST when a directory with the same name exists, so it fails instead of trying again.

The real use case behind this code is making temp directories on multiple threads simultaneously.


{{{
import Prelude
import System.IO
import System.Directory

main :: IO ()
main = do
    dir <- getTemporaryDirectory
    (npath1, handle1) <- openTempFile dir ""tmp""
    hClose handle1
    removeFile npath1
    createDirectory npath1
    (npath2, handle2) <- openTempFile dir ""tmp""
    return ()

}}}
",bug,closed,high,7.4.2,libraries/base,7.0.1,fixed,,ganesh@… fryguybob@…,Windows,x86_64 (amd64),Incorrect result at runtime,Unknown,,,,
