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_atime): Pathname#atime translated from

pathname.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-08-03 21:25:43 +00:00
parent 5e9c47c81d
commit 88e78ac59b
3 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Wed Aug 4 06:25:04 2010 Tanaka Akira <akr@fsij.org>
* ext/pathname/pathname.c (path_atime): Pathname#atime translated from
pathname.rb.
Tue Aug 3 21:16:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* random.c (Init_Random): add Random::DEFAULT.

View file

@ -512,9 +512,6 @@ end
class Pathname # * File *
# See <tt>File.atime</tt>. Returns last access time.
def atime() File.atime(@path) end
# See <tt>File.ctime</tt>. Returns last (directory entry, not file) change time.
def ctime() File.ctime(@path) end

View file

@ -230,6 +230,15 @@ path_realdirpath(int argc, VALUE *argv, VALUE self)
return rb_class_new_instance(1, &str, rb_obj_class(self));
}
/*
* See <tt>File.atime</tt>. Returns last access time.
*/
static VALUE
path_atime(VALUE self)
{
return rb_funcall(rb_cFile, rb_intern("atime"), 1, get_strpath(self));
}
/*
* == Pathname
*
@ -430,4 +439,5 @@ Init_pathname()
rb_define_method(rb_cPathname, "sub_ext", path_sub_ext, 1);
rb_define_method(rb_cPathname, "realpath", path_realpath, -1);
rb_define_method(rb_cPathname, "realdirpath", path_realdirpath, -1);
rb_define_method(rb_cPathname, "atime", path_atime, 0);
}