.Platform addition (was Re: [R] where does R search when source()?)

Paul Roebuck roebuck at odin.mdacc.tmc.edu
Mon Jul 12 18:01:49 CEST 2004


On Sun, 11 Jul 2004, Gabor Grothendieck wrote:

> search.path <-
> function(fn,
>          paths = strsplit(Sys.getenv("PATH"), split = ";")[[1]],
>          fsep = "\\") {
>     for(d in paths) {
>         f <- file.path(d, fn, fsep = fsep)
>         if (file.exists(f))
>             return(f)
>     }
>     return(NULL)
> }
>
> source(search.path("myscript.R"))

I glanced this and thought this might be handy to keep for
possible use. To make it less Windows-specific, I was going
to replace Gabor's fsep default value with '.Platform$file.sep'
when I noticed that .Platform doesn't have a '$path.sep'
field. Just missing or available elsewhere?

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)




More information about the R-help mailing list