[darcs-users] DeleteFile on Windows
me at mornfall.net
Tue Oct 27 11:41:38 UTC 2009
Ok, since I was a little (too) curious, I have tried the following testcase:
main = do x <- mmapFileByteString "test.hs.out" Nothing
h <- createFile "test.hs.out"
-- removeFile "test.hs.out"
putStrLn "hey there"
This program dies with a page-in failure on the last line (print x). However,
this is probably a bug in the mmap package, which closes the filehandle even
though the mapping is still live. The resulting behaviour is almost certainly a
win32 bug, but it should be possible to fix within mmap (by clinging onto the
filehandle until everything is unmapped).
PS: (To try yourself, you have to create nonempty test.hs.out before calling
the program. I tried with mmap 0.4.2 which we currently use, may be it is
already fixed in 0.5.x, but that will need a little porting effort on
More information about the darcs-users