summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-20 07:07:46 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-20 07:07:46 +0000
commit15e6d26049f5637277e2f4da3b43422e5b41a126 (patch)
treef4b2f403a4b18413568c666e3f824dafedcaeacb /io.c
parentbe4f7bf51253b5a0519126fb742b8de514bad278 (diff)
* io.c: Improve rdoc for {File|IO}.write
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/io.c b/io.c
index fc4fba7aa2..34b8a7189f 100644
--- a/io.c
+++ b/io.c
@@ -9186,12 +9186,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
@@ -9204,15 +9206,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 <i>offset</i>, write
+ * Opens the file, optionally seeks to the given <i>offset</i>, writes
* <i>string</i> then returns the length written.
* <code>binwrite</code> ensures the file is closed before returning.
* The open mode would be "wb:ASCII-8BIT".
* If <i>offset</i> 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