Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
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 '13 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 '13 at 14:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.