iOS-NSFileManager获取文件的信息

//将图片写人本地
    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *imagePath=[[paths lastObject] stringByAppendingFormat:@"/test.jpg"];
    
    
    UIImage *image=[UIImage imageNamed:@"test5.jpg"];
    [UIImageJPEGRepresentation(image, 1) writeToFile:imagePath atomically:YES];

    
    
    NSDictionary *fileAttrs=[[NSFileManager defaultManager] attributesOfItemAtPath:imagePath error:nil];
    NSLog(@"文件的基本信息  %@",fileAttrs);

你可能感兴趣的:(iOS-NSFileManager获取文件的信息)