#4968: openTempFile fails on Windows if a directory exists with the file name it
tries
-------------------------------+--------------------------------------------
    Reporter:  ganesh          |        Owner:                             
        Type:  bug             |       Status:  new                        
    Priority:  high            |    Milestone:  7.2.1                      
   Component:  libraries/base  |      Version:  7.0.1                      
    Keywords:                  |     Testcase:                             
   Blockedby:                  |   Difficulty:                             
          Os:  Windows         |     Blocking:                             
Architecture:  x86_64 (amd64)  |      Failure:  Incorrect result at runtime
-------------------------------+--------------------------------------------

Comment(by fryguybob):

 It probably should be noted that even with a working `openTempFile` the
 example code can still fail:

 {{{
 #!hs
     ...
     (npath1, handle1) <- openTempFile dir "tmp"
     hClose handle1
     removeFile npath1
     -- An openTempFile on another thread
     createDirectory npath1
     ...
 }}}

 Using something other then the file system to ensure (with very high
 probability at least) uniqueness is probably easier then tracking down all
 the possible ways a `createTempDirectory` made with `openTempFile` could
 fail.  Perhaps using something like
 [http://hackage.haskell.org/package/uuid uuid] or
 [http://hackage.haskell.org/package/system-uuid system-uuid] could work.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4968#comment:4>
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

Reply via email to