class method
File.writable?
(::string | ::_ToPath file_name) -> bool
File.writable?(file_name) → true or false
file.c
View on GitHub ↗
static VALUE
rb_file_writable_p(VALUE obj, VALUE fname)
{
return RBOOL(rb_eaccess(fname, W_OK) >= 0);
}
Returns true if the named file is writable by the effective user and group id of this process. See eaccess(3).
Note that some OS-level security features may cause this to return true even though the file is not writable by the effective user/group.
See also
.world_writable?
.writable_real?
.world_readable?
.zero?
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0