Copies the contents of one file to another. This function will also copy the permission bits of the original file to the destination file. This function will overwrite the contents of to. This is a proxy to [`tokio::fs::copy`].
(&self, from: impl AsRef<Path>, to: impl AsRef<Path>)
| 278 | /// |
| 279 | /// This is a proxy to [`tokio::fs::copy`]. |
| 280 | pub async fn copy(&self, from: impl AsRef<Path>, to: impl AsRef<Path>) -> io::Result<u64> { |
| 281 | match self { |
| 282 | Self::Real => fs::copy(from, to).await, |
| 283 | Self::Chroot(root) => fs::copy(append(root.path(), from), append(root.path(), to)).await, |
| 284 | Self::Fake(_) => panic!("unimplemented"), |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | /// Returns `Ok(true)` if the path points at an existing entity. |
| 289 | /// |