Re: why is the size of a directory always 1024b ?

Mark H. Wood (mwood@iupui.edu)
Sat, 26 Jun 1999 08:56:24 -0500 (EST)


On Wed, 23 Jun 1999, Riley Williams wrote:
[snippage]
> I can understand the viewpoint that says the "size" of a directory is
> simply a count of the number of valid entries therein, but I don't
> agree with it.

What I think the original poster objects to is that this makes directory
files different from nondirectory files, without giving a good reason.
When I ls -l a text file or a program or... I see the number of useful
bytes in it, but when I ls -l a directory I see the number of *allocated*
bytes in it.

I suppose one could consider this a feature: it makes life difficult for
people who want to interpret directory files themselves instead of letting
the kernel do it. But this violates the bag-of-bytes model that is
supposedly sacred. Everything is a file, but some files are more
file-like than others.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
A Brazil-nut is neatly packaged and tightly integrated.  To turn it into
food, you must crack and remove the shell.  I find that I feel the same   
way about an increasing number of software products.  *sigh*

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/