RE: FW: lazy file reading in H98

(1) At least, the definition should say that the behaviour is undefined if a program ever writes to a file that it has read with `readFile' or `hGetContents' before.
The Library Report is already stronger than this.
Yes, but the behaviour specified by the report isn't exactly useful. The problem is that a semi-closed handle becomes fully closed at some random point in the future, when the list returned from readFile is fully evaluated. In order to make sure that a subsequent writeFile won't fail due to a locking violation, you have to fully force the string returned from readFile. Incedentally, nhc98 doesn't seem to implement the locking (perhaps this is a known bug, I didn't check). Cheers, Simon

Yes, but the behaviour specified by the report isn't exactly useful.
I know, but making the definition less defined than at present won't help much either.
Incidentally, nhc98 doesn't seem to implement the locking (perhaps this is a known bug, I didn't check).
Yes, nhc98 doesn't currently implement file locking. I regard this as non-conformance to the standard, rather than a bug as such. We just never got round to implementing it yet. Regards, Malcolm
participants (2)
-
Malcolm Wallace
-
Simon Marlow