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

Method try_exists

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

Returns `Ok(true)` if the path points at an existing entity. This function will traverse symbolic links to query information about the destination file. In case of broken symbolic links this will return `Ok(false)`. This is a proxy to [`tokio::fs::try_exists`].

(&self, path: impl AsRef<Path>)

Source from the content-addressed store, hash-verified

292 ///
293 /// This is a proxy to [`tokio::fs::try_exists`].
294 pub async fn try_exists(&self, path: impl AsRef<Path>) -> Result<bool, io::Error> {
295 match self {
296 Self::Real => fs::try_exists(path).await,
297 Self::Chroot(root) => fs::try_exists(append(root.path(), path)).await,
298 Self::Fake(_) => panic!("unimplemented"),
299 }
300 }
301
302 /// Returns `true` if the path points at an existing entity.
303 ///

Callers 1

get_test_agentsFunction · 0.80

Calls 2

appendFunction · 0.70
pathMethod · 0.45

Tested by

no test coverage detected