From 239692dde86f19c9a13bace56082b1c290b1d7e9 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 8 Aug 2010 10:29:16 +0000 Subject: * ext/pathname/pathname.c (path_make_link): Pathname#make_link translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/pathname/pathname.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ext/pathname/pathname.c') diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index 4ed17f4efd..fb023f334e 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -324,6 +324,18 @@ path_ftype(VALUE self) return rb_funcall(rb_cFile, rb_intern("ftype"), 1, get_strpath(self)); } +/* + * call-seq: + * pathname.make_link(old) + * + * See File.link. Creates a hard link at _pathname_. + */ +static VALUE +path_make_link(VALUE self, VALUE old) +{ + return rb_funcall(rb_cFile, rb_intern("link"), 2, old, get_strpath(self)); +} + /* * == Pathname * @@ -534,4 +546,5 @@ Init_pathname() rb_define_method(rb_cPathname, "fnmatch", path_fnmatch, -1); rb_define_method(rb_cPathname, "fnmatch?", path_fnmatch, -1); rb_define_method(rb_cPathname, "ftype", path_ftype, 0); + rb_define_method(rb_cPathname, "make_link", path_make_link, 1); } -- cgit v1.2.3