[*] GetLastError() == ERROR_FILE_EXISTS fast path
This commit is contained in:
parent
18ac961ac9
commit
f177b67e1f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user