Expand description
Aims to provide platform-independent methods to obtain login records
ONLY support linux, macos and freebsd for the time being
§Examples:
use uucore::utmpx::Utmpx;
for ut in Utmpx::iter_all_records() {
if ut.is_user_process() {
println!("{}: {}", ut.host(), ut.user())
}
}Specifying the path to login record:
use uucore::utmpx::Utmpx;
for ut in Utmpx::iter_all_records_from("/some/where/else") {
if ut.is_user_process() {
println!("{}: {}", ut.host(), ut.user())
}
}Re-exports§
pub extern crate time;
Structs§
Enums§
- Utmpx
Record - Wrapper type that can hold either traditional utmpx records or systemd records
Constants§
- ACCOUNTING
- BOOT_
TIME - DEAD_
PROCESS - EMPTY
- INIT_
PROCESS - LOGIN_
PROCESS - NEW_
TIME - OLD_
TIME - RUN_LVL
- USER_
PROCESS - UT_
HOSTSIZE - UT_
IDSIZE - UT_
LINESIZE - UT_
NAMESIZE