D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
/
Filename :
ungetc-i.ri
back
Copy
U:RDoc::AnyMethod[iI"ungetc:ETI"IO#ungetc;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"GPushes back ("unshifts") the given data onto the stream's buffer, ;TI"Dplacing the data so that it is next to be read; returns +nil+. ;TI"2See {Character IO}[rdoc-ref:IO@Character+IO].;To:RDoc::Markup::BlankLine o; ; [I"Note that:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"QCalling the method has no effect with unbuffered reads (such as IO#sysread).;To;;0; [o; ; [I"ACalling #rewind on the stream discards the pushed-back data.;T@o; ; [I"MWhen argument +integer+ is given, interprets the integer as a character:;T@o:RDoc::Markup::Verbatim; [ I" File.write('t.tmp', '012') ;TI"f = File.open('t.tmp') ;TI"!f.ungetc(0x41) # => nil ;TI"$f.read # => "A012" ;TI"f.rewind ;TI"!f.ungetc(0x0442) # => nil ;TI""f.getc.ord # => 1090 ;TI" f.close ;T:@format0o; ; [I":When argument +string+ is given, uses all characters:;T@o;; [I" File.write('t.tmp', '012') ;TI"f = File.open('t.tmp') ;TI"!f.ungetc('A') # => nil ;TI"f.read # => "A012" ;TI"f.rewind ;TI"3f.ungetc("\u0442\u0435\u0441\u0442") # => nil ;TI"f.getc.ord # => 1090 ;TI"f.getc.ord # => 1077 ;TI"f.getc.ord # => 1089 ;TI"f.getc.ord # => 1090 ;TI"f.close;T;0: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"3ungetc(integer) -> nil ungetc(string) -> nil ;T0[ I" (p1);T@=FI"IO;TcRDoc::NormalClass00