зеркало из https://github.com/github/ruby.git
* ext/pathname/pathname.c (path_utime): Pathname#utime translated
from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
f214490d90
Коммит
5c55715c08
|
@ -1,3 +1,8 @@
|
|||
Sun Aug 15 00:15:45 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_utime): Pathname#utime translated
|
||||
from pathname.rb.
|
||||
|
||||
Sat Aug 14 21:04:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* thread.c (rb_gc_mark_threads): deprecated.
|
||||
|
|
|
@ -512,9 +512,6 @@ end
|
|||
|
||||
class Pathname # * File *
|
||||
|
||||
# See <tt>File.utime</tt>. Update the access and modification times.
|
||||
def utime(atime, mtime) File.utime(atime, mtime, @path) end
|
||||
|
||||
# See <tt>File.basename</tt>. Returns the last component of the path.
|
||||
def basename(*args) self.class.new(File.basename(@path, *args)) end
|
||||
|
||||
|
|
|
@ -414,6 +414,15 @@ path_truncate(VALUE self, VALUE length)
|
|||
return rb_funcall(rb_cFile, rb_intern("truncate"), 2, get_strpath(self), length);
|
||||
}
|
||||
|
||||
/*
|
||||
* See <tt>File.utime</tt>. Update the access and modification times.
|
||||
*/
|
||||
static VALUE
|
||||
path_utime(VALUE self, VALUE atime, VALUE mtime)
|
||||
{
|
||||
return rb_funcall(rb_cFile, rb_intern("utime"), 3, atime, mtime, get_strpath(self));
|
||||
}
|
||||
|
||||
/*
|
||||
* == Pathname
|
||||
*
|
||||
|
@ -632,4 +641,5 @@ Init_pathname()
|
|||
rb_define_method(rb_cPathname, "lstat", path_lstat, 0);
|
||||
rb_define_method(rb_cPathname, "make_symlink", path_make_symlink, 1);
|
||||
rb_define_method(rb_cPathname, "truncate", path_truncate, 1);
|
||||
rb_define_method(rb_cPathname, "utime", path_utime, 2);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче