Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Next release (5.3)
- X-seq: zsh-users 21749
- From: Filipe Silva <filipe.silva@xxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: Next release (5.3)
- Date: Tue, 12 Jul 2016 23:56:39 -0300
- Cc: zsh-users@xxxxxxx
- 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==
- In-reply-to: <37271.1468354988@hydra.kiddle.eu>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20160712075849.GG1537@isis.sigpipe.cz> <160712094017.ZM17395@torch.brasslantern.com> <37271.1468354988@hydra.kiddle.eu>
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 <okiddle@xxxxxxxxxxx> 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
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author