diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-02 09:48:34 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-02 09:48:34 +0000 |
commit | e89c029f2b038a67b6d9b9dfc6bc9e429cab69b3 (patch) | |
tree | a65f423e194cf4a9ed0e5ef2b81e7b68025bdd81 /io.c | |
parent | 5fd798d1ed52dde16f71ea7540c96a82b0d921da (diff) | |
download | ruby-e89c029f2b038a67b6d9b9dfc6bc9e429cab69b3.tar.gz |
update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 29 |
1 files changed, 9 insertions, 20 deletions
@@ -10684,30 +10684,19 @@ static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock); * ARGF.readpartial(maxlen) -> string * ARGF.readpartial(maxlen, outbuf) -> outbuf * - * Reads at most _maxlen_ bytes from the ARGF stream. It blocks only if - * +ARGF+ has no data immediately available. If the optional _outbuf_ - * argument is present, it must reference a String, which will receive the - * data. + * Reads at most _maxlen_ bytes from the ARGF stream. + * + * If the optional _outbuf_ argument is present, + * it must reference a String, which will receive the data. * The <i>outbuf</i> will contain only the received data after the method call * even if it is not empty at the beginning. - * It raises <code>EOFError</code> on end of file. - * - * +readpartial+ is designed for streams such as pipes, sockets, and ttys. It - * blocks only when no data is immediately available. This means that it - * blocks only when following all conditions hold: - * - * * The byte buffer in the +IO+ object is empty. - * * The content of the stream is empty. - * * The stream has not reached EOF. * - * When +readpartial+ blocks, it waits for data or EOF. If some data is read, - * +readpartial+ returns with the data. If EOF is reached, readpartial raises - * an +EOFError+. + * It raises <code>EOFError</code> on end of ARGF stream. + * Since ARGF stream is a concatenation of multiple files, + * internally EOF is occur for each file. + * ARGF.readpartial returns empty strings for EOFs except the last one and + * raises <code>EOFError</code> for the last one. * - * When +readpartial+ doesn't block, it returns or raises immediately. If - * the byte buffer is not empty, it returns the data in the buffer. Otherwise, if - * the stream has some content, it returns the data in the stream. If the - * stream reaches EOF an +EOFError+ is raised. */ static VALUE |