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

Method rename

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

Renames a file or directory to a new name, replacing the original file if `to` already exists. This will not work if the new name is on a different mount point. This is a proxy to [`tokio::fs::rename`].

(&self, from: impl AsRef<Path>, to: impl AsRef<Path>)

Source from the content-addressed store, hash-verified

265 ///
266 /// This is a proxy to [`tokio::fs::rename`].
267 pub async fn rename(&self, from: impl AsRef<Path>, to: impl AsRef<Path>) -> io::Result<()> {
268 match self {
269 Self::Real => fs::rename(from, to).await,
270 Self::Chroot(root) => fs::rename(append(root.path(), from), append(root.path(), to)).await,
271 Self::Fake(_) => panic!("unimplemented"),
272 }
273 }
274
275 /// Copies the contents of one file to another. This function will also copy the permission bits
276 /// of the original file to the destination file.

Callers 1

Calls 2

appendFunction · 0.70
pathMethod · 0.45

Tested by 1