From: ana Date: Mon, 10 Aug 2015 16:59:28 +0000 (+0300) Subject: Fix incorrect behavior of IsExists() function on Windows X-Git-Tag: V7_7_0a1~8^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=22f4ea052777260bd8390224d6c133511c217f80;p=modules%2Fkernel.git Fix incorrect behavior of IsExists() function on Windows --- 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; }