U:RDoc::NormalClass[iI"IO:ET@I"Object;To:RDoc::Markup::Document:@parts[
o;;[ :
@fileI"ext/io/console/console.c;T:0@omit_headings_from_table_of_contents_below0o;;[o:RDoc::Markup::Paragraph;[I"SExpect library adds the IO instance method #expect, which does similar act to ;TI"tcl's expect extension.;To:RDoc::Markup::BlankLine o;;[I":In order to use this method, you must require expect:;T@o:RDoc::Markup::Verbatim;[I"require 'expect'
;T:@format0o;;[I""Please see #expect for usage.;T; I"ext/pty/lib/expect.rb;T;
0o;;[!o;;[I"AThe IO class is the basis for all input and output in Ruby. ;TI"JAn I/O stream may be duplexed (that is, bidirectional), and ;TI"=so may use more than one native operating system stream.;T@o;;[ I"PMany of the examples in this section use the File class, the only standard ;TI"Lsubclass of IO. The two classes are closely associated. Like the File ;TI"Hclass, the Socket library subclasses from IO (such as TCPSocket or ;TI"UDPSocket).;T@o;;[I"NThe Kernel#open method can create an IO (or File) object for these types ;TI"of arguments:;T@o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o;;[I"FA plain string represents a filename suitable for the underlying ;TI"operating system.;T@o;;0;[o;;[ I"EA string starting with "|"
indicates a subprocess. ;TI"CThe remainder of the string following the "|"
is ;TI"Ainvoked as a process with appropriate input/output channels ;TI"connected to it.;T@o;;0;[o;;[I"BA string equal to "|-"
will create another Ruby ;TI"instance as a subprocess.;T@o;;[I"PThe IO may be opened with different file modes (read-only, write-only) and ;TI"Jencodings for proper conversion. See IO.new for these options. See ;TI"LKernel#open for details of the various command formats described above.;T@o;;[I"HIO.popen, the Open3 library, or Process#spawn may also be used to ;TI"1communicate with subprocesses through an IO.;T@o;;[
I"DRuby will convert pathnames between different operating system ;TI"Econventions if possible. For instance, on a Windows system the ;TI"Cfilename "/gumby/ruby/test.rb"
will be opened as ;TI"J"\gumby\ruby\test.rb"
. When specifying a Windows-style ;TI"Cfilename in a Ruby string, remember to escape the backslashes:;T@o;
;[I" "C:\\gumby\\ruby\\test.rb"
;T;0o;;[I"@Our examples here will use the Unix-style forward slashes; ;TI"LFile::ALT_SEPARATOR can be used to get the platform-specific separator ;TI"character.;T@o;;[
I"OThe global constant ARGF (also accessible as $<
) provides an ;TI"FIO-like stream which allows access to all files mentioned on the ;TI"Pcommand line (or STDIN if no files are mentioned). ARGF#path and its alias ;TI"OARGF#filename are provided to access the name of the file currently being ;TI"
read.;T@S:RDoc::Markup::Heading:
leveli: textI"io/console;T@o;;[I"HThe io/console extension provides methods for interacting with the ;TI"Kconsole. The console can be accessed from IO.console or the standard ;TI"#input/output/error IO objects.;T@o;;[I"5Requiring io/console adds the following methods:;T@o;;;;[o;;0;[o;;[I"IO::console;To;;0;[o;;[I"IO#raw;To;;0;[o;;[I"IO#raw!;To;;0;[o;;[I"IO#cooked;To;;0;[o;;[I"IO#cooked!;To;;0;[o;;[I"
IO#getch;To;;0;[o;;[I"
IO#echo=;To;;0;[o;;[I"
IO#echo?;To;;0;[o;;[I"IO#noecho;To;;0;[o;;[I"IO#winsize;To;;0;[o;;[I"IO#winsize=;To;;0;[o;;[I"IO#iflush;To;;0;[o;;[I"IO#ioflush;To;;0;[o;;[I"IO#oflush;T@o;;[I"
Example:;T@o;
;[I"require 'io/console'
;TI"%rows, columns = $stdout.winsize
;TI";puts "Your screen is #{columns} wide and #{rows} tall";T;0; I" io.c;T;
0o;;[ ; I"lib/scanf.rb;T;
0o;;[ ; I"prelude.rb;T;
0; 0;
0[ [U:RDoc::Constant[i I"EWOULDBLOCKWaitReadable;TI" IO::EWOULDBLOCKWaitReadable;T00o;;[o;;[I"EAGAINWaitReadable;T@; @º;
0@º@cRDoc::NormalClass0U;[i I"EWOULDBLOCKWaitWritable;TI" IO::EWOULDBLOCKWaitWritable;T00o;;[o;;[I"EAGAINWaitWritable;T@; @º;
0@º@@Ì0U;[i I"
SEEK_SET;TI"IO::SEEK_SET;T00o;;[o;;[I"(Set I/O position from the beginning;T@; @º;
0@º@@Ì0U;[i I"
SEEK_CUR;TI"IO::SEEK_CUR;T00o;;[o;;[I"/Set I/O position from the current position;T@; @º;
0@º@@Ì0U;[i I"
SEEK_END;TI"IO::SEEK_END;T00o;;[o;;[I""Set I/O position from the end;T@; @º;
0@º@@Ì0U;[i I"SEEK_DATA;TI"IO::SEEK_DATA;T00o;;[o;;[I":Set I/O position to the next location containing data;T@; @º;
0@º@@Ì0U;[i I"SEEK_HOLE;TI"IO::SEEK_HOLE;T00o;;[o;;[I"&Set I/O position to the next hole;T@; @º;
0@º@@Ì0[[I"File::Constants;To;;[ ; I"file.c;T;
0I"file.c;T[I"Enumerable;To;;[ ; @º;
0I" io.c;T[[I"
class;T[[:public[[I"binread;T@[I"
binwrite;T@[I"console;TI"ext/io/console/console.c;T[I"copy_stream;T@[I"for_fd;T@[I"foreach;T@[I"new;T@[I" open;T@[I" pipe;T@[I"
popen;T@[I" read;T@[I"readlines;T@[I"select;T@[I"sysopen;T@[I"try_convert;T@[I"
write;T@[:protected[ [:private[ [I"
instance;T[[;[i[I"<<;T@[I"advise;T@[I"autoclose=;T@[I"autoclose?;T@[I" beep;T@[I"binmode;T@[I"
binmode?;T@[I"
bytes;T@[I"
chars;T@[I"
close;T@[I"close_on_exec=;T@[I"close_on_exec?;T@[I"close_read;T@[I"close_write;T@[I"closed?;T@[I"codepoints;T@[I"cooked;T@[I"cooked!;T@[I"cursor;T@[I"cursor=;T@[I" each;T@[I"each_byte;T@[I"each_char;T@[I"each_codepoint;T@[I"each_line;T@[I"
echo=;T@[I"
echo?;T@[I"eof;T@[I" eof?;T@[I"expect;FI"ext/pty/lib/expect.rb;T[I"external_encoding;T@[I"
fcntl;T@[I"fdatasync;T@[I"fileno;T@[I"
flush;T@[I"
fsync;T@[I"getbyte;T@[I" getc;T@[I"
getch;T@[I"getpass;T@[I" gets;T@[I" goto;T@[I"iflush;T@[I"inspect;T@[I"internal_encoding;T@[I"
ioctl;T@[I"ioflush;T@[I"isatty;T@[I"lineno;T@[I"lineno=;T@[I"
lines;T@[I"noecho;T@[I"
nonblock;TI"ext/io/nonblock/nonblock.c;T[I"nonblock=;T@ª[I"nonblock?;T@ª[I"
nread;TI"ext/io/wait/wait.c;T[I"oflush;T@[I"
pathconf;TI"ext/etc/etc.c;T[I"pid;T@[I"pos;T@[I" pos=;T@[I"
pressed?;T@[I"
print;T@[I"printf;T@[I" putc;T@[I" puts;T@[I"raw;T@[I" raw!;T@[I" read;T@[I"read_nonblock;FI"prelude.rb;T[I"
readbyte;T@[I"
readchar;T@[I"
readline;T@[I"readlines;T@[I"readpartial;T@[I"ready?;T@±[I"reopen;T@[I"rewind;T@[I"
scanf;FI"lib/scanf.rb;T[I" seek;T@[I"set_encoding;T@[I" stat;T@ [I" sync;T@[I"
sync=;T@[I"sysread;T@[I"sysseek;T@[I"
syswrite;T@[I" tell;T@[I" to_i;T@[I"
to_io;T@[I" tty?;T@[I"ungetbyte;T@[I"ungetc;T@[I" wait;T@±[I"wait_readable;T@±[I"wait_writable;T@±[I"winsize;T@[I"
winsize=;T@[I"
write;T@[I"write_nonblock;F@Ï[;[ [;[[I"block_scanf;F@â[I"soak_up_spaces;F@â[ [U:RDoc::Context::Section[i 0o;;[ ; 0;
0[I"ext/etc/etc.c;T@
I"ext/io/nonblock/nonblock.c;TI"ext/io/wait/wait.c;T@@@ºI"lib/csv.rb;TI"lib/net/ftp.rb;TI"'lib/rubygems/package/tar_reader.rb;T@½I" lib/webrick/httpresponse.rb;TI"*lib/webrick/httpservlet/cgihandler.rb;TI"+lib/webrick/httpservlet/filehandler.rb;T@À@ÀcRDoc::TopLevel