| 44 | } |
| 45 | |
| 46 | static void removeFile(const std::string& path) { |
| 47 | if (!std::filesystem::exists(path)) { |
| 48 | return; |
| 49 | } |
| 50 | std::error_code removeErrorCode; |
| 51 | if (std::filesystem::is_directory(path)) { |
| 52 | return; |
| 53 | } |
| 54 | if (!std::filesystem::remove(path, removeErrorCode)) { |
| 55 | throw Exception(std::format("Error removing directory {}. Error Message: {}", path, |
| 56 | removeErrorCode.message())); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | static uint64_t readStorageVersionFromHeader(const std::string& databasePath) { |
| 61 | auto localFileSystem = common::LocalFileSystem(""); |