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 Fri, Jun 5, 2020 at 9:55 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> Bart Schaefer wrote on Fri, 05 Jun 2020 18:41 -0700:
> >
> > I don't think that's the intended typical usage of noclobber.  It's
> > not set by default, and it can't have any effect outside the local
> > shell.
>
> NO_CLOBBER causes open() to be called with the O_EXCL bit, which does
> affect other processes as well.

??  All that O_EXCL guarantees is that no other process is able to
create the file.  Once it exists, another file can open it and
truncate it and write to it, unless prevented by umask.



Messages sorted by: Reverse Date, Date, Thread, Author