Salome HOME
Compilation on Windows. V9_3_0b1
authorrnv <rnv@opencascade.com>
Wed, 13 Mar 2019 11:09:55 +0000 (14:09 +0300)
committerrnv <rnv@opencascade.com>
Wed, 13 Mar 2019 11:09:55 +0000 (14:09 +0300)
src/Container/Container_i.cxx

index 587b07f2e12a3e6899f34e45f8caedcbfae8d5d5..8b2c05eab1675dffd123815fe5d97949ed3e8908 100644 (file)
@@ -1858,16 +1858,24 @@ void Engines_Container_i::clearTemporaryFiles()
 {
   std::list<std::string>::const_iterator it;
   for ( it = _tmp_files.begin(); it != _tmp_files.end(); ++it ) {
-#ifdef WIN32     
-    std::string command = (GetFileAttributes((*it).c_str()) == FILE_ATTRIBUTE_DIRECTORY) ? "rd /Q \"" : "del /F /Q \"";
+#if defined(WIN32) && defined(UNICODE)
+       std::wstring aFile = Kernel_Utils::utf8_decode_s(*it);
+       std::wstring command = (GetFileAttributes(aFile.c_str()) == FILE_ATTRIBUTE_DIRECTORY) ? L"rd /Q \"" : L"del /F /Q \"";
+       command += aFile;
+       command += L"\" 2>NUL";
+       _wsystem(command.c_str());
 #else
-    std::string command = "rm -rf ";
+#if defined(WIN32)
+       std::string aFile = *it;
+       std::string command = (GetFileAttributes(aFile.c_str()) == FILE_ATTRIBUTE_DIRECTORY) ? "rd /Q \"" : "del /F /Q \"";
+       command += aFile;
+       command += "\" 2>NUL";
+#else
+       std::string command = "rm -rf ";
+       command += *it;
 #endif
-    command += *it;
-#ifdef WIN32     
-    command += "\" 2>NUL";
+       system(command.c_str());
 #endif
-    system( command.c_str() );
   }
   _tmp_files.clear();
 }