blob: 2942a1bc6be1296bc309fba4c81861addb0f5c00 [file] [log] [blame]
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00001\section{Built-in Module \sectcode{grp}}
Guido van Rossume47da0a1997-07-17 16:34:52 +00002\label{module-grp}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00003
4\bimodindex{grp}
5This module provides access to the \UNIX{} group database.
6It is available on all \UNIX{} versions.
7
8Group database entries are reported as 4-tuples containing the
9following items from the group database (see \file{<grp.h>}), in order:
10\code{gr_name},
11\code{gr_passwd},
12\code{gr_gid},
13\code{gr_mem}.
14The gid is an integer, name and password are strings, and the member
15list is a list of strings.
16(Note that most users are not explicitly listed as members of the
Guido van Rossum470be141995-03-17 16:07:09 +000017group they are in according to the password database.)
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000018An exception is raised if the entry asked for cannot be found.
19
20It defines the following items:
21
22\renewcommand{\indexsubitem}{(in module grp)}
23\begin{funcdesc}{getgrgid}{gid}
24Return the group database entry for the given numeric group ID.
25\end{funcdesc}
26
27\begin{funcdesc}{getgrnam}{name}
28Return the group database entry for the given group name.
29\end{funcdesc}
30
31\begin{funcdesc}{getgrall}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000032Return a list of all available group entries, in arbitrary order.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000033\end{funcdesc}