[R-SIG-Mac] path expansion

Simon Urbanek simon.urbanek at r-project.org
Wed Aug 31 06:19:15 CEST 2005


On Aug 30, 2005, at 9:14 PM, Kasper Daniel Hansen wrote:

> I have source compile my own version of R on MacOS Tiger.
>
> I have a problem with path.expand and dirname. On Linux and the
> binary version of R
>    path.expand("~/foo/")
> exapnds to something like
>    "/Users/kdh/foo"
>
> On my homebuild I just get
>    "~/foo"

path.expand relies on R_ExpandFileName which in turn either uses its  
own version of expansion or the one from readline, depending on  
availability.

So the crucial question here is - do you use readline or compatible  
library and if so, which one? The CRAN binary (where expansion works)  
uses GNU readline 5.0.

Tiger doesn't have GNU readline because of license issues, it  
supplies libedit instead and creates a symlink to impersonate  
readline. So if you compiled your R against that one, chances are  
that its tilde_expand is broken.

Anyway, using GNU readline (as CRAN binary does) should fix it. In  
the meantime I'll check whether we can work around libedit somehow.  
(The R internal expansion doesn't support ~user/foo, that's why it  
would be better to find a real one somewhere on Tiger...).

Cheers,
Simon



More information about the R-SIG-Mac mailing list