mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Fix false read-only detection of sessions on Windows with OneDrive
see https://discourse.ardour.org/t/ardour-8-4-on-win11-amd64-always-opens-session-in-read-only-mode/110063/38?u=x42
This commit is contained in:
parent
9494ecf6e9
commit
6c8a2ec05b
1 changed files with 3 additions and 0 deletions
|
|
@ -526,11 +526,14 @@ exists_and_writable (const std::string & p)
|
||||||
/* doesn't exist - not writable */
|
/* doesn't exist - not writable */
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef PLATFORM_WINDOWS
|
||||||
|
/* Folders on Windows fail this test if they're on OneDrive */
|
||||||
DEBUG_TRACE (DEBUG::FileUtils, string_compose("exists_and_writable stat '%1': %2 \n", p, statbuf.st_mode));
|
DEBUG_TRACE (DEBUG::FileUtils, string_compose("exists_and_writable stat '%1': %2 \n", p, statbuf.st_mode));
|
||||||
if (!(statbuf.st_mode & S_IWUSR)) {
|
if (!(statbuf.st_mode & S_IWUSR)) {
|
||||||
/* exists and is not writable */
|
/* exists and is not writable */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* filesystem may be mounted read-only, so even though file
|
/* filesystem may be mounted read-only, so even though file
|
||||||
* permissions permit access, the mount status does not.
|
* permissions permit access, the mount status does not.
|
||||||
* access(2) seems like the best test for this.
|
* access(2) seems like the best test for this.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue