Re[4]: [Haskell-cafe] windows file locking

2006-10-15 Thread Bulat Ziganshin
Hello Stefan, Wednesday, October 11, 2006, 4:53:19 PM, you wrote: So far the windows API seems to work for me. Currently I'm still struggling to not write garbage to the file but the shared access works now. Does anyone have an example how to use it (e.g. the implementation of hPutStr on

[Haskell-cafe] windows file locking

2006-10-11 Thread Stefan Aeschbacher
HiI need to open a file and keep it open for writing (a log file). Another process hasto read from this file. On windows the second process (e.g. tail -f) can not open the file.How can I open a file without this locking? regardsStefan ___ Haskell-Cafe

Re: [Haskell-cafe] windows file locking

2006-10-11 Thread Krasimir Angelov
Hi Stefan, Haskell I/O systems implements single writer-multiple readers file locking. See http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#8 Cheers, Krasimir On 10/11/06, Stefan Aeschbacher [EMAIL PROTECTED] wrote: Hi I need to open a file and keep it open for

Re: [Haskell-cafe] windows file locking

2006-10-11 Thread Esa Ilari Vuokko
On 10/11/06, Stefan Aeschbacher [EMAIL PROTECTED] wrote: Hi I need to open a file and keep it open for writing (a log file). Another process has to read from this file. On windows the second process (e.g. tail -f) can not open the file. How can I open a file without this locking? Using

Re[2]: [Haskell-cafe] windows file locking

2006-10-11 Thread Bulat Ziganshin
Hello Esa, Wednesday, October 11, 2006, 2:13:49 PM, you wrote: Using base-package's IO-system, that is not possible as far as I know. The flag you need to pass CreateFile (api call which is used to open practically all files) is FILE_SHARE_READ. You can find these in Win32-package, but

Re: Re[2]: [Haskell-cafe] windows file locking

2006-10-11 Thread Stefan Aeschbacher
HiSo far the windows API seems to work for me. Currently I'm still struggling to notwrite garbage to the file but the shared access works now. Does anyone have anexample how to use it (e.g. the implementation of hPutStr on windows or something, i did not find it in the ghc source code)?I tried to