草庐IT

AttributesOfFileSystemForpaths

全部标签

ios - 如何在 swift 2.0 中使用 AttributesOfFileSystemForpaths 获取总磁盘空间和可用磁盘空间

这是我在Objective-C中使用的方式-(uint64_t)getFreeDiskspace{floattotalSpace=0;floattotalFreeSpace=0;NSError*error=nil;NSArray*paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);NSDictionary*dictionary=[[NSFileManagerdefaultManager]attributesOfFileSystemForPath:[pathslastObj