Chinaunix

标题: 目录size的问题 [打印本页]

作者: whpu000625    时间: 2006-04-17 11:45
标题: 目录size的问题
linux中ll后显示文件的stat。

其中directory的size都是4096的整数倍。

绝大多数directory的size都是4096,个别比较大。

但我看了一下,这个size应该不是表示某目录中有占了多少磁盘空间。

因为我在的home目录中看到wangchen这个dir的size是4096(wangchen是空的)

但lost+found也是空的,size却有16384



man 2 stat

       The  value  st_size  gives  the size of the file (if it is a regular file or a symlink) in
       bytes. The size of a symlink is the length of the pathname it contains,  without  trailing
       NUL.


目录的size到底显示的是什么东东?
作者: whpu000625    时间: 2006-04-17 11:58
我发现linux下很多目录的size大小都是4096,不管目录是不是空的,这个大小到底是什么啊!为什么又是这个大小那,目录大小是怎么计算出来的?
作者: lovesaka    时间: 2006-04-17 14:05
这是由结点和块大小决定的
你也可以分小点




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2