From e6e04bdab95fdb65b37bfe76439d3b8ee28e641f Mon Sep 17 00:00:00 2001 From: hsc Date: Thu, 19 Apr 2012 07:31:44 +0000 Subject: [PATCH] wmoo: campaign appends to output CSV Usually you'll want to remove weathermonitor.csv before running the campaign. If you forgot that but desperately need the old or the new data, you can easily recover these manually (as they're separated by CSV headers). git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1115 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- core/experiments/weathermonitor/campaign.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/experiments/weathermonitor/campaign.cc b/core/experiments/weathermonitor/campaign.cc index 7cbc8627..c416e07b 100644 --- a/core/experiments/weathermonitor/campaign.cc +++ b/core/experiments/weathermonitor/campaign.cc @@ -32,12 +32,9 @@ bool WeathermonitorCampaign::run() { Logger log("Weathermonitor Campaign"); - ifstream test(results_filename); - if (test.is_open()) { - log << results_filename << " already exists" << endl; - return false; - } - ofstream results(results_filename); + // non-destructive: due to the CSV header we can always manually recover + // from an accident (append mode) + ofstream results(results_filename, ios::out | ios::app); if (!results.is_open()) { log << "failed to open " << results_filename << endl; return false;