From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 8255 invoked from network); 12 Apr 2020 17:35:42 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with UTF8ESMTPZ; 12 Apr 2020 17:35:42 -0000 Received: (qmail 9779 invoked by alias); 12 Apr 2020 17:35:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45685 Received: (qmail 6888 invoked by uid 1010); 12 Apr 2020 17:35:31 -0000 X-Qmail-Scanner-Diagnostics: from relay6-d.mail.gandi.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25779. spamassassin: 3.4.4. Clear:RC:0(217.70.183.198):SA:0(-2.6/5.0):. Processed in 2.470694 secs); 12 Apr 2020 17:35:31 -0000 X-Envelope-From: stephane@chazelas.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _nblcust.gandi.net designates 217.70.183.198 as permitted sender) X-Originating-IP: 94.3.152.49 Date: Sun, 12 Apr 2020 18:34:48 +0100 From: Stephane Chazelas To: zsh-workers@zsh.org Subject: Re: glob qualifier '-' doesn't work correctly on dangling symlinks Message-ID: <20200412173448.rl3wttigdx5t5wcn@chazelas.org> Mail-Followup-To: zsh-workers@zsh.org References: <20200411151511.GA1708902@zira.vinc17.org> <20200411173450.56nnznxtmil5oge3@chazelas.org> <20200411191711.GA1722320@zira.vinc17.org> <20200411203714.wupg6wmd7b7xch2w@chazelas.org> <20200411234817.GA1737986@zira.vinc17.org> <20200412012155.7954a35f@tarpaulin.shahaf.local2> <20200412021722.GA1748686@zira.vinc17.org> <20200412070930.etfzj6j2qvd5em7b@chazelas.org> <20200412142544.GA1783815@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200412142544.GA1783815@zira.vinc17.org> User-Agent: NeoMutt/20180716 2020-04-12 16:25:44 +0200, Vincent Lefevre: [...] > > by the link, and not the link itself. If the > > ^^^^^^ > > referenced file does not exist, the file information > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > and type shall be for the link itself. > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > At least, that's explicit, unambiguous documentation. [...] Well, as seen in the varying interpretations made by the various implementations, it is not that clear. How do you determine whether a file exists or not? What does "exist" mean? If ENOENT or ENOTDIR is returned upon stat(), you can tell there's no file at that path, but it's not so clear with ELOOP, EACCES, EOVERFLOW, ENOMEM for instance, where we can't tell for sure the file doesn't "exist". If didn't exist for the caller at the time in that it can't access it, but it may exist in the "absolute" or for a caller with different credentials or in a different namespace (could also apply for ENOENT/ENOTDIR in that case).. That was discussed on the austin-group mailing list not so long ago wrt glob(3) https://www.mail-archive.com/austin-group-l@opengroup.org/msg04496.html https://www.austingroupbugs.net/view.php?id=1275 -- Stephane