End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
File::Stat#setgid?
stat.setgid? → true or false
file.c
View on GitHub ↗
static VALUE
rb_stat_sgid(VALUE obj)
{
#ifdef S_ISGID
if (get_stat(obj)->st_mode & S_ISGID) return Qtrue;
#endif
return Qfalse;
}
Returns true if stat has the set-group-id permission bit set, false if it doesn’t or if the operating system doesn’t support this feature.
Example
File.stat("/usr/sbin/lpc").setgid? #=> true