pbs-software / pbs-modelling

R package PBSmodelling - GUI tools made easy: interact with models and explore data
2 stars 1 forks source link

openFile("..") #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
openFile(".") works,
but openFile("..") opens the current dir and not parent
openFile("../..") only opens the first parent directory (only 1 level up)

Original issue reported on code.google.com by alex_goo...@mofo.ca on 4 Dec 2009 at 5:52

GoogleCodeExporter commented 9 years ago
shell.exec() is relative to the location of R, NOT the current working 
directory of R.
so shell.exec(".") will always open R's location, and NOT the current working 
directory.

currently shell.exec( paste( getwd(), ".", sep="/" ) ) is used. but
this fails for ".."

One solution is to use:

Sys.setenv( R_HOME = getwd() )
shell.exec( "." )

but then the program you are calling better not require R_HOME.

Original comment by alex_goo...@mofo.ca on 6 Dec 2009 at 2:19

GoogleCodeExporter commented 9 years ago
On Windows 7 (at least), shell.exec() is relative to the current working 
directory of R.  I cleaned up much of this function, mainly by using 
normalizePath, and I thoroughly tested the new code both on Windows (7) and Mac 
OS X (10.8), and didn't run into any problems.

Commit 245 contains the fix.

Original comment by nmbo...@gmail.com on 13 Jan 2013 at 11:17