7 releases (breaking)
Uses old Rust 2015
0.6.0 | Nov 29, 2018 |
---|---|
0.5.0 | Oct 30, 2018 |
0.4.0 | Oct 29, 2018 |
0.3.0 | Oct 25, 2018 |
0.1.1 | Oct 14, 2018 |
#753 in Unix APIs
29 downloads per month
16KB
206 lines
Rust acct - parse acct(5) files
A library for handling UNIX process accounting files.
To install, add this line to your Cargo.toml:
[dependencies]
acct = "0.6.0"
Example
let mut file = File::open(acct_file).unwrap();
let acct_file = AcctFile::new(&mut file).unwrap();
for acct in &acct_file.records {
let datetime = DateTime::<Utc>::from(acct.creation_time);
let timestamp_str = datetime.format("%Y-%m-%d %H:%M:%S.%f").to_string();
println!("{}\t{}\t{:?}\tSU:{}", acct.command, acct.username, timestamp_str, acct.was_super_user());
}
Documentation
lib.rs
:
This is documentation for the acct
crate.
The acct crate is meant to be used for handling and processing the acct(5) file generated by UNIX process accounting.
Dependencies
~2.2–3MB
~54K SLoC