mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[DOC] Improve example of IO#pread [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2e5cf0b711
commit
9f68d0f591
1 changed files with 6 additions and 4 deletions
10
io.c
10
io.c
|
@ -5107,10 +5107,12 @@ pread_internal_call(VALUE arg)
|
|||
* at end of file and <code>NotImplementedError</code> if platform does not
|
||||
* implement the system call.
|
||||
*
|
||||
* f = File.new("testfile")
|
||||
* f.read #=> "This is line one\nThis is line two\n"
|
||||
* f.pread(12, 0) #=> "This is line"
|
||||
* f.pread(9, 8) #=> "line one\n"
|
||||
* File.write("testfile", "This is line one\nThis is line two\n")
|
||||
* File.open("testfile") do |f|
|
||||
* p f.read # => "This is line one\nThis is line two\n"
|
||||
* p f.pread(12, 0) # => "This is line"
|
||||
* p f.pread(9, 8) # => "line one\n"
|
||||
* end
|
||||
*/
|
||||
static VALUE
|
||||
rb_io_pread(int argc, VALUE *argv, VALUE io)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue