0
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){
fileSystem.root.getFile(localPath, { create: false }, function(fileEntry) {
doSomethingGood();
}, function(err) {
alert(err.code);
});
});
在我的文件系統中存在localPath中指定的文件。我仍然收到錯誤回撥。它提醒代碼:1000
。這很奇怪,因爲根據調試,錯誤代碼應該是FileError
中的錯誤代碼之一,等於1到12(http://cordova.apache.org/docs/en/2.5.0/cordova_file_file.md.html#FileError)。那麼錯誤代碼1000
想告訴我什麼?如果文件存在,爲什麼會拋出錯誤回調? getFile方法調用具有奇怪錯誤代碼(1000)的錯誤回調 - 儘管文件存在
你得到你的日誌(堆棧跟蹤)任何其他錯誤?在'FileUtils' – benka 2014-09-02 12:22:59
中錯誤'1000'被定義爲'UNKNOWN_ERR',你是否請求訪問文件系統? – benka 2014-09-02 12:25:42
是:\t \t \t \t \t window.requestFileSystem(LocalFileSystem.PERSISTENT,0,函數(文件系統){ – Ferenjito 2014-09-02 13:09:12