From 96e165147563160005a513da943319e0ec98ac57 Mon Sep 17 00:00:00 2001 From: dmv Date: Wed, 15 Sep 2010 06:05:02 +0000 Subject: [PATCH] IPAL21917 WinTC5.1.4: Mesh and Post-Pro objects couldn't be displayed in the opened study --- src/HDFPersist/HDFascii.cc | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/HDFPersist/HDFascii.cc b/src/HDFPersist/HDFascii.cc index 601e8f7fc..1bc9c8a1e 100644 --- a/src/HDFPersist/HDFascii.cc +++ b/src/HDFPersist/HDFascii.cc @@ -667,20 +667,12 @@ bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp) //============================================================================ std::string GetTmpDir() { - //Find a temporary directory to store a file - std::string aTmpDir; - char *Tmp_dir = getenv("SALOME_TMP_DIR"); if(Tmp_dir != NULL) { aTmpDir = std::string(Tmp_dir); if(aTmpDir[aTmpDir.size()-1] != dir_separator) aTmpDir+=dir_separator; -/*#ifdef WIN32 - if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\'; -#else - if(aTmpDir[aTmpDir.size()-1] != '/') aTmpDir+='/'; -#endif*/ } else { #ifdef WIN32 @@ -700,20 +692,13 @@ std::string GetTmpDir() aTmpDir += aSubDir; //Get RND sub directory if(aTmpDir[aTmpDir.size()-1] != dir_separator) aTmpDir+=dir_separator; -/* -#ifdef WIN32 - if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\'; -#else - if(aTmpDir[aTmpDir.size()-1] != '/') aTmpDir+='/'; -#endif - */ std::string aDir = aTmpDir; aRND = 0; while( Exists(aDir) ) { sprintf(buffer, "%d", aRND); aDir = aTmpDir+buffer; //Build a unique directory name - aRND++; + aRND++; } #ifdef WIN32 @@ -783,11 +768,7 @@ void read_float64(FILE* fp, hdf_float64* value) bool Exists(const std::string thePath) { #ifdef WIN32 - if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { - if ( GetLastError () != ERROR_FILE_NOT_FOUND ) { - return false; - } - } + return (GetFileAttributes( thePath.c_str() ) != 0xFFFFFFFF); #else int status = access ( thePath.c_str() , F_OK ); if (status != 0) return false; -- 2.39.2