From f03d702d84f08d3f14356e45434b822fc78822de Mon Sep 17 00:00:00 2001 From: castano Date: Fri, 9 Jan 2009 05:45:02 +0000 Subject: [PATCH] Implement exists with access instead of stat. --- src/nvcore/FileSystem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nvcore/FileSystem.cpp b/src/nvcore/FileSystem.cpp index b582fe6..ec87740 100644 --- a/src/nvcore/FileSystem.cpp +++ b/src/nvcore/FileSystem.cpp @@ -17,8 +17,9 @@ using namespace nv; bool FileSystem::exists(const char * path) { #if NV_OS_UNIX - struct stat buf; - return stat(path, &buf) == 0; + return access(path, F_OK|R_OK) == 0; + //struct stat buf; + //return stat(path, &buf) == 0; #else if (FILE * fp = fopen(path, "r")) {