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

2006-07-20 Thread Maurício

  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

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2006-07-20 Thread Bulat Ziganshin
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,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe