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

2005-12-13 Thread Bulat Ziganshin
Hello Einar, Monday, December 12, 2005, 5:01:20 PM, you wrote: EK 3) Using System.Posix.IO EK Using the fd{Read,Close,Write} functions from System.Posix.IO EK could solve the problem - except that there is no way to EK write binary buffers (Ptr Word8) with the API. Thus no EK solution. you can

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 perform

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 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 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 things are

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

2005-12-12 Thread Donn Cave
Quoth Einar Karttunen ekarttun@cs.helsinki.fi: ... | *** 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

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 Simon Marlow
On 12 December 2005 17:53, Donn Cave wrote: Quoth Einar Karttunen ekarttun@cs.helsinki.fi: ... *** 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.

[Haskell-cafe] Opening the same file multiple times

2005-12-11 Thread Einar Karttunen
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 perform random access IO with seeks on the file. Sharing the same Handle

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

2005-12-11 Thread Donn Cave
Quoth Einar Karttunen ekarttun@cs.helsinki.fi: | 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 |

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 ekarttun@cs.helsinki.fi: | 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

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

2005-12-11 Thread Donn Cave
Quoth Einar Karttunen ekarttun@cs.helsinki.fi: | On 11.12 22:26, Donn Cave wrote: | Quoth Einar Karttunen ekarttun@cs.helsinki.fi: | | 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