1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/pathname/pathname.c (path_stat): Pathname#stat translated

from pathname.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-08-10 21:19:01 +00:00
parent bbb5a6d6f7
commit e5215bfdc5
3 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Wed Aug 11 06:18:20 2010 Tanaka Akira <akr@fsij.org>
* ext/pathname/pathname.c (path_stat): Pathname#stat translated
from pathname.rb.
Tue Aug 10 21:18:04 2010 Tadayoshi Funaba <tadf@dotrb.org> Tue Aug 10 21:18:04 2010 Tadayoshi Funaba <tadf@dotrb.org>
* complex.c (nucomp_to_[ifr]): don't allow complex with in-exact * complex.c (nucomp_to_[ifr]): don't allow complex with in-exact

View file

@ -512,9 +512,6 @@ end
class Pathname # * File * class Pathname # * File *
# See <tt>File.stat</tt>. Returns a <tt>File::Stat</tt> object.
def stat() File.stat(@path) end
# See <tt>File.lstat</tt>. # See <tt>File.lstat</tt>.
def lstat() File.lstat(@path) end def lstat() File.lstat(@path) end

View file

@ -375,6 +375,15 @@ path_rename(VALUE self, VALUE to)
return rb_funcall(rb_cFile, rb_intern("rename"), 2, get_strpath(self), to); return rb_funcall(rb_cFile, rb_intern("rename"), 2, get_strpath(self), to);
} }
/*
* See <tt>File.stat</tt>. Returns a <tt>File::Stat</tt> object.
*/
static VALUE
path_stat(VALUE self)
{
return rb_funcall(rb_cFile, rb_intern("stat"), 1, get_strpath(self));
}
/* /*
* == Pathname * == Pathname
* *
@ -589,4 +598,5 @@ Init_pathname()
rb_define_method(rb_cPathname, "open", path_open, -1); rb_define_method(rb_cPathname, "open", path_open, -1);
rb_define_method(rb_cPathname, "readlink", path_readlink, 0); rb_define_method(rb_cPathname, "readlink", path_readlink, 0);
rb_define_method(rb_cPathname, "rename", path_rename, 1); rb_define_method(rb_cPathname, "rename", path_rename, 1);
rb_define_method(rb_cPathname, "stat", path_stat, 0);
} }