Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
ri
/
2.1.0
/
system
/
IO
/
//opt/alt/ruby21/share/ri/2.1.0/system/IO/write-c.ri
U:RDoc::AnyMethod[iI" write:ETI"IO::write;TT:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [ I"IOpens the file, optionally seeks to the given <i>offset</i>, writes ;TI"5<i>string</i>, then returns the length written. ;TI"E<code>write</code> ensures the file is closed before returning. ;TI"GIf <i>offset</i> is not given, the file is truncated. Otherwise, ;TI"it is not truncated.;To:RDoc::Markup::BlankLine o; ; [I"FIf the last argument is a hash, it specifies option for internal ;TI"Gopen(). The key would be the following. open_args: is exclusive ;TI"to others.;T@o:RDoc::Markup::Verbatim; [I""encoding: string or encoding ;TI" ;TI"G specifies encoding of the read string. encoding will be ignored ;TI" if length is specified. ;TI" ;TI"mode: string ;TI" ;TI"S specifies mode argument for open(). it should start with "w" or "a" or "r+" ;TI"& otherwise it would cause error. ;TI" ;TI"perm: fixnum ;TI" ;TI"* specifies perm argument for open(). ;TI" ;TI"open_args: array ;TI" ;TI"2 specifies arguments for open() as an array. ;TI" ;TI"6 IO.write("testfile", "0123456789", 20) # => 10 ;TI"g # File could contain: "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n" ;TI"6 IO.write("testfile", "0123456789") #=> 10 ;TI"* # File would now read: "0123456789";T:@format0: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"lIO.write(name, string, [offset] ) => fixnum IO.write(name, string, [offset], open_args ) => fixnum ;T0[ I"(*args);T@0FI"IO;TcRDoc::NormalClass00