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

Re: Globbing for Empty Directories?



    Hi Danek :)

 * Danek Duvall <duvall@xxxxxxxxxxx> dixit:
> > > 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.

    I'm with you, it's quite logical, but unfortunately people tends
to think that, since a filename is 'linked' to its container
directory, that should affect st_nlink (which is not true, this can
be seen even in the GNU libc documentation). I was not sure if the
standard (POSIX or SuS) specified the opposite.

    Summarizing: Zsh should follow 'find' example and implement tests
for empty dirs investigating its contents, but since this can be
easily done in, let's say, 'user space' (I mean, outside the shell,
using shell commands), I see no need for it. I would like to have a
globbing flag for empty dirs, because it is simpler, better
integrated with the rest of globbin syntax and less error prone, so I
vote for including it O:)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/



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