Skip to content

Commit

Permalink
windows: create files if they don't exist, and with write permission
Browse files Browse the repository at this point in the history
  • Loading branch information
puffnfresh committed Jan 14, 2025
1 parent 2cb0ddf commit 0be55f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libutil/fs-sink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0be55f8

Please sign in to comment.