Merge pull request #96840 from bruvzg/open_wstat
[Windows] Remove `_wstat` use in `FileAccessWindows::open_internal`
This commit is contained in:
commit
e9194702a3
1 changed files with 6 additions and 5 deletions
|
@ -118,11 +118,12 @@ Error FileAccessWindows::open_internal(const String &p_path, int p_mode_flags) {
|
||||||
return ERR_INVALID_PARAMETER;
|
return ERR_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _stat st;
|
if (path.ends_with(":\\") || path.ends_with(":")) {
|
||||||
if (_wstat((LPCWSTR)(path.utf16().get_data()), &st) == 0) {
|
return ERR_FILE_CANT_OPEN;
|
||||||
if (!S_ISREG(st.st_mode)) {
|
}
|
||||||
return ERR_FILE_CANT_OPEN;
|
DWORD file_attr = GetFileAttributesW((LPCWSTR)(path.utf16().get_data()));
|
||||||
}
|
if (file_attr != INVALID_FILE_ATTRIBUTES && (file_attr & FILE_ATTRIBUTE_DIRECTORY)) {
|
||||||
|
return ERR_FILE_CANT_OPEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
|
|
Loading…
Reference in a new issue