We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 06a49a9 + 1732888 commit 5877f94Copy full SHA for 5877f94
drivers/windows/file_access_windows.cpp
@@ -402,13 +402,8 @@ bool FileAccessWindows::file_exists(const String &p_name) {
402
}
403
404
String filename = fix_path(p_name);
405
- FILE *g = _wfsopen((LPCWSTR)(filename.utf16().get_data()), L"rb", _SH_DENYNO);
406
- if (g == nullptr) {
407
- return false;
408
- } else {
409
- fclose(g);
410
- return true;
411
- }
+ DWORD file_attr = GetFileAttributesW((LPCWSTR)(filename.utf16().get_data()));
+ return (file_attr != INVALID_FILE_ATTRIBUTES) && !(file_attr & FILE_ATTRIBUTE_DIRECTORY);
412
413
414
uint64_t FileAccessWindows::_get_modified_time(const String &p_file) {
0 commit comments