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

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 the file while other Handles perform random access | IO with seeks on the file. How is it not supported? What happens with something like this
Try the same in ghc / ghci: e@yui:~$ ghci ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.4.1, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Loading package base-1.0 ... linking ... done. Prelude> :m IO Prelude IO> af <- openFile "z" AppendMode Prelude IO> sf <- openFile "z" ReadMode *** Exception: z: openFile: resource busy (file is locked) Prelude IO> - Einar Karttunen
participants (2)
-
Donn Cave
-
Einar Karttunen