[Rprotobuf-yada] linking against R shared library

Romain Francois romain.francois at dbmail.com
Sat Nov 7 20:06:19 CET 2009


On 11/07/2009 08:01 PM, Dirk Eddelbuettel wrote:
>
>
> On 7 November 2009 at 19:07, Romain Francois wrote:
> | I'm close to give up. I don't see why they would make this available:
> |
> | void R_InitConnOutPStream(R_outpstream_t stream, Rconnection con,
> | 			  R_pstream_format_t type, int version,
> | 			  SEXP (*phook)(SEXP, SEXP), SEXP pdata);
> |
> | when there seems to be no way to get hold of __any__ Rconnection. If I
> | could get to some Rconnection, then knowing its number I'd be able to
> | jump to the one I'm interested in I think since they are in an array ...
> |
> | The closest I can get is to the con->exp_ptr which is this guy:
> |
> |>  f<- file( "/tmp/foo", open = "w" )
> |>  attr( f, "conn_id")
> |<pointer: 0x30>
> |
> | which would be useful if the external pointer did point to something
> | useful, but that's not what I gather from these :
> |
> |      con->ex_ptr = R_MakeExternalPtr(con->id, install("connection"),
> | 				    R_NilValue);
> |      setAttrib(ans, install("conn_id"), con->ex_ptr);
>
> Is it worth talking to Simon?

It always is, but I don't think he gets them, since it appears you 
cannot. Did I say something that confused you about using connections in 
rJava ? It would be nice, but I don't think it is done.

> What does he do to get the connections?
>
> Dirk


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/BcPw : celebrating R commit #50000
|- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc
`- http://tr.im/yw8E : New R package : sos



More information about the Rprotobuf-yada mailing list