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
implement read_directory and is_directory for android asset reader #9969
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
Do we have a way to unit test this? It's surprisingly complex for a "read files" operation, and I'd like to ensure it keeps working. |
I don't know how bevy does tests but I imagine |
also this will require an is_directory implementation of some kind, it seems that it still refuses to work without it |
probably not easily, you need to be in an Android environment...
Yup, you need to implement it... looking at the asset manager doc, it seems your "silly hack" is the best we can do |
ok this will definitely require a test, on my device apparently after the folder's loadstate is loaded it has 0 handles??? |
I have tried working on this, not knowing about this PR (#11495). That happened to me when I used |
yeah closing in favour of your one |
Objective
Fixes #9968
Solution
Uses open_dir to read files.
It's collected in a vector since the AssetDir cant be sent between threads.
For
is_directory
it uses a silly hack (trying to open it then if it succeeds it must be a directory) seems there is no better way.It also ignores meta like the filesystem implementation does, no idea if this is needed on android.
Changelog
read_directory
andis_directory
.