Re: [Haskell-cafe] Opening the same file multiple times

2005-12-12 Thread Donn Cave
On Mon, 12 Dec 2005, Duncan Coutts wrote: > On Mon, 2005-12-12 at 09:52 -0800, Donn Cave wrote: > > > Of course there's a risk that the authors of ghc may notice that > > we're doing this and come up with a way to thwart it, but it seems > > to me that between interfering with legitimate applicati

RE: [Haskell-cafe] Opening the same file multiple times

2005-12-12 Thread Simon Marlow
On 12 December 2005 17:53, Donn Cave wrote: > Quoth Einar Karttunen : > ... >> *** Exception: z: openFile: resource busy (file is locked) > > Now that I have access to a platform where ghc builds, I can > duplicate your results - and in case it helps, here's another > work-around. Apparently thi

Re: [Haskell-cafe] Opening the same file multiple times

2005-12-12 Thread Duncan Coutts
On Mon, 2005-12-12 at 09:52 -0800, Donn Cave wrote: > Of course there's a risk that the authors of ghc may notice that > we're doing this and come up with a way to thwart it, but it seems > to me that between interfering with legitimate applications and not > working reliably anyway, there'd be a

Re: [Haskell-cafe] Opening the same file multiple times

2005-12-12 Thread Donn Cave
Quoth Einar Karttunen : ... | *** Exception: z: openFile: resource busy (file is locked) Now that I have access to a platform where ghc builds, I can duplicate your results - and in case it helps, here's another work-around. Apparently this "feature" uses POSIX filesystem locks, because it appear

RE: [Haskell-cafe] Opening the same file multiple times

2005-12-12 Thread Simon Marlow
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 t

Re: [Haskell-cafe] Opening the same file multiple times

2005-12-12 Thread Bulat Ziganshin
Hello Einar, Monday, December 12, 2005, 8:43:15 AM, you wrote: EK> It seems that opening the same file multiple times (one writer EK> and multiple readers) is not supported at least on *nix with EK> GHC. I want to use one Handle to use append data till the EK> end of the file while other Handles

Re: [Haskell-cafe] Opening the same file multiple times

2005-12-12 Thread Einar Karttunen
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

Re: [Haskell-cafe] Opening the same file multiple times

2005-12-12 Thread Duncan Coutts
On Mon, 2005-12-12 at 07:43 +0200, Einar Karttunen wrote: > Hello > > It seems that opening the same file multiple times (one writer > and multiple readers) is not supported at least on *nix with > GHC. I want to use one Handle to use append data till the > end of the file while other Handles perf

Re: [Haskell-cafe] Opening the same file multiple times

2005-12-11 Thread Donn Cave
Quoth Einar Karttunen : | On 11.12 22:26, Donn Cave wrote: | > Quoth Einar Karttunen : | > | It seems that opening the same file multiple times (one writer | > | and multiple readers) is not supported at least on *nix with | > | GHC. I want to use one Handle to use append data till the | > | end of

Re: [Haskell-cafe] Opening the same file multiple times

2005-12-11 Thread Einar Karttunen
On 11.12 22:26, Donn Cave wrote: > Quoth Einar Karttunen : > | It seems that opening the same file multiple times (one writer > | and multiple readers) is not supported at least on *nix with > | GHC. I want to use one Handle to use append data till the > | end of the file while other Handles perfor

Re: [Haskell-cafe] Opening the same file multiple times

2005-12-11 Thread Donn Cave
Quoth Einar Karttunen : | It seems that opening the same file multiple times (one writer | and multiple readers) is not supported at least on *nix with | GHC. I want to use one Handle to use append data till the | end of the file while other Handles perform random access | IO with seeks on the file