Module util

Module util 

Source
Expand description

§Utility functions and data structures

Structs§

GroupEntry
An entry to the /etc/group file.
PasswdEntry
An entry to the /etc/passwd file.

Enums§

TripleBool
A bool but with three options, TripleBool::Known, TripleBool::Unknown

Functions§

errno
Get the OS error, effectively the same as the errno macro in C
file_owned_by_gid
Check if the file named name is owned by the group with GID gid
file_owned_by_group
Check if the file named fname is owned by the group named gname
file_owned_by_uid
Check if the file named name is owned by the user with UID uid
file_owned_by_user
Check if the file named fname is owned by the user named uname
get_file_group
Get the group owner of the file
get_file_owner
Get the owner of the file
get_file_owner_gid
Gets the GID of the owner of the file
get_file_owner_uid
Gets the UID of the owner of the file
group_exists
Checks if a group named name exists on the system
is_package_installed
Check if a package is installed purely from the name
user_exists
Checks if a user with username name exists on the system
user_is_admin
Checks if the user has administrator privileges.
user_is_in_group
Checks if a user named uname is in the group named gname.

Type Aliases§

gid_t
uid_t