%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/cpanel/ea-ruby24/root/usr/share/ri/system/PTY/
Upload File :
Create Path :
Current File : //opt/cpanel/ea-ruby24/root/usr/share/ri/system/PTY/cdesc-PTY.ri

U:RDoc::NormalModule[iI"PTY:ET@0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"<Creates and managed pseudo terminals (PTYs).  See also ;TI"1http://en.wikipedia.org/wiki/Pseudo_terminal;To:RDoc::Markup::BlankLineo;	;[I"LPTY allows you to allocate new terminals using ::open or ::spawn a new ;TI"&terminal with a specific command.;T@S:RDoc::Markup::Heading:
leveli:	textI"Example;T@o;	;[I"PIn this example we will change the buffering type in the +factor+ command, ;TI":assuming that factor uses stdio for stdout buffering.;T@o;	;[I"RIf IO.pipe is used instead of PTY.open, this code deadlocks because factor's ;TI"stdout is fully buffered.;T@o:RDoc::Markup::Verbatim;[ I"3# start by requiring the standard library PTY
;TI"require 'pty'
;TI"
;TI"master, slave = PTY.open
;TI"read, write = IO.pipe
;TI"3pid = spawn("factor", :in=>read, :out=>slave)
;TI",read.close     # we dont need the read
;TI"#slave.close    # or the slave
;TI"
;TI"'# pipe "42" to the factor command
;TI"write.puts "42"
;TI"'# output the response from factor
;TI"%p master.gets #=> "42: 2 3 7\n"
;TI"
;TI"7# pipe "144" to factor and print out the response
;TI"write.puts "144"
;TI",p master.gets #=> "144: 2 2 2 2 3 3\n"
;TI""write.close # close the pipe
;TI"
;TI"I# The result of read operation when pty slave is closed is platform
;TI"# dependent.
;TI"ret = begin
;TI"4        master.gets     # FreeBSD returns nil.
;TI"5      rescue Errno::EIO # GNU/Linux raises EIO.
;TI"        nil
;TI"      end
;TI"p ret #=> nil
;T:@format0S;;i;
I"License;T@o;;[I"'C) Copyright 1998 by Akinori Ito.
;TI"
;TI"IThis software may be redistributed freely for this purpose, in full
;TI"Hor in part, provided that this entire copyright notice is included
;TI"Non any copies of this software and applications and derivations thereof.
;TI"
;TI"LThis software is provided on an "as is" basis, without warranty of any
;TI"Lkind, either expressed or implied, as to any matter including, but not
;TI"Glimited to warranty of fitness of purpose, or merchantability, or
;TI"0results obtained from use of this software.;T;0:
@fileI"ext/pty/pty.c;T:0@omit_headings_from_table_of_contents_below0;0;0[[[[[I"
class;T[[:public[	[I"
check;TI"ext/pty/pty.c;T[I"getpty;T@V[I"	open;T@V[I"
spawn;T@V[:protected[[:private[[I"
instance;T[[;[[;[[;[[[U:RDoc::Context::Section[i0o;;[;0;0[@J@JcRDoc::TopLevel

Zerion Mini Shell 1.0