X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FUtils%2FFolders.cpp;h=3fa04025823b3502f4959ebc50e8a5fb83d6b57f;hb=d3f16728298e0639a3b2e916386f4e8cea4018ff;hp=8f2bc18feddfc1c2b44af47ac1adbc5592240448;hpb=8cff961ce194a360481a0734252a5a59a7e0578e;p=lugaru.git diff --git a/Source/Utils/Folders.cpp b/Source/Utils/Folders.cpp index 8f2bc18..3fa0402 100644 --- a/Source/Utils/Folders.cpp +++ b/Source/Utils/Folders.cpp @@ -133,3 +133,15 @@ FILE* Folders::openMandatoryFile(const std::string& filename, const char* mode) } return tfile; } + +bool Folders::file_exists(const std::string& filepath) +{ + FILE* file; + file = fopen(filepath.c_str(), "rb"); + if (file == NULL) { + return false; + } else { + fclose(file); + return true; + } +}