Skip to main content

Mojo module

pwd

Provides access to the user password database on Unix-like systems.

This module retrieves user account information from the system password database, similar to Python's pwd module. It provides functions to look up user entries by user ID or username, returning structured account information including home directory, shell, and user/group IDs.

Constraints: Available on Linux and macOS only.

Structs

  • Passwd: Represents user account information retrieved from the user password database related to a user ID.

Functions

  • getpwnam: Retrieves the user ID in the password database for the given user name.
  • getpwuid: Retrieve the password database entry for a given user ID.

Was this page helpful?