title: Copying a file using Cordova
body: <p>I've been trying to copy file named versions.txt from applicationDirectory to externalApplicationStorageDirectory using cordova but code fails.</p>
  
  <p>here is the code</p>
  
  <pre><code>var path = cordova.file.applicationDirectory + "www/Data/versions.txt";
  
        window.resolveLocalFileSystemURL(path,
        function gotFile(fileEntry)
        {
  
            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
                function onSuccess(fileSystem)
                { 
                        var directory = new DirectoryEntry("versions.txt", path);
  
                        fileEntry.copyTo(directory, 'versions.txt',
                            function()
                            {
                                alert('copying was successful')
                            },
                            function()
                            {
                                alert('unsuccessful copying')
                            });
  
                }, null);
        },null);
  </code></pre>
  
  <p>Any help?</p>