From 0f070a1f4bb6227cb0a18b1e6dab6e5f972a1c9b Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 10 Sep 2010 21:54:24 +0000 Subject: * ext/pathname/pathname.c (path_symlink_p): Pathname#symlink? translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/pathname/pathname.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ext/pathname/pathname.c') diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index ff3588c7f3..14b745c164 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -768,6 +768,15 @@ path_sticky_p(VALUE self) return rb_funcall(rb_mFileTest, rb_intern("sticky?"), 1, get_strpath(self)); } +/* + * See FileTest.symlink?. + */ +static VALUE +path_symlink_p(VALUE self) +{ + return rb_funcall(rb_mFileTest, rb_intern("symlink?"), 1, get_strpath(self)); +} + /* * == Pathname * @@ -1016,4 +1025,5 @@ Init_pathname() rb_define_method(rb_cPathname, "size", path_size, 0); rb_define_method(rb_cPathname, "size?", path_size_p, 0); rb_define_method(rb_cPathname, "sticky?", path_sticky_p, 0); + rb_define_method(rb_cPathname, "symlink?", path_symlink_p, 0); } -- cgit v1.2.3