diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-03 21:25:43 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-03 21:25:43 +0000 |
commit | 88e78ac59b042365a09199aa72488405bcbcad95 (patch) | |
tree | ca79f8bf1814d6605c1e62d91ab7e71a1c99c9a0 /ext/pathname | |
parent | 5e9c47c81d986219b1d6c64e4e490179527cd916 (diff) | |
download | ruby-88e78ac59b042365a09199aa72488405bcbcad95.tar.gz |
* 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
Diffstat (limited to 'ext/pathname')
-rw-r--r-- | ext/pathname/lib/pathname.rb | 3 | ||||
-rw-r--r-- | ext/pathname/pathname.c | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb index a89b740638..1a88d5f603 100644 --- a/ext/pathname/lib/pathname.rb +++ b/ext/pathname/lib/pathname.rb @@ -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 diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index d4fd502674..5be73a351b 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -231,6 +231,15 @@ path_realdirpath(int argc, VALUE *argv, VALUE 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 * * Pathname represents a pathname which locates a file in a filesystem. @@ -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); } |