#include <Basics_Utils.hxx>
#include <utilities.h>
+#include <boost/filesystem.hpp>
+namespace boofs = boost::filesystem;
+
#include <fstream>
#include <algorithm>
}
}
+// change results files permissions to user only (using boost to be used without C++17)
+static void chmodUserOnly(const char* filename)
+{
+ if (boofs::exists(filename))
+ boofs::permissions(filename, boofs::remove_perms | boofs::group_all | boofs::others_all );
+}
+
//=============================================================================
/*!
*
}
MGInput->GmfCloseMesh(idx);
+ chmodUserOnly(theMeshFileName);
if (idxRequired)
- MGInput->GmfCloseMesh(idxRequired);
+ {
+ MGInput->GmfCloseMesh(idxRequired);
+ chmodUserOnly(theRequiredFileName);
+ }
if (idxSol)
- MGInput->GmfCloseMesh(idxSol);
-
+ {
+ MGInput->GmfCloseMesh(idxSol);
+ chmodUserOnly(theSolFileName);
+ }
return true;
}
}
aIdsFile.close();
+ chmodUserOnly(aSmdsToHybridIdMapFileName.c_str());
if ( ! Ok ) {
if ( !_keepFiles ) {
if ( _logInStandardOutput && mgHybrid.IsLibrary() )
std::cout << std::endl << mgHybrid.GetLog() << std::endl;
+ else
+ chmodUserOnly(aLogFileName.c_str());
if ( Ok )
std::cout << "End of Hybrid execution !" << std::endl;
+ if ( mgHybrid.IsExecutable() )
+ {
+ chmodUserOnly(aResultFileName.c_str());
+ chmodUserOnly(aResSolFileName.c_str());
+ }
+
// --------------
// read a result
// --------------
if ( _logInStandardOutput && mgHybrid.IsLibrary() )
std::cout << std::endl << mgHybrid.GetLog() << std::endl;
+ else
+ chmodUserOnly(aLogFileName.c_str());
if ( Ok )
std::cout << "End of Hybrid execution !" << std::endl;
+ if (mgHybrid.IsExecutable())
+ {
+ chmodUserOnly(aResultFileName.c_str());
+ chmodUserOnly(aResSolFileName.c_str());
+ }
+
// --------------
// read a result
// --------------