aboutsummaryrefslogtreecommitdiff
path: root/zencore/filesystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zencore/filesystem.cpp')
-rw-r--r--zencore/filesystem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp
index 4456757a6..a4c81f6cc 100644
--- a/zencore/filesystem.cpp
+++ b/zencore/filesystem.cpp
@@ -545,11 +545,12 @@ WriteFile(std::filesystem::path Path, const IoBuffer* const* Data, size_t Buffer
}
#else
- int Fd = open(Path.c_str(), O_WRONLY);
+ int OpenFlags = O_WRONLY|O_CREAT|O_TRUNC;
+ int Fd = open(Path.c_str(), OpenFlags);
if (Fd < 0)
{
zen::CreateDirectories(Path.parent_path());
- Fd = open(Path.c_str(), O_WRONLY);
+ Fd = open(Path.c_str(), OpenFlags);
}
if (Fd < 0)