如何使用 JavaScript 文件系统 API 重命名目录?
我尝试如下:
dirNameWithPath = '/MyPictures3/New Folder';
newDirName = 'newTitle';
dirPath = '/MyPictures3';
filesystem.root.getDirectory(dirNameWithPath, {}, function(dirEntry) {
dirEntry.moveTo(dirPath, newDirName, callback, errorHandler);
});
我收到以下错误:
FileError.INVALID_MODIFICATION_ERR