From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29834 invoked by alias); 28 Jun 2015 09:21:25 -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: X-Seq: 35652 Received: (qmail 25004 invoked from network); 28 Jun 2015 09:21:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1435482955; bh=F6ygxjrHbQrm5kRhri6ZzgEfl8Ez9w2t69M4+LlkWn4=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=T7QA8dICjoKHsroF6c/SLGrlGj0EMKiJ8mFCXQkBgAlB9MynIiomO1c7vKzPI3YIHTjtXj+rqA/YVMN6nRixPhqSYtTsUPQrEGHqW+U2Wu0WtKyt3hNL9CMBkovvd7SQtbyrYY2HDGwBM4WryWG5JemKRZZ8q71A5qhYuRV5JLMu4/+dZ4o9rRoorqxNLEzWtwUu4PD187es6B1o8XRetuguNvHAWKbS0vByOZzabDvUjhBeOPzXihX2jtKmECxSbor5VkVbxyt2EMb1wY30o2wkMLN9rDsg+q145O2M5iVnPnh6AZoa1BqJU3AtgHq7+B22TYgUnrrYlmSKKLvshw== X-Yahoo-Newman-Id: 631589.17526.bm@smtp124.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: bElDf2MVM1ksHQuUnDc.RTaGeGHAYKmT1N6AQk.GBIIGZwM 6pKB0CxiKFXlxv6_GANonG2LWGeGQ1hcpUHWPaM.JmpSl3W4GDzmm5qAjNQ6 jR9jP0h5GYfmjC7zn3hGpLcryezBiRLSNUTqbiBlfdDwFXUERk7WIXiD1.7r e9fNAZwl6uRK_uMnah.akscxCOGMGP9SmlPwbxsucI0bUFgINiP285s4WXM_ TFL_UxEIJV1NFd0ienseoGZ4vMV_Ct.p3H2ZZqx2Fy5vfLYCT9flL8iXXKyO yd6CCV8PVYHlfSwPSi2CTqXf2jBw33nQJDYaqREjvf8QgjCtIEtykh0mUw3g _Mxc88aChcI0VXg2gvv8XFFqSYb2W8.8kKzDormZiLsLC_jdXNwadfkCZqnN JpV8OmKPJ.KOi4F1KYiPGWqyh3ikCKGP2TRimIoL4DEGBHwUyTr4g2B1_aLY T0lqscEN2ND5sywvAb.ILPVsWMzODprjoLmSxiCuPoes484XUtzw3dJHYtDG PUmLwOTyaYTA7BLLJCnqLuJ9vKPysRg-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <20150628074837.GB4818@chaz.gmail.com> From: Oliver Kiddle References: <558B5342.2090706@inlv.org> <150624184916.ZM19079@torch.brasslantern.com> <558B65EB.3060204@inlv.org> <150625003047.ZM19218@torch.brasslantern.com> <558D5E34.3020505@inlv.org> <20150627180230.5fda7e09@ntlworld.com> <558F397D.9030708@inlv.org> <20150628074837.GB4818@chaz.gmail.com> To: zsh-workers@zsh.org Subject: Re: '>>' does not create file if set -C (noclobber) is active MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16433.1435482953.1@thecus.kiddle.eu> Date: Sun, 28 Jun 2015 11:15:53 +0200 Message-ID: <16434.1435482953@thecus.kiddle.eu> Stephane Chazelas wrote: > I agree it's a potentially useful feature to prevent >> from > creating files, but it shouldn't be done upon a "noclobber" > option as it's the opposite meaning that noclobber conveys. If we're preserving backward compatibility for both states of the clobber option, it has to be linked to the noclobber option. I'm not so bothered about the name but perhaps a CSH_ prefix on it would make sense. > BTW, slightly related, I think it would be nice for the shell to > have access to some of the other open() flags. I often found > myself wishing I could use O_NOFOLLOW for instance. > > How about a <(flags)> operator O_NOFOLLOW is fairly easily emulated, either with a condition or, if you really want succinct, a glob qualifier: > file(^@) But for other flags like O_CLOEXEC or O_SYNC, you can't do much. We'd also have to worry about how portable each of the open flags are. New syntax has additional costs such as making scripts less readable. An alternative would be to add a sysopen builtin to the zsh/system module. Or perhaps a -o option to exec, e.g. exec -o nofollow 3>file > That could even be extended to do lseeks(), dups(), (3<(>+20)> > to lseek(3, 20, SEEK_CUR))... Recent ksh has <#((offset)) and <##pattern for seeking. Along with (( fd<# )) to get the current position. I'm not sure how useful that would really be, especially as byte offsets are less meaningful when you have multibyte encodings. Oliver