Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get iOS storage size
@import Darwin.sys.mount;
int main(int argc, const char * agrv[]) {
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);
}
@BlueCocoa

This comment has been minimized.

Copy link
Owner Author

commented May 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.