Thanks.
Post
Replies
Boosts
Views
Activity
Whole file ? As per the documentation,
If the device has not yet downloaded the file at the given URL, this method blocks (potentially for a long time) while the file is downloaded. If the file cannot be downloaded, this method fails..
I need a method to pass a URL to AVAsset and ensure that only the specified offset range is read from the AVFoundation library
Yes. This is what I do after enumerate the received URL.
let stop = fileURL.startAccessingSecurityScopedResource()
defer {
if stop {
fileURL.stopAccessingSecurityScopedResource()
}
}
let permissions: mode_t = 0o644
let err = chmod(fileURL.path, permissions)
if err != 0 {
print("chmod failed: \(String(cString: strerror(errno)))")
}
First option, There is a warning sign :(
Only use waitForStabilization(completionHandler:) for testing and debugging. Don’t call this method in a production app, due to its high performance cost.
Second option didn't work. chmod throws Operation not permitted error, both in code and in the terminal (even with sudo).