modify oss to append at end

This commit is contained in:
2022-07-13 11:25:53 +02:00
parent d1bfc512ec
commit 8b39f65472
4 changed files with 10 additions and 9 deletions

View File

@ -154,9 +154,10 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons
ReturnValue_t status = RETURN_OK;
auto oneFileHandler = [&](std::string cmdName) {
fileId = random_string(6);
std::ostringstream oss("/tmp/scex-");
std::ostringstream oss("/tmp/scex-", std::ostringstream::ate);
oss << cmdName << fileId << ".bin";
fileName = oss.str();
std::cout << fileName << std::endl;
ofstream out(fileName, ofstream::binary);
if (out.bad()) {
sif::error << "ScexDeviceHandler::interpretDeviceReply: Could not open file " << fileName
@ -172,7 +173,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons
if ((helper.getPacketCounter() == 1) or (not fileNameSet)) {
fileId = random_string(6);
std::ostringstream oss("/tmp/scex-");
std::ostringstream oss("/tmp/scex-", std::ostringstream::ate);
oss << cmdName << fileId << ".bin";
fileName = oss.str();
fileNameSet = true;