diff options
| author | Dan Engelbrecht <[email protected]> | 2022-03-23 11:13:36 +0100 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-03-31 11:29:27 +0200 |
| commit | 53222208fa59b8e1903c5ffd23c00a8703c65edd (patch) | |
| tree | cf1ac6fb820dbc6bdcdde63ad6207d6aa7c39127 /zenstore/basicfile.cpp | |
| parent | cleanup (diff) | |
| download | zen-53222208fa59b8e1903c5ffd23c00a8703c65edd.tar.xz zen-53222208fa59b8e1903c5ffd23c00a8703c65edd.zip | |
We need DELETE access to be able to mark a file for delete on close.
Diffstat (limited to 'zenstore/basicfile.cpp')
| -rw-r--r-- | zenstore/basicfile.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp index fd0c8a8f6..77bada95f 100644 --- a/zenstore/basicfile.cpp +++ b/zenstore/basicfile.cpp @@ -47,16 +47,11 @@ BasicFile::Open(const std::filesystem::path& FileName, bool IsCreate, std::error #if ZEN_PLATFORM_WINDOWS const DWORD dwCreationDisposition = IsCreate ? CREATE_ALWAYS : OPEN_EXISTING; - DWORD dwDesiredAccess = GENERIC_READ | GENERIC_WRITE; + DWORD dwDesiredAccess = GENERIC_READ | GENERIC_WRITE | DELETE; const DWORD dwShareMode = FILE_SHARE_READ; const DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL; HANDLE hTemplateFile = nullptr; - if (IsCreate) - { - dwDesiredAccess |= DELETE; - } - HANDLE FileHandle = CreateFile(FileName.c_str(), dwDesiredAccess, dwShareMode, |