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
This commit is contained in:
@ -32,12 +32,9 @@ bool WeathermonitorCampaign::run()
|
|||||||
{
|
{
|
||||||
Logger log("Weathermonitor Campaign");
|
Logger log("Weathermonitor Campaign");
|
||||||
|
|
||||||
ifstream test(results_filename);
|
// non-destructive: due to the CSV header we can always manually recover
|
||||||
if (test.is_open()) {
|
// from an accident (append mode)
|
||||||
log << results_filename << " already exists" << endl;
|
ofstream results(results_filename, ios::out | ios::app);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
ofstream results(results_filename);
|
|
||||||
if (!results.is_open()) {
|
if (!results.is_open()) {
|
||||||
log << "failed to open " << results_filename << endl;
|
log << "failed to open " << results_filename << endl;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user