From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22323 invoked by alias); 28 Jun 2015 00:02:13 -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: 35648 Received: (qmail 8181 invoked from network); 28 Jun 2015 00:02:08 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 Message-ID: <558F397D.9030708@inlv.org> Date: Sun, 28 Jun 2015 02:02:05 +0200 From: Martijn Dekker User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: zsh-workers@zsh.org Subject: Re: '>>' does not create file if set -C (noclobber) is active 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> In-Reply-To: <20150627180230.5fda7e09@ntlworld.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Peter Stephenson schreef op 27-06-15 om 19:02: > This isn't very elegant, but nor is it obviously problematic, and it > does at least draw attention to a potential issue. I've tested this patch against the current git version and noticed the following: - The new clobberappend option is on by default, but 'set -C' (-o noclobber) turns clobberappend off. Conversely, 'set +C' (+o noclobber) turns it back on. This applies even when noclobber is already on or off. - Contrary to the documentation, unsetting clobberappend has effect even when noclobber is not active. IOW, this currently provides a way to keep '>>' from creating files even when noclobber is off. - 'emulate sh' and 'emulate ksh' do not make any difference to the above. While it's good to be able to modify this behaviour, this does not achieve POSIX compatibility for 'set -C': even in the emulation modes, '>>' still won't create nonexistent files, and enabling this ability requires a zsh-specific 'set -o clobberappend' command. At the risk of pedantry, I also wonder if 'createappend' or 'appendcreate' would be a better name, since "clobbering" is commonly understood to mean overwriting pre-existing files, not creating new ones. Hope this helps, - M.