summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-06 17:09:31 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-06 17:09:31 +0000
commit9352485e47d878b21441511286e99ff74c4b3ee8 (patch)
treed7482f93ac298fefa064c933f8aa3d044505e34f /ext
parentc4c4bff456a6f0eb28de0b1e6f6d7bfe4d3e5291 (diff)
* ext/pathname/pathname.c (path_lchmod): Pathname#lchmod translated
from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/pathname/lib/pathname.rb3
-rw-r--r--ext/pathname/pathname.c10
2 files changed, 10 insertions, 3 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 1f83275911..7e3d453e66 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -512,9 +512,6 @@ end
class Pathname # * File *
- # See <tt>File.lchmod</tt>.
- def lchmod(mode) File.lchmod(mode, @path) end
-
# See <tt>File.chown</tt>. Change owner and group of file.
def chown(owner, group) File.chown(owner, group, @path) end
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index 1fae923380..0a3b6771c4 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -269,6 +269,15 @@ path_chmod(VALUE self, VALUE mode)
}
/*
+ * See <tt>File.lchmod</tt>.
+ */
+static VALUE
+path_lchmod(VALUE self, VALUE mode)
+{
+ return rb_funcall(rb_cFile, rb_intern("lchmod"), 2, mode, get_strpath(self));
+}
+
+/*
* == Pathname
*
* Pathname represents a pathname which locates a file in a filesystem.
@@ -472,4 +481,5 @@ Init_pathname()
rb_define_method(rb_cPathname, "ctime", path_ctime, 0);
rb_define_method(rb_cPathname, "mtime", path_mtime, 0);
rb_define_method(rb_cPathname, "chmod", path_chmod, 1);
+ rb_define_method(rb_cPathname, "lchmod", path_lchmod, 1);
}