Remove
(pname: &str)
| 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 |