From bc1a02b7cfb3025d09565cb4b032327cd54a4e5b Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 24 Jan 2005 11:43:12 +0000 Subject: fix IO#read docment. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/io.c b/io.c index 1085e81c5..b8e25c19e 100644 --- a/io.c +++ b/io.c @@ -1223,14 +1223,20 @@ io_readpartial(int argc, VALUE *argv, VALUE io) /* * call-seq: - * ios.read([integer [, buffer]]) => string, buffer, or nil - * - * Reads at most integer bytes from the I/O stream, or to the - * end of file if integer is omitted or is nil. + * ios.read([length [, buffer]]) => string, buffer, or nil + * + * Reads at most length bytes from the I/O stream, or to the + * end of file if length is omitted or is nil. + * length must be a non-negative integer or nil. * If the optional buffer argument is present, it must reference - * a String, which will receive the data. Returns nil - * if called at end of file. - * + * a String, which will receive the data. + * + * At end of file, it returns nil or "" + * depend on length. + * ios.read() and + * ios.read(nil) returns "". + * ios.read(positive-integer) returns nil. + * * f = File.new("testfile") * f.read(16) #=> "This is line one" */ -- cgit