D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
/
Filename :
readlines-c.ri
back
Copy
U:RDoc::AnyMethod[iI"readlines:ETI"IO::readlines;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"8Returns an array of all lines read from the stream.;To:RDoc::Markup::BlankLine o; ; [I"=When called from class \IO (but not subclasses of \IO), ;TI"Xthis method has potential security vulnerabilities if called with untrusted input; ;TI">see {Command Injection}[rdoc-ref:command_injection.rdoc].;T@o; ; [I"DThe first argument must be a string that is the path to a file.;T@o; ; [I"VWith only argument +path+ given, parses lines from the file at the given +path+, ;TI"2as determined by the default line separator, ;TI")and returns those lines in an array:;T@o:RDoc::Markup::Verbatim; [I"IO.readlines('t.txt') ;TI"S# => ["First line\n", "Second line\n", "\n", "Third line\n", "Fourth line\n"] ;T:@format0o; ; [I"RWith argument +sep+ given, parses lines as determined by that line separator ;TI"8(see {Line Separator}[rdoc-ref:IO@Line+Separator]):;T@o;; [I"# Ordinary separator. ;TI"!IO.readlines('t.txt', 'li') ;TI"R# =>["First li", "ne\nSecond li", "ne\n\nThird li", "ne\nFourth li", "ne\n"] ;TI"!# Get-paragraphs separator. ;TI"IO.readlines('t.txt', '') ;TI"G# => ["First line\nSecond line\n\n", "Third line\nFourth line\n"] ;TI"# Get-all separator. ;TI" IO.readlines('t.txt', nil) ;TI"C# => ["First line\nSecond line\n\nThird line\nFourth line\n"] ;T; 0o; ; [I"LWith argument +limit+ given, parses lines as determined by the default ;TI"4line separator and the given line-length limit ;TI"`(see {Line Separator}[rdoc-ref:IO@Line+Separator] and {Line Limit}[rdoc-ref:IO@Line+Limit]:;T@o;; [I"IO.readlines('t.txt', 7) ;TI"c# => ["First l", "ine\n", "Second ", "line\n", "\n", "Third l", "ine\n", "Fourth ", "line\n"] ;T; 0o; ; [I"-With arguments +sep+ and +limit+ given, ;TI" combines the two behaviors ;TI"V(see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit]).;T@o; ; [I"/Optional keyword arguments +opts+ specify:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I".{Open Options}[rdoc-ref:IO@Open+Options].;To;;0; [o; ; [I"B{Encoding options}[rdoc-ref:encodings.rdoc@Encoding+Options].;To;;0; [o; ; [I"){Line Options}[rdoc-ref:IO@Line+IO].;T: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"�IO.readlines(path, sep = $/, **opts) -> array IO.readlines(path, limit, **opts) -> array IO.readlines(path, sep, limit, **opts) -> array ;T0[ I"$(p1, p2 = v2, p3 = v3, p4 = {});T@QFI"IO;TcRDoc::NormalClass00