attributesOfItemAtPath获取文件的大小、文件的内容等属性

来源:互联网 发布:淘宝收货人姓名搞笑 编辑:程序博客网 时间:2024/06/07 07:09

- (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)errorNS_AVAILABLE(10_5, 2_0);



<span style="font-size:14px;"> NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:@"/Users/hechong/Desktop/NewZxing.zip"                                                                                error:nil];    NSLog(@"attributes:%@",attributes);//获取文件的属性attributes:{    NSFileCreationDate = "2014-10-24 16:32:51 +0000";    NSFileExtendedAttributes =     {        "com.apple.quarantine" = <30303032 3b353436 64343431 323b5361 66617269 3b324442 31303037 422d4530 33432d34 3633432d 42423442 2d444638 41383544 31363437 31>;    };    NSFileExtensionHidden = 0;    NSFileGroupOwnerAccountID = 20;    NSFileGroupOwnerAccountName = staff;    NSFileModificationDate = "2014-10-24 16:32:51 +0000";    NSFileOwnerAccountID = 501;    NSFilePosixPermissions = 420;    NSFileReferenceCount = 1;    NSFileSize = 1093489;    NSFileSystemFileNumber = 10352334;    NSFileSystemNumber = 16777218;    NSFileType = NSFileTypeRegular;}</span>

0 0
原创粉丝点击