Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Any way to allow clobbering empty files when noclobber is set?



> 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