Prof Brian Ripley <[EMAIL PROTECTED]> writes:

> On Sat, 29 Nov 2003, Simon Urbanek wrote:
> 
> > The current R needs R_HOME to be set before using it even in its 
> > embedded form. Now this defeats the idea of location independence of 
> > the framework. The application doesn't have to care whether the 
> > framework is in /Library/Frameworks, ~/Library/Frameworks or any 
> > user-defined framework location. Therefore it would be nice to have a 
> > tiny function in the R shlib, that would tell me where the shlib lives 
> > (either by using system's API to determine its own location, or at 
> > least the path used on installation).
> > 
> > BTW: This is not Mac specific - I was fighting this on Windows (and 
> > unix for that matter) as well - it is possible to run an .exe linked to 
> > R.dll from anywhere, if R.dll is in the PATH. But then, one has to 
> > determine R_HOME somehow (yes, there is the registry, but that's not 
> > really safe if more R versions are installed).
> 
> How do you do that?  For R's own executables on Windows R_HOME is
> determined from where they are loaded from.  You cannot AFAIK determine
> from within an executable where the R.dll was linked from.  That's why the
> rproxy.dll uses the registry.  I believe you have even less information on 
> Windows.

..than on Windows? Did you mean Unix there? 

Finding the full path name of the current executable is a well-known
impossible under Unix (there's no enforced relation between the
executable and what goes in argv[0]). Doesn't keep applications from
trying anyway, and mostly succeeding. E.g. Tcl has Tcl_FindExecutable.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])             FAX: (+45) 35327907

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-devel

Reply via email to