
11 Oct
2006
11 Oct
'06
10:13 a.m.
On 10/11/06, Stefan Aeschbacher
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 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 files opened via raw api bindings don't work well together with base-packages IO-system (ie, you need to read and write using rawish api calls.) Best regards, Esa