Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Pathname#setuid?
() -> bool
setuid? → true or false
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/pathname_builtin.rb, line 2579
def setuid?() FileTest.setuid?(@path) end
Returns whether the setuid bit is set in the special bits for the entry at the path in self:
Example
pn = Pathname('doc/t.tmp') pn.write('foo') mode = pn.stat.mode.to_s(8) # => "100664" pn.setuid? # => false pn.chmod(0o4644) # Set the bit. mode = pn.stat.mode.to_s(8) # => "104644" pn.setuid? # => true pn.delete # Clean up.
On Windows, the bit is never set; the method always returns false.