Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

File.writable_real?

(::string | ::_ToPath file_name) -> bool
File.writable_real?(file_name) → true or false

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.

See also .writable? .zero? .world_writable? #atime also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0