Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能的重复: 内部碎片
我最近一直在做一个项目,以递归方式列出目录中的所有文件并输出文件名、大小和路径。
我现在需要将内部碎片的数量添加到输出中,然后计算出目录中内部碎片的百分比。
我已经努力做到这一点。我需要 inode 编号(我从中获得stat())。然后,我需要跟踪该 inode 编号并遍历 inode 以找到最后一个块。然后我需要计算出这个块中有多少未使用的空间,这会给我内部碎片。
stat()
在我撕掉头发之前迫切需要帮助!