When to use sysread

Uhm, what is the purpose of #sysread.
In other words, when would I use it instead of just #read.

I've done some searching, but have found nothing concrete.

···

--
Jim Freeze

In article <20050510142749.GA53646@freeze.org>,
  Jim Freeze <jim@freeze.org> 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