Linux-kernel mailing list archive 1999-25,: Re: why is the size of a directory always 1024b ?

# 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)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Andre M. Hedrick: "Re: strange hdparm problem"
- Previous message: NIIBE Yutaka: "Re: PLIP"
- Maybe in reply to: MURALI N: "why is the size of a directory always 1024b ?"
- Next in thread: Brandon S. Allbery KF8NH: "Re: why is the size of a directory always 1024b ?"

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/

- Next message: Andre M. Hedrick: "Re: strange hdparm problem"
- Previous message: NIIBE Yutaka: "Re: PLIP"
- Maybe in reply to: MURALI N: "why is the size of a directory always 1024b ?"
- Next in thread: Brandon S. Allbery KF8NH: "Re: why is the size of a directory always 1024b ?"