Skip to content

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

class method

File.owned?

File.owned?(file_name) → true or false

Returns true if the named file exists and the effective used id of the calling process is the owner of the file.

file_name can be an IO object.

See also .open .path .new .pipe? also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0