D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
File
/
Filename :
new-c.ri
back
Copy
U:RDoc::AnyMethod[iI"new:ETI"File::new;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"GOpens the file at the given +path+ according to the given +mode+; ;TI"9creates and returns a new File object for that file.;To:RDoc::Markup::BlankLine o; ; [I"EThe new File object is buffered mode (or non-sync mode), unless ;TI"+filename+ is a tty. ;TI"8See IO#flush, IO#fsync, IO#fdatasync, and IO#sync=.;T@o; ; [I"/Argument +path+ must be a valid file path:;T@o:RDoc::Markup::Verbatim; [ I" f = File.new('/etc/fstab') ;TI" f.close ;TI"f = File.new('t.txt') ;TI" f.close ;T:@format0o; ; [I"KOptional argument +mode+ (defaults to 'r') must specify a valid mode; ;TI"4see {Access Modes}[rdoc-ref:File@Access+Modes]:;T@o;; [ I" f = File.new('t.tmp', 'w') ;TI" f.close ;TI")f = File.new('t.tmp', File::RDONLY) ;TI" f.close ;T; 0o; ; [I"POptional argument +perm+ (defaults to 0666) must specify valid permissions ;TI"<see {File Permissions}[rdoc-ref:File@File+Permissions]:;T@o;; [ I".f = File.new('t.tmp', File::CREAT, 0644) ;TI" f.close ;TI".f = File.new('t.tmp', File::CREAT, 0444) ;TI" f.close ;T; 0o; ; [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].;T: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"=File.new(path, mode = 'r', perm = 0666, **opts) -> file ;T0[ I"$(p1, p2 = v2, p3 = v3, p4 = {});T@AFI" File;TcRDoc::NormalClass00