Author: jcouteau Date: 2009-05-12 08:11:31 +0000 (Tue, 12 May 2009) New Revision: 80 Modified: lutinj2r/trunk/src/main/java/org/codelutin/j2r/jni/RJniEngine.java lutinj2r/trunk/src/main/java/org/codelutin/j2r/net/RNetEngine.java Log: Should fix setwd() bug under windows Modified: lutinj2r/trunk/src/main/java/org/codelutin/j2r/jni/RJniEngine.java =================================================================== --- lutinj2r/trunk/src/main/java/org/codelutin/j2r/jni/RJniEngine.java 2009-05-04 19:07:48 UTC (rev 79) +++ lutinj2r/trunk/src/main/java/org/codelutin/j2r/jni/RJniEngine.java 2009-05-12 08:11:31 UTC (rev 80) @@ -78,7 +78,7 @@ public Object eval(String expr) throws RException { REXP result = null; try { - log.debug(expr); + log.info(expr); result = engine.eval(expr); } catch (Exception eee) { throw new RException("Unable to evaluate the R expression " @@ -181,6 +181,7 @@ // voidEval is not really supproted by JRI, we just discard the result // conversion try { + log.info(expr); engine.eval(expr); } catch (Exception eee) { throw new RException("An error occured while voidEval on JNI", eee); @@ -219,7 +220,7 @@ * @throws RException */ public void setwd(File directory) throws RException { - voidEval("setwd(\"" + directory.getAbsolutePath() + "\")"); + voidEval("setwd(\"" + directory.getAbsolutePath().replaceAll("\\\\", "/") + "\")"); } /** Modified: lutinj2r/trunk/src/main/java/org/codelutin/j2r/net/RNetEngine.java =================================================================== --- lutinj2r/trunk/src/main/java/org/codelutin/j2r/net/RNetEngine.java 2009-05-04 19:07:48 UTC (rev 79) +++ lutinj2r/trunk/src/main/java/org/codelutin/j2r/net/RNetEngine.java 2009-05-12 08:11:31 UTC (rev 80) @@ -255,7 +255,7 @@ * @throws RException */ public void setwd(File directory) throws RException { - voidEval("setwd(\"" + directory.getAbsolutePath() + "\")"); + voidEval("setwd(\"" + directory.getAbsolutePath().replaceAll("\\\\", "/") + "\")"); } /**