Displaying 1 result from an estimated 1 matches for "safepath".
Did you mean:
basepath
2007 Aug 16
1
Advice on parsing / overriding function calls
.... Right now, I'm trying to
address this in the R environment by forcing the script to use modified
versions of scan, read.table, sys.load.image, etc.
I can run a replace string on the user-supplied script so that, for example,
"scan(" is replaced by "safe.scan("
e.g.
> SafePath <- function(file)
{fp<-strsplit(file,"/");paste("safepath",fp[[1]][length(fp[[1]])],sep="/")}
> SafePath("/etc/passwd")
[1] "safepath/passwd"
> Safe.scan <- function(file, ...) scan(SafePath(file),...)
> Safe.scan("/etc/pass...