I just want to know if one text file equal to another. Of course I can load files to NSString and compare them, but is there a better way?
Asked
Active
Viewed 1,492 times
1 Answers
8
Have a look at the NSFileManager documentation. There is a method which will complete your task I think:
NSFileManager *filemgr;
filemgr = [NSFileManager defaultManager];
if ([filemgr contentsEqualAtPath: @"/path/to/file1.txt" andPath: @"/path/to/file2.txt"] == YES) {
//MATCH
}

dehlen
- 7,325
- 4
- 43
- 71