| 37 | namespace bytedance::bolt::common { |
| 38 | |
| 39 | bool generateFileDirectory(const char* dirPath) { |
| 40 | std::error_code errorCode; |
| 41 | const auto success = fs::create_directories(dirPath, errorCode); |
| 42 | fs::permissions(dirPath, fs::perms::all, fs::perm_options::replace); |
| 43 | if (!success && errorCode.value() != 0) { |
| 44 | LOG(ERROR) << "Failed to create file directory '" << dirPath |
| 45 | << "'. Error: " << errorCode.message() << " errno " |
| 46 | << errorCode.value(); |
| 47 | return false; |
| 48 | } |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | std::optional<std::string> generateTempFilePath( |
| 53 | const char* basePath, |