Skip to main content
Log in

Mojo function

getpwuid

getpwuid(uid: Int) -> Passwd

Retrieve the password database entry for a given user ID.

Constraints:

This function is constrained to run on Linux or macOS operating systems only.

Args:

  • uid (Int): The user ID for which to retrieve the password database entry.

Returns:

An object containing the user's account information, including login name, encrypted password, user ID, group ID, real name, home directory, and shell program.

Raises:

If the user ID does not exist or there is an error retrieving the information.

Was this page helpful?