blob: 10f12e8ef5594d1f5dab3ffcf1c45b90fb73cd40 [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{grp} ---
Fred Drakef6863c11999-03-02 16:37:17 +00002 The group database}
3
Fred Drakeb91e9341998-07-23 17:59:49 +00004\declaremodule{builtin}{grp}
Fred Drakea54a8871999-03-02 17:03:42 +00005 \platform{Unix}
Fred Drakeb91e9341998-07-23 17:59:49 +00006\modulesynopsis{The group database (\function{getgrnam()} and friends).}
7
Fred Drakef6863c11999-03-02 16:37:17 +00008
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00009This module provides access to the \UNIX{} group database.
10It is available on all \UNIX{} versions.
11
12Group database entries are reported as 4-tuples containing the
Fred Drakea5aefba1998-08-14 17:05:17 +000013following items from the group database (see \code{<grp.h>}), in order:
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000014\code{gr_name},
15\code{gr_passwd},
16\code{gr_gid},
17\code{gr_mem}.
18The gid is an integer, name and password are strings, and the member
19list is a list of strings.
20(Note that most users are not explicitly listed as members of the
Guido van Rossum470be141995-03-17 16:07:09 +000021group they are in according to the password database.)
Fred Drakef6863c11999-03-02 16:37:17 +000022\exception{KeyError} is raised if the entry asked for cannot be found.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000023
24It defines the following items:
25
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000026\begin{funcdesc}{getgrgid}{gid}
27Return the group database entry for the given numeric group ID.
28\end{funcdesc}
29
30\begin{funcdesc}{getgrnam}{name}
31Return the group database entry for the given group name.
32\end{funcdesc}
33
34\begin{funcdesc}{getgrall}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000035Return a list of all available group entries, in arbitrary order.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000036\end{funcdesc}