diff --git a/ChangeLog b/ChangeLog index a448fe994f..0d649221c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Mar 11 15:46:45 2012 Shota Fukumori + + * io.c: fix rdoc of `IO.binwrite` to show same as `IO.write` except + it opens file with mode "wb:ASCII-8BIT". [Bug #5782] [ruby-core:42592] + Sat Mar 10 23:52:28 2012 Nobuyoshi Nakada * st.c: pack tables also generic keys. patched by Sokolov Yura at diff --git a/io.c b/io.c index 35104c6f4c..d53633c937 100644 --- a/io.c +++ b/io.c @@ -9246,18 +9246,11 @@ rb_io_s_write(int argc, VALUE *argv, VALUE io) /* * call-seq: * IO.binwrite(name, string, [offset] ) => fixnum + * IO.binwrite(name, string, [offset], open_args ) => fixnum * - * 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. + * Same as IO.write except opening the file in binary mode + * and ASCII-8BIT encoding ("wb:ASCII-8BIT"). * - * 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