0

Upgraded my app to phonegap 3.4 and reading a text file (db.txt) in the root of the www folder now fails. The following snippet used to work:

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, this.gotFS, this.fail); 
this.gotFS = function(fileSystem) {
        console.log(fileSystem.name);
        fileSystem.root.getFile("../MyappName.app/www/db.txt", {create: false, exclusive: true}, file_reader.gotFileEntry, file_reader.fail);
    };

I've read here some changes occured in the file api but even if I use

fileSystem.root.getFile("db.txt", {create: false, exclusive: true}, file_reader.gotFileEntry, file_reader.fail);
        };

or

fileSystem.root.getFile(fileSystem.root.toURL()+"db.txt", {create: false, exclusive: true}, file_reader.gotFileEntry, file_reader.fail);
        };

file_reader.fail is always called with the error code of 5 which is ENCODING_ERR.

So basically how do you read a file in the root of the www folder with the new file api?

0 Answers0