title: Issues with build.phonegap write to file
body: <p>I'm trying to build a <a href="http://en.wikipedia.org/wiki/PhoneGap" rel="nofollow noreferrer">PhoneGap</a> application through the <a href="https://build.phonegap.com" rel="nofollow noreferrer" title="build.phonegap.com">online build service</a> that should run on both <a href="http://en.wikipedia.org/wiki/IOS_%28Apple%29" rel="nofollow noreferrer">iOS</a> and <a href="http://en.wikipedia.org/wiki/Android_%28operating_system%29" rel="nofollow noreferrer">Android</a>, but this question focuses on the Android part.</p>
  
  <p>The main target of the application is to be able to access and modify the filesystem.
  Inspired from <a href="http://www.raymondcamden.com/index.cfm/2012/3/9/PhoneGaps-File-API" rel="nofollow noreferrer">Raymond Camden's blog post</a>, I ended up writing a sample application very similar to his, that accesses the filesystem with read/write privileges. The main difference is that my application is built online without any SDK installed and without caring about any <em>androidManifes.xml</em> file.</p>
  
  <p>My <strong>problem</strong> is that I am able to access the filesystem (list directories, read files), but I am not able to write anything on it.</p>
  
  <p>I have included the <a href="https://build.phonegap.com/docs/config-xml" rel="nofollow noreferrer">necessary <code>&lt;feature /&gt;</code> tag in the <em>confix.xml</em></a> in order to have file access permissions:</p>
  
  <pre><code>&lt;feature name="http://api.phonegap.com/1.0/file"/&gt;
  </code></pre>
  
  <p>Here is some sample code used in my application:</p>
  
  <h3>Read file code:</h3>
  
  <pre><code>// Request fileSystem
  fileSystem.root.getFile(fileName, {create:true}, readFile, onError);
  
  // Function that reads a file
  function readFile(file){
      var reader = new FileReader();
      reader.onloadend = function(e) {
          console.log("contents: ", e.target.result);
      }
      reader.readAsText(file);
  }
  </code></pre>
  
  <h3>Write/append file code:</h3>
  
  <pre><code>fileSystem.root.getFile(fileName, {create:true}, function(file){
      file.createWriter(function(writer) {
          writer.onwrite = function() {
              console.log('writing', arguments);
          }
  
          writer.onerror = function(e) {
              console.error('error', e);
          }
  
          writer.onwriteend = function() {
              console.log('writeend', arguments);
          }
  
          //Go to the end of the file...
          writer.seek(writer.length);
  
          // Append a timestamp
          writerOb.write("Test at "+new Date().toString() + "\n");
      })
  }, onError);
  </code></pre>
  
  <p>The second code sample doesn't write anything in the targeted file and the <code>onerror</code> handlers shows that it's because of a <code>NOT_FOUND_ERR</code>. And this just doesn't make sense, because I am able to read that same file (and it can be <em>found</em>).</p>
  
  <p>In the same manner, when I try to create a new file (with the same code from <em>write/append file code</em>, but where the targeted file doesn't exist), I get a <code>INVALID_MODIFICATION_ERR</code> error.</p>
  
  <p>I have also tried <a href="http://docs.phonegap.com/en/2.5.0/cordova_file_file.md.html#FileReader_full_example" rel="nofollow noreferrer">the example in the official documentation</a> and I got the same result (read and no write).</p>
  
  <p>Note that since PhoneGap is using the HTML5 file <a href="http://en.wikipedia.org/wiki/Application_programming_interface" rel="nofollow noreferrer">API</a>, I've tried to write the contents through <a href="http://www.w3.org/TR/FileAPI/#dfn-Blob" rel="nofollow noreferrer">blobs</a> as suggested in <a href="https://stackoverflow.com/questions/7685020/how-to-create-a-text-file-locally-at-client-side-using-javascript-jquery">this Stack&nbsp;Overflow answer</a> (and in other sites) without any luck.</p>
  
  <p>What am I missing? Do I need a separate plugin for writing files or is this something that can't be done via the online build tool and I have to download the SDK and compile the application the old fashioned way?</p>
  
  <p>P.S.: My PhoneGap version is <strong>2.3.0</strong>.</p>