A hard link reuses the inode, but requires a separate directory entry, which takes up 8 bytes plus the length of the file name in ext2. There may be other costs associated, such as when directory indexing is used, also, directories grow by entire blocks.
Think of a hard link as just another name for a file. If a file has 1000 hard links, that just means that it has 1000 different directory entries associated with it, all with potentially different names. For example, if you had 1000 different names, you would still only be one person. You'd take up the same amount of space no matter how many names you had. You'd just have a bit more paperwork for each additional name.
发布评论
评论(2)
硬链接重用inode,但需要一个单独的目录条目,该条目占用8 个字节加上 ext2 中的文件名长度。可能还有其他相关成本,例如当使用目录索引时,目录也会按整个块增长。
A hard link reuses the inode, but requires a separate directory entry, which takes up 8 bytes plus the length of the file name in ext2. There may be other costs associated, such as when directory indexing is used, also, directories grow by entire blocks.
将硬链接视为文件的另一个名称。如果一个文件有 1000 个硬链接,则意味着它有 1000 个与其关联的不同目录条目,所有条目的名称可能都不同。例如,如果你有 1000 个不同的名字,你仍然只是一个人。无论您有多少个名字,您都会占用相同的空间。每增加一个名字,您就需要多做一些文书工作。
Think of a hard link as just another name for a file. If a file has 1000 hard links, that just means that it has 1000 different directory entries associated with it, all with potentially different names. For example, if you had 1000 different names, you would still only be one person. You'd take up the same amount of space no matter how many names you had. You'd just have a bit more paperwork for each additional name.