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
- nil
- string error message
- int errnum
See also:
Usage:
local grp = require "posix.grp" t = grp.getgrgid (0)
- getgrnam (name)
-
Fetch named group.
Parameters:
- name string group name
Returns:
-
PosixGroup
group record for name, if successful
Or
- nil
- string error message
- 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