mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 00:10:58 +08:00
fix: move pathExists out of sys calls and do not mock it
Moved pathExists from SysCalls to path.h. In ULTs, use unchanged pathExists and mock stat, getFileAttributesA instead. Add Windows and Linux ULTs for pathExists. Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9bdd7b784a
commit
ea5b586c37
24
shared/source/helpers/windows/path.cpp
Normal file
24
shared/source/helpers/windows/path.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/path.h"
|
||||
|
||||
#include "shared/source/os_interface/windows/sys_calls.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace NEO {
|
||||
bool pathExists(const std::string &path) {
|
||||
DWORD ret = NEO::SysCalls::getFileAttributesA(path.c_str());
|
||||
|
||||
if (ret == INVALID_FILE_ATTRIBUTES) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (ret & FILE_ATTRIBUTE_DIRECTORY) != 0;
|
||||
}
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user