From: <gg...@us...> - 2007-09-18 13:17:38
|
Revision: 66 http://bugs-r.svn.sourceforge.net/bugs-r/?rev=66&view=rev Author: ggorjan Date: 2007-09-18 06:17:39 -0700 (Tue, 18 Sep 2007) Log Message: ----------- two minor tweaks for S-PLUS on Linux/UNIX Modified Paths: -------------- trunk/R2WinBUGS/R/bugs.R trunk/R2WinBUGS/R/bugs.run.R Modified: trunk/R2WinBUGS/R/bugs.R =================================================================== --- trunk/R2WinBUGS/R/bugs.R 2007-09-17 09:18:14 UTC (rev 65) +++ trunk/R2WinBUGS/R/bugs.R 2007-09-18 13:17:39 UTC (rev 66) @@ -37,15 +37,15 @@ on.exit(setwd(savedWD)) } if(is.function(model.file)){ - temp <- - if(is.R()){ - paste(tempfile("model"), "txt", sep=".") - } else { - gsub(".tmp$", ".txt", tempfile("model")) - } - write.model(model.file, con = temp) + temp <- + ifelse(is.R(), + paste(tempfile("model"), "txt", sep="."), + ifelse(.Platform$OS.type != "unix", + gsub(".tmp$", ".txt", tempfile("model")), + paste(tempfile("model"), "txt", sep="."))) + write.model(model.file, con=temp) model.file <- gsub("\\\\", "/", temp) - if(!is.R()) on.exit(file.remove(model.file), add = TRUE) + if(!is.R()) on.exit(file.remove(model.file), add=TRUE) } if(!file.exists(model.file)) stop(paste(model.file, "does not exist.")) Modified: trunk/R2WinBUGS/R/bugs.run.R =================================================================== --- trunk/R2WinBUGS/R/bugs.run.R 2007-09-17 09:18:14 UTC (rev 65) +++ trunk/R2WinBUGS/R/bugs.run.R 2007-09-18 13:17:39 UTC (rev 66) @@ -9,7 +9,7 @@ ## Is bugs.directory defined in Windows (where second character is : ## i.e. C:\Program...) or Unix style path? - if(useWINE && (substr(bugs.directory, start=2, stop=2) == ":")) { + if(useWINE && (substr(bugs.directory, 2, 2) == ":")) { bugs.directory <- win2native(bugs.directory, newWINE=newWINE, WINEPATH=WINEPATH) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |