Expand description
A Library for parsing /etc/{passwd,group,shadow} files.
§Example Usage
Print my username
, uid
, homedir
, and shell
extern crate pgs_files;
use pgs_files::passwd;
fn main() {
let entry = passwd::get_entry_by_name("gary");
match entry {
Some(user) => {
println!("{}: {} {} {}",
user.name, user.uid, user.dir, user.shell
);
},
None => { println!("No such user!"); }
};
}
Modules§
- Fuctions and Structs for dealing with /etc/group
- Fuctions and Structs for dealing with /etc/passwd
- Fuctions and Structs for dealing with /etc/shadow
Structs§
Traits§
- A Trait to represent an entry of data from an /etc/{
passwd
,group
,shadow
} file.