Merge pull request #103622 from bruvzg/lock_file_time

[Windows] Fix `get_modified_time` on locked files.
This commit is contained in:
Thaddeus Crews 2025-03-05 12:08:07 -06:00
commit 7dc6b38699
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84

View File

@ -418,7 +418,7 @@ uint64_t FileAccessWindows::_get_modified_time(const String &p_file) {
file = file.substr(0, file.length() - 1);
}
HANDLE handle = CreateFileW((LPCWSTR)(file.utf16().get_data()), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, nullptr);
HANDLE handle = CreateFileW((LPCWSTR)(file.utf16().get_data()), FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, nullptr);
if (handle != INVALID_HANDLE_VALUE) {
FILETIME ft_create, ft_write;