Module homedir::unix

source ·
Expand description

Contains the implementation of the crate for Unix systems.

Functions

  • Get a user’s home directory path.
  • Get a user’s home directory path from their user identifier.
  • Get a user’s id from their username. This function operates identically to the get_home function, except it reads the uid field from the User structure instead of the dir field. Because of this, doing get_home_from_id(get_id(name)) is not recommended. Instead, get_home(name) should be used.
  • Get this process’ user’s home directory path.
  • Get the current process’ real user id. This uses the nix crate’s Uid::current method, which uses getuid(3). This function will never return the Err variant on Unix systems. However, the error is kept so that the API remains the same on both Unix and Windows.

Type Aliases