#鸿蒙学习大百科#如何删除键值型数据库的备份文件来释放存储空间?

如何删除键值型数据库的备份文件来释放存储空间?

HarmonyOS
2024-10-24 10:42:53
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
无敌大暴龙
let files = ['BK001'];
let kvStore: distributedKVStore.SingleKVStore | undefined = undefined;//kvStore获取步骤省略
try {
  kvStore.deleteBackup(files).then((data) => {
    console.info(`Succeed in deleting Backup. Data:filename is ${data[0]},result is ${data[1]}.`);
  }).catch((err: BusinessError) => {
    console.error(`Fail to delete Backup. Code:${err.code},message:${err.message}`);
  })
} catch (e) {
  let error = e as BusinessError;
  console.error(`An unexpected error occurred. Code:${error.code},message:${error.message}`);
}
分享
微博
QQ
微信
回复
2024-10-24 17:07:57
相关问题