In article <opsbhnakfau5o8pp / 233.dallas-20rh16rt.tx.dial-access.att.net>, "John Feezell" <JohnFeezell / 3wplace.com> writes: > Here are some other possible names that seems to fit with readchar, > readline, > and readlines and yet catch the idea of "readpartial." > > readportion > readparcel > readbundle > readatmost > > Personally, "readatmost" would fit closes in my mind to the above > description. "at most" doesn't represent the difference between IO#readpartial and IO#read. IO#read also reads at most <i>integer</i> bytes from the I/O stream. The difference is the blocking behaviour. % (sleep 1; echo abc; sleep 1; echo def) | ./ruby -e 't1 = Time.now; p STDIN.readpartial(4096); t2 = Time.now; p t2-t1' "abc\n" 1.001541 % (sleep 1; echo abc; sleep 1; echo def) | ./ruby -e 't1 = Time.now; p STDIN.read(4096); t2 = Time.now; p t2-t1' "abc\ndef\n" 2.011527 Both IO#readpartial and IO#read blocks until some data are available. But after some data are avalable, IO#readpartial just return the data and doesn't block anymore. IO#read blocks until EOF or specified length, though. -- Tanaka Akira