D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
/
Buffer
/
Filename :
pwrite-i.ri
back
Copy
U:RDoc::AnyMethod[iI"pwrite:ETI"IO::Buffer#pwrite;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"NWrite at least +length+ bytes from the buffer starting at +offset+, into ;TI"Mthe +io+ starting at the specified +from+ position. If an error occurs, ;TI"return <tt>-errno</tt>.;To:RDoc::Markup::BlankLine o; ; [I"NIf +length+ is not given or +nil+, it defaults to the size of the buffer ;TI".minus the offset, i.e. the entire buffer.;T@o; ; [I"KIf +length+ is zero, exactly one <tt>pwrite</tt> operation will occur.;T@o; ; [I"NIf +offset+ is not given, it defaults to zero, i.e. the beginning of the ;TI"buffer.;T@o; ; [I"KIf the +from+ position is beyond the end of the file, the gap will be ;TI"&filled with null (0 value) bytes.;T@o:RDoc::Markup::Verbatim; [I"Tout = File.open('output.txt', File::RDWR) # open for read/write, no truncation ;TI"4IO::Buffer.for('1234567').pwrite(out, 2, 3, 1) ;T:@format0o; ; [I"PThis leads to +234+ (3 bytes, starting from position 1) being written into ;TI"8<tt>output.txt</tt>, starting from file position 2.;T: @fileI"io_buffer.c;T:0@omit_headings_from_table_of_contents_below0I"Fpwrite(io, from, [length, [offset]]) -> written length or -errno ;T0[ I"(*args);T@(FI"Buffer;TcRDoc::NormalClass00