zsh-users
 help / color / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: zsh-users@zsh.org
Subject: Re: Unreadable directories aren't included in glob expansion
Date: Thu, 9 Jan 2020 17:22:22 +0000
Message-ID: <20200109172222.uwgyjouab45zk2gf@chaz.gmail.com> (raw)
In-Reply-To: <1578585101.6028.13.camel__24021.2781982095$1578585228$gmane$org@samsung.com>

[re-post to zsh-users. Sorry I read my MLs on gmane and always
forget that zsh-users and zsh-workers are cross-posted]

2020-01-09 15:51:41 +0000, Peter Stephenson:
> On Thu, 2020-01-09 at 15:41 +0000, Daniel Shahaf wrote:
> > Consider:
> > 
> > % mkdir foo
> > % mkdir -m 000 bar 
> > % echo */ 
> > foo/
> > % echo *(/)
> > bar foo
> > % 
> > 
> > Shouldn't the expansion of «*/» include «bar/»?
> 
> Certainly, */ and *(/) have always been inconsistent and I don't know of
> any fundamental reason why that needs to be.
[...]

*/ in all shells also includes symlinks to directories. So if
only for that reason, it has to be different from *(/).

Now, zsh seems to be the only shell where */ excludes the
non-*searchable* (it does include the non-readable ones provided
you have search access).

It might make it the only  POSIX compliant shell as I have a
vague recollection it's meant to give the same result as */.,
but that could very  well be a bad recollection, and if that was
a POSIX requirement, that's probably one that should change.

IMO, */ should give the same list as *(-/) (with some /
appended), that is expand to the files that can be determined to
be of type "directory" after symlink resolution (determined from
the result of stat(), not lstat()) for consistency with other
shells.

-- 
Stephane

  parent reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200109154313eucas1p13b2e5465f21d059ea08537012e140236@eucas1p1.samsung.com>
2020-01-09 15:41 ` Daniel Shahaf
2020-01-09 15:51   ` Peter Stephenson
2020-01-09 16:10     ` Bart Schaefer
2020-01-09 16:16       ` Daniel Shahaf
     [not found]   ` <1578585101.6028.13.camel__24021.2781982095$1578585228$gmane$org@samsung.com>
2020-01-09 17:22     ` Stephane Chazelas [this message]
2020-01-09 23:05       ` Mikael Magnusson
2020-01-10 17:11       ` Daniel Shahaf
     [not found]     ` <20200109172222.uwgyjouab45zk2gf__13897.4118557357$1578604026$gmane$org@chaz.gmail.com>
2020-01-10  7:27       ` Stephane Chazelas
2020-01-10 17:09         ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200109172222.uwgyjouab45zk2gf@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

zsh-users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git