
Max Bolingbroke
http://hackage.haskell.org/packages/archive/unix/2.4.2.0/doc/html/System-Pos.... Thanks for the link. I tried to use it: Prelude System.Posix.IO> fd1 <- openFd "xxx.tmp" WriteOnly (Just 0666) defaultFileFlags Loading package unix-2.4.0.2 ... linking ... done. Prelude System.Posix.IO> fd2 <- openFd "xxx.tmp" WriteOnly (Just 0666) defaultFileFlags Prelude System.Posix.IO> print (fd1,fd2) (5,7) Prelude System.Posix.IO> h1 <- fdToHandle fd1 Prelude System.Posix.IO> h2 <- fdToHandle fd2 *** Exception: openFile: resource busy (file is locked) So I can open file twice. So far so good. Then I convert Fds to Handles and second conversion fails. I'm looking for file locking code in GHC.IO.* modules, but cannot find any. How do I convince fdToHandle to create an independent handle to non-locked file? -- Gracjan