Module posix.grp

Group Database Operations.

Query the system group database.

See also:

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 ()
Fetch next group.

Returns:

    PosixGroup next group record

See also:

Usage:

    local grp = require "posix.grp"
    t = grp.getgrent ()
    while t ~= nil do
      process (t)
      t = grp.getgrent ()
    end
    grp.endgrent ()
getgrgid (gid)
Fetch group with given group id.

Parameters:

  • gid int group id

Returns:

    PosixGroup group record for gid, if successful

Or

  1. nil
  2. string error message
  3. int errnum

See also:

Usage:

    local grp = require "posix.grp"
    t = grp.getgrgid (0)
getgrnam (name)
Fetch named group.

Parameters:

Returns:

    PosixGroup group record for name, if successful

Or

  1. nil
  2. string error message
  3. int errnum

See also:

Usage:

    local grp = require "posix.grp"
    t = grp.getgrnam "wheel"
setgrent ()
Rewind next getgrent back to start of database.

See also:

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.5.0 Last updated 2023-06-16 20:19:12