From: Wayne Blair Date: 2001-05-22T03:40:09+09:00 Subject: [ruby-talk:15501] StringBuffer IO Class Is there a built in or has anyone developed a string buffer stream class as an IO object. I would like to redirect standard out at certain times to such a buffer. If not, is there an alternative way to redirect stdout to a regular string object? Here is pseudocode for what I want to do - I'd be really appreciative if anyone could help fill in the blanks with ruby code. def foo # redirect stdout to a buffer (buff) # do some work that may result in writes to stdout # redirect stdout back to original stdout # write contents of buff to stdout end Wayne