[Rd] getConnection, R_outpstream_st

From: Romain Francois <romain.francois_at_dbmail.com>
Date: Sat, 07 Nov 2009 11:24:18 +0100


Hello,

I'm trying to use the limited connections api defined in Rinternals.h. I have code that looks like this (inspired from do_serializeToConn) :

SEXP serialize_to_connection( SEXP xp, SEXP connection ){

Rconnection con ;
struct R_outpstream_st out;
R_pstream_format_t type = R_pstream_binary_format ; SEXP (*hook)(SEXP, SEXP) = NULL ;
con = getConnection(Rf_asInteger(connection)); R_InitConnOutPStream(&out, con, type, 0, hook, R_NilValue );

return R_NilValue ;
}

The problem I have is that I cannot actually call getConnection since it is not part of the api. Is there another way to get the Rconnection that is associated with a number.

Many thanks.

Romain

-- 
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 ______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat 07 Nov 2009 - 10:27:55 GMT

This archive was generated by hypermail 2.2.0 : Sun 08 Nov 2009 - 13:00:21 GMT