ruby-changes:16882
From: akr <ko1@a...>
Date: Thu, 5 Aug 2010 22:10:09 +0900 (JST)
Subject: [ruby-changes:16882] Ruby:r28878 (trunk): * ext/pathname/pathname.c (path_ctime): Pathname#ctime translated from
akr 2010-08-05 22:09:53 +0900 (Thu, 05 Aug 2010) New Revision: 28878 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28878 Log: * ext/pathname/pathname.c (path_ctime): Pathname#ctime translated from pathname.rb. Modified files: trunk/ChangeLog trunk/ext/pathname/lib/pathname.rb trunk/ext/pathname/pathname.c Index: ChangeLog =================================================================== --- ChangeLog (revision 28877) +++ ChangeLog (revision 28878) @@ -1,3 +1,8 @@ +Thu Aug 5 22:09:30 2010 Tanaka Akira <akr@f...> + + * ext/pathname/pathname.c (path_ctime): Pathname#ctime translated from + pathname.rb. + Thu Aug 5 21:20:31 2010 Yusuke Endoh <mame@t...> * compile.c (NODE_ARGSCAT, NODE_ARGSPUSH): drop unused ARGSCAT Index: ext/pathname/lib/pathname.rb =================================================================== --- ext/pathname/lib/pathname.rb (revision 28877) +++ ext/pathname/lib/pathname.rb (revision 28878) @@ -512,9 +512,6 @@ class Pathname # * File * - # See <tt>File.ctime</tt>. Returns last (directory entry, not file) change time. - def ctime() File.ctime(@path) end - # See <tt>File.mtime</tt>. Returns last modification time. def mtime() File.mtime(@path) end Index: ext/pathname/pathname.c =================================================================== --- ext/pathname/pathname.c (revision 28877) +++ ext/pathname/pathname.c (revision 28878) @@ -198,6 +198,8 @@ return rb_class_new_instance(1, &str2, rb_obj_class(self)); } +/* Facade for File */ + /* * Returns the real (absolute) pathname of +self+ in the actual * filesystem not containing symlinks or useless dots. @@ -240,6 +242,15 @@ } /* + * See <tt>File.ctime</tt>. Returns last (directory entry, not file) change time. + */ +static VALUE +path_ctime(VALUE self) +{ + return rb_funcall(rb_cFile, rb_intern("ctime"), 1, get_strpath(self)); +} + +/* * == Pathname * * Pathname represents a pathname which locates a file in a filesystem. @@ -440,4 +451,5 @@ 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); + rb_define_method(rb_cPathname, "ctime", path_ctime, 0); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/