file.removeDir() INVALID_MODIFICATION_ERR (code: 9)


#1

I’m using cordova-plugin-file to try to remove a directory, but I’m getting “INVALID_MODIFICATION_ERR (code: 9)” error.
file.checkDir() says that file exists, but when I try to remove ir i got that error.

this.file.removeDir(this.file.dataDirectory, 'images')
			.then(entry =>{
					console.log('pasta images deletada');
					//return this.file.copyDir(this.file.applicationDirectory + 'www/', 'images', this.file.dataDirectory, 'images')
				})
				.catch(err =>{
					console.log(err);
				});

Am I forgetting something?
Thank you


#2

I solved my problem. I can remove the directory using file.removeRecursively() method.


#3

Thanks! Worked For me as well.