Rust library to detect the operating system type
Include this into your Cargo.toml
:
toml
[dependencies]
os_type="1.0.0"
In your code:
rust
extern crate os_type;
let os = os_type::current_platform();
println!("Type: {:?}", os.os_type);
println!("Version: {}", os.version);
Right now, the following operating system types can be returned: - Unknown - Redhat - CentOS - OSX - Ubuntu - Debian - Arch
If you need support for more OS types, I am looking forward to your Pull Request.
MIT