| 293 | } |
| 294 | |
| 295 | void createTempDirectory(const std::string& rootPath) { |
| 296 | auto temp_path = std::format("{}/tmp", rootPath); |
| 297 | if (!file::isDirectory(temp_path)) { |
| 298 | auto lock = file::getLock(rootPath)->asScopedLock(); |
| 299 | if (lock.lock(1000 / portTICK_PERIOD_MS)) { |
| 300 | if (mkdir(temp_path.c_str(), 0777) == 0) { |
| 301 | LOGGER.info("Created {}", temp_path); |
| 302 | } else { |
| 303 | LOGGER.error("Failed to create {}", temp_path); |
| 304 | } |
| 305 | } else { |
| 306 | LOGGER.error(LOG_MESSAGE_MUTEX_LOCK_FAILED_FMT, rootPath); |
| 307 | } |
| 308 | } else { |
| 309 | LOGGER.info("Found existing {}", temp_path); |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | void prepareFileSystems() { |
| 314 | file_system_for_each(nullptr, [](auto* fs, void* context) { |
no test coverage detected