title: How do I create directory if it doesn't exist to create a file?
body: <p>I have a piece of code here that breaks if the directory doesn't exist:</p>
  
  <pre><code>System.IO.File.WriteAllText(filePath, content);
  </code></pre>
  
  <p>In one line (or a few lines), is it possible to check if the directory leading to the new file doesn't exist and if not, to create it before creating the new file?</p>
  
  <p>I'm using .NET 3.5.</p>