Now that the user is required to set the java temp directory, it is safer for the LsfJobRunner to write to the java temp directory instead of the command directory.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4593 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kshakir 2010-10-28 15:00:21 +00:00
parent 860de05a7c
commit d768c6558d
2 changed files with 4 additions and 4 deletions

View File

@ -166,7 +166,7 @@ class LsfJobRunner(val function: CommandLineFunction) extends DispatchJobRunner
* @return the file path to the pre-exec.
*/
private def writeExec() = {
IOUtils.writeTempFile(function.commandLine, ".exec", "", function.commandDirectory)
IOUtils.writeTempFile(function.commandLine, ".exec", "")
}
/**
@ -185,7 +185,7 @@ class LsfJobRunner(val function: CommandLineFunction) extends DispatchJobRunner
mountCommand(function).foreach(command =>
preExec.append("%s%n".format(command)))
IOUtils.writeTempFile(preExec.toString, ".preExec", "", function.commandDirectory)
IOUtils.writeTempFile(preExec.toString, ".preExec", "")
}
/**
@ -211,6 +211,6 @@ class LsfJobRunner(val function: CommandLineFunction) extends DispatchJobRunner
|fi
|""".stripMargin.format(function.commandDirectory, touchDone, touchFail))
IOUtils.writeTempFile(postExec.toString, ".postExec", "", function.commandDirectory)
IOUtils.writeTempFile(postExec.toString, ".postExec", "")
}
}

View File

@ -89,7 +89,7 @@ object IOUtils {
def writeContents(file: File, content: String) = FileUtils.writeStringToFile(file, content)
def writeTempFile(content: String, prefix: String, suffix: String = "", directory: File) = {
def writeTempFile(content: String, prefix: String, suffix: String = "", directory: File = null) = {
val tempFile = absolute(File.createTempFile(prefix, suffix, directory))
writeContents(tempFile, content)
tempFile