title: Create and/or Write to a file
body: <p>I feel like this should be easy, but google is totally failing me at the moment.  I want to open a file, or create it if it doesn't exist, and write to it.</p>
  
  <p>The following</p>
  
  <pre><code>AssignFile(logFile, 'Test.txt');
  Append(logFile);
  </code></pre>
  
  <p>throws an error on the second line when the file doesn't exist yet, which I assume is expected.  But I'm really failing at finding out how to a) test if the file exists and b) create it when needed.</p>
  
  <p>FYI, working in Delphi XE.</p>