@import Darwin.sys.mount; int main(int argc, char * argv[]) { @autoreleasepool { struct statfs buf; long long freespace = 0; if (statfs("/", &buf) >= 0) { freespace = (long long)buf.f_bsize * buf.f_blocks; } if (statfs("/private/var", &buf) >= 0) { freespace += (long long)buf.f_bsize * buf.f_blocks; } printf("%lld/n",freespace); return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } }
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/3304.html