diff --git a/Source/IO/AuIOHandle.NT.cpp b/Source/IO/AuIOHandle.NT.cpp index 56063cc7..8a0298e0 100644 --- a/Source/IO/AuIOHandle.NT.cpp +++ b/Source/IO/AuIOHandle.NT.cpp @@ -197,7 +197,8 @@ namespace Aurora::IO if (hFileHandle == INVALID_HANDLE_VALUE) { - if (AuFS::FileExists(pathex.c_str())) + if (GetLastError() == ERROR_FILE_EXISTS || + AuFS::FileExists(pathex.c_str())) { SysPushErrorResourceExists("File {} already exists", create.path); return false; @@ -253,7 +254,8 @@ namespace Aurora::IO if (hFileHandle == INVALID_HANDLE_VALUE) { - if (AuFS::FileExists(pathex.c_str())) + if (GetLastError() == ERROR_FILE_EXISTS || + AuFS::FileExists(pathex.c_str())) { SysPushErrorResourceExists("File {} already exists", create.path); return false;