Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Pathname#grpowned?

() -> bool
grpowned? → true or false

Returns false on Windows.

On other systems, returns whether the effective group id of the calling process is the owner of the entry at the path in self:

Example
# => "/tmp/t.tmp"
File.write(filepath, 'foo')
Pathname(filepath).grpowned?      # => true
Pathname('/etc').grpowned?        # => false
Pathname('/etc/passwd').grpowned? # => false
Pathname('nosuch').grpowned?      # => false
File.delete(filepath)             # Clean up.
See also #glob #has_trailing_separator? #ftype #join also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0