From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32703 invoked from network); 5 Jun 2020 02:23:07 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 5 Jun 2020 02:23:07 -0000 Received: (qmail 16739 invoked by alias); 5 Jun 2020 02:23:01 -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: List-Unsubscribe: X-Seq: 45978 Received: (qmail 29236 invoked by uid 1010); 5 Jun 2020 02:23:01 -0000 X-Qmail-Scanner-Diagnostics: from wout5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25828. spamassassin: 3.4.4. Clear:RC:0(64.147.123.21):SA:0(-2.6/5.0):. Processed in 0.74805 secs); 05 Jun 2020 02:23:01 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudegvddgheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfgjfhfogggtgfesthhqtddtredtjeenucfhrhhomhepffgrnhhi vghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgeqne cuggftrfgrthhtvghrnhephfdtteefheevuedthedutdeifeegteettdejtdffheduieei jeelteetkeduteehnecukfhppeejledrudejiedrfeelrdeileenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhh rghhrghfrdhnrghmvg X-ME-Proxy: Date: Fri, 5 Jun 2020 02:22:23 +0000 From: Daniel Shahaf To: "Martin Tournoij" Cc: "Peter Stephenson" , zsh-workers@zsh.org Subject: Re: Any way to allow clobbering empty files when noclobber is set? Message-ID: <20200605022223.1e5fcef4@tarpaulin.shahaf.local2> In-Reply-To: <92413353-973e-4bc5-94fa-7bb5b7f2fae0@www.fastmail.com> References: <89aed74d-db7b-47ad-b218-8158838049e9@www.fastmail.com> <94e73ebcf39d4d3f9c7ae257b1d75d16@CAMSVWEXC01.scsc.local> <20200604014850.52d241bd@tarpaulin.shahaf.local2> <92413353-973e-4bc5-94fa-7bb5b7f2fae0@www.fastmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Martin Tournoij wrote on Thu, 04 Jun 2020 14:31 +0800: > The thinking was that it's the "least magical" behaviour I could think of: > if I tell zsh to "NO_CLOBBER" then I'm telling it to "don't make me lose > data when I'm being stupid". I think allowing it to overwrite empty files > fits rather nicely with the intent of NO_CLOBBER. >=20 > This seems less magic to me than "> creates a file, except when [...]". >=20 > That being said, you solution would obviously also be workable, and don't > overly care one way or the other, but this was my thinking behind it. >=20 *nod* I was going to give as an example commands such as =C2=ABtar -cf foo /does/not/exist=C2=BB, =C2=ABcurl -o foo https://will/respond/404/not/f= ound=C2=BB, and so on, but it turns out they actually do create a zero-length file and return non-zero. The evidence does seem to argue in favour of the CLOBBER_EMPTY approach=E2= =80=A6 > Also, I'm almost disappointed Peter wrote a patch already, as I was looki= ng > forward to doing it myself heh =F0=9F=98=85 Our apologies, then =E2=98=BA Perhaps you'd be interested in writing some other patch? See Etc/BUGS and Test/list-XFails for known issues. workers/45843#1, for example, is a recently-reported segfault. Cheers, Daniel