aboutsummaryrefslogtreecommitdiffstats
path: root/ext/pathname/pathname.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-14 15:16:19 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-14 15:16:19 +0000
commit5c55715c089f189ec1004b13de6ec6f95d9ba0af (patch)
treeae7911e847c2a31bea49a6aaa90e1cdfdb99ae8e /ext/pathname/pathname.c
parentf214490d90b1e813114fcfde84555e15335e9794 (diff)
downloadruby-5c55715c089f189ec1004b13de6ec6f95d9ba0af.tar.gz
* 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
Diffstat (limited to 'ext/pathname/pathname.c')
-rw-r--r--ext/pathname/pathname.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index a1d260f3ad..ca7377c85a 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -415,6 +415,15 @@ path_truncate(VALUE self, VALUE 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
*
* Pathname represents a pathname which locates a file in a filesystem.
@@ -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);
}