writePropeties(): create dir if necessary

This commit is contained in:
mfranz
2007-01-12 21:24:50 +00:00
parent a0af7f0524
commit de6b32d8c6
+3
View File
@@ -540,6 +540,9 @@ void
writeProperties (const string &file, const SGPropertyNode * start_node, writeProperties (const string &file, const SGPropertyNode * start_node,
bool write_all, SGPropertyNode::Attribute archive_flag) bool write_all, SGPropertyNode::Attribute archive_flag)
{ {
SGPath path(file.c_str());
path.create_dir(0777);
ofstream output(file.c_str()); ofstream output(file.c_str());
if (output.good()) { if (output.good()) {
writeProperties(output, start_node, write_all, archive_flag); writeProperties(output, start_node, write_all, archive_flag);