#ifdef WIN32
int flags = 0;
+ int share_flags = 0;
int create_flags = OPEN_EXISTING;
if(mode&M_READ)
flags |= GENERIC_READ;
- else if(mode&M_WRITE)
+
+ if(mode&M_WRITE)
{
flags |= GENERIC_WRITE;
case C_NEW: create_flags = CREATE_NEW; break;
}
}
+ else
+ share_flags = FILE_SHARE_READ;
- *handle = CreateFile(fn.c_str(), flags, 0, 0, create_flags, FILE_ATTRIBUTE_NORMAL, 0);
+ *handle = CreateFile(fn.c_str(), flags, share_flags, 0, create_flags, FILE_ATTRIBUTE_NORMAL, 0);
if(!handle)
{
int err = GetLastError();