tempOutputFile << (*iter).first << "_ROOT_DIR="<< curModulePath << endl;
tempOutputFile << "export " << (*iter).first << "_ROOT_DIR" << endl;
tempOutputFile << "LD_LIBRARY_PATH=" << curModulePath << "/lib/salome" << ":${LD_LIBRARY_PATH}" << endl;
- tempOutputFile << "PYTHONPATH=" << curModulePath << "/bin/salome:" << curModulePath << "/lib/python2.2/site-packages/salome:";
+ tempOutputFile << "PYTHONPATH=" << curModulePath << "/bin/salome:" << curModulePath << "/lib/salome:" << curModulePath << "/lib/python2.2/site-packages/salome:";
tempOutputFile << curModulePath << "/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH}" << endl;
}
tempOutputFile << "export LD_LIBRARY_PATH" << endl;
tempOutputFile << "SALOME_Container ";
tempOutputFile << containerName << " -";
AddOmninamesParams(tempOutputFile);
- tempOutputFile << " > /tmp/" << "/" << containerName << "_" << machine << ".log 2>&1 &" << endl;//" &" << endl;
- //tempOutputFile << "EOF" << endl;
- //tempOutputFile << "&" << endl;
+ tempOutputFile << " &" << endl;
tempOutputFile.flush();
tempOutputFile.close();
chmod(_TmpFileName.c_str(),0x1ED);
_CommandForRemAccess=command;
command+=" ";
command+=_TmpFileName;
- command+=" & ";
+ command += " > ";
+ command += "/tmp/";
+ command += containerName;
+ command += "_";
+ command += machine;
+ command += ".log &";
cout << "Command is ... " << command << endl;
return command;
}
{
string command="rm ";
command+=_TmpFileName;
- system(command.c_str());
+ char *temp=strdup(command.c_str());
+ int lgthTemp=strlen(temp);
+ temp[lgthTemp-3]='*';
+ temp[lgthTemp-2]='\0';
+ system(temp);
+ free(temp);
}
}
string SALOME_ResourcesManager::BuildTemporaryFileName() const
{
//build more complex file name to support multiple salome session
- string command( "/tmp/" );
- char *temp=new char[14];
- strcpy(temp,"command");
+ char *temp=new char[19];
+ strcpy(temp,"/tmp/command");
strcat(temp,"XXXXXX");
mkstemp(temp);
- command += temp;
+ string command(temp);
delete [] temp;
command += ".sh";
return command;