D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
/
Filename :
pread-i.ri
back
Copy
U:RDoc::AnyMethod[iI" pread:ETI" IO#pread;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"1Behaves like IO#readpartial, except that it:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I",Reads at the given +offset+ (in bytes).;To;;0; [o; ; [I"<Disregards, and does not modify, the stream's position ;TI",(see {Position}[rdoc-ref:IO@Position]).;To;;0; [o; ; [I"5Bypasses any user space buffering in the stream.;T@o; ; [I"=Because this method does not disturb the stream's state ;TI"R(its position, in particular), +pread+ allows multiple threads and processes ;TI"?to use the same \IO object for reading at various offsets.;T@o:RDoc::Markup::Verbatim; [ I"f = File.open('t.txt') ;TI"Hf.read # => "First line\nSecond line\n\nFourth line\nFifth line\n" ;TI"f.pos # => 52 ;TI""# Read 12 bytes at offset 0. ;TI"(f.pread(12, 0) # => "First line\n" ;TI"!# Read 9 bytes at offset 8. ;TI"%f.pread(9, 8) # => "ne\nSecon" ;TI" f.close ;T:@format0o; ; [I"%Not available on some platforms.;T: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"]pread(maxlen, offset) -> string pread(maxlen, offset, out_string) -> string ;T0[ I"(p1, p2, p3 = v3);T@3FI"IO;TcRDoc::NormalClass00