diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-06-13 15:09:40 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-06-13 15:09:40 +0000 |
commit | 38897f7df4ef71fef5b074a177338b35ae314d29 (patch) | |
tree | 03ddfe3b2c907b9d2571259adad8732467fc39ff /libs | |
parent | bd92282cc4f2cd7559e0508222d7f932187b1cf0 (diff) |
add use of access(2) to filesystem exists_and_is_writable() implementation, to pick up filesystems mounted read-only
git-svn-id: svn://localhost/ardour2/branches/3.0@12701 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/pbd/filesystem.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/pbd/filesystem.cc b/libs/pbd/filesystem.cc index 819a044a7b..344252f4ba 100644 --- a/libs/pbd/filesystem.cc +++ b/libs/pbd/filesystem.cc @@ -111,6 +111,13 @@ exists_and_writable (const path & p) /* exists and is not writable */ return false; } + /* filesystem may be mounted read-only, so even though file + * permissions permit access, the mount status does not. + * access(2) seems like the best test for this. + */ + if (g_access (p.to_string().c_str(), W_OK) != 0) { + return false; + } } return true; |