将1000字节文件压缩为300字节文件是否值得?或文件系统空间消耗是否相同?
我正在考虑在我的iphone上存储少于4k的文件,我很好奇我是否会通过压缩来节省空间。
谢谢,
卡尔
答案 0 :(得分:18)
iPhone使用HFSX文件系统,用户分区上的块大小为8k:
int main(int argc, char *argv[]) {
struct statfs *mntbufp = NULL;
getmntinfo(&mntbufp, 0);
unsigned i, count = 0;
count = getmntinfo(&mntbufp, 0);
for (i=0; i<count; i++)
{
char *volName = mntbufp[i].f_mntonname;
printf("Volume %s blocksize: %lu\n", volName, mntbufp[i].f_bsize);
}
return 0;
}
返回
Volume / blocksize: 8192 Volume /dev blocksize: 512 Volume /private/var blocksize: 8192 Volume /Developer blocksize: 4096