Method: File.writable_real?

Defined in:
file.c

.writable_real?(file_name) ⇒ Boolean

Returns true if the named file is writable by the real user and group id of this process. See access(3).

Note that some OS-level security features may cause this to return true even though the file is not writable by the real user/group.

Returns:

  • (Boolean)


1886
1887
1888
1889
1890
1891
# File 'file.c', line 1886

static VALUE
rb_file_writable_real_p(VALUE obj, VALUE fname)
{
    if (rb_access(fname, W_OK) < 0) return Qfalse;
    return Qtrue;
}