D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
/
Filename :
rewind-i.ri
back
Copy
U:RDoc::AnyMethod[iI"rewind:ETI"IO#rewind;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [ I".Repositions the stream to its beginning, ;TI"<setting both the position and the line number to zero; ;TI"*see {Position}[rdoc-ref:IO@Position] ;TI"0and {Line Number}[rdoc-ref:IO@Line+Number]:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"f = File.open('t.txt') ;TI"f.tell # => 0 ;TI"f.lineno # => 0 ;TI"$f.gets # => "First line\n" ;TI"f.tell # => 12 ;TI"f.lineno # => 1 ;TI"f.rewind # => 0 ;TI"f.tell # => 0 ;TI"f.lineno # => 0 ;TI" f.close ;T:@format0o; ; [I"XNote that this method cannot be used with streams such as pipes, ttys, and sockets.;T: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"rewind -> 0 ;T0[ I"();T@!FI"IO;TcRDoc::NormalClass00