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

Method rm

src/fs/directory.rs:243–257  ·  view source on GitHub ↗

Remove

(pname: &str)

Source from the content-addressed store, hash-verified

241
242 // Remove
243 pub fn rm(pname: &str) -> Result<(), ()>
244 {
245 let pname = crate::fs::rpath(pname);
246 let dname = crate::fs::dname(&pname);
247 let fname = crate::fs::fname(&pname);
248
249 if let Some(mut directory) = Directory::open(dname)
250 {
251 directory.item_del(fname)
252 }
253 else
254 {
255 Err(())
256 }
257 }
258
259
260 // Root

Callers

nothing calls this directly

Calls 6

rpathFunction · 0.85
dnameFunction · 0.85
fnameFunction · 0.85
item_delMethod · 0.80
openFunction · 0.70
ErrEnum · 0.50

Tested by

no test coverage detected