D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
/
Filename :
close-i.ri
back
Copy
U:RDoc::AnyMethod[iI" close:ETI" IO#close;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"4Closes the stream for both reading and writing ;TI"0if open for either or both; returns +nil+. ;TI"HSee {Open and Closed Streams}[rdoc-ref:IO@Open+and+Closed+Streams].;To:RDoc::Markup::BlankLine o; ; [I"DIf the stream is open for writing, flushes any buffered writes ;TI",to the operating system before closing.;T@o; ; [I"LIf the stream was opened by IO.popen, sets global variable <tt>$?</tt> ;TI"(child exit status).;T@o; ; [I"LIt is not an error to close an IO object that has already been closed. ;TI"It just returns nil.;T@o; ; [I" Example:;T@o:RDoc::Markup::Verbatim; [I"&IO.popen('ruby', 'r+') do |pipe| ;TI" puts pipe.closed? ;TI" pipe.close ;TI" puts $? ;TI" puts pipe.closed? ;TI" end ;T:@format0o; ; [I"Output:;T@o;; [I"false ;TI"pid 13760 exit 0 ;TI" true ;T; 0o; ; [I"8Related: IO#close_read, IO#close_write, IO#closed?.;T: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"close -> nil ;T0[ I"();T@3FI"IO;TcRDoc::NormalClass00