Yes, this is the right code. Why you want any different?
news:db1f608b-bb80-403d-a6f9-dcb2804a2e3a@j22g2000hsf.googlegroups.com...
....
That code works.
If shareDenyNone is taken out, shared read is not allowed.
How are you opening the files for read?
"Alexander" <the44s...@yahoo.com> wrote in message
news:9eeea132-fdb9-4469-b5c5-7edb4eaca46a@p25g2000hsf.googlegroups.com...
Ok, guys. I think I'm not getting across.
1. No thread writes to the file. Writing is not an issue.
2. Several threads read the file at the same time.
The problem is that I found that the only way to allow several threads
to read the file is by using shareDenyNone. In particular:
1. If I don't use shareDenyNone, multiple reads are not allowed.
2. If I use shareDenyWrite, multiple reads are not allowed.
Solution? Use shareDenyNone _which_ does not make sense when all you
want is to allow shared reads.
On Jul 22, 10:26 pm, "David Ching" <d...@remove-this.dcsoft.com>
wrote:
"Alexander" <the44s...@yahoo.com> wrote in message
news:03400894-db1f-4a7a-af7d-2397a61d4502@m3g2000hsc.googlegroups.com...
The file was created with modeWrite and modeCreate. However, this file
is created by another program at a different time and it has no
bearing on the issue at hand.
The writer program is the one that should do:
if( fIn.Open( csPath, CFile::modeWrite | CFile::shareDenyWrite ) )
{
...
}
to make sure it is the only process that can write to the file! But this
says nothing about reading, so multiple files can read this file while
it
is
being written to. Isn't this what you want?
Thanks,
David