Yes, the same happens in the home folder as well.
After reading each file path from the database, I am trying to access each file like this:
if let percentDecoded = "\(dbPath)\(relativeFilePathFromDb)".removingPercentEncoding,
let url = URL(string: percentDecoded),
let normalizedUrl = URL(string: url.path, relativeTo: URL(fileURLWithPath: "/"))?.standardizedFileURL {
print("\(normalizedUrl)") // this outputs the expected path
let success = normalizedUrl.startAccessingSecurityScopedResource()
if success { // this is always false
// ...
} else {
print("Unable to access file!")
}
normalizedUrl.stopAccessingSecurityScopedResource()
}
Is this maybe the wrong way to construct the path url?
Topic:
Privacy & Security
SubTopic:
General
Tags: