summaryrefslogtreecommitdiff
path: root/ext/pathname/pathname.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-12 21:46:04 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-12 21:46:04 +0000
commita335ded4c9c9a47f5425fea1795eda918f457b5c (patch)
treeb3f666795dca08c5fd4bd66f592f7e27f4e87df7 /ext/pathname/pathname.c
parentd50b19ff275aa3332c1b99f857e15f49ca4d39d3 (diff)
* ext/pathname/pathname.c (path_writable_real_p):
Pathname#writable_real? translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29235 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 076aa6a..61cf9d8 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -796,6 +796,15 @@ path_world_writable_p(VALUE self)
}
/*
+ * See <tt>FileTest.writable_real?</tt>.
+ */
+static VALUE
+path_writable_real_p(VALUE self)
+{
+ return rb_funcall(rb_mFileTest, rb_intern("writable_real?"), 1, get_strpath(self));
+}
+
+/*
* == Pathname
*
* Pathname represents a pathname which locates a file in a filesystem.
@@ -1046,4 +1055,5 @@ Init_pathname()
rb_define_method(rb_cPathname, "symlink?", path_symlink_p, 0);
rb_define_method(rb_cPathname, "writable?", path_writable_p, 0);
rb_define_method(rb_cPathname, "world_writable?", path_world_writable_p, 0);
+ rb_define_method(rb_cPathname, "writable_real?", path_writable_real_p, 0);
}