[Hugs-bugs] File remains locked after crash

Neil Mitchell ndmitchell at gmail.com
Mon May 1 11:32:30 EDT 2006


Hi,

On Windows, Hugs CVS Head:

Change to a directory and run, at the prompt:
writeFile "test.txt" (error "fail")

The file test.txt is created, and the error "fail" is given.

Now flipping to Windows explorer, try to delete the file test.txt and
you can't because its still held open by hugs. The only way I can find
for Hugs to release the file is to close hugs and restart it.

My guess is that the handle that is openned by writeFile is not closed on error.

For reference, GHCi has the same problem, but much worse. While GHCi
locks the handle opened by writeFile, it also locks the file in this
circumstance:

readFile "ans2.txt" >> putStrLn (error "fail")

While Hugs doesn't (or at least allows the file to be deleted)

Thanks

Neil


More information about the Hugs-Bugs mailing list