Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Replaced use of access function with stat function when using FileExists
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 31 May 2016 21:32:39 +0000 (22:32 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 31 May 2016 21:32:39 +0000 (22:32 +0100)
source/common/file.cpp
source/common/file.h

index da236b3..01526d0 100644 (file)
@@ -8,16 +8,14 @@ bool FileExists(std::string Filename){
 
 #else 
 
-       const char *FilenameChar = Filename.c_str(); 
-       
-       int rescode = access(FilenameChar, R_OK);
-       
-       if (errno == ENOENT){
+       struct stat BuffData;
+               
+       if (stat(Filename.c_str(), &BuffData) == -1){
                return false;
        }
 
 #endif
-
+       
        return true;
        
 }
\ No newline at end of file
index b986eb5..63c39d3 100644 (file)
@@ -6,7 +6,7 @@
 #if defined (__WIN32__)
 
 #else
-#include <sys/unistd.h>
+#include <sys/stat.h>
 #endif
 
 bool FileExists(std::string Filename);
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy