xlab/android-go

App: Add getting asset directory contents

FlorianUekermann opened this issue · 1 comments

The NDK implements exploration of asset directories via the AAssetDir iterator. I suspect AAssetDir is not thread-safe, so it may be bad idea to copy the iterator model that the NDK uses. Something like app.NativeActivity.GetAssetDirContents(name string) []string should be relatively safe and is much nicer to use anyway (like ioutil.ReadDir(dirname string) ([]os.FileInfo, error)).

xlab commented

I'd suggest to implement filepath.FileWalk interface if possible.

type WalkFunc func(path string, info os.FileInfo, err error) error