Opened 11 years ago

Closed 11 years ago

Last modified 45 years ago

#198 closed bug (Fixed)

Directory.renameFile broken under windows

Reported by: pstrand Owned by: nobody
Priority: normal Milestone:
Component: hslibs/posix Version: 6.0.1
Keywords: Cc:
Operating System: Architecture:
Type of failure: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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) ?

Change History (1)

comment:1 Changed 11 years ago by sigbjorn

  • Status changed from assigned to closed
Logged In: YES 
user_id=232905

Fixed a couple of months back, next version will include the 
change. cf. http://haskell.org/pipermail/glasgow-haskell-
bugs/2003-July/003411.html
Note: See TracTickets for help on using tickets.