Module uu_chown::entries [−][src]
Expand description
Get password/group file entry
Examples:
use uucore::entries::{self, Locate};
let root_group = if cfg!(any(target_os = "linux", target_os = "android")) {
"root"
} else {
"wheel"
};
assert_eq!("root", entries::uid2usr(0).unwrap());
assert_eq!(0, entries::usr2uid("root").unwrap());
assert!(entries::gid2grp(0).is_ok());
assert!(entries::grp2gid(root_group).is_ok());
assert!(entries::Passwd::locate(0).is_ok());
assert!(entries::Passwd::locate("0").is_ok());
assert!(entries::Passwd::locate("root").is_ok());
assert!(entries::Group::locate(0).is_ok());
assert!(entries::Group::locate("0").is_ok());
assert!(entries::Group::locate(root_group).is_ok());
Structs
Traits
Fetch desired entry.