blob: 986c831d8131eae874393c5fd680684b73d06154 [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Built-in Module \module{grp}}
Fred Drakeb91e9341998-07-23 17:59:49 +00002\declaremodule{builtin}{grp}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00003
Fred Drakeb91e9341998-07-23 17:59:49 +00004
5\modulesynopsis{The group database (\function{getgrnam()} and friends).}
6
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00007This module provides access to the \UNIX{} group database.
8It is available on all \UNIX{} versions.
9
10Group database entries are reported as 4-tuples containing the
11following items from the group database (see \file{<grp.h>}), in order:
12\code{gr_name},
13\code{gr_passwd},
14\code{gr_gid},
15\code{gr_mem}.
16The gid is an integer, name and password are strings, and the member
17list is a list of strings.
18(Note that most users are not explicitly listed as members of the
Guido van Rossum470be141995-03-17 16:07:09 +000019group they are in according to the password database.)
Guido van Rossumeb0f0661997-12-30 20:38:16 +000020A \code{KeyError} exception is raised if the entry asked for cannot be found.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000021
22It defines the following items:
23
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000024\begin{funcdesc}{getgrgid}{gid}
25Return the group database entry for the given numeric group ID.
26\end{funcdesc}
27
28\begin{funcdesc}{getgrnam}{name}
29Return the group database entry for the given group name.
30\end{funcdesc}
31
32\begin{funcdesc}{getgrall}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000033Return a list of all available group entries, in arbitrary order.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000034\end{funcdesc}