From a3192373a534934e4b26acaa32ecb22cf2270b58 Mon Sep 17 00:00:00 2001 From: marcandre Date: Tue, 20 Dec 2011 06:52:04 +0000 Subject: * io.c: Improve rdoc for {File|IO}.write git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/io.c b/io.c index d13ba93edd..69c3c9e6eb 100644 --- a/io.c +++ b/io.c @@ -8506,12 +8506,14 @@ io_s_write(int argc, VALUE *argv, int binary) * * specifies perm argument for open(). * - * open_args: array of strings + * open_args: array * * specifies arguments for open() as an array. * - * IO.write("testfile", "0123456789") #=> "0123456789" - * IO.write("testfile", "0123456789", 20) #=> "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n" + * IO.write("testfile", "0123456789", 20) # => 10 + * # File could contain: "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n" + * IO.write("testfile", "0123456789") #=> 10 + * # File would now read: "0123456789" */ static VALUE @@ -8524,15 +8526,17 @@ rb_io_s_write(int argc, VALUE *argv, VALUE io) * call-seq: * IO.binwrite(name, string, [offset] ) => fixnum * - * Opens the file, optionally seeks to the given offset, write + * Opens the file, optionally seeks to the given offset, writes * string then returns the length written. * binwrite ensures the file is closed before returning. * The open mode would be "wb:ASCII-8BIT". * If offset is not given, the file is truncated. Otherwise, * it is not truncated. * - * IO.binwrite("testfile", "0123456789") #=> "0123456789" - * IO.binwrite("testfile", "0123456789", 20) #=> "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n" + * IO.binwrite("testfile", "0123456789", 20) # => 10 + * # File could contain: "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n" + * IO.binwrite("testfile", "0123456789") #=> 10 + * # File would now read: "0123456789" */ static VALUE -- cgit v1.2.3