Expand description
Provides the means for 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);
}
}
Enums§
- OS
- Describes the OS found on a partition.
Functions§
- detect_
linux - Detect if Linux is installed at the given path.
- detect_
macos - Detect if Mac OS is installed at the given path.
- detect_
os_ from_ device - Mounts the partition to a temporary directory and checks for the existence of an installed operating system.
- detect_
os_ from_ path - Detects the existence of an OS at a defined path.
- detect_
windows - Detect if Windows is installed at the given path.