diff options
author | Alan Wu <[email protected]> | 2022-08-03 10:47:12 -0400 |
---|---|---|
committer | Alan Wu <[email protected]> | 2022-08-05 14:34:08 -0400 |
commit | f1057393da7a98e447ee7679db69aeec8f4d1650 (patch) | |
tree | c7327063b5f5ab486916f899cb48f38f7829e18c /io.c | |
parent | ce6dc9f66079f44df009b96f8467cd014bc5dd4c (diff) |
[DOC] Clarify that `IO.read` uses text mode
See: https://bugs.ruby-lang.org/issues/18882#note-13
[Bug #18882]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6212
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -11776,12 +11776,16 @@ seek_before_access(VALUE argp) * IO.read('| cat t.txt') * # => "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: * * IO.read('t.txt') * # => "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. * * With argument +length+, returns +length+ bytes if available: |