PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
U:RDoc::AnyMethod[iI" pipe:ETI" IO::pipe;TT:publico:RDoc::Markup::Document:@parts[$o:RDoc::Markup::Paragraph; [I"ACreates a pair of pipe endpoints, +read_io+ and +write_io+, ;TI"connected to each other.;To:RDoc::Markup::BlankLine o; ; [I"NIf argument +enc_string+ is given, it must be a string containing one of:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"BThe name of the encoding to be used as the external encoding.;To;;0; [o; ; [I"KThe colon-separated names of two encodings to be used as the external ;TI"and internal encodings.;T@o; ; [ I"CIf argument +int_enc+ is given, it must be an Encoding object ;TI"Nor encoding name string that specifies the internal encoding to be used; ;TI"Hif argument +ext_enc+ is also given, it must be an Encoding object ;TI"Mor encoding name string that specifies the external encoding to be used.;T@o; ; [I"JThe string read from +read_io+ is tagged with the external encoding; ;TI"Hif an internal encoding is also specified, the string is converted ;TI"(to, and tagged with, that encoding.;T@o; ; [I"#If any encoding is specified, ;TI";optional hash arguments specify the conversion option.;T@o; ; [I"/Optional keyword arguments +opts+ specify:;T@o;; ;;[o;;0; [o; ; [I".{Open Options}[rdoc-ref:IO@Open+Options].;To;;0; [o; ; [I"B{Encoding Options}[rdoc-ref:encodings.rdoc@Encoding+Options].;T@o; ; [I"@With no block given, returns the two endpoints in an array:;T@o:RDoc::Markup::Verbatim; [I"+IO.pipe # => [#<IO:fd 4>, #<IO:fd 5>] ;T:@format0o; ; [I"AWith a block given, calls the block with the two endpoints; ;TI">closes both endpoints and returns the value of the block:;T@o;; [I":IO.pipe {|read_io, write_io| p read_io; p write_io } ;T;0o; ; [I"Output:;T@o;; [I"#<IO:fd 6> ;TI"#<IO:fd 7> ;T;0o; ; [I"$Not available on all platforms.;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"Bparent process, the <tt>rd.read</tt> will never return if it ;TI".does not first issue a <tt>wr.close</tt>:;T@o;; [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;0o; ; [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(**opts) -> [read_io, write_io] IO.pipe(enc, **opts) -> [read_io, write_io] IO.pipe(ext_enc, int_enc, **opts) -> [read_io, write_io] IO.pipe(**opts) {|read_io, write_io| ...} -> object IO.pipe(enc, **opts) {|read_io, write_io| ...} -> object IO.pipe(ext_enc, int_enc, **opts) {|read_io, write_io| ...} -> object ;T0[ I" (p1 = v1, p2 = v2, p3 = {});T@sFI"IO;TcRDoc::NormalClass00
[+]
..
[-] raw-i.ri
[edit]
[-] each_byte-i.ri
[edit]
[-] echo%3f-i.ri
[edit]
[-] nonblock-i.ri
[edit]
[-] scroll_forward-i.ri
[edit]
[-] copy_stream-c.ri
[edit]
[-] goto-i.ri
[edit]
[-] erase_line-i.ri
[edit]
[-] readchar-i.ri
[edit]
[+]
EINPROGRESSWaitReadable
[-] write-c.ri
[edit]
[-] getch-i.ri
[edit]
[-] isatty-i.ri
[edit]
[-] readlines-i.ri
[edit]
[-] ioctl-i.ri
[edit]
[-] sysseek-i.ri
[edit]
[-] try_convert-c.ri
[edit]
[+]
EINPROGRESSWaitWritable
[-] readlines-c.ri
[edit]
[-] oflush-i.ri
[edit]
[-] %3c%3c-i.ri
[edit]
[-] binwrite-c.ri
[edit]
[-] eof-i.ri
[edit]
[-] ungetc-i.ri
[edit]
[-] ttyname-i.ri
[edit]
[+]
generic_readable
[-] pwrite-i.ri
[edit]
[-] console_mode-i.ri
[edit]
[-] winsize-i.ri
[edit]
[-] nonblock%3d-i.ri
[edit]
[-] set_encoding_by_bom-i.ri
[edit]
[-] closed%3f-i.ri
[edit]
[-] wait_readable-i.ri
[edit]
[+]
Buffer
[-] sync%3d-i.ri
[edit]
[-] sysread-i.ri
[edit]
[-] each_line-i.ri
[edit]
[-] echo%3d-i.ri
[edit]
[-] raw%21-i.ri
[edit]
[-] cdesc-IO.ri
[edit]
[-] read_nonblock-i.ri
[edit]
[-] rewind-i.ri
[edit]
[-] binmode%3f-i.ri
[edit]
[-] close_on_exec%3f-i.ri
[edit]
[-] write_nonblock-i.ri
[edit]
[+]
generic_writable
[-] expect-i.ri
[edit]
[-] flush-i.ri
[edit]
[-] lineno-i.ri
[edit]
[-] stat-i.ri
[edit]
[-] new-c.ri
[edit]
[-] printf-i.ri
[edit]
[-] cursor_up-i.ri
[edit]
[-] autoclose%3f-i.ri
[edit]
[-] cooked%21-i.ri
[edit]
[-] wait-i.ri
[edit]
[-] getc-i.ri
[edit]
[-] clear_screen-i.ri
[edit]
[-] external_encoding-i.ri
[edit]
[-] readpartial-i.ri
[edit]
[-] seek-i.ri
[edit]
[-] close_read-i.ri
[edit]
[-] getpass-i.ri
[edit]
[-] nread-i.ri
[edit]
[-] tty%3f-i.ri
[edit]
[-] pipe-c.ri
[edit]
[-] read-c.ri
[edit]
[-] sync-i.ri
[edit]
[-] cooked-i.ri
[edit]
[-] erase_screen-i.ri
[edit]
[-] putc-i.ri
[edit]
[+]
ConsoleMode
[-] to_path-i.ri
[edit]
[-] set_encoding-i.ri
[edit]
[-] cursor%3d-i.ri
[edit]
[-] lineno%3d-i.ri
[edit]
[-] close-i.ri
[edit]
[-] select-c.ri
[edit]
[+]
EAGAINWaitWritable
[-] each-i.ri
[edit]
[-] fcntl-i.ri
[edit]
[-] pos-i.ri
[edit]
[-] open-c.ri
[edit]
[-] reopen-i.ri
[edit]
[+]
TimeoutError
[+]
EWOULDBLOCKWaitWritable
[-] readline-i.ri
[edit]
[-] pid-i.ri
[edit]
[-] cursor_right-i.ri
[edit]
[-] wait_writable-i.ri
[edit]
[-] path-i.ri
[edit]
[-] nonblock%3f-i.ri
[edit]
[-] readbyte-i.ri
[edit]
[-] binmode-i.ri
[edit]
[-] ioflush-i.ri
[edit]
[-] puts-i.ri
[edit]
[-] getbyte-i.ri
[edit]
[-] close_on_exec%3d-i.ri
[edit]
[-] each_char-i.ri
[edit]
[-] wait_priority-i.ri
[edit]
[-] goto_column-i.ri
[edit]
[-] to_i-i.ri
[edit]
[-] check_winsize_changed-i.ri
[edit]
[+]
WaitReadable
[-] fsync-i.ri
[edit]
[-] cursor_down-i.ri
[edit]
[-] pos%3d-i.ri
[edit]
[-] pread-i.ri
[edit]
[-] each_codepoint-i.ri
[edit]
[-] pressed%3f-i.ri
[edit]
[-] timeout%3d-i.ri
[edit]
[-] syswrite-i.ri
[edit]
[-] timeout-i.ri
[edit]
[-] gets-i.ri
[edit]
[-] cursor-i.ri
[edit]
[-] ungetbyte-i.ri
[edit]
[-] for_fd-c.ri
[edit]
[-] ready%3f-i.ri
[edit]
[-] winsize%3d-i.ri
[edit]
[-] internal_encoding-i.ri
[edit]
[-] fdatasync-i.ri
[edit]
[-] iflush-i.ri
[edit]
[-] popen-c.ri
[edit]
[-] binread-c.ri
[edit]
[-] read-i.ri
[edit]
[-] sysopen-c.ri
[edit]
[-] beep-i.ri
[edit]
[-] advise-i.ri
[edit]
[-] scroll_backward-i.ri
[edit]
[-] pathconf-i.ri
[edit]
[-] write-i.ri
[edit]
[-] console_mode%3d-i.ri
[edit]
[-] autoclose%3d-i.ri
[edit]
[-] inspect-i.ri
[edit]
[+]
WaitWritable
[-] close_write-i.ri
[edit]
[-] tell-i.ri
[edit]
[-] fileno-i.ri
[edit]
[-] cursor_left-i.ri
[edit]
[+]
EWOULDBLOCKWaitReadable
[-] print-i.ri
[edit]
[-] foreach-c.ri
[edit]
[-] eof%3f-i.ri
[edit]
[-] console-c.ri
[edit]
[-] to_io-i.ri
[edit]
[-] noecho-i.ri
[edit]
[+]
EAGAINWaitReadable