var filePath = '/storage/emulated/0/MIUI/sound_recorder/call_rec/';
// 这是获取目录下的文件
plus.io.resolveLocalFileSystemURL(
filePath, // 指定的目录
function (entry) {
var directoryReader = entry.createReader() // 获取读取目录对象
directoryReader.readEntries(
function (entries) {
// 历遍子目录即可
console.log(entries)
var count = 0 // 记录多少条 用于处理循环跳出
var total_count = entries.length
for (var i = 0; i < entries.length; i++) {
count++
let file_name = entries[total_count-count].name
file_name = trim(file_name, 'g')
if (count > 5) {
clearInterval(_this.uploadEvent)
break
}
var uploadFilePath = filePath + '/' + entries[total_count-count].name
checkFileSizeIsChange(uploadFilePath, entries[total_count-count])
}
if (entries.length == 0) {
clearInterval(_this.uploadEvent)
}
},
function (err) {
console.log('err', err);
clearInterval(_this.uploadEvent)
console.log('访问目录失败')
},
)
},
function (err) {
clearInterval(_this.uploadEvent)
console.log('访问指定目录失败:' + err.message)
},
)
1 个回复
FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866
支持Android13、通话状态监听、通话录音文件获取、通话自动录音、通话记录获取:https://ext.dcloud.net.cn/plugin?id=11480