method
new
new(*args)
public
Opens the file named by filename according to mode (default is “r”) and returns a new File object.
Parameters
See the description of class IO for a description of mode. The file mode may optionally be specified as a Fixnum by or-ing together the flags (O_RDONLY etc, again described under IO).
Optional permission bits may be given in perm. These mode and permission bits are platform dependent; on Unix systems, see open(2) for details.
Optional opt parameter is same as in <code.IO.open.
Examples
f = File.new("testfile", "r") f = File.new("newfile", "w+") f = File.new("newfile", File::CREAT|File::TRUNC|File::RDWR, 0644)
Register or
log in
to add new notes.
sshaw -
April 21, 2010
0 thanks
webmat -
February 23, 2013
0 thanks