Cannot read all files from USB drive
See original GitHub issueProblem
Not all files are returned when we try to read usb via listFiles()
. I have an usb with 1000+ pictures and this method return only a part of them. For different file sizes it returns a different amount, so I guess this might be related to some buffer size or any other memory related stuff.
I tried this with different USB and SD cards(connected via OTG adapter) on different Andorid 11 devices.
Code where problem occurs
val currentFs = storageDevice.partitions[0].fileSystem
val rootDir = fileSystem.rootDirectory
val files = rootDir.listFiles()
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Solved: Cannot Open Files on USB Flash Drive
Open files that are invisible on USB flash drive · 1. Press Windows+R simultaneously, type “cmd” and hit “Enter” key to run Command...
Read more >Cannot Open USB Flash Drive on Windows 10 and Access File!
1. Try the USB Drive on Another PC/Laptop · 2. Try to Recover Files from USB Drive · Wondershare Recoverit Software · 3....
Read more >[SOLVED] USB Drive not Showing Files and Folders + 5 ...
This post lists 5 methods to help you solve the USB drive not showing files and folders issue with easily and quickly.
Read more >I can't access the files in my USB drive, what should I do?
If it does power on and shows up in windows explorer but you cannot access the files, then it may be due to...
Read more >Can Not Access USB Drive Windows 10 - EaseUS
When you can't access a USB drive on Windows 10, 8, or 7, a quick way to fix this issue is to change...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to download libusb 1.0.25 and set
libusb.dir
to the path where you extracted the source tarball. See gitlab ci for more info. https://github.com/magnusja/libaums/blob/566a5a9c8dd64a32fc1627b5d7de383d79abe12d/.github/workflows/android.yml#L16-L19@magnusja @vasiledoe Anything new with this issue? I am facing the same thing, I have 1k images and the listFiles() is only returning 300 of them . Update: Version v0.7.1 does not have this issue and it’s working fine for me.