MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 216.73.216.153
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /proc/thread-self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/IO/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //proc/thread-self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/IO/pipe-c.ri
U:RDoc::AnyMethod[iI"	pipe:ETI"
IO::pipe;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph;	[I"DCreates a pair of pipe endpoints (connected to each other) and ;TI"Ereturns them as a two-element array of <code>IO</code> objects: ;TI"C<code>[</code> <i>read_io</i>, <i>write_io</i> <code>]</code>.;To:RDoc::Markup::BlankLineo;
;	[
I"2If a block is given, the block is called and ;TI"%returns the value of the block. ;TI"L<i>read_io</i> and <i>write_io</i> are sent to the block as arguments. ;TI"SIf read_io and write_io are not closed when the block exits, they are closed. ;TI"Ai.e. closing read_io and/or write_io doesn't cause an error.;T@o;
;	[I"$Not available on all platforms.;T@o;
;	[I"]If an encoding (encoding name or encoding object) is specified as an optional argument, ;TI"Bread string from pipe is tagged with the encoding specified. ;TI"DIf the argument is a colon separated two encoding names "A:B", ;TI"Fthe read string is converted from encoding A (external encoding) ;TI"<to encoding B (internal encoding), then tagged with B. ;TI"<If two optional arguments are specified, those must be ;TI")encoding objects or encoding names, ;TI"1and the first one is the external encoding, ;TI"2and the second one is the internal encoding. ;TI"FIf the external encoding and the internal encoding is specified, ;TI":optional hash argument specify the conversion option.;T@o;
;	[I"HIn the example below, the two processes close the ends of the pipe ;TI"Fthat they are not using. This is not just a cosmetic nicety. The ;TI"Fread end of a pipe will not generate an end of file condition if ;TI"Hthere are any writers with the pipe still open. In the case of the ;TI"Fparent process, the <code>rd.read</code> will never return if it ;TI"2does not first issue a <code>wr.close</code>.;T@o:RDoc::Markup::Verbatim;	[I"rd, wr = IO.pipe
;TI"
;TI"
if fork
;TI"  wr.close
;TI"'  puts "Parent got: <#{rd.read}>"
;TI"  rd.close
;TI"  Process.wait
;TI"
else
;TI"  rd.close
;TI"(  puts "Sending message to parent"
;TI"  wr.write "Hi Dad"
;TI"  wr.close
;TI"	end
;T:@format0o;
;	[I"<em>produces:</em>;T@o;;	[I"Sending message to parent
;TI"Parent got: <Hi Dad>;T;
0:
@fileI"	io.c;T:0@omit_headings_from_table_of_contents_below0I"IO.pipe                             ->  [read_io, write_io]
IO.pipe(ext_enc)                    ->  [read_io, write_io]
IO.pipe("ext_enc:int_enc" [, opt])  ->  [read_io, write_io]
IO.pipe(ext_enc, int_enc [, opt])   ->  [read_io, write_io]
IO.pipe(...) {|read_io, write_io| ... }
;T0[I" (p1 = v1, p2 = v2, p3 = {});T@FFI"IO;TcRDoc::NormalClass00

MMCT - 2023