Skip to content

Commit 0ec57bd

Browse files
committed
fix: also checks if the folder is readable
Merely detecting writability is not enough, as the folder permissions may be "Write only (Drop Box)".
1 parent 2700906 commit 0ec57bd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

xcode/App-Mac/Functions.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ func getSaveLocationURL() -> URL {
88
}
99

1010
func setSaveLocationURL(url: URL) -> Bool {
11+
guard FileManager.default.isReadableFile(atPath: url.path) else {
12+
let alert = NSAlert()
13+
alert.messageText = "Can not read to path. Choose a different path."
14+
alert.runModal()
15+
return false
16+
}
1117
guard FileManager.default.isWritableFile(atPath: url.path) else {
1218
let alert = NSAlert()
1319
alert.messageText = "Can not write to path. Choose a different path."

0 commit comments

Comments
 (0)