diff options
Diffstat (limited to 'ext/pathname/pathname.c')
-rw-r--r-- | ext/pathname/pathname.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 @@ -325,6 +325,18 @@ path_ftype(VALUE self) } /* + * call-seq: + * pathname.make_link(old) + * + * See <tt>File.link</tt>. 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 * * Pathname represents a pathname which locates a file in a filesystem. @@ -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); } |