Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Etc.getgrent
getgrent
ext/etc/etc.c
View on GitHub ↗
static VALUE
etc_getgrent(VALUE obj)
{
#ifdef HAVE_GETGRENT
struct group *gr;
if ((gr = getgrent()) != 0) {
return setup_group(gr);
}
#endif
return Qnil;
}
Returns an entry from the /etc/group file.
The first time it is called it opens the file and returns the first entry; each successive call returns the next entry, or nil if the end of the file has been reached.
To close the file when processing is complete, call ::endgrent.
Each entry is returned as a Group struct