diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-18 22:51:00 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-18 22:51:00 +0800 |
| commit | 59c16e41007257a91455eced7ca132344e202e5f (patch) | |
| tree | 18dc3e1de5a18301879f101bcf2a1e0babaa6818 /systems/_framework/src | |
| parent | 2372495e1a0acb9ffead7651d8ed36a3bb98a15b (diff) | |
Add sheet management methods to WorkspaceManager
Diffstat (limited to 'systems/_framework/src')
| -rw-r--r-- | systems/_framework/src/space.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/systems/_framework/src/space.rs b/systems/_framework/src/space.rs index 8a9b2ec..315bf2b 100644 --- a/systems/_framework/src/space.rs +++ b/systems/_framework/src/space.rs @@ -376,6 +376,12 @@ impl<T: SpaceRoot> Space<T> { let path = self.local_path(relative_path)?; Ok(tokio::fs::write(path, contents).await?) } + + /// Check if a file or directory exists at the given relative path within the space. + pub async fn exists(&self, relative_path: impl AsRef<Path>) -> Result<bool, SpaceError> { + let path = self.local_path(relative_path)?; + Ok(tokio::fs::try_exists(path).await?) + } } impl<T: SpaceRoot> From<T> for Space<T> { |
