MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / copy

Method copy

crates/chat-cli/src/os/fs/mod.rs:280–286  ·  view source on GitHub ↗

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>)

Source from the content-addressed store, hash-verified

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 ///

Callers 1

Calls 2

appendFunction · 0.70
pathMethod · 0.45

Tested by 1