title: On which systems/filesystems is os.open() atomic?
body: <p><a href="http://www.anattatechnologies.com/q/2012/11/locking-and-concurrency-in-python/" rel="noreferrer">This</a> article states, that</p>
  
  <pre><code>fd = os.open('foo.lock', os.O_CREAT|os.O_EXCL|os.O_RDWR)
  </code></pre>
  
  <p>"is atomic on most filesystems". Is that true (on Unix and Windows)? On which filesystems?</p>
  
  <p>The <a href="http://docs.python.org/2/library/os.html#open-constants" rel="noreferrer">docs</a> state that mentioned flags are available on Unix and Windows, so it looks like a tempting, cross-platform method for file locking (the flags <code>O_CREAT</code> and <code>O_EXCL</code> ensure that the calling process creates the file).</p>