title: PhoneGap (Android) Delete Directory
body: <p>I'm trying to delete a directory and it's contents with <code>PhoneGap on Android</code> using:</p>
  
  <pre><code>deleteDirectory = function deleteDirectory(uri) {
      uri = uri.substring(0, uri.lastIndexOf('/'));
      return $.Deferred(function (def) {
          fileSystem.root.getDirectory(uri, {
              create: false
          }, function (directory) {
              directory.removeRecursively();
              def.resolve();
          }, function (error) {
              resolveError("Error deleting directory: ", error, def);
          });
      }).promise();
  }
  </code></pre>
  
  <p>with the following error: <code>File No Modification Allowed Error</code></p>
  
  <p>I've confirmed this permission is set: </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  </code></pre>
  
  <p>Where else should I be looking?</p>