I'm trying to figure out what happens if I write to the same file using the method [NSData writeToFile:atomically:YES]
from multiple threads. Is there a guarantee that the file will be uncorrupted after the threads finish writing to it?
For simplicity you can assume the file system is APFS (iOS 11+).
The question is also relevant for NSFileManager
's
[replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:]