MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / read_sysfs_trimmed

Function read_sysfs_trimmed

crates/openshell-vfio/src/sysfs.rs:210–217  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

208}
209
210pub(crate) fn read_sysfs_trimmed(path: &Path) -> Result<String, VfioError> {
211 fs::read_to_string(path)
212 .map(|s| s.trim().to_string())
213 .map_err(|source| VfioError::SysfsIo {
214 path: path.display().to_string(),
215 source,
216 })
217}
218
219pub(crate) fn write_sysfs(path: &Path, value: &str) -> Result<(), VfioError> {
220 fs::write(path, value).map_err(|source| VfioError::SysfsIo {

Callers 1

read_trimmedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected