Uploaded July 2024 | Updated November 2026, 3 days ago
This is a technical explanation of why the "record length" used in Linux directory entries is useless nonsense and why having the length of the actual file name instead would be much more useful. In 1995, Linus Torvalds blasted the "d_namlen" extension to a struct dirent, saying "d_reclen" made a lot more sense. He was wrong. He was also young and still learning a lot, so I don't blame him for making this mistake. Unfortunately, this bad decision became a source of "technical debt" in Linux (tech debt is when something is put in place earlier in a project that's not the best way to do something and other things get built on top of it, making it harder and harder to fix or replace it later).
This is a technical explanation of why the "record length" used in Linux directory entries is useless nonsense and why having the length of the actual file name instead would be much more useful. In 1995, Linus Torvalds blasted the "d_namlen" extension to a struct dirent, saying "d_reclen" made a lot more sense. He was wrong. He was also young and still learning a lot, so I don't blame him for making this mistake. Unfortunately, this bad decision became a source of "technical debt" in Linux (tech debt is when something is put in place earlier in a project that's not the best way to do something and other things get built on top of it, making it harder and harder to fix or replace it later).










