From: Christophe Bourcier Date: Thu, 27 Apr 2023 13:06:18 +0000 (+0200) Subject: Change permissions only if the file exists X-Git-Tag: V9_11_0b1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=37c4bf1ec06ca4c973ab4017d92bb6fbd71ed3dc;p=plugins%2Fghs3dplugin.git Change permissions only if the file exists --- diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 6e0012c..fbc5bf1 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -119,7 +119,8 @@ static std::string flagsToErrorStr( int anInvalidEnforcedFlags ) // 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 ); + if (boofs::exists(filename)) + boofs::permissions(filename, boofs::remove_perms | boofs::group_all | boofs::others_all ); } typedef const list TTriaList;