出于某种原因,当我在 OS X 上制作文本文件时,它总是至少 4kB,除非它是空白的。为什么是这样?1 字节的纯文本可能有 4,000 字节的元数据吗?
如果我正确阅读了 ext4 文档,从 Linux 3.8 开始,对于非常小的文件,应该可以将数据直接存储在 inode 中。
我期望这样一个文件的大小为 0 块,但事实并非如此。
# creating a small file
printf "abcde" > small_file
# checking size of file in bytes
stat --printf='%s\n' small_file
5
# number of 512-byte blocks used by file
stat --printf='%b\n' small_file
8
Run Code Online (Sandbox Code Playgroud)
我希望这里的最后一个数字是 0。我错过了什么吗?