Question on retrieving information on file in application directory?
i have a program 开发者_Go百科which i can download a video file from a server to the app's directory but how do i retrieve the information about this file (mp4). I would like know the size of that file and it there a way to know when the file is being created as in a date or time? Thanks in advance
NSError *error = nil;
NSDictionary *fileInfo = [[NSFileManager defaultManager] attributesOfItemAtPath: filePath error: &error];
if ( fileInfo ) {
// examine fileInfo, see NSDictionary (NSFileAttributes) in NSFileManager.h
} else {
// handle the error
}
精彩评论