Zsh Mailing List Archive
Messages sorted by:
Re: realpath(3), symlinks, '..' components, and the ':A' word modifier
- X-seq: zsh-users 21736
- From: Filipe <filipe.silva@xxxxxxxxx>
- To: Vadim Zeitlin <vz-zsh@xxxxxxxxxxxx>
- Subject: Re: realpath(3), symlinks, '..' components, and the ':A' word modifier
- Date: Wed, 6 Jul 2016 12:15:48 -0300
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eposZstOB+R5VeRS7oWIwSgw3V1aVWs7ruhpsj1Ik5g=; b=so20Th1pZMsM6cJ4V08JOH0VzBoeWoGeSRiL6g6ey/T30QCX/jjOf4jNolUR+PupZg yCTTtXdmOAbg6HSbHk10xu3BFUQSHIaZUYq1kZ5t7UdNtrnsFt/ZXAM+R3JX/eFXL6qx 3840urdEO3BAlk9ZCzN6AH26ZPcIPx4K98iXfnDjkT0hAa+260vkoMZHldCpwySfGabo dbVHBL42F4u2J14IMrK+2KRrHePdbXye+1eaYBOHejUtPYLmuuAGQuUP0FBJ802KuYn1 9xSiE+3nil8Y+iVbBskO8cQ2s4GiRLb8V3GozEPC6KWeO7ccW/Qq+opMelHUKsb5iamU rxvg==
- In-reply-to: <E1bKQL3-0000lOemail@example.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20160705045756.GC11492@tarsus.local2> <E1bKQL3-0000lOfirstname.lastname@example.org>
having a script broken by upgrading is such a painful, awful experience.
Couldn't we create another modifier that behaves like realpath? e.g. (:Ar) or even add an option to trigger this realpath compatible behaviour?
> On 5 de jul de 2016, at 10:24, Vadim Zeitlin <vz-zsh@xxxxxxxxxxxx> wrote:
> On Tue, 05 Jul 2016 04:57:56 +0000 Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> DS> Feedback is sought for a proposed behaviour change to the shell.
> DS> Currently, the ':a' word modifier removes '..' component from a path —
> DS> using a purely syntactic transformation, i.e., without consulting the
> DS> filesystem at all — and ':A' does the same and then resolves symlinks
> DS> [so no path component in the result is a symlink].
> DS> It has been proposed to change the semantics of :A to resolve symlinks
> DS> first and '..' components second, like the realpath(3) library function
> DS> does.
> DS> Under the incumbent semantics, $foo:A denotes the same file as $foo:a
> DS> (but not necessarily the same file as $foo). Under the proposed
> DS> semantics, $foo:A denotes the same file as $foo (but not necesarily the
> DS> same file as $foo:a).
> DS> Would this change be a good idea?
> I am not sure why would this be a good idea, the only argument for it I
> see is compatibility with realpath(), but how much does it really matter?
> There would seem to be quite a few flags/modifiers not corresponding to any
> C library functions, so this doesn't seem like such an egregious exception.
> But this change would be backwards incompatible, if only marginally, and
> my personal test for making breaking changes is whether I could see myself
> justifying them reasonably well to someone whose script has got broken
> after updating the shell. If you imagine yourself in such a situation, what
> would your explanation be? I don't think that "we decided to make it
> compatible with realpath(3)" quite cuts it. But this is just my personal
> opinion, of course (and, FWIW, I don't think I personally have any script
> which could be broken by this change anyhow).
Messages sorted by: