Skip to content

The file in the scanned directory does not exist #90

@Mistsink

Description

@Mistsink

react-native: 0.76.5
react-native-file-access: 3.1.1
Platform: Android

Bug

I used react-native-document-picker to select a specific directory. Then, I used react-native-file-access to scan all image files in the directory. However, when validating with FileSystem.exists, the result shows that the file does not exist.

To reproduce
const dir = await DocumentPicker.pickDirectory()
const files = await FileSystem.ls(dir);
const dirForFile = dir
for (const file of files) {
if (isImageFile(file)) {
const filePath = decodeURIComponent(${dirForFile}/${file});
const exist = await FileSystem.exists(filePath);
console.log("filePath", filePath, "exist", exist);
rootPages.push({ fileName: file, filePath });
}
}

output:
image

Details
Logs, code snippets, screenshots, extended bug description.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions