MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / remove_file

Method remove_file

ramdisk/src/main.rs:164–173  ·  view source on GitHub ↗

Delete a file

(&mut self, path: &str)

Source from the content-addressed store, hash-verified

162 }
163 /// Delete a file
164 fn remove_file(&mut self, path: &str) -> Result<Arc<RwLock<dyn FileLike + Send + Sync>>, syscalls::SyscallError> {
165 let path = path.trim_start_matches('/');
166 println!("[ramdisk] Removing file {}", path);
167
168 if let Some(file) = self.files.remove(path) {
169 Ok(file)
170 } else {
171 Err(syscalls::SYSCALL_ERROR_NOTFOUND)
172 }
173 }
174}
175
176#[no_mangle]

Callers

nothing calls this directly

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected