PEACEMAKER
21 years ago
I have an application that needs to be able to open any file for reading.
Currently I only use FILE_SHARE_READ but I looking at the docs it mentions
that if a file was opened by another processes with FILE_SHARE_WRITE then
all subsequent open operations on the file has to include this flag or
opening will fail (eg if I only specificy FILE_SHARE_READ). The docs don't
say what happens in the reverse case.. eg a file is created with
FILE_SHARE_READ, but I attempt to open it with
FILE_SHARE_READ|FILE_SHARE_WRITE. Which flags should I use to be able to
open all shared files without any problems?
Currently I only use FILE_SHARE_READ but I looking at the docs it mentions
that if a file was opened by another processes with FILE_SHARE_WRITE then
all subsequent open operations on the file has to include this flag or
opening will fail (eg if I only specificy FILE_SHARE_READ). The docs don't
say what happens in the reverse case.. eg a file is created with
FILE_SHARE_READ, but I attempt to open it with
FILE_SHARE_READ|FILE_SHARE_WRITE. Which flags should I use to be able to
open all shared files without any problems?