On 09/06/2012 10:12 AM, Bob Proulx wrote: > The file replacement is atomic. The reading of the file is not.
Sure, but the point is that from the end user's point of view, 'sed -i' is not atomic, and can't be expected to be atomic. 'sed -i' and 'sort -o' both use some atomic operations internally, but neither is atomic overall. Users who want atomicity must look elsewhere, or implement it themselves.