Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Anyone interested in implementing O_NOCLOBBER ?



On 17.04.2020 18:46, Robert Elz wrote:
>     Date:        Fri, 17 Apr 2020 16:49:40 +0200
>     From:        Kamil Rytarowski <n54%gmx.com@localhost>
>     Message-ID:  <cb2d0341-30cd-8935-3a25-02ced4c164bf%gmx.com@localhost>
> 
>   | I use this in ksh and I find this as a useful feature.
> 
> If you just mean that you use noclobber mode (set -C) for
> protection (what little it offers) then that's fine - that's
> never going away (and O_NOCLOBBER is largely irrelevant to
> that kind of use).
> 
> If you mean you use noclobber in scripts to aid in implementing
> (sh script level) locking primitives, or for filename generation
> (ie: re-implementing mktemp in sh code for some reason) then I'd
> suggest that you should find a better way.   If you insist on
> continuing that way, then O_NOCLOBBER might allow such mechanisms
> (locking particularly) to work reliably.
> 
> kre
> 

I just use it to protect from overwriting preexisting files by an
accident. If O_NOCLOBBER can be useful in the implementation of this
feature in shells, it is a nice to have addition.

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index