Project

General

Profile

Bug #470 » file-open.diff

yugui (Yuki Sonoda), 08/22/2008 09:57 PM

View differences:

io.c
/*
* call-seq:
* File.new(filename, mode="r") => file
* File.new(filename [, mode [, perm]]) => file
* File.new(filename, mode="r") => file
* File.new(filename [, mode [, perm]]) => file
* File.open(filename, mode="r") => file
* File.open(filename, mode="r") {|f| block } => obj
* File.open(filename [, mode [, perm]]) => file
* File.open(filename [, mode [, perm]]) {|f| block } => obj
*
* Opens the file named by _filename_ according to
......
* bits are platform dependent; on Unix systems, see
* <code>open(2)</code> for details.
*
* With no associated block, <code>open</code> is a synonym for
* <code>File::new</code>.
* If the optional code block is given, it will
* be passed <i>f</i> as an argument, and the File object will
* automatically be closed when the block terminates. In this instance,
* <code>File::open</code> returns the value of the block.
*
* f = File.new("testfile", "r")
* f = File.new("newfile", "w+")
* f = File.new("newfile", File::CREAT|File::TRUNC|File::RDWR, 0644)
    (1-1/1)