Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Any way to allow clobbering empty files when noclobber is set?
- X-seq: zsh-workers 45970
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Any way to allow clobbering empty files when noclobber is set?
- Date: Thu, 4 Jun 2020 13:26:48 +0100 (BST)
- Cc: Martin Tournoij <martin@xxxxxxxxxx>
- Importance: Medium
- In-reply-to: <CAN=4vMq0iRVjcSDOTSc-tzqK1Uq1X3pa83s9ZT=1auZBxfXxkw@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: <CGME20200603020919eucas1p13e26ebcbb335784d14bfb97b137f385a@eucas1p1.samsung.com> <89aed74d-db7b-47ad-b218-8158838049e9@www.fastmail.com> <94e73ebcf39d4d3f9c7ae257b1d75d16@CAMSVWEXC01.scsc.local> <CAH+w=7YpQ3CcsMhAvztGHx19FnALBV349RAz4p8iuB+_8AnsxQ@mail.gmail.com> <483300941.422089.1591263753638@mail2.virginmedia.com> <CAN=4vMq0iRVjcSDOTSc-tzqK1Uq1X3pa83s9ZT=1auZBxfXxkw@mail.gmail.com>
> On 04 June 2020 at 13:20 Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
> On Thu, Jun 4, 2020 at 11:43 AM Peter Stephenson
> <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > At the least we'd need to open the existing file without
> > truncating (then either close it or leave it open for writing
> > if it was already empty).
>
> If you mean opening the file with O_APPEND, this could result in
> unexpected file content.
>
> I should also note that the existing no_clobber option can be used to
> implement file locks.
>
> Regardless of what gets decided w.r.t. no-clobber extensions, I hope
> this would keep working.
Indeed, this is the sort of thing backing up my thinking that we keep
the clobbering open function call exactly as it now is if we add the
extension for empty files.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author