Question

How to access file info (such as date created,size etc) about a file in iphone?i need to sort certain files based on the date of creation,size etc..

Was it helpful?

Solution

Try this method:

NSError *error;
NSDictionary* attributes = [[NSFileManager defaultManager] 
                             attributesOfItemAtPath: filePath 
                                              error: &error];

You can then query [attributes fileCreationDate] or [attributes fileSize]. See NSFileManager.h for the NSFileAttributes category of NSDictionary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top