if (tmpDirName == NULL) tmpDirName = getenv("TMPDIR");
if (tmpDirName == NULL) tmpDirName = "/tmp";
- string fileName = (string)tmpDirName + "/libbatch-" + prefix + "-XXXXXX";
-
#ifdef WIN32
+ string fileName = (string)tmpDirName + "\\libbatch-" + prefix + "-XXXXXX";
char randstr[7];
srand(time(NULL));
outputStream.open(fileName.c_str(), ios_base::binary | ios_base::out);
#else
-
+ string fileName = (string)tmpDirName + "/libbatch-" + prefix + "-XXXXXX";
char * buf = new char[fileName.size()+1];
fileName.copy(buf, fileName.size());
buf[fileName.size()] = '\0';
fileToExecute = param[EXECUTABLE].str();
else
throw RunTimeException("param[EXECUTABLE] is not defined. Please define it, cannot submit this job.");
-
- string::size_type p1 = fileToExecute.find_last_of("/");
+#ifdef WIN32
+ const char separator = '\\';
+#else
+ const char separator = '/';
+#endif
+ string::size_type p1 = fileToExecute.find_last_of(separator);
string::size_type p2 = fileToExecute.find_last_of(".");
string rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
string fileNameToExecute = fileToExecute.substr(p1+1);
- string remotePath = workDir + "/" + rootNameToExecute + "_launch_job";
+ string remotePath = workDir + separator + rootNameToExecute + "_launch_job";
// Create batch submit file
ofstream tempOutputFile;