[Haskell-cafe] File I/O question

Andrew Coppin andrewcoppin at btinternet.com
Wed Mar 12 17:21:21 EDT 2008


Don Stewart wrote:
> Oh, you want another process in the system to read the file while GHC is
> writing to it?

That's the one. ;-)

[Well, not GHC but my GHC-compiled binary, but anyway...]

> This works fine on unix systems -- and perhaps Neil, or
> one of the other windows experts, can explain what the story is on Windows.
>   

I thought the Report... wait, let me check...

Oh, OK, that's not what I thought the Report says. Section 21.2.3, "File 
Locking". I thought it says that Haskell is supposed to prevent access 
to the same file by multiple threads. (And that, presumably, is why it's 
using an exclusive lock to try to implement these semantics under the 
Win32 API.) However, that's apparently not what it says... (It says 
multiple reader / single writer.)

So... does this count as a bug then?



More information about the Haskell-Cafe mailing list