MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / canon

Function canon

src/fs/mod.rs:110–131  ·  view source on GitHub ↗

Canonicalize

(path: &str)

Source from the content-addressed store, hash-verified

108
109// Canonicalize
110pub fn canon(path: &str) -> Result<String, ()>
111{
112 match crate::sys::proc::env("HOME")
113 {
114 Some(home) =>
115 {
116 if path.starts_with('~')
117 {
118 Ok(path.replace('~', &home))
119 }
120 else
121 {
122 Ok(path.to_string())
123 }
124 },
125
126 None =>
127 {
128 Ok(path.to_string())
129 }
130 }
131}
132
133
134// Create a new device

Callers

nothing calls this directly

Calls 1

envFunction · 0.85

Tested by

no test coverage detected