Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
File::Stat#gid
() -> ::Integer
gid → integer
file.c
View on GitHub ↗
static VALUE
rb_stat_gid(VALUE self)
{
return GIDT2NUM(get_stat(self)->ST_(gid));
}
On Windows, returns 0.
On other systems, returns the group identifier of the owner of the entry in the snapshot in self:
Example
File.stat('/etc').gid # => 0 filepath = '/tmp/t.tmp' File.write(filepath, 'foo') File.stat(filepath).gid # => 1000 File.delete(filepath) # Clean up.