From: Ron Jeffries Date: 2001-12-20T12:08:47+09:00 Subject: [ruby-talk:29056] Re: Stream? On Wed, 19 Dec 2001 17:39:09 GMT, Pierre-Charles David wrote: >I don't how how ReadStream works, but isn't String#each_byte what >you're looking for? > >% ri String.each_byte >------------------------------------------------------- String#each_byte > str.each_byte {| aFixnum | block } -> str >------------------------------------------------------------------------ > Passes each byte in str to the given block. > "hello".each_byte {|c| print c, ' ' } > produces: > 104 101 108 108 111 Well, the idea is to set up a stream on a string and then pass it to a method that expects a file, for testing purposes. So I can do it to the extent that the method only uses methods that Strings understand. Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com