From: rnv Date: Wed, 13 Mar 2019 11:09:55 +0000 (+0300) Subject: Compilation on Windows. X-Git-Tag: V9_3_0b1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2ce309a37d894264cdb85fe1086dae48d41017aa;p=modules%2Fkernel.git Compilation on Windows. --- diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 587b07f2e..8b2c05eab 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -1858,16 +1858,24 @@ void Engines_Container_i::clearTemporaryFiles() { std::list::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(); }