From 709b25a34abaac82025b8e22d51735454dbefc2e Mon Sep 17 00:00:00 2001 From: Lachlan Deakin Date: Fri, 13 Oct 2023 13:40:13 +1100 Subject: [PATCH] fix: FilesystemStore remove non-empty prefixes --- CHANGELOG.md | 1 + src/storage/store/filesystem.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 370dfbc6..d0d88bbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The `array_subset_iter_contiguous_indices3` test was incorrect as the array shape was invalid for the array subset - `ArraySubset::extract_bytes` now reserves the appropriate amount of memory - Sharding codec performance optimisations + - `FilesystemStore::erase_prefix` now correctly removes non-empty directories ### Removed - **Breaking**: Disabled data type extensions `array::data_type::DataType::Extension`. diff --git a/src/storage/store/filesystem.rs b/src/storage/store/filesystem.rs index 42df0aa2..e69b67c7 100644 --- a/src/storage/store/filesystem.rs +++ b/src/storage/store/filesystem.rs @@ -324,7 +324,7 @@ impl WritableStorageTraits for FilesystemStore { let _lock = self.files.lock(); // lock all operations let prefix_path = self.prefix_to_fs_path(prefix); - let result = std::fs::remove_dir(prefix_path); + let result = std::fs::remove_dir_all(prefix_path); if let Err(err) = result { match err.kind() { std::io::ErrorKind::NotFound => Ok(false),