/* * call-seq: * File.symlink(old_name, new_name) => 0 * * Creates a symbolic link called <i>new_name</i> for the existing file * <i>old_name</i>. Raises a <code>NotImplemented</code> exception on * platforms that do not support symbolic links. * * File.symlink("testfile", "link2test") #=> 0 * */ static VALUE rb_file_s_symlink(klass, from, to) VALUE klass, from, to; { #ifdef HAVE_SYMLINK SafeStringValue(from); SafeStringValue(to); if (symlink(StringValueCStr(from), StringValueCStr(to)) < 0) { sys_fail2(from, to); } return INT2FIX(0); #else rb_notimplement(); return Qnil; /* not reached */ #endif }