[Haskell-cafe] Opening the same file multiple times

Simon Marlow simonmar at microsoft.com
Mon Dec 12 10:27:11 EST 2005


On 12 December 2005 14:01, Einar Karttunen wrote:

> On 12.12 12:06, Duncan Coutts wrote:
>> It states in the Haskell Report 21.2.3:
>> 
>> http://haskell.org/onlinereport/io.html
> 
> Thanks, for the pointer, but am looking for an extension
> in the non-haskell98 API to do it.
> 
> It seems that things are quite problematic:
> 
> 1) Use openFile or GHC.Handle.openFd
> 
> Works in Hugs, fails as the standard mandates in GHC
> due to locking. This is fine.

You can trick openFd into not locking the file by passing (Just
RawDevice) as the file type.  Ugly, but should work.

Cheers,
	Simon


More information about the Haskell-Cafe mailing list