From d12b5f7b05e4d8c01487e19d986bfacb871c1ce4 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 6 Sep 2024 11:24:50 -0500 Subject: [PATCH] fix --- support/src/utils/file.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/support/src/utils/file.cpp b/support/src/utils/file.cpp index e39ccb35..84d8a745 100644 --- a/support/src/utils/file.cpp +++ b/support/src/utils/file.cpp @@ -176,13 +176,13 @@ auto get_times(std::string_view path) -> std::optional { file_times ret{}; #if defined(_WIN32) - auto file_handle = - ::CreateFileA(std::string{path}.c_str(), GENERIC_READ, - FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, - nullptr, OPEN_EXISTING, 0U, nullptr); + auto file_handle = ::CreateFileA( + std::string{path}.c_str(), GENERIC_READ, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, nullptr); if (file_handle == INVALID_HANDLE_VALUE) { - throw std::runtime_error("failed to get file times|" + std::string{path} + - '|' + + throw std::runtime_error("failed to open file to get file times|" + + std::string{path} + '|' + std::to_string(utils::get_last_error_code())); }