------- Comment #1 from [EMAIL PROTECTED] 2008-11-27 17:15 -------
I have tested, and reviwed the new parseMode function.
It is now possible to open for read (e.g. tail -f) a file that is being written
to by a d program using FileMode.Out
Unfortunatly it's still not possible to open a file for read, that is being
written to by another process.
In dos window #1:
C:\temp>copy /y con test.txt
In dos window #2:
Error: Cannot open or create file 'test.txt'
auto f = new File("test.txt", FileMode.In);
s = readln();
Again, changing the first line in main to:
auto f = new File("test.txt", FileMode.In | FileMode.Out);
is a workaround, but I feel isn't correct as I am not opening it for write
access. The workaround causes the sharing mode to be FILE_SHARE_READ |
I belive, reasonably, that the share mode should always have these two flags
set no matter what the FileMode is, read or write, so that there are no sharing
confilicts on windows.
It is sometimes useful to write to a file with one process, while reading from
it with another process. Read/write races or conflicts may occur, but that is
up to the user to deal with.