os-detect

Crates.ioos-detect
lib.rsos-detect
version0.2.2
sourcesrc
created_at2018-11-02 17:30:50.916834
updated_at2019-01-03 21:33:04.183508
descriptionDetect an OS installed on a partition
homepage
repositoryhttps://github.com/pop-os/distinst
max_upload_size
id94362
size9,550
Jeremy Soller (jackpot51)

documentation

README

os-detect

Rust crate for detecting the existence of an OS from an unmounted device, or path.

extern crate os_detect;

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);
    }
}
Commit count: 1010

cargo fmt