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);
Run Code Online (Sandbox Code Playgroud)
使用此代码,您将在全局变量“rootFS”中存储应用程序根目录的 DirectoryEntry 对象。您可以像这样获取该文件夹的路径:
rootFS.fullPath
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21019 次 |
| 最近记录: |