While Justin answered my question, I used NSFileWrapper internally, so I could not always use contentsEqualAtPath:andPath:
In case this helps anyone, here is what I wrote to compare the contents of NSFileWrapper with the contents of the file:
- (BOOL) contentsOfFileWrapper:(NSFileWrapper*)fileWrapper equalContentsAtPath:(NSString*)path { NSDictionary *fileAttrs = [[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil]; NSUInteger fileSize = [attrs fileSize]; NSUInteger fileWrapperSize = [fileWrapper.fileAttributes fileSize];
As Justin suggested, I only use this method if I cannot restore the path to the file shell. If I can, I use contentsEqualAtPath:andPath:
source share