[Haskell-cafe] Opening a file that another process is writing

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Jul 20 05:28:30 EDT 2006


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 at gmail.com



More information about the Haskell-Cafe mailing list