Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Add chmod builtin
- X-seq: zsh-workers 44136
- From: dana <dana@xxxxxxx>
- To: Matthew Martin <phy1729@xxxxxxxxx>
- Subject: Re: Add chmod builtin
- Date: Sun, 17 Mar 2019 06:27:46 -0500
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tdEH00wmfYt7T4H1sldGY2sMxSP0N86U63JBhpIF2DU=; b=im2gz61w+2k+l9XSCaLvVF+XkZPZeVeQSdIsBf3upNs+8ExmD+THBK5Nt+uLVoHMiP U3W5l/4sQM3bipvReAQBHDtL3NUbjff9F+jq9bU0grJkaNe2boqwKDZKJNM4+qa+B7+G evynUX+v88KcCz9WutgFSn5iKYkayAZ3QT4GbH1LQGXWglKNEGqBRKlHVeHy+fUzTyPe wcu9TpZP7rRmcBhvjg6ozOmnu0oqbFWIETlRxxRL5/I1ov1Meg9F2hmwt/yNGX0ErdL2 nIXsuzVjNtD8/9VPNi9/gfvEXqBUxzDX4+o6/uaWOJbqAb56TtAurGtUBSbefS7OiDe0 CqqA==
- In-reply-to: <CAGnh9tCS+EU3BujFTQDwVLWxjsruxpdte05-BfgMSmOY8uX+Fw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAGnh9tCS+EU3BujFTQDwVLWxjsruxpdte05-BfgMSmOY8uX+Fw@mail.gmail.com>
On 16 Mar 2019, at 22:08, Matthew Martin <phy1729@xxxxxxxxx> wrote:
>Previously in #zsh "so sad that there is no zf_chmod". So here we are.
ty
One issue i mentioned when testing this is that it always follows symlinks
found in the tree when working recursively, which isn't how any real-world
chmod(1) works. The existing chown/chgrp built-ins have the same issue,
though, so it doesn't seem necessarily like a blocking thing.
>+if zmodload -e zsh/files && [[ $words[1] != */* ]]; then
I don't think this is reliable. It will detect any chmod as the built-in even
if only zf_chown is loaded (with -F). And `zmodload -e` always returns 1 for
modules loaded through selective auto-loading (-Fa), so it will *never*
detect the built-in in that case. (Not sure if that -e behaviour is intended?)
I know the $OSTYPE-$variant thing is dumb (should have passed $OSTYPE directly
to _pick_variant), but otherwise i think the method i used for distinguishing
the built-ins in _stat is fairly robust.
PS: Your patch seems to have corrupt white space
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author