MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / createTempDirectory

Function createTempDirectory

Tactility/Source/Tactility.cpp:295–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295void 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
313void prepareFileSystems() {
314 file_system_for_each(nullptr, [](auto* fs, void* context) {

Callers 1

prepareFileSystemsFunction · 0.85

Calls 6

isDirectoryFunction · 0.85
getLockFunction · 0.85
asScopedLockMethod · 0.80
infoMethod · 0.80
errorMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected