
Miro Jurisic wrote:
In article <cdj26s$et$1@sea.gmane.org>, Vladimir Prus <ghost@cs.msu.su> wrote:
Actually, I'm not sure what it means to atomically create a directory.
It means that if one processes is attempting directory creation and other processes are performing other filesystem operations (including directory creation, but not limited to it), then directory creation in the first process is guaranteed to completely succeed (creating a directory with the desired path and permissions and returning 0) or completely fail (returning an error and not touching the file system). This is not the case on all file systems and on those on which it is, the POSIX API does not guarantee that mkdir() is implemented to take advantage of it.
I'm still at loss. Could you give some specific situations between "completely succeed" and "completely fail". Also, how does it affect temporary files? The only case which seems to be problematic is when 'mkdir' returns success but does not set the right permissions. Is it ever possible? My reading of the docs suggests otherwise. - Volodya