Current-Users archive

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

Re: Anyone interested in implementing O_NOCLOBBER ?



    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



Home | Main Index | Thread Index | Old Index