FS helpers #604

Merged
muellerr merged 9 commits from core_ctrl_fs_helpers into develop 2023-04-16 02:57:16 +02:00
Showing only changes of commit 767a0eda30 - Show all commits

View File

@ -1010,7 +1010,11 @@ ReturnValue_t CoreController::actionListDirectoryDumpDirectly(ActionId_t actionI
const char *repoName = parser.getRepoName(repoNameLen);
oss << " " << repoName << " > " << LIST_DIR_DUMP_WORK_FILE;
sif::info << "Executing " << oss.str() << " for direct dump" << std::endl;
sif::info << "Executing " << oss.str() << " for direct dump";
if (parser.compressionOptionSet()) {
sif::info << " with compression";
}
sif::info << std::endl;
int ret = std::system(oss.str().c_str());
if (ret != 0) {
utility::handleSystemError(result, "CoreController::actionListDirectoryDumpDirectly");
@ -1102,10 +1106,11 @@ ReturnValue_t CoreController::actionListDirectoryIntoFile(ActionId_t actionId,
return returnvalue::FAILED;
}
// Compression will add a .gz ending. I don't have any issue with this, it makes it explicit
// that this is a compressed file.
if (parser.compressionOptionSet()) {
std::string compressedName = targetFileName + std::string(".gz");
oss.str("");
oss << "gzip -c " << compressedName << " > " << targetFileName;
oss << "gzip " << targetFileName;
sif::info << "Compressing directory listing: " << oss.str() << std::endl;
ret = std::system(oss.str().c_str());
if (ret != 0) {