]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Fix incorrect behavior of IsExists() function on Windows
authorana <ana@opencascade.com>
Mon, 10 Aug 2015 16:59:28 +0000 (19:59 +0300)
committerana <ana@opencascade.com>
Mon, 10 Aug 2015 16:59:28 +0000 (19:59 +0300)
src/Basics/Basics_DirUtils.cxx

index 36335c3857eb059fb89619f95c3b5508b8ee7a86..ad5372334f4bbb980e3b1f288585e9a0b5bba3aa 100644 (file)
@@ -31,6 +31,9 @@
 # include <dirent.h>
 # include <unistd.h>
 #else
+#include <io.h>
+#define F_OK 0
+#define access _access
 # include <windows.h>
 # include <time.h>
 #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;
   }