Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
File::Stat#grpowned?
() -> bool
stat.grpowned? → true or false
file.c
View on GitHub ↗
static VALUE
rb_stat_grpowned(VALUE obj)
{
#ifndef _WIN32
if (rb_group_member(get_stat(obj)->st_gid)) return Qtrue;
#endif
return Qfalse;
}
Returns true if the effective group id of the process is the same as the group id of stat. On Windows, returns false.
Example
File.stat("testfile").grpowned? #=> true File.stat("/etc/passwd").grpowned? #=> false