Function users::get_group_by_name [−][src]
pub fn get_group_by_name<S: AsRef<OsStr> + ?Sized>(
groupname: &S
) -> Option<Group>
Searches for a Group
with the given group name in the system’s group database.
Returns it if one is found, otherwise returns None
.
libc functions used
Examples
use users::get_group_by_name; match get_group_by_name("db-access") { Some(group) => println!("Found group #{}", group.gid()), None => println!("Group not found"), }