From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8547 invoked by alias); 13 Jul 2016 02:56:45 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21749 Received: (qmail 7529 invoked from network); 13 Jul 2016 02:56:45 -0000 X-Qmail-Scanner-Diagnostics: from mail-oi0-f51.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.218.51):SA:0(0.0/5.0):. Processed in 0.261867 secs); 13 Jul 2016 02:56:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: filipe.silva@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.218.51 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1fKsvc0HQzpS20znVYjZviDok5IZU+6DUF003trdKfw=; b=l3DxT3DLaLfWfCGYqMMUzkVvF1ZsW87ZgccC9ZSby57YEybhi4QqypgaisuM42a/3E dLGAueRbR/0WxI33VnjhTE4jsdXT/DfDAwjlFM+Oq2MhG3mA4i/2IuevNarzv0Fa4YeE 9u0ak1z0MgCM7LoEpBDt1AuhLAVmk7abJqwh6t+mo5bsaNiBfuy5ptizl74THlwRQef7 hnWiGEepgiz+WULZ0RDjTxj0fQB1QR2B17WtKdlqAatfjMYUJqHYMDhFKsBrEx0hy9k1 J3eKWArUcyJaiWwUbUpKBZ4CZnd5wwDaeHDcC4/p32NperTzYjfxCOKFK9DBTjuObyOX YV8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1fKsvc0HQzpS20znVYjZviDok5IZU+6DUF003trdKfw=; b=Uh2jIn/A1e6o4jkSHiras6ljsErDxzNt+kXBpcuZMtPyJwBobv9+61zTUcTk5twu7M d+LvR641A6Ck60alWnzFQXjeuUi6LqCE1ZWPOa/0ESIssd+tWkDsJiXOYzbwnDMAi52I YiidN3O+bMbRRUKUbhnVhYKRbOGJiQ3MMXiD7+IRwLyftoQTcGvCwlcVKwIPsVsOQCcx yD0A9bV1BMBCYZGIC+yaUv8LeePtzCIlGY2rgRGea4zU3aLqQJ0orY2wL42i6Dy7UMJx n+3//oDIrezImeySXYqTUJFtUOr2MQ9bjoFKs9TsFldH1a2XW1+WLE/SvMKJg3vcHbfc 6fvQ== X-Gm-Message-State: ALyK8tK1J8bxaOQ7mAiRKt2PSsMS1m9fYLfz3hqiEcVUou4OZmlsbcc5n/uGQKU7Q0Aab8Bptxo6kfH8mKse8w== X-Received: by 10.157.48.106 with SMTP id w39mr3662812otd.108.1468378599790; Tue, 12 Jul 2016 19:56:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <37271.1468354988@hydra.kiddle.eu> References: <20160712075849.GG1537@isis.sigpipe.cz> <160712094017.ZM17395@torch.brasslantern.com> <37271.1468354988@hydra.kiddle.eu> From: Filipe Silva Date: Tue, 12 Jul 2016 23:56:39 -0300 Message-ID: Subject: Re: Next release (5.3) To: Oliver Kiddle Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=001a113adb00d6210705377b8868 --001a113adb00d6210705377b8868 Content-Type: text/plain; charset=UTF-8 Wait good people. Maybe I am missing something, but why the specific focus on the non-posix `realpath`? Doesn't `readlink -f` emulates what realpath does but it is always available because it is posix? Maybe :A should really call `readlink -f`? Makes sense? On Tue, Jul 12, 2016 at 5:23 PM, Oliver Kiddle wrote: > Bart wrote: > > Thanks for the concise summary. > > > The present situation is: > > > > 1. :a performs a string-manipulation on the path to remove any > > relative path segments. > > 2. :A does (1) and then calls realpath on the result. > > The only advantage I can think of that is that it might do what you want > in the case where you don't have read permissions on one of the > intermediate directories. Otherwise, the potential for the result being > a different file is not good. > > > This matches the documentation. > > > > Daniel is arguing that (1) is essentially useless and calling realpath > > after that may give a different result than realpath on the original > > path string. His suggestion is: > > > > 1. :a is as before > > 2. :A calls realpath, and does (1) only if there is no realpath > > That seems like a good approach. It might also try (1) if realpath fails. > > I don't have many uses in scripts to check but I'd expect it'd be > more likely to fix scripts than introduce a bug. > > With that approach, I guess you could get the original :A behaviour by > chaining the modifiers - :a:A > > And adding modifiers just makes it harder to work out which one you > want. I could see a use for a pure readlink one, however. > > > (It's unclear to me whether there would be any reason to do (1) AFTER > > calling realpath.) > > > > The emerging consensus seems to be for: > > > > 1. :a is as before > > 2. :A is as before > > 3. new modifier calls realpath and does (1) if no realpath > > > > Is there one of those three cases with which you agree, or are you in > > fact asking for zsh to re-implement realpath internally? > > If systems lacking realpath were common, it would be worth doing > but from a check of online man pages it seems to be there on currently > relevant systems. Our own implementation might handle unreadable > directories followed by ../ but there might be some OS specific > oddities: case-insensitivity on macOS and Solaris xattrs come to > mind. > > Oliver > --001a113adb00d6210705377b8868--