PhoneGap - 如何在assets/www/example/hallo.text
我的错误中创建一个新文件是"Error fileSystem"
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
function fail() {
confirm('Error fileSystem');
}
function gotFS(fileSystem) {
fileSystem.root.getFile("file:///android_asset/www/example/hallo.text", {
create: true
}, gotFileEntry, fail);
}
function gotFileEntry(fileEntry) {
fileEntry.createWriter(gotFileWriter, fail);
}
function gotFileWriter(writer) {
writer.write("hallo");
}