-(NSString *) freeDiskSpaceInBytes{//#include//#includestruct statfs buf;
long long freespace = -1;
if(statfs("/var", &buf) >= 0){
freespace = (long long)(buf.f_bsize * buf.f_bfree);
}
return [NSString stringWithFormat:@"手机剩余存储空间为:%qi MB" ,freespace/1000/1000];
}
网友评论