diff --git a/Utilities/File.cpp b/Utilities/File.cpp index 66b1c2f065..7c8b94907d 100644 --- a/Utilities/File.cpp +++ b/Utilities/File.cpp @@ -675,7 +675,7 @@ bool fs::truncate_file(const std::string& path, u64 length) #ifdef _WIN32 // Open the file - const auto handle = CreateFileW(to_wchar(path).get(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + const auto handle = CreateFileW(to_wchar(path).get(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (handle == INVALID_HANDLE_VALUE) { g_tls_error = to_error(GetLastError()); @@ -714,7 +714,7 @@ bool fs::utime(const std::string& path, s64 atime, s64 mtime) #ifdef _WIN32 // Open the file - const auto handle = CreateFileW(to_wchar(path).get(), FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + const auto handle = CreateFileW(to_wchar(path).get(), FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (handle == INVALID_HANDLE_VALUE) { g_tls_error = to_error(GetLastError());