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

Paul Roebuck
Mon, 12 Jul 2004 16:01:49 -0000

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)