fix: windows cl_cache fixes and improvements

Fixed the function that checks if a directory exists.
Added debug message in case config file creation fails.
Simplified setting pattern for searching all files in a directory.
Adding file search loop skip when found file is a directory.

Fixes: #762
Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwoliński
2024-09-09 11:44:08 +00:00
committed by Compute-Runtime-Automation
parent dd8460beba
commit e30b8c0300
3 changed files with 108 additions and 9 deletions

View File

@@ -47,7 +47,11 @@ DWORD getLastError() {
bool pathExists(const std::string &path) {
DWORD ret = GetFileAttributesA(path.c_str());
return ret == FILE_ATTRIBUTE_DIRECTORY;
if (ret == INVALID_FILE_ATTRIBUTES) {
return false;
}
return (ret & FILE_ATTRIBUTE_DIRECTORY) != 0;
}
HANDLE createEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) {