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 655 invoked from network); 14 Apr 2020 12:03:27 -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; 14 Apr 2020 12:03:27 -0000 Received: (qmail 26678 invoked by alias); 14 Apr 2020 12:03:21 -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: 45695 Received: (qmail 28747 invoked by uid 1010); 14 Apr 2020 12:03:21 -0000 X-Qmail-Scanner-Diagnostics: from out5-smtp.messagingengine.com 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(66.111.4.29):SA:0(-2.6/5.0):. Processed in 0.736276 secs); 14 Apr 2020 12:03:21 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrfedugdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfgjfhfogggtgfesthhqtd dtredtjeenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghnihgv lhdrshhhrghhrghfrdhnrghmvgeqnecukfhppeejledrudejjedruddugedrudegleenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegu rghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Date: Tue, 14 Apr 2020 12:02:41 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: glob qualifier '-' doesn't work correctly on dangling symlinks Message-ID: <20200414120241.3d8d7246@tarpaulin.shahaf.local2> In-Reply-To: <20200414061816.5qfbjyc6w3x34wcz@chazelas.org> References: <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> <20200412173448.rl3wttigdx5t5wcn@chazelas.org> <20200412233845.GB1831017@zira.vinc17.org> <20200413142257.orwzb4jrgmf7gpoi@chazelas.org> <20200413214149.GA2644627@zira.vinc17.org> <20200414061816.5qfbjyc6w3x34wcz@chazelas.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Stephane Chazelas wrote on Tue, 14 Apr 2020 07:18 +0100: > 2020-04-13 23:41:49 +0200, Vincent Lefevre: > [...] > > > Which one(s) should find -L . -type l (or find . -xtype l) > > > print? =20 > >=20 > > /etc/passwd/foo > > /etc/pesswd/foo > > symloop/foo > >=20 > > (and I would expect an error message for /root/foo, such as > > "Permission denied", in addition to a non-zero exit status). =20 >=20 > So not that "unambiguous" after all. I could not find a single > find implementation that agrees with your interpretation (not > that it means that your intepretation is better or worse). >=20 > GNU find for instance only prints /etc/pesswd/foo and > /etc/passwd/foo (but outputs an error for the latter) and > returns non-zero for anything but /etc/pesswd/foo. >=20 > What should the outcome be for ESYS123 error code? >=20 > To me, the best approach is zsh's where *(-@) reports *all* > broken links, broken meaning "whose target cannot be resolved". Counter-argument: since an ENOMEM during symlink resolution causes =C2=AB(-@)=C2=BB to presume the symlink is broken, the zsh language is non-deterministic: what =C2=ABintact-symlink(N-@)=C2=BB will expand to will depend on whether there is enough memory at runtime. Shouldn't an ENOMEM during expansion of =C2=ABintact-symlink(N-@)=C2=BB res= ult in an error? "In the face of ambiguity, refuse the temptation to guess." That is: I think there's a qualitative difference between ENOENT and ENOMEM. I'm not sure what to do about unknown error codes. Cheers, Daniel