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

Function remove_rootfs_path

crates/openshell-driver-vm/src/rootfs.rs:900–912  ·  view source on GitHub ↗
(rootfs: &Path, relative: &str)

Source from the content-addressed store, hash-verified

898}
899
900fn remove_rootfs_path(rootfs: &Path, relative: &str) -> Result<(), String> {
901 let path = rootfs.join(relative);
902 if !path.exists() {
903 return Ok(());
904 }
905
906 let result = if path.is_dir() {
907 fs::remove_dir_all(&path)
908 } else {
909 fs::remove_file(&path)
910 };
911 result.map_err(|e| format!("remove {}: {e}", path.display()))
912}
913
914#[cfg(test)]
915mod tests {

Callers 1

prepare_sandbox_rootfsFunction · 0.85

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected