#include <algorithm>
#include <errno.h>
+#include <boost/filesystem.hpp>
+
+namespace boofs = boost::filesystem;
+
#ifdef _DEBUG_
//#define _MY_DEBUG_
#endif
return str;
}
+// change results files permissions to user only (using boost to be used without C++17)
+static void chmodUserOnly(const char* filename)
+{
+ boofs::permissions(filename, boofs::remove_perms | boofs::group_all | boofs::others_all );
+}
+
typedef const list<const SMDS_MeshFace*> TTriaList;
static const char theDomainGroupNamePrefix[] = "Domain_";
MGInput->GmfSetLin( idx, GmfRequiredTriangles, int( anElemSet.size()+enfID ));
}
+ // close input files and change results files permissions to user only
MGInput->GmfCloseMesh(idx);
+ chmodUserOnly(theMeshFileName);
if (idxRequired)
- MGInput->GmfCloseMesh(idxRequired);
+ {
+ MGInput->GmfCloseMesh(idxRequired);
+ chmodUserOnly(theRequiredFileName);
+ }
if (idxSol)
- MGInput->GmfCloseMesh(idxSol);
+ {
+ MGInput->GmfCloseMesh(idxSol);
+ chmodUserOnly(theRequiredFileName);
+ }
return true;
}
}
}
aIdsFile.close();
+ chmodUserOnly(aSmdsToGhs3dIdMapFileName.ToCString());
if ( ! Ok ) {
if ( !_keepFiles ) {
removeFile( aGMFFileName );
BRIEF_INFOS("")
}
+ // change results files permissions to user only
+ chmodUserOnly(aLogFileName.ToCString());
+ if (Ok)
+ {
+ chmodUserOnly(aResultFileName.ToCString());
+ chmodUserOnly(aResSolFileName.ToCString());
+ }
+
// --------------
// read a result
// --------------