Method: File.link
- Defined in:
- file.c
.link(old_name, new_name) ⇒ 0
2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 |
# File 'file.c', line 2995
static VALUE
rb_file_s_link(VALUE klass, VALUE from, VALUE to)
{
FilePathValue(from);
FilePathValue(to);
from = rb_str_encode_ospath(from);
to = rb_str_encode_ospath(to);
if (link(StringValueCStr(from), StringValueCStr(to)) < 0) {
sys_fail2(from, to);
}
return INT2FIX(0);
}
|