summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-04-09 15:38:42 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-04-09 15:38:42 +0000
commit41d0052d19b44474b09b8066838c2479d9788d83 (patch)
treee691db3cf597e115e4c5fa1c2f447ed11fddb42b /libs/ardour/session_state.cc
parent8177e85bf915ddba427024423450c9472cf3a490 (diff)
remove all use of access(2) (this was done a bit stupidly, we could have used g_access)
git-svn-id: svn://localhost/ardour2/branches/3.0@9340 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc16
1 files changed, 3 insertions, 13 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index b5b713cbd4..616f19c50a 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -130,6 +130,7 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
+
void
Session::first_stage_init (string fullpath, string snapshot_name)
{
@@ -151,11 +152,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
_path += G_DIR_SEPARATOR;
}
- if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS) && ::access (_path.c_str(), W_OK)) {
- _writable = false;
- } else {
- _writable = true;
- }
+ _writable = exists_and_writable (sys::path (_path));
/* these two are just provisional settings. set_state()
will likely override them.
@@ -898,14 +895,7 @@ Session::load_state (string snapshot_name)
set_dirty();
- /* writable() really reflects the whole folder, but if for any
- reason the session state file can't be written to, still
- make us unwritable.
- */
-
- if (::access (xmlpath.to_string().c_str(), W_OK) != 0) {
- _writable = false;
- }
+ _writable = exists_and_writable (xmlpath);
if (!state_tree->read (xmlpath.to_string())) {
error << string_compose(_("Could not understand ardour file %1"), xmlpath.to_string()) << endmsg;