[Rd] RFC: rawConnection (was "loop connections")

dhinds@sonic.net dhinds at sonic.net
Thu Sep 1 07:09:48 CEST 2005


Duncan Murdoch <murdoch at stats.uwo.ca> wrote:

> I would implement it differently from the way you did.  I'd call it
> a rawConnection, taking a raw variable (or converting something else
> using as.raw) as the input, and providing both text and binary
> read/write modes (using the same conventions for text mode as a file
> connection would).  It *should* support seek, at least in binary
> mode.

I was trying to reuse as much of the textConnection semantics and
underlying code as possible...

Having a rawConnection() entry point is simple enough.  Seeking also
seems straightforward.  I'm not so sure about using as.raw().  I
wondered about that, but also thought that rather than coercing to
raw, it might make more sense to cast atomic vector types to raw,
byte-for-byte.

Can you given an example of where a text-mode raw connection would be
a useful thing?

-- Dave



More information about the R-devel mailing list