1

Using a ext3 or ext4 file system, assuming that the files have similar checksums, would the following files:

8c87dba9cf4dbc27c0d54083311ffeef6821e8426f5a8d50165d84f5eef80103.npz
1.npz

Take up a different amount of space on the HD? I have many (10 to 100's of thousands) of these files so a difference, however small, would be worth knowing about.

1 Answer 1

2

Yes, the longer file name takes up a few more bytes of space in the directory, but a few bytes is insignificant compared to the size of the file, even if the file is only a single 4K block.

2
  • Is there a definitive way of knowing this difference without simply creating files and looking at my available free space? I thought (but this is why I was asking), that a file inode took up a fixed sized block.
    – Hooked
    Jun 19, 2013 at 14:39
  • @Hooked, an inode is a fixed size, but the directory entry (where the name is) pointing to that inode is not. It's size is a few bytes for the inode number, the file type, and whatever the length of the name is. Also directories with many entries get dirhash enabled, which adds extra entries of the hash of the name in sorted order so name lookup can be fast in very large directories.
    – psusi
    Jun 19, 2013 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .