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

Albert D. Cahalan (acahalan@cs.uml.edu)
Fri, 25 Jun 1999 23:19:19 -0400 (EDT)


Janos Farkas writes:

> That's a fine idea; but *why* would you want to show a *different*
> value than the allocated blocks to a directory? What would you get
> if it would show (for example) how many entries are in there?
> You can tell that pretty easily with ls itself..

You have to read the whole directory to determine how many files
are in it, unless the size indicates the number of files.

> Think about it, now at least you *know* how much space a directory
> takes, and at least *know* what takes up enormous space, and why
> access in that directory is slow, so you can fix it.

You know this anyway. The number of blocks in use is returned by stat().
It ought to be available via "ls -s". (perhaps converted to kB or 1/2 kB)

-
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/