From fa4768557a81ddf298ea3dcf95664d6fd2fabcc6 Mon Sep 17 00:00:00 2001 From: castano Date: Mon, 19 Jan 2009 10:41:51 +0000 Subject: [PATCH] Implement FileSystem::exists correctly on win32. --- trunk/src/nvcore/FileSystem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/trunk/src/nvcore/FileSystem.cpp b/trunk/src/nvcore/FileSystem.cpp index ec87740..8d3bc33 100644 --- a/trunk/src/nvcore/FileSystem.cpp +++ b/trunk/src/nvcore/FileSystem.cpp @@ -4,7 +4,9 @@ #include #if NV_OS_WIN32 -#include +//#include // PathFileExists +#include // GetFileAttributes +#include // _mkdir #else #include #include @@ -20,6 +22,10 @@ bool FileSystem::exists(const char * path) return access(path, F_OK|R_OK) == 0; //struct stat buf; //return stat(path, &buf) == 0; +#elif NV_OS_WIN32 + // PathFileExists requires linking to shlwapi.lib + //return PathFileExists(path) != 0; + return GetFileAttributes(path) != 0xFFFFFFFF; #else if (FILE * fp = fopen(path, "r")) {