On Fri, Jul 9, 2010 at 3:48 PM, Duncan Murdoch <murdoch.duncan@gmail.com>wrote:

> On 09/07/2010 2:38 PM, Dominick Samperi wrote:
>
>> Is it possible to set Windows' search path from within R, or
>> to tell Windows how to find a DLL in some other way from
>> R? Specifically, if a package DLL depends on another DLL
>> the normal requirement is that the second DLL be in the
>> search path so Windows can find it (there are other tricks,
>> but they apply at the Windows level, not at the R level).
>>
>>
>
>
> I haven't tried this, but can't you use Sys.setenv() to change the PATH to
> what you want?  Presumably you'll want to change it back afterwards.
>

Thanks, good suggestion, but it does not seem to work. If PATH is updated in
this way the
change is local to the current process, not to the top-level Windows
process, so a subsequent
dyn.load('foo.dll') will fail if foo.dll depends on bar.dll, unless bar.dll
is placed in the search
path for the top-level shell. Seems like this needs to be done as part of
system
startup outside of R.

On the other hand, if foo.dll is the package library for package foo, and if
foo
depends on package bar, then there is no need to place bar.dll in the
top-level
search path. R takes care of this (more typical) situation.

Dominick

	[[alternative HTML version deleted]]

