Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^3: Safely create new directory

by BrowserUk (Patriarch)
on Jul 26, 2012 at 14:51 UTC ( #983851=note: print w/replies, xml ) Need Help??

in reply to Re^2: Safely create new directory
in thread Safely create new directory

nformation in this thread that mkdir is in fact atomic

I don't believe that atomicity of mkdir was ever in doubt as far as local filesystems are concerned.

The question, I thought, was about whether it remained atomic for NFS mounted directories.

My point in posting was -- on ancient HP/UX, where mkdir was tested and found atomic on NFS-mounted drives -- not just that that simple form of loop was sufficient to obtain a unique directory, but actually that it is far more likely to be reliable than the two-stage mechanisms that create files first, then directories.

Tendered with the clear caveat of the ancient state of my knowledge, I fail to see that creating a file -- just another name in the directory space -- is any more likely to be atomic than creating a directory.

But ... that is based on logic alone; not current, OS-specific knowledge.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://983851]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2023-09-26 22:54 GMT
Find Nodes?
    Voting Booth?

    No recent polls found