News for hackers. Stuff that matters.
Re:Things UNIX can do atomically by samuel on Wednesday January 06, 2010 @01:00PM (#1035217)
One more: mkdir(2)
Re:Things UNIX can do atomically by jrockway on Wednesday January 06, 2010 @04:04PM (#1035753)
How would mkdir not be atomic? It is a logical operation that only encapsulates a single physical operation.

Rename is an interesting case, because it encapsulates two operations - a copy and a delete. Doing two operations in one step is interesting atomicity. Doing one operation in one step (mkdir) is not as interesting.

Re:Things UNIX can do atomically by geocar on Wednesday January 06, 2010 @04:30PM (#1035820)
See Phrack 25: http://www.phrack.com/issues.html?issue=25&id=5 for what it was like when mkdir was not atomic.
Re:Things UNIX can do atomically by skorgu on Wednesday January 06, 2010 @07:50PM (#1036203)
mkdir can fail atomicity if non-local storage is involved: http://www.mail-archive.com/[email protected]/msg2...

I still use it for the quick-and-dirty lockfile case despite this.