79311402

Date: 2024-12-27 09:27:49
Score: 0.5
Natty:
Report link

Apparently the error is misleading, because even though it explicitly mentions that my app can not access the target directory, the issue was actually with my source file. Adding the following to the begging of my copy function solved the issue:

guard file.startAccessingSecurityScopedResource()
else { throw FileError.noPermission }
defer {
   file.stopAccessingSecurityScopedResource()
}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Krisztian