News for hackers. Stuff that matters.
Re:Unix shells are generally not viable access control mecha... by naasking on Monday September 18, 2023 @10:54AM (#37556949)
> You would have to lock the file, or guarantee consistency in some other way.

I think the standard approach to atomicity is to copy, change the copy, then move that copy overwriting the original (edit: file moves are sorta atomic). Not perfect but generally works.

I agree that this approach is not good for a users directory, I'm just disagreeing that the reason is performance-related.

Re:Unix shells are generally not viable access control mecha... by fragmede on Monday September 18, 2023 @06:08PM (#37562765)
Moves are atomic. During the move, at no time is it possible to get the contents of file 1 and file 2 confused when reading from the file descriptors. (Confusion by the human operating things is eminently possible.)