Main Page | Report this Page
Computers Forum Index  »  Computer Languages (Ruby)  »  StringIO and reopen...
Page 1 of 1    

StringIO and reopen...

Author Message
Hal Fulton...
Posted: Tue Nov 03, 2009 3:02 am
Guest
[Note: parts of this message were removed to make it a legal post.]

I've noticed (via my friend Taylor Carpenter) that IO#reopen
doesn't work for a StringIO object.

Should it?

I haven't dug into the source yet, but my guess is that it would
be easy to implement...


Hal Fulton
 
Charles Oliver Nutter...
Posted: Tue Nov 03, 2009 3:44 am
Guest
StringIO is not actually an IO object; it just mimics one. Unless
reopen worked with non-descriptor IO-like objects (as in JRuby), it
would not be possible to IO#reopen against a StringIO.

On Monday, November 2, 2009, Hal Fulton <rubyhacker at (no spam) gmail.com> wrote:
Quote:
I've noticed (via  my friend Taylor Carpenter) that IO#reopen
doesn't work for a StringIO object.

Should it?

I haven't dug into the source yet, but my guess is that it would
be easy to implement...


Hal Fulton
 
Hal Fulton...
Posted: Tue Nov 03, 2009 4:57 am
Guest
[Note: parts of this message were removed to make it a legal post.]

By "Should it?" I mean "in the future" -- I'm not implying there's
a bug now.

That is, I'm aware of how it works now. I'm just questioning whether
it is worth changing.

I believe it should be possible in theory to make it work -- though
as I said, I haven't dig into the source.

Hal Fulton


On Mon, Nov 2, 2009 at 5:44 PM, Charles Oliver Nutter
<headius at (no spam) headius.com>wrote:

Quote:
StringIO is not actually an IO object; it just mimics one. Unless
reopen worked with non-descriptor IO-like objects (as in JRuby), it
would not be possible to IO#reopen against a StringIO.

On Monday, November 2, 2009, Hal Fulton <rubyhacker at (no spam) gmail.com> wrote:
I've noticed (via my friend Taylor Carpenter) that IO#reopen
doesn't work for a StringIO object.

Should it?

I haven't dug into the source yet, but my guess is that it would
be easy to implement...


Hal Fulton


 
 
Page 1 of 1    
All times are GMT
The time now is Sun Dec 06, 2009 7:39 am