Files
compute-runtime/shared/source/helpers/linux/path.cpp
Semenov Herman (Семенов Герман) 34ee40393f refactor: remove excess cast to C-string and add const reference
Signed-off-by: Semenov Herman (Семенов Герман) <GermanAizek@yandex.ru>
2025-01-14 13:25:31 +01:00

24 lines
440 B
C++

/*
* Copyright (C) 2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/path.h"
#include "shared/source/os_interface/linux/sys_calls.h"
#include <string>
namespace NEO {
bool pathExists(const std::string &path) {
struct stat statbuf = {};
if (NEO::SysCalls::stat(path, &statbuf) == -1) {
return false;
}
return (statbuf.st_mode & S_IFDIR) != 0;
}
} // namespace NEO