0

我正在尝试使用此代码和此插件cordova-plugin-file在手机存储中创建一个目录。

function createDirectory(fileSystem){
    var directoryEntry = fileSystem.root;
    var folderName = cordova.file.externalRootDirectory + 'SomeFolder/';
    console.log(folderName);

    directoryEntry.getDirectory(folderName, { create: true, exclusive: false }, function(parent){
        console.log(parent);
    }, function(err){
        console.log('Error while creating directory.',err)
    })
}

但它抛出了这个错误:

`Error while creating directory. FileError {code: 5}`

如何解决此错误并在手机存储的根目录中创建目录?

该文档仅显示此错误code : 5意味着ENCODING_ERR

4

0 回答 0