|
|
|
@ -205,11 +205,13 @@ |
|
|
|
#define GETCWD _getcwd // NOTE: MSDN recommends not to use getcwd(), chdir() |
|
|
|
#define CHDIR _chdir |
|
|
|
#define MKDIR(dir) _mkdir(dir) |
|
|
|
#define ACCESS(fn) _access(fn, 0) |
|
|
|
#else |
|
|
|
#include <unistd.h> // Required for: getch(), chdir(), mkdir(), access() |
|
|
|
#define GETCWD getcwd |
|
|
|
#define CHDIR chdir |
|
|
|
#define MKDIR(dir) mkdir(dir, 0777) |
|
|
|
#define ACCESS(fn) access(fn, F_OK) |
|
|
|
#endif |
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------- |
|
|
|
@ -1972,11 +1974,7 @@ bool FileExists(const char *fileName) |
|
|
|
{ |
|
|
|
bool result = false; |
|
|
|
|
|
|
|
#if defined(_WIN32) |
|
|
|
if (_access(fileName, 0) != -1) result = true; |
|
|
|
#else |
|
|
|
if (access(fileName, F_OK) != -1) result = true; |
|
|
|
#endif |
|
|
|
if (ACCESS(fileName) != -1) result = true; |
|
|
|
|
|
|
|
// NOTE: Alternatively, stat() can be used instead of access() |
|
|
|
//#include <sys/stat.h> |
|
|
|
|