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 3220 invoked from network); 4 Jun 2020 05:01:05 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 4 Jun 2020 05:01:05 -0000 Received: (qmail 27072 invoked by alias); 4 Jun 2020 05:00:56 -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: 45961 Received: (qmail 2637 invoked by uid 1010); 4 Jun 2020 05:00:56 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot1-f68.google.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(209.85.210.68):SA:0(-1.9/5.0):. Processed in 2.236237 secs); 04 Jun 2020 05:00:56 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.210.68 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ORpzUxNNzFfqs7+C9MKu0Hjyvu3wFbm1Jd9OO4C1JtU=; b=boBsT61uIQX3Q1GOjGgzOmnspDaKU1YjYkmBH9G8CyIsZfPwOV4faVcjAV49FIUN7h G2lay/tRaRTVzpAqvhPjwBPDvSsUtL+yHuj7mTr6Sdis2zh3LClKQjssLd/9TlyM+qJO ykEmcHir5mxtA2Cdq+fyK7/nntoUlHAfU9CpG//G+xZY8QmvS3i1L+3FaV+P8Hb1hvmg uNefsabd28A4yNNLzOwM98JE7RiM/SUigyo6wVLtiWYJyhrESnUErmupvxOenbve2Z9v ihEmMd79LL52sf11pU9r+oga17dPyGzEIAX7m2GEvgu0tjFy2lUDYfcy3wZuodxWCGhx Q9KQ== X-Gm-Message-State: AOAM532znZ+mvBI8MLPh3ZJkGm0IkKsgHZbyfHOy8lmZvVzVgFpSO7pn m8KNIHmME5l/12Af5fntHENnRUNbTiTP2iEJgVzTdc/HuRg= X-Google-Smtp-Source: ABdhPJzlYghCwEaL1sPQ3mXbURjPjy0P4Tiwh0cWEsPeDxEE8drABG8Fa1PyV3lMPkUMpo/JBO6Bmv4G52UI/aEJANw= X-Received: by 2002:a9d:7e8e:: with SMTP id m14mr2566198otp.229.1591246820766; Wed, 03 Jun 2020 22:00:20 -0700 (PDT) MIME-Version: 1.0 References: <89aed74d-db7b-47ad-b218-8158838049e9@www.fastmail.com> <94e73ebcf39d4d3f9c7ae257b1d75d16@CAMSVWEXC01.scsc.local> <20200604014850.52d241bd@tarpaulin.shahaf.local2> In-Reply-To: From: Bart Schaefer Date: Wed, 3 Jun 2020 22:00:09 -0700 Message-ID: Subject: Re: Any way to allow clobbering empty files when noclobber is set? To: Daniel Shahaf Cc: "zsh-workers@zsh.org" , Martin Tournoij Content-Type: text/plain; charset="UTF-8" On Wed, Jun 3, 2020 at 9:06 PM Daniel Shahaf wrote:> > > [ Let's call this UNLINK_EMPTY_AFTER_FAILURE for the sake of discussion. ] > > Bart Schaefer wrote on Thu, 04 Jun 2020 02:43 +00:00: > > > > How does that user experience differ from HIST_ALLOW_CLOBBER? > > Well, for one, because that proposal only takes effect when foo exited > non-zero, created bar, and bar is zero-sized? Fair enough, although (silly example) "false > empty" would remove the file? Wouldn't you at least want the reason for the unlink to be that the redirection failed, rather than that the command exited non-zero? What if the redirection target is a symbolic link? What if it isn't a plain file? > > and silently unlinking a file is not very friendly. The /etc/nologin > > example in your next message comes to mind. > > Doesn't this argument also apply to anyone who might set CLOBBER_EMPTY > and then lose the timestamps on empty files, as in your next message? Yes, but to a lesser degree, because the file is at least still present if it's presence means something. > Seriously, though, it's perfectly possible that CLOBBER_EMPTY is the > better solution here. I was only brainstorming. Sure, you just got me curious about thinking through it.