获取硬盘的容量

来源:互联网 发布:千兆以太网测试软件 编辑:程序博客网 时间:2024/05/18 00:29
NSFileManager*fm = [NSFileManagerdefaultManager];
    NSDictionary*fattributes = [fm attributesOfFileSystemForPath:NSHomeDirectory()error:nil];
     
  
    NSLog(@"%lldG",[[fattributesobjectForKey:NSFileSystemSize]longLongValue]/1000000000);
    NSLog(@"%lldG",[[fattributesobjectForKey:NSFileSystemFreeSize]longLongValue]/1000000000);
0 0
原创粉丝点击