Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
File.writable_real?
(::path file_name) -> bool
File.writable_real?(object) → true or false
file.c
View on GitHub ↗
static VALUE
rb_file_writable_real_p(VALUE obj, VALUE fname)
{
return RBOOL(rb_access(fname, W_OK) >= 0);
}
Like File.writable?, but checks against the real owner and group instead of the effective owner and group.
Note that filesystem security features may cause this method to return true even when the object is not writable by the real owner and group.