cmode = OPEN_EXISTING;
if (omode & FDBOWRITER) {
mode |= GENERIC_WRITE;
- if (omode & (FDBOTRUNC | FDBOCREAT)) {
+ if (omode & FDBOTRUNC) {
cmode = CREATE_ALWAYS;
- } else if (omode & FDBOTRUNC) {
- cmode = TRUNCATE_EXISTING;
} else if (omode & FDBOCREAT) {
- cmode = CREATE_NEW;
+ cmode = OPEN_ALWAYS;
}
}
fd = CreateFile(path, mode,
cmode = OPEN_EXISTING;
if (omode & HDBOWRITER) {
mode |= GENERIC_WRITE;
- if (omode & (HDBOTRUNC | HDBOCREAT)) {
+ if (omode & HDBOTRUNC) {
cmode = CREATE_ALWAYS;
- } else if (omode & HDBOTRUNC) {
- cmode = TRUNCATE_EXISTING;
} else if (omode & HDBOCREAT) {
- cmode = CREATE_NEW;
+ cmode = OPEN_ALWAYS;
}
}
fd = CreateFile(path, mode,