We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62d4c22 commit 9a5df07Copy full SHA for 9a5df07
src/dmi.rs
@@ -6,6 +6,7 @@ use std::{
6
fmt::Display,
7
fs::File,
8
io::{BufRead, BufReader, Read},
9
+ path::Path,
10
};
11
12
use anyhow::{Result, bail};
@@ -82,6 +83,20 @@ impl DMI {
82
83
let mut system: Option<System> = None;
84
let mut baseboard: Option<Baseboard> = None;
85
86
+ let dmi_file_path = Path::new("/sys/firmware/dmi/tables/DMI");
87
+
88
+ match dmi_file_path.try_exists() {
89
+ Ok(true) => {}
90
+ Ok(false) => {
91
+ eprintln!("Can not find {} file", dmi_file_path.to_string_lossy());
92
+ std::process::exit(1);
93
+ }
94
+ Err(_) => {
95
+ eprintln!("e");
96
97
98
99
100
let mem_file = File::open("/sys/firmware/dmi/tables/DMI")?;
101
let mut file = BufReader::new(mem_file);
102
0 commit comments