Operating on strings using IO interface

Hello,

is there a means that a piece of software can use just the IO
interface transparently without needing to know, whether the data to
read (resp. to write) is coming from (resp. going to) a file or a
string? Something comparable to stringstream in C++?

Regards
Thomas

On Apr 14, 2007, at 12:05 PM, Thomas H. wrote:

is there a means that a piece of software can use just the IO
interface transparently without needing to know, whether the data to
read (resp. to write) is coming from (resp. going to) a file or a
string? Something comparable to stringstream in C++?

ri StringIO

– fxn

On Apr 14, 12:27 pm, Xavier N. [email protected] wrote:

On Apr 14, 2007, at 12:05 PM, Thomas H. wrote:

is there a means that a piece of software can use just the IO
interface transparently without needing to know, whether the data to
read (resp. to write) is coming from (resp. going to) a file or a
string? Something comparable to stringstream in C++?

ri StringIO

– fxn

lol, funny, on my kubuntu-box, ri runned until yesterday, and now:
ri StringIO
/usr/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in concat': can't convert nil into Array (TypeError) from /usr/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:inmerge_in’
from /usr/lib/ruby/1.8/rdoc/ri/ri_reader.rb:56:in get_class' from /usr/lib/ruby/1.8/rdoc/ri/ri_reader.rb:52:inget_class’
from /usr/lib/ruby/1.8/rdoc/ri/ri_reader.rb:31:in
find_class_by_name' from /usr/lib/ruby/1.8/rdoc/ri/ri_display.rb:97:indisplay_class_info’
from /usr/lib/ruby/1.8/rdoc/ri/ri_display.rb:96:in
display_class_info' from /usr/lib/ruby/1.8/rdoc/ri/ri_display.rb:199:inpage’
from /usr/lib/ruby/1.8/rdoc/ri/ri_display.rb:77:in
display_class_info' from /usr/lib/ruby/1.8/rdoc/ri/ri_driver.rb:71:inreport_class_stuff’
from /usr/lib/ruby/1.8/rdoc/ri/ri_driver.rb:106:in
get_info_for' from /usr/lib/ruby/1.8/rdoc/ri/ri_driver.rb:135:inprocess_args’
from /usr/lib/ruby/1.8/rdoc/ri/ri_driver.rb:134:in
`process_args’
from /usr/bin/ri:48

Sometimes I hate those automatic updates…

Xavier N. [email protected] wrote/schrieb
[email protected]:

ri StringIO

Thanks, that’s exacly what I was looking for.

Regards
Thomas