Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Pathname#owned?
() -> bool
owned? → true or false
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/pathname_builtin.rb, line 2503
def owned?() FileTest.owned?(@path) end
Returns whether the entry at the path represented by self exists and is owned by the user of the current process:
Example
pn = Pathname('doc/t.tmp') pn.write('foo') pn.owned? # => true pn.delete # Clean up. pn = Pathname('doc/tmp') pn.mkdir pn.owned? # => true pn.rmdir # Clean up. Pathname('/etc').owned? # => false