Cordoba getDirectory returns an error code

I am trying to access the file system in an iOS cordova application, but when using the method, getDirectoryit always returns error code 3 (ABORT_ERR).

I am using the following code:

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);

function onFileSystemSuccess(fileSystem) {
    console.log(fileSystem.name);
    dataDir = fileSystem.root.getDirectory("ozzie", {create: true}, getDir, fail);
}

function getDir(dir) {
    console.log("successfull got directory", dir);
}

function fail(error) {
    console.log("error", error.code);
}

I believe me fileSystem.name("persistent"), but never get a directory. This always returns error.code = 3, which is in accordance with the ABORT_ERR phone records documentation.

Has anyone had this behavior before?

+4
source share
1 answer

Perhaps your problem is that you are trying to create two directories, for example: directory1/directory2

In iOS, you must first create one and then the other.

The directory Documentsdoes not exist on the iPad .

0
source

Source: https://habr.com/ru/post/1527304/


All Articles