现在的位置: 首页 > 综合 > 正文

ios 获取指定路径文件大小

2017年12月09日 ⁄ 综合 ⁄ 共 213字 ⁄ 字号 评论关闭
-(long long) fileSizeAtPath:(NSString*) filePath{  
  NSFileManager* manager = [NSFileManager defaultManager];  
  if ([manager fileExistsAtPath:filePath]){  
    return [[manager attributesOfItemAtPath:filePath error:nil] fileSize];  
  }  
  return 0;  
}  

抱歉!评论已关闭.