I can able to read the files in a directory using following function
const path = RNFS.DocumentDirectoryPath;
RNFS.readDir(path)
.then((result) => {
console.warn(result);
const Files = [];
if(result != undefined && result.length > 0){
for(index in result) {
const item = result[index];
console.log(item);
if(item.isFile()){
Files.push(item);
}
}
if(Files.length > 0) {
callback(Files);
}
else{
callback(null);
}
}
else{
callback(null);
}
})
.catch(err => {
console.log('err in reading files');
console.log(err);
callback(null);
})
But i want to read the directory and it's subdirectory and the files belongs to them, is there any way to achieve it?