From: Tanaka Akira Date: 2005-05-11T00:20:26+09:00 Subject: Re: When to use sysread In article <20050510142749.GA53646@freeze.org>, Jim Freeze writes: > Uhm, what is the purpose of #sysread. > In other words, when would I use it instead of just #read. When you know neither a length nor a terminator of data available. For example, telnet.rb uses IO#sysread. It reads from network until a shell's prompt. But the length until the prompt is not known in general. Also the prompt varies. If IO#read is used and longer length is specified, it blocks forever. -- Tanaka Akira