Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Globbing for Empty Directories?
- X-seq: zsh-users 7296
- From: DervishD <raul@xxxxxxxxxxxx>
- To: Danek Duvall <duvall@xxxxxxxxxxx>, Aaron Davies <agdavi01@xxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: Globbing for Empty Directories?
- Date: Mon, 29 Mar 2004 17:57:15 +0200
- In-reply-to: <20040329151920.GA6379@xxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Danek Duvall <duvall@xxxxxxxxxxx>, Aaron Davies <agdavi01@xxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Pleyades
- References: <20040328194921.GA6311@DervishD> <CA7477A0-8146-11D8-913F-000502631FBD@xxxxxxxxxxxxxx> <20040329132800.GA7384@DervishD> <20040329151920.GA6379@xxxxxxxxxxxxxxxxxx>
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