From dhinds at sonic.net  Thu Sep  1 07:09:48 2005
From: dhinds at sonic.net (dhinds@sonic.net)
Date: Thu, 1 Sep 2005 05:09:48 +0000 (UTC)
Subject: [Rd] RFC: rawConnection (was "loop connections")
References: <dedndn$daj$1@sea.gmane.org>
	<17168.15848.291481.473231@stat.math.ethz.ch>
	<df5b90$1ba$1@sea.gmane.org> <431667BC.7050906@stats.uwo.ca>
Message-ID: <df62er$jab$1@sea.gmane.org>

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



[Rd] RFC: rawConnection (was "loop connections")
dhinds@sonic.net