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