mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/pathname/pathname.c (path_ctime): Pathname#ctime translated from
pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5ffe59faf8
commit
9bf69293e7
3 changed files with 17 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Aug 5 22:09:30 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_ctime): Pathname#ctime translated from
|
||||
pathname.rb.
|
||||
|
||||
Thu Aug 5 21:20:31 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* compile.c (NODE_ARGSCAT, NODE_ARGSPUSH): drop unused ARGSCAT
|
||||
|
|
|
@ -512,9 +512,6 @@ end
|
|||
|
||||
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
|
||||
|
||||
|
|
|
@ -198,6 +198,8 @@ path_sub_ext(VALUE self, VALUE repl)
|
|||
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.
|
||||
|
@ -239,6 +241,15 @@ path_atime(VALUE self)
|
|||
return rb_funcall(rb_cFile, rb_intern("atime"), 1, get_strpath(self));
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
|
@ -440,4 +451,5 @@ Init_pathname()
|
|||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue