Deleting memory mapped file

Does NSData dataWithContentsOfFile/initWithContentsOfFile with NSDataReadingMappedIfSafe always use mmap(2) which guards against the file being unlinked while it is mapped?

I've created an NSData instance using - initWithContentsOfFile:options:error: with options = NSDataReadingMappedIfSafe, on a file in my sandbox Documents folder, deleted the file and continued to read from the NSData instance with no issues. But I can't tell for sure if this will always be the case. It seems that on iOS one should always be able to rely on mmap(2) behavior since the Documents folder is pretty much always there.

Can someone from Apple comment? Thanks!


Deleting memory mapped file
 
 
Q