Scheme 48 Manual | Contents | In Chapter: Access to POSIX
Previous: Users and groups | Next: Users and groups

## Users and groups

`User-id`s and `group-id`s are boxed integers representing Unix users and groups. The procedures in this section are in structures `posix-users` and `posix`.

- `(user-id? x) -> boolean`
- `(user-id=? user-id0 user-id1) -> boolean`
- `(user-id->integer user-id) -> integer`
- `(integer->user-id integer) -> user-id`

- `(group-id? x) -> boolean`
- `(group-id=? group-id0 group-id1) -> boolean`
- `(group-id->integer group-id) -> integer`
- `(integer->group-id integer) -> group-id`

User-ids and group-ids have their own own predicates and comparison, boxing, and unboxing functions.

- `(user-id->user-info user-id) -> user-info`
- `(name->user-info string) -> user-info`

These return the user info for a user identified by user-id or name.

- `(user-info? x) -> boolean`
- `(user-info-name user-info) -> string`
- `(user-info-id user-info) -> user-id`
- `(user-info-group user-info) -> group-id`
- `(user-info-home-directory user-info) -> string`
- `(user-info-shell user-info) -> string`

A `user-info` contains information about a user. Available are the user's name, id, group, home directory, and shell.

- `(group-id->group-info group-id) -> group-info`
- `(name->group-info string) -> group-info`

These return the group info for a group identified by group-id or name.

- `(group-info? x) -> boolean`
- `(group-info-name group-info) -> string`
- `(group-info-id group-info) -> group-id`
- `(group-info-members group-info) -> user-ids`

A `group-info` contains information about a group. Available are the group's name, id, and a list of members.

Previous: Users and groups | Next: Users and groups