[DOC] Add a note to clarify binary flags to IO.new
Try to make it more clear that the `File::BINARY` integer flag, and the `b` string suffix are not equivalent.
This commit is contained in:
parent
6850e3c42e
commit
ec7b42eb77
Notes:
git
2022-05-20 17:24:06 +09:00
Merged: https://github.com/ruby/ruby/pull/5923 Merged-By: nobu <nobu@ruby-lang.org>
8
io.c
8
io.c
@ -14212,7 +14212,7 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
|
|||||||
* ==== Read/Write Mode Specified as an \Integer
|
* ==== Read/Write Mode Specified as an \Integer
|
||||||
*
|
*
|
||||||
* When +mode+ is an integer it must be one or more (combined by bitwise OR (<tt>|</tt>)
|
* When +mode+ is an integer it must be one or more (combined by bitwise OR (<tt>|</tt>)
|
||||||
* of the modes defined in File::Constants:
|
* of the following modes:
|
||||||
*
|
*
|
||||||
* - +File::RDONLY+: Open for reading only.
|
* - +File::RDONLY+: Open for reading only.
|
||||||
* - +File::WRONLY+: Open for writing only.
|
* - +File::WRONLY+: Open for writing only.
|
||||||
@ -14277,6 +14277,12 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
|
|||||||
*
|
*
|
||||||
* File.open('t.tmp', 'wx')
|
* File.open('t.tmp', 'wx')
|
||||||
*
|
*
|
||||||
|
* Note that when using integer flags to set the read/write mode, it's not
|
||||||
|
* possible to also set the binary data mode by adding the File::BINARY flag
|
||||||
|
* to the bitwise OR combination of integer flags. This is because, as
|
||||||
|
* documented in File::Constants, the File::BINARY flag only disables line code
|
||||||
|
* conversion, but does not change the external encoding at all.
|
||||||
|
*
|
||||||
* == Encodings
|
* == Encodings
|
||||||
*
|
*
|
||||||
* Any of the string modes above may specify encodings --
|
* Any of the string modes above may specify encodings --
|
||||||
|
Loading…
x
Reference in New Issue
Block a user