Files
compute-runtime/shared/source/helpers/linux/path.cpp
Compute-Runtime-Validation 242a31a024 Revert "refactor: remove excess cast to C-string and add const reference"
This reverts commit 34ee40393f.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2025-01-15 02:43:40 +01:00

24 lines
453 B
C++

/*
* Copyright (C) 2024-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.c_str(), &statbuf) == -1) {
return false;
}
return (statbuf.st_mode & S_IFDIR) != 0;
}
} // namespace NEO