more work on linking file existence and removability

This commit is contained in:
Paul Davis 2014-04-14 03:03:35 -04:00
parent 062dd5b71d
commit 5764970709
6 changed files with 73 additions and 31 deletions

View file

@ -63,9 +63,12 @@ SMFSource::SMFSource (Session& s, const string& path, Source::Flag flags)
{
/* note that origin remains empty */
if (init(_path, false)) {
if (init (_path, false)) {
throw failed_constructor ();
}
assert (!Glib::file_test (_path, Glib::FILE_TEST_EXISTS));
existence_check ();
/* file is not opened until write */
@ -94,10 +97,13 @@ SMFSource::SMFSource (Session& s, const XMLNode& node, bool must_exist)
throw failed_constructor ();
}
if (init(_path, true)) {
if (init (_path, true)) {
throw failed_constructor ();
}
assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS));
existence_check ();
if (open(_path)) {
throw failed_constructor ();
}