(&self, path: impl AsRef<Path>)
| 126 | } |
| 127 | |
| 128 | pub async fn create_new(&self, path: impl AsRef<Path>) -> io::Result<fs::File> { |
| 129 | match self { |
| 130 | Self::Real => fs::File::create_new(path).await, |
| 131 | Self::Chroot(root) => fs::File::create_new(append(root.path(), path)).await, |
| 132 | Self::Fake(_) => Err(io::Error::other("unimplemented")), |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | pub async fn create_dir(&self, path: impl AsRef<Path>) -> io::Result<()> { |
| 137 | match self { |