mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/pathname/pathname.c (path_mtime): Pathname#mtime translated from
pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9bf69293e7
commit
dc2676a8a0
3 changed files with 15 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Aug 6 05:53:32 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_mtime): Pathname#mtime translated from
|
||||
pathname.rb.
|
||||
|
||||
Thu Aug 5 22:09:30 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_ctime): Pathname#ctime translated from
|
||||
|
|
|
@ -512,9 +512,6 @@ end
|
|||
|
||||
class Pathname # * File *
|
||||
|
||||
# See <tt>File.mtime</tt>. Returns last modification time.
|
||||
def mtime() File.mtime(@path) end
|
||||
|
||||
# See <tt>File.chmod</tt>. Changes permissions.
|
||||
def chmod(mode) File.chmod(mode, @path) end
|
||||
|
||||
|
|
|
@ -250,6 +250,15 @@ path_ctime(VALUE self)
|
|||
return rb_funcall(rb_cFile, rb_intern("ctime"), 1, get_strpath(self));
|
||||
}
|
||||
|
||||
/*
|
||||
* See <tt>File.mtime</tt>. Returns last modification time.
|
||||
*/
|
||||
static VALUE
|
||||
path_mtime(VALUE self)
|
||||
{
|
||||
return rb_funcall(rb_cFile, rb_intern("mtime"), 1, get_strpath(self));
|
||||
}
|
||||
|
||||
/*
|
||||
* == Pathname
|
||||
*
|
||||
|
@ -452,4 +461,5 @@ Init_pathname()
|
|||
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);
|
||||
rb_define_method(rb_cPathname, "mtime", path_mtime, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue