How can I get the file creation or last modification date of the file at a particular location, e.g. /Users/MYUSER/Downloads/text.txt
?
Example from Rosetta Code has deprecated parts. Here is the right code for getting file modification date
NSString *path = @"/Users/Raven/Downloads/1.png";
NSDictionary* fileAttribs = [[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil];
NSDate *result = [fileAttribs objectForKey:NSFileCreationDate]; //or NSFileModificationDate
NSLog(@"%@",result);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With