Robert Elz <k...@munnari.oz.au> wrote, on 01 Nov 2016: > > Without getting into the specifics of the proposed change yet, I'd > like someone to explain just what is the fascination with using -C > and '>' for making lock files? > > The time honoured way of making lock files (since way, way, back) is via > the use of link(2) (or ln(1)) which has always provided for atomic creation > of a file name in a perfectly safe, and easy to use manor. > > Why are we bothering to attempt to make > (with -C) atomic just to solve a > problem that already has a better solution ?
The problem is not limited to lock files. That's just being used as an example because it's the case where problems are most likely to occur. > IMO, -C should go back to its original use (from csh where noclobber mode > originated) and have its intended function being to avoid accidental loss > of improtant data due to accidental incorrect use of >filename (with the > wrong filename) and simplify the definition, rather than complicating it. If '>' with set -C is not atomic, then it cannot be relied on to perform this function either. The complicated definition (option 1) is only that complicated because it allows existing practice. Option 2 is much simpler, and I would prefer that, but we are constrained by our rules about existing practice, so we need the other option as a fallback. -- Geoff Clare <g.cl...@opengroup.org> The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England