return true if the session directories were successfully created, not
if the session directory was previously invalid(new directory).
git-svn-id: svn://localhost/ardour2/branches/3.0@12907
d708f5d6-7413-0410-9779-
e7cbd77b26cf
/**
* Create the session directory and all the subdirectories.
*
- * @return true If a new session directory was created, otherwise
- * (if it already existed) false.
+ * @return true If a new session directory and subdirectories were
+ * created, otherwise false.
*
* @post is_valid ()
*/
bool
SessionDirectory::create ()
{
- bool is_new = false;
-
vector<std::string> sub_dirs = sub_directories ();
for (vector<std::string>::const_iterator i = sub_dirs.begin(); i != sub_dirs.end(); ++i)
{
- if (Glib::file_test (*i, Glib::FILE_TEST_EXISTS)) {
- is_new = false;
- }
-
if (g_mkdir_with_parents (i->c_str(), 0755) != 0) {
PBD::error << string_compose(_("Cannot create Session directory at path %1 Error: %2"), *i, g_strerror(errno)) << endmsg;
-
+ return false;
}
}
- return is_new;
+ return true;
}
bool