lchown(p1, p2, *args)
public
Equivalent to File::chown, but does not follow symbolic links (so it will
change the owner associated with the link, not the file referenced by the
link). Often not available. Returns
number of files in the argument list.
Show source
static VALUE
rb_file_s_lchown(int argc, VALUE *argv)
{
VALUE o, g, rest;
struct chown_args arg;
long n;
rb_secure(2);
rb_scan_args(argc, argv, "2*", &o, &g, &rest);
if (NIL_P(o)) {
arg.owner = -1;
}
else {
arg.owner = NUM2UIDT(o);
}
if (NIL_P(g)) {
arg.group = -1;
}
else {
arg.group = NUM2GIDT(g);
}
n = apply2files(lchown_internal, rest, &arg);
return LONG2FIX(n);
}