[darcs-users] MinGW running problems

David Roundy droundy at abridgegame.org
Sun Nov 16 17:31:21 UTC 2003

On Sun, Nov 16, 2003 at 02:44:08PM +0100, Gour wrote:
> Peter Strand (d98peter at dtek.chalmers.se) wrote:
> > I was bitten by this one yesterday as well ;)
> > renameFile is slightly broken in released ghc versions,
> > but fixed in the upcoming release. A workaround for now is to 
> > remove the target file before the rename.
> The only problem is that I cannot find the target. The directory is empty
> i.e.  no _darcs folder in it.

What he means is that you can (as a workaround) modify writeToFile in
Lock.lhs to removeFile f before renameFile newf f.  This has the
unfortunate result that it makes repository writes non-atomic (if you lose
power between the removeFile and the renameFile, your repo is hosed).

You'd also want to make the same change in Zlib.lhs to gzWriteToFile (which
serves the same purpose as writeToFile, except that it compresses it.

I would say that renameFile is very broken on released win32 ghc if it
doesn't support renaming to an existing file.

Perhaps we should create an autoconf test for a broken renameFile? It
might be a good idea to start switching to autoconf-style tests rather than
"#if __GLASGOW_HASKELL__ < 600" for dealing with ghc bugs and old library
David Roundy

More information about the darcs-users mailing list