Opening a file that another process is writing

Hi, I want to open for reading a log file that another process is locking for write. I know it's possible, since 'cat' and 'vim' can read that file (but not edit it, of course). How can I do that in Haskell? 'openFile' says "permission denied". Thanks, Maurício

Hello Maurício, Thursday, July 20, 2006, 1:22:01 AM, you wrote:
I want to open for reading a log file that another process is locking for write. I know it's possible, since 'cat' and 'vim' can read that file (but not edit it, of course). How can I do that in Haskell? 'openFile' says "permission denied".
(untested) i think you should open it in shared mode, that is impossible via openFile. but you can open Fd using low-level c_open call and then use fdToHandle procedure -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (2)
-
Bulat Ziganshin
-
Maurício