chmod(p1, *args)
public
Changes permission bits on the named file(s) to the bit pattern represented
by mode_int. Actual effects are operating system dependent (see
the beginning of this section). On Unix systems, see chmod(2) for details. Returns the number of
files processed.
File.chmod(0644, "testfile", "out")
Show source
static VALUE
rb_file_s_chmod(int argc, VALUE *argv)
{
VALUE vmode;
VALUE rest;
int mode;
long n;
rb_secure(2);
rb_scan_args(argc, argv, "1*", &vmode, &rest);
mode = NUM2INT(vmode);
n = apply2files(chmod_internal, rest, &mode);
return LONG2FIX(n);
}