[Haskell-cafe] Exclusive mode in openFile

Gracjan Polak gracjanpolak at gmail.com
Tue Jun 28 18:50:45 CEST 2011

Hi all,

It seems I'm not allowed to open same file both for writing and for reading:

Prelude System.IO> f_out <- openFile "mylog.log" AppendMode
Prelude System.IO> f_in <- openFile "mylog.log" ReadMode
*** Exception: mylog.log: openFile: resource busy (file is locked)

Usage scenario:

I use hslogger to write to logs, but I'd like to read parts of these logs *from
inside same Haskell application*.

How do I get around exclusive mode in openFile?


More information about the Haskell-Cafe mailing list