1) check that TMP environment variable exists, before getting it's value;
2) add $USER value into filename to avoid R/W problems between users.
std::string MEDCouplingCorbaServBasicsTest::buildFileNameForIOR()
{
- std::string ret;
- ret+=getenv("TMP");
- ret+="/entryPointMEDCouplingCorba.ior";
+ std::string tmpdir;
+ if (getenv("TMP"))
+ tmpdir = getenv("TMP");
+ if (tmpdir == "")
+ tmpdir = "/tmp";
+
+ std::string username;
+ if ( getenv("USERNAME") )
+ username = std::string(getenv("USERNAME"))+"_";
+ else if ( getenv("USER") )
+ username = std::string(getenv("USER"))+"_";
+
+ std::string ret = tmpdir+"/"+username+"entryPointMEDCouplingCorba.ior";
return ret;
}
}
return ret;
def buildFileNameForIOR(self):
- ret=os.getenv("TMP");
- ret+="/entryPointMEDCouplingCorba.ior";
+ tmpdir=os.getenv("TMP", "/tmp");
+ username="";
+ if os.getenv("USERNAME"):
+ username = os.getenv("USERNAME")+"_";
+ elif os.getenv("USER"):
+ username = os.getenv("USER")+"_";
+ ret=tmpdir+"/"+username+"entryPointMEDCouplingCorba.ior";
return ret;
pass