WSL/SLF GitLab Repository

Commit 92d581b3 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

There was a problem when opening a new smet file in APPEND mode: only the last...

There was a problem when opening a new smet file in APPEND mode: only the last data line was written. This should now work as expected.
parent 4fca1874
...@@ -540,7 +540,11 @@ void SMETWriter::write(const std::vector<std::string>& vec_timestamp, const std: ...@@ -540,7 +540,11 @@ void SMETWriter::write(const std::vector<std::string>& vec_timestamp, const std:
} }
fout.open(filename.c_str(), ios::binary | ofstream::app); fout.open(filename.c_str(), ios::binary | ofstream::app);
} else { //normal mode } else { //normal mode
fout.open(filename.c_str(), ios::binary); if (!append_possible) { //first write -> overwrite potential previous content
fout.open(filename.c_str(), ios::binary);
append_possible = true;
} else //after the first write: append
fout.open(filename.c_str(), ios::binary | ofstream::app);
} }
if (fout.fail()) { if (fout.fail()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment