class method
File.open
(::string | ::_ToPath | ::int file_name, ?::string | ::int mode, ?::int perm) -> instance
[T] (::string | ::_ToPath | ::int file_name, ?::string | ::int mode, ?::int perm) { (::File) -> T } -> T
File.open(path, mode = 'r', perm = 0666, **opts) → file
File.open(path, mode = 'r', perm = 0666, **opts) {|f| ... } → object
io.c
View on GitHub ↗
static VALUE
rb_io_s_open(int argc, VALUE *argv, VALUE klass)
{
VALUE io = rb_class_new_instance_kw(argc, argv, klass, RB_PASS_CALLED_KEYWORDS);
if (rb_block_given_p()) {
return rb_ensure(rb_yield, io, io_close, io);
}
return io;
}