I know there is a function called _fsopen() that allows one to specify the
file sharing mode.
Does anyone know what is the assumed file sharing mode when one calls
fopen()? What is the equivalent to CreateFile's share mode value?
My experiments allow me to open two files at the same time in two different
process irrespective of reading or writing. But I have not tried to write or
read from them.
Thanks.
Rover
You could just debug the `fopen' call. VS ships with the source
code for CRT library. `fopen' is a mere wrapper over _fsopen(...,
_SH_DENYNO) call.
Alex
Thanks for the advice.
So without proper concurrency control and file locking, multiple users of a
file can use fopen() to open the file but their access will corrupt the file
or retrieving corrupted data much like failure to control access to a share
resource in MT programming. Is that what will happen?
Leon
"Alex Blekhman" <tkfx....@yahoo.com> wrote in message
news:uTMrBnGX...@TK2MSFTNGP06.phx.gbl...
Exactly. SH_DENYNO flag permits read and write access to a file.
Without proper synchronization you'll corrupt a file.
Alex