问题描述
我正在尝试从Android下载目录中删除一些文件。 我获得了外部存储的android许可,所以这是我的代码:
var RNFS = require('react-native-fs');
...
await RNFS.exists(filepath).then((exists) => {
if (exists) {
RNFS.unlink(filepath).then(() => {
RNFS.scanFile(filepath);
})
}
});
当我添加一些登录信息时,unlink函数可以完美地工作。它不是catch()
,但是当我再次启动相同的脚本时,在必须删除文件的同时,取消链接仍然有效,怎么可能?
编辑:
我检查了react-native-fs
并说:
Android support is currently limited to only the DocumentDirectory. This maps to the app's files directory.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)