Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Globbing for Empty Directories?



On Mon, Mar 29, 2004 at 03:28:00PM +0200, DervishD wrote:

> > Adding any subdirectories or files to it seems to increase the
> > number of links it has.
> 
>     Not under Linux, at least, although it may depend on the
> filesystem type. For ext3, only subdirs increase the number of links
> of a directory.

As it should be.  Think of it this way.  st_nlink is the number of names
a filesystem object has on a filesystem.  For any directory, that'll be
1) the name the directory has in its parent, 2) the name "." it contains
itself, and 3-nlink) the name ".." its children contain.

Non-directory files (generally) don't contain other files, so they won't 
add to st_nlink.

Danek



Messages sorted by: Reverse Date, Date, Thread, Author