mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[DOC] Clarify that IO.read
uses text mode
See: https://bugs.ruby-lang.org/issues/18882#note-13 [Bug #18882]
This commit is contained in:
parent
ce6dc9f660
commit
f1057393da
Notes:
git
2022-08-06 03:34:33 +09:00
1 changed files with 5 additions and 1 deletions
6
io.c
6
io.c
|
@ -11776,12 +11776,16 @@ seek_before_access(VALUE argp)
|
||||||
* IO.read('| cat t.txt')
|
* IO.read('| cat t.txt')
|
||||||
* # => "First line\nSecond line\n\nThird line\nFourth line\n"
|
* # => "First line\nSecond line\n\nThird line\nFourth line\n"
|
||||||
*
|
*
|
||||||
* With only argument +path+ given, reads and returns the entire content
|
* With only argument +path+ given, reads in text mode and returns the entire content
|
||||||
* of the file at the given path:
|
* of the file at the given path:
|
||||||
*
|
*
|
||||||
* IO.read('t.txt')
|
* IO.read('t.txt')
|
||||||
* # => "First line\nSecond line\n\nThird line\nFourth line\n"
|
* # => "First line\nSecond line\n\nThird line\nFourth line\n"
|
||||||
*
|
*
|
||||||
|
* On Windows, text mode can terminate reading and leave bytes in the file
|
||||||
|
* unread when encountering certain special bytes. Consider using
|
||||||
|
* IO.binread if all bytes in the file should be read.
|
||||||
|
*
|
||||||
* For both forms, command and path, the remaining arguments are the same.
|
* For both forms, command and path, the remaining arguments are the same.
|
||||||
*
|
*
|
||||||
* With argument +length+, returns +length+ bytes if available:
|
* With argument +length+, returns +length+ bytes if available:
|
||||||
|
|
Loading…
Reference in a new issue