mirror of
https://github.com/NixOS/nix
synced 2025-06-24 18:01:16 +02:00
Merge pull request #12253 from nix-windows/windows-create-writable-files
windows: create files if they don't exist, and with write permission
This commit is contained in:
commit
8aafc05885
1 changed files with 1 additions and 1 deletions
|
@ -112,7 +112,7 @@ void RestoreSink::createRegularFile(const CanonPath & path, std::function<void(C
|
|||
crf.startFsync = startFsync;
|
||||
crf.fd =
|
||||
#ifdef _WIN32
|
||||
CreateFileW(p.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)
|
||||
CreateFileW(p.c_str(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL)
|
||||
#else
|
||||
open(p.c_str(), O_CREAT | O_EXCL | O_WRONLY | O_CLOEXEC, 0666)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue