sometimes file stat fails for media files / iOS 14.2 and up

sometimes, for the very same video file, we get an error from this call on iOS

example of fail case path:

/var/mobile/Media/DCIM/102APPLE/IMG_2685.mp4

sometimes it works fine. what?

[[NSFileManager defaultManager] attributesOfItemAtPath:filepath error:&error];

anyone see this before?

continued: this is the error we get fairly often (same file works other times). this is a file from the photos folder.

Error Domain=NSCocoaErrorDomain Code=260 "The file “IMG_2685.mp4” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/var/mobile/Media/DCIM/102APPLE/IMG_2685.mp4, NSUnderlyingError=0x281af1cb0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

How did you get this path?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

sometimes file stat fails for media files / iOS 14.2 and up
 
 
Q