mirror of
https://github.com/Cantera/cantera.git
synced 2026-08-08 20:18:24 -05:00
[SolutionArray] Enable appending to empty file
This commit is contained in:
committed by
Ray Speth
parent
7b7a5380f6
commit
304136ca6f
@@ -1341,7 +1341,8 @@ void SolutionArray::save(const string& fname, const string& name, const string&
|
||||
if (extension == "yaml" || extension == "yml") {
|
||||
// Check for an existing file and load it if present
|
||||
AnyMap data;
|
||||
if (std::ifstream(fname).good()) {
|
||||
std::ifstream file(fname);
|
||||
if (file.good() && file.peek() != std::ifstream::traits_type::eof()) {
|
||||
data = AnyMap::fromYamlFile(fname);
|
||||
}
|
||||
writeHeader(data, name, desc, overwrite);
|
||||
|
||||
Reference in New Issue
Block a user