| Crates.io | os-detect-aosc |
| lib.rs | os-detect-aosc |
| version | 0.2.0 |
| created_at | 2025-03-29 17:54:18.999685+00 |
| updated_at | 2025-03-29 18:03:49.426365+00 |
| description | Detect an OS installed on a partition (fork from pop-os/distinst) |
| homepage | |
| repository | https://github.com/aosc-dev/os-detect |
| max_upload_size | |
| id | 1611489 |
| size | 23,550 |
Rust crate for detecting the existence of an OS from an unmounted device, or path.
use os_detect::detect_os_from_device;
use std::path::Path;
pub fn main() {
let device_path = &Path::new("/dev/sda3");
let fs = "ext4";
if let Some(os) = detect_os_from_device(device_path, fs) {
println!("{:#?}", os);
}
}