title: How to make file creation an atomic operation?
body: <p>I am using Python to write chunks of text to files in a single operation:</p>
  <pre><code>open(file, 'w').write(text)
  </code></pre>
  <p>If the script is interrupted so a file write does not complete I want to have no file rather than a partially complete file. Can this be done?</p>