title: How to check whether a directory exists or not in delphi XE2?
body: <p>I want to create a directory say <code>TestDir</code> but only when that directory does not exist. I don't find the way the check the existence of that directory.</p>
  
  <p>I am using following function to create the directory.</p>
  
  <pre><code>CreateDir('TestDir')
  </code></pre>
  
  <p>How should I make sure that I use this <code>CreateDir</code> function only when <code>TestDir</code> does not exist? </p>