summaryrefslogtreecommitdiff
path: root/ext/pathname/pathname.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-16 14:48:20 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-16 14:48:20 +0000
commit08c467330ba0bc92150a65a01cd397562a5ea78d (patch)
tree343da50c66c52f71c47b8a6981da38d73c1cd86b /ext/pathname/pathname.c
parent5c1fd225c85157cba69996683a345d8e4a831ba2 (diff)
* ext/pathname/pathname.c (path_opendir): Pathname#opendir translated
from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pathname/pathname.c')
-rw-r--r--ext/pathname/pathname.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index cc1fd8c..92c0955 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -905,6 +905,18 @@ path_rmdir(VALUE self)
}
/*
+ * See <tt>Dir.open</tt>.
+ */
+static VALUE
+path_opendir(VALUE self)
+{
+ VALUE args[1];
+
+ args[0] = get_strpath(self);
+ return rb_block_call(rb_cDir, rb_intern("open"), 1, args, 0, 0);
+}
+
+/*
* == Pathname
*
* Pathname represents a pathname which locates a file in a filesystem.
@@ -1163,4 +1175,5 @@ Init_pathname()
rb_define_method(rb_cPathname, "entries", path_entries, 0);
rb_define_method(rb_cPathname, "mkdir", path_mkdir, -1);
rb_define_method(rb_cPathname, "rmdir", path_rmdir, 0);
+ rb_define_method(rb_cPathname, "opendir", path_opendir, 0);
}