https://github.com/uutils/platform-info
A cross-platform way to get information about your machine
https://github.com/uutils/platform-info
cross-platform information-retrieval rust uname
Last synced: about 1 year ago
JSON representation
A cross-platform way to get information about your machine
- Host: GitHub
- URL: https://github.com/uutils/platform-info
- Owner: uutils
- License: mit
- Created: 2018-03-11T12:07:34.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2025-05-15T08:41:43.000Z (about 1 year ago)
- Last Synced: 2025-05-15T09:39:40.817Z (about 1 year ago)
- Topics: cross-platform, information-retrieval, rust, uname
- Language: Rust
- Size: 210 KB
- Stars: 97
- Watchers: 12
- Forks: 28
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# platform-info
[](https://crates.io/crates/platform-info)
[](LICENSE)
[](https://codecov.io/gh/uutils/platform-info/tree/main)
A simple cross-platform way to get information about the currently running system.
## Examples
This simple example:
```rust
// examples/ex.rs
// * use `cargo run --example ex` to execute this example
// spell-checker:ignore (API) nodename osname sysname
use platform_info::*;
fn main() {
let info = PlatformInfo::new().expect("Unable to determine platform info");
// println!("info={:#?}", info);
println!("{}", info.sysname().to_string_lossy());
println!("{}", info.nodename().to_string_lossy());
println!("{}", info.release().to_string_lossy());
println!("{}", info.version().to_string_lossy());
println!("{}", info.machine().to_string_lossy());
println!("{}", info.osname().to_string_lossy());
}
```
should display something like:
```text
Linux
hostname
5.10.0-8-amd64
#1 SMP Debian 5.10.46-4 (2021-08-03)
x86_64
GNU/Linux
```
> Using `cargo run --example ex` will build and execute this [example code](examples/ex.rs).
Other examples can be found in the [examples](examples) directory.
## License
`platform-info` is licensed under the [MIT License](LICENSE).