D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
/
Filename :
reopen-i.ri
back
Copy
U:RDoc::AnyMethod[iI"reopen:ETI"IO#reopen;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"2Reassociates the stream with another stream, ;TI"(which may be of a different class. ;TI"<This method may be used to redirect an existing stream ;TI"to a new destination.;To:RDoc::Markup::BlankLine o; ; [I"CWith argument +other_io+ given, reassociates with that stream:;T@o:RDoc::Markup::Verbatim; [I"$# Redirect $stdin from a file. ;TI"f = File.open('t.txt') ;TI"$stdin.reopen(f) ;TI" f.close ;TI" ;TI"## Redirect $stdout to a file. ;TI"!f = File.open('t.tmp', 'w') ;TI"$stdout.reopen(f) ;TI" f.close ;T:@format0o; ; [I"RWith argument +path+ given, reassociates with a new stream to that file path:;T@o;; [I"$stdin.reopen('t.txt') ;TI""$stdout.reopen('t.tmp', 'w') ;T; 0o; ; [I"/Optional keyword arguments +opts+ specify:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I".{Open Options}[rdoc-ref:IO@Open+Options].;To;;0; [o; ; [I"B{Encoding options}[rdoc-ref:encodings.rdoc@Encoding+Options].;T: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"Wreopen(other_io) -> self reopen(path, mode = 'r', **opts) -> self ;T0[ I"(p1, p2 = v2, p3 = {});T@6FI"IO;TcRDoc::NormalClass00