Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The file in the scanned directory does not exist #90

Open
Mistsink opened this issue Dec 26, 2024 · 0 comments
Open

The file in the scanned directory does not exist #90

Mistsink opened this issue Dec 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Mistsink
Copy link

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.

@Mistsink Mistsink added the bug Something isn't working label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant