Skip to content

Commit f20fa7a

Browse files
pcaspersjenkins
authored andcommitted
QPR-11632 update file pointer when rolling over to a new file
1 parent 35c1e44 commit f20fa7a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

OREData/ored/report/csvreport.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class ReportTypePrinter : public boost::static_visitor<> {
6666
fprintString(s);
6767
}
6868

69+
void updateFile(FILE* fp) { fp_ = fp; }
70+
6971
private:
7072
void fprintNull() const { fprintf(fp_, "%s", null_.c_str()); }
7173

@@ -105,10 +107,12 @@ void CSVFileReport::open() {
105107
LOG("Opening CSV file report '" << filename_ << "'");
106108
fp_ = FileIO::fopen(filename_.c_str(), "w");
107109
QL_REQUIRE(fp_, "Error opening file '" << filename_ << "'");
110+
for (auto& p : printers_)
111+
p.updateFile(fp_);
108112
finalized_ = false;
109113
}
110114

111-
void CSVFileReport::rollover() {
115+
void CSVFileReport::rollover() {
112116
checkIsOpen("rollover()");
113117
end();
114118
version_++;

0 commit comments

Comments
 (0)