itinance / itinance/react-native-fs

is there anyway to read directory recursively to get sub folder and items in it

Open
#593 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.