zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Devin Hussey <husseydevin@gmail.com>
Cc: "Lawrence Velázquez" <vq@larryv.me>, zsh-workers@zsh.org
Subject: Re: [PATCH] Ignore EACCES when doing non-pure globbing
Date: Wed, 13 Jan 2021 02:26:02 +0100	[thread overview]
Message-ID: <CAHYJk3QTXgOeZJ4FhswqKoi28kVUdD3dSndRRmnM9o=1CS9-Zw@mail.gmail.com> (raw)
In-Reply-To: <CAEtFKssoysK5T33JHZPKeoxaRwBaWtj0jYZJeqCpGMv7CF65pw@mail.gmail.com>

On 1/13/21, Devin Hussey <husseydevin@gmail.com> wrote:
> We are already violating POSIX with our globbing:
>
> "If the pattern does not match any existing filenames or pathnames, the
> pattern string shall be left unchanged."
>
> Therefore, this:
>
> zsh:1: no matches found: /tmp/inaccessible/a/*
>
> is wrong, it should just print this:
>
> /tmp/inaccessible/a/*

If you want the broken POSIX behavior you can say 'setopt nonomatch'.

> Also, at least with the implementation on my device, the glob() function
> works fine as long as the folder has execute permission. (The sample was
> wrong, it should be 111, not 000)

This makes quite a big difference indeed. Have you considered just not
unsetting caseglob?
Also of note (maybe) (without unsetting caseglob obviously) (and
setting extendedglob),
% echo $PWD/(#i)a*
/tmp/inaccessible/a/A /tmp/inaccessible/a/a
% echo (#i)$PWD/a*
zsh: no matches found: (#i)/tmp/inaccessible/a/a*

Eg, as long as you don't ask for case insensitiveness for the
unreadable segments, you're fine.

-- 
Mikael Magnusson


  parent reply	other threads:[~2021-01-13  1:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 22:42 Devin Hussey
2021-01-12 22:48 ` Devin Hussey
2021-01-12 23:47 ` Lawrence Velázquez
2021-01-13  0:53   ` Devin Hussey
2021-01-13  1:12     ` Devin Hussey
2021-01-13  1:28       ` Bart Schaefer
2021-01-13  1:26     ` Mikael Magnusson [this message]
     [not found]       ` <CAEtFKsuDqhu3USSVCcrt-8rkvA_yAkHt=eU+FY6=pNu+gVogMw@mail.gmail.com>
2021-01-13  2:14         ` Devin Hussey
2021-01-13  3:01           ` Devin Hussey

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='CAHYJk3QTXgOeZJ4FhswqKoi28kVUdD3dSndRRmnM9o=1CS9-Zw@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=husseydevin@gmail.com \
    --cc=vq@larryv.me \
    --cc=zsh-workers@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).