diff --git a/src/nvcore/FileSystem.cpp b/src/nvcore/FileSystem.cpp index d3ce3f9..b582fe6 100644 --- a/src/nvcore/FileSystem.cpp +++ b/src/nvcore/FileSystem.cpp @@ -8,7 +8,7 @@ #else #include #include -//#include +#include #endif using namespace nv; @@ -16,9 +16,17 @@ using namespace nv; bool FileSystem::exists(const char * path) { -// stat buf; -// stat(path, &buf); - return false; +#if NV_OS_UNIX + struct stat buf; + return stat(path, &buf) == 0; +#else + if (FILE * fp = fopen(path, "r")) + { + fclose(fp); + return true; + } + return false; +#endif } bool FileSystem::createDirectory(const char * path) @@ -29,3 +37,4 @@ bool FileSystem::createDirectory(const char * path) return mkdir(path, 0777) != -1; #endif } +