[ ghc-Bugs-842445 ] Directory.renameFile broken under windows

SourceForge.net noreply at sourceforge.net
Fri Nov 14 17:23:25 EST 2003


Bugs item #842445, was opened at 2003-11-14 23:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=842445&group_id=8032

Category: hslibs/posix
Group: 6.0.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Peter Strand (pstrand)
Assigned to: Nobody/Anonymous (nobody)
Summary: Directory.renameFile broken under windows

Initial Comment:

According to the library report, renameFile should succed 
even if the target file already exists. Under windows it 
fails with:
 
Fail: already exists
Action: renameFile
Reason: File exists
File: foo

(ghc 6.0 and 6.0.1)

The reason seems to be that it uses the rename library 
call directly, which indeed fails if the target exists:

http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/vclib/html/_crt_rename.2c_._wrename.asp

A solution might involve MoveFileEx(old, new, 
MOVEFILE_REPLACE_EXISTING) ?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=842445&group_id=8032


More information about the Glasgow-haskell-bugs mailing list