获得当前硬盘空间

#pragma mark - 获得当前硬盘空间
- (void)acquireDiskInterspace {

    NSFileManager *fm = [NSFileManager defaultManager];
    
    NSDictionary *fattributes = [fm attributesOfFileSystemForPath:NSHomeDirectory() error:nil];
    
    NSLog(@"容量%lldG",[[fattributes objectForKey:NSFileSystemSize] longLongValue]/1000000000);
    
    NSLog(@"可用%lldG",[[fattributes objectForKey:NSFileSystemFreeSize] longLongValue]/1000000000);
}






你可能感兴趣的:(获得当前硬盘空间)