Implement FileSystem::exists correctly on win32.
This commit is contained in:
parent
07a4daed7b
commit
f753cc9702
@ -4,7 +4,9 @@
|
||||
#include <nvcore/nvcore.h>
|
||||
|
||||
#if NV_OS_WIN32
|
||||
#include <direct.h>
|
||||
//#include <shlwapi.h> // PathFileExists
|
||||
#include <windows.h> // GetFileAttributes
|
||||
#include <direct.h> // _mkdir
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
@ -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"))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user