luaposix 33.4.0 Reference

# Module `posix.grp`

Group Database Operations.

Query the system group database.

## Functions

endgrent () | Release group database resources.
getgrent () | Fetch next group.
getgrgid (gid) | Fetch group with given group id.
getgrnam (name) | Fetch named group.
setgrent () | Rewind next getgrent back to start of database.

## Tables

PosixGroup | Group record.

## Functions

endgrent ()
  Release group database resources.

  ### See also:

  getgrent
getgrent ()
  Fetch next group.

  ### Returns:

  PosixGroup next group record

  ### See also:

  endgrent

  ### Usage:

        t = P.getgrent ()
        while t ~= nil do
          process (t)
          t = P.getgrent ()
        end
        P.endgrent ()

getgrgid (gid)
  Fetch group with given group id.

  ### Parameters:

  - gid int group id

  ### Returns:

  PosixGroup group record for gid

  ### Usage:

      t = P.getgrgid (0)

getgrnam (name)
  Fetch named group.

  ### Parameters:

  - name string group name

  ### Returns:

  PosixGroup group record for name

  ### Usage:

      t = P.getgrnam "wheel"

setgrent ()
  Rewind next getgrent back to start of database.

  ### See also:

  getgrent

## Tables

PosixGroup
  Group record.

  ### Fields:

  - gr_mem list a list of group members
  - gr_name string name of group
  - gr_gid int unique group id

generated by LDoc 1.4.3 Last updated 2016-02-27 14:10:34