title: Phonegap - Creating a .txt file on first load
body: <p>I am creating a phonegap app and need to create a new .txt file on first load. After this I need to check whether the file exists and then ignore the creation if that is the case, below is the general flow that I am after:</p>
  
  <p>1 - onDeviceReady - loading phoengap app
  2 - Check is readme.txt exist (if yes load home page)
  3 - Create a file readme.txt and add to www folder
  4 - Continue loading homepage</p>
  
  <p>EDIT - Rather than the valid answer mentioned below I decided to use HTML5s local storage as this was simply 1 line of code.</p>
  
  <pre><code>localStorage.setItem("name", "Email Supplied!");
  </code></pre>
  
  <p>and can be checked using this simple if statement</p>
  
  <pre><code> if (localStorage.getItem("name") == "Email Supplied!")
          {
              // What you want to happen here
          }
  </code></pre>