function gotFS(fileSystem) {
console.log("got filesystem");
// save the file system for later access
console.log(fileSystem.root.fullPath);
window.rootFS = fileSystem.root;
}
document.addEventListener('deviceready', function() {
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}, false);
With this code you'll have a DirectoryEntry object for the root directory of your app stored in the global variable "rootFS". You can get the path of that folder like this:
rootFS.fullPath
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…