[R-SIG-Mac] help.start() and Safari etc

Jan de Leeuw deleeuw at stat.ucla.edu
Wed Jul 16 08:53:19 MEST 2003


This is not a browser problem, but a problem with "open"

 >cd
 >cat > aa.txt
aa
^D
 >ln -s aa.txt bb.txt
 >open bb.txt

opens the file aa.txt (in TextEdit). Of course as soon as aa.txt
is open it does not know anything about bb.txt anymore. Same
for

 > open -a /Applications/Safari.app bb.txt

So that's the problem. As for the solution, no idea. Obviously
if R would copy files to Rtmp instead of making soft links the
problem would go away. In fact hard links also work

 >cd /tmp
 > ln ~/aa.txt cc.txt
 >open -a /Applications/Safari.app cc.txt

does open /private/tmp/cc.txt

On Wednesday, July 16, 2003, at 2:24 AM, David Firth wrote:

> I have
>
> > options("browser")
> $browser
> [1] "/usr/bin/open"
>
> and my default HTML browser in OS X is Safari (but it could be Omniweb  
> or IE or whatever).
>
> Problem: doing help.start() opens page
>   file:///usr/local/lib/R/doc/html/index.html
> AND it causes
>   file:///usr/local/lib/R/doc/html/
> to be the root for relative URLs from that page.  As a consequence the  
> "Packages" link goes to the wrong page: it should go to the  
> packages.html file in the per-session temporary directory, not the one  
> in /usr/local/lib/R/doc/html/.
>
> The problem seems to be that /usr/bin/open follows rather slavishly  
> the links set up in the per-session directory: for example, when my R  
> session makes temporary directory Rtmp536,
> david% cd  /tmp/Rtmp536/.R/doc/html
> david% ls -l
> total 64
> lrwxr-xr-x   1 david    wheel          31 Jul 16 08:45 R.css ->  
> /usr/local/lib/R/doc/html/R.css
> lrwxr-xr-x   1 david    wheel          36 Jul 16 08:45 about.html ->  
> /usr/local/lib/R/doc/html/about.html
> lrwxr-xr-x   1 david    wheel          34 Jul 16 08:45 faq.html ->  
> /usr/local/lib/R/doc/html/faq.html
> lrwxr-xr-x   1 david    wheel          39 Jul 16 08:45 function.html  
> -> /usr/local/lib/R/doc/html/function.html
> lrwxr-xr-x   1 david    wheel          36 Jul 16 08:45 index.html ->  
> /usr/local/lib/R/doc/html/index.html
> lrwxr-xr-x   1 david    wheel          34 Jul 16 08:45 left.jpg ->  
> /usr/local/lib/R/doc/html/left.jpg
> lrwxr-xr-x   1 david    wheel          34 Jul 16 08:45 logo.jpg ->  
> /usr/local/lib/R/doc/html/logo.jpg
> lrwxr-xr-x   1 david    wheel          36 Jul 16 08:45 logosm.jpg ->  
> /usr/local/lib/R/doc/html/logosm.jpg
> lrwxr-xr-x   1 david    wheel          44 Jul 16 08:45  
> packages-head.html -> /usr/local/lib/R/doc/html/packages-head.html
> -rw-r--r--   1 david    wheel        6208 Jul 16 08:45 packages.html
> etc
>
> I can't see a way around this using /usr/bin/open.
>
> What would be useful is a command-line executable, say  
> /usr/local/bin/safari, such that
> david% safari /tmp/Rtmp536/.R/doc/html/index.html
> works in much the same way as does
> david% lynx /tmp/Rtmp536/.R/doc/html/index.html
> i.e., it displays the material at  
> file:///usr/local/lib/R/doc/html/index.html but keeps as the root for  
> relative URLs the temporary directory file:///tmp/Rtmp536/.R/doc/html
>
> But I don't know how to make such a "safari" script or other  
> executable.  Any suggestions?
>
> The same problem seems to occur with other browsers such as IE and  
> Omniweb.
>
> Regards,
> David
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-mac
>
>
===
Jan de Leeuw; Professor and Chair, UCLA Department of Statistics;
Editor: Journal of Multivariate Analysis, Journal of Statistical  
Software
US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw at stat.ucla.edu
homepage: http://gifi.stat.ucla.edu
   
------------------------------------------------------------------------ 
-------------------------
           No matter where you go, there you are. --- Buckaroo Banzai
                    http://gifi.stat.ucla.edu/sounds/nomatter.au



More information about the R-SIG-Mac mailing list