带有Ripple模拟器和getDirectory的FileError

时间:2014-04-25 04:07:51

标签: cordova ripple

我在尝试在Phonegap应用程序中创建本地目录时收到了FileError。我正在使用Ripple Emulator进行测试。我已经安装了Cordova File Plugin

首先,我要求文件系统如下:

window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, onFileSystemSuccess, onFileSystemFail);

我的成功处理程序触发:

function onFileSystemSuccess(fileSystem) {
    console.log('fileSystem.root: ', fileSystem.root);
    var entry = fileSystem.root;
    entry.getDirectory("myDirectory", {create: true, exclusive: false}, getDirSuccess, onFileSystemFail);
}

该console.log报告有效的DirectoryEntry对象。但是后来调用了getDirectory错误处理程序:

function onFileSystemFail(evt) {
    console.log("onFileSystemFail: ", evt);
}

记录以下内容:

  

onFileSystemFail:FileError {code:1}

根据the docs,这是一个NOT_FOUND_ERR。但我的理解是,如果无法找到目录,创建标志将会生成目录。

那我为什么会得到这个FileError?

我正在使用:

  • Phonegap 3.4.0-0.19.18
  • Ripple 0.9.22
  • Chrome 34.0.1847.131

0 个答案:

没有答案