Bowling/src/FileHelper.cpp

13 lines
285 B
C++

#include "../include/FileHelper.h"
#include <sys/stat.h>
bool FileHelper::fileExists(char *path){
struct stat s;
// Check if file exists, and if it isn't a folder.
if (stat(path, &s) == 0 && !(s.st_mode & S_IFDIR)){
return true;
}
return false;
}