From 22f4ea052777260bd8390224d6c133511c217f80 Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 10 Aug 2015 19:59:28 +0300 Subject: [PATCH] Fix incorrect behavior of IsExists() function on Windows --- src/Basics/Basics_DirUtils.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Basics/Basics_DirUtils.cxx b/src/Basics/Basics_DirUtils.cxx index 36335c385..ad5372334 100644 --- a/src/Basics/Basics_DirUtils.cxx +++ b/src/Basics/Basics_DirUtils.cxx @@ -31,6 +31,9 @@ # include # include #else +#include +#define F_OK 0 +#define access _access # include # include #endif @@ -160,16 +163,8 @@ namespace Kernel_Utils //============================================================================ bool IsExists(const std::string& thePath) { -#ifdef WIN32 - if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { - if ( GetLastError () == ERROR_FILE_NOT_FOUND ) { - return false; - } - } -#else int status = access ( thePath.c_str() , F_OK ); if (status != 0) return false; -#endif return true; } -- 2.39.2