13
0

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
This commit is contained in:
Paul Davis 2012-06-13 15:09:40 +00:00
parent bd92282cc4
commit 38897f7df4

View File

@ -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;