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

Function normalize_path

crates/openshell-supervisor-network/src/opa.rs:974–986  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

972/// the filesystem. Only works correctly for absolute paths.
973#[cfg(any(target_os = "linux", test))]
974fn normalize_path(path: &Path) -> PathBuf {
975 let mut result = PathBuf::new();
976 for component in path.components() {
977 match component {
978 std::path::Component::ParentDir => {
979 result.pop();
980 }
981 std::path::Component::CurDir => {}
982 other => result.push(other),
983 }
984 }
985 result
986}
987
988#[cfg(target_os = "linux")]
989fn resolve_binary_in_container(policy_path: &str, entrypoint_pid: u32) -> Option<String> {

Callers 1

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected