diff --git a/src/Filesystem/dir.c b/src/Filesystem/dir.c index c98e732..812c755 100644 --- a/src/Filesystem/dir.c +++ b/src/Filesystem/dir.c @@ -12,13 +12,13 @@ bool dir_exists(const char* path){ #if KFS_USE_WINDOWS_H DWORD dwAttrib = GetFileAttributes(path); return (bool)( - (dwAttrib != INVALID_FILE_ATTRIBUTES) & // file exists + (dwAttrib != INVALID_FILE_ATTRIBUTES) && // file exists (dwAttrib & FILE_ATTRIBUTE_DIRECTORY)); // file is a directory #else struct stat stats; i32 rez=stat(path, &stats); return (bool)( - (rez!=-1) & // file exists + (rez!=-1) && // file exists (S_ISDIR(stats.st_mode))); // file is a directory #endif } diff --git a/src/Filesystem/file.c b/src/Filesystem/file.c index c58aa4f..b028652 100644 --- a/src/Filesystem/file.c +++ b/src/Filesystem/file.c @@ -15,13 +15,13 @@ bool file_exists(const char* path){ #if KFS_USE_WINDOWS_H DWORD dwAttrib = GetFileAttributes(path); return (bool)( - (dwAttrib != INVALID_FILE_ATTRIBUTES) & // file exists + (dwAttrib != INVALID_FILE_ATTRIBUTES) && // file exists !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)); // file is not directory #else struct stat stats; i32 rez=stat(path, &stats); return (bool)( - (rez!=-1) & // file exists + (rez!=-1) && // file exists !(S_ISDIR(stats.st_mode))); // file is not directory #endif }