Lookup and return shared reference to a directory
(&self, name: &str)
| 74 | impl DirLike for Directory { |
| 75 | /// Lookup and return shared reference to a directory |
| 76 | fn get_dir(&self, name: &str) -> Result<Arc<RwLock<dyn DirLike + Send + Sync>>, syscalls::SyscallError> { |
| 77 | if self.subdirs.contains_key(name) { |
| 78 | Ok(self.subdirs[name].clone()) |
| 79 | } else { |
| 80 | Err(syscalls::SYSCALL_ERROR_NOTFOUND) |
| 81 | } |
| 82 | } |
| 83 | /// Lookup and return shared reference to a file |
| 84 | fn get_file(&self, name: &str) -> Result<Arc<RwLock<dyn FileLike + Send + Sync>>, syscalls::SyscallError> { |
| 85 | if self.files.contains_key(name) { |