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

Tree API? #2

Open
tilpner opened this issue Sep 20, 2016 · 1 comment
Open

Tree API? #2

tilpner opened this issue Sep 20, 2016 · 1 comment

Comments

@tilpner
Copy link
Owner

tilpner commented Sep 20, 2016

I didn't use this with a large amount of files or deep file structures yet,
but while a phf map may be fast, it breaks down as soon as the included directories become deeper and more complex.

Would a filesystem-ish tree API be a better fit here?
One could imitate the std::fs API without writability, to allow for proper path manipulation,
directory listing, tree walking, etc.

Opinions? @emk

@emk
Copy link
Contributor

emk commented Sep 21, 2016

A filesystem-like API would certainly be nice for some use-cases.

My use case is a simple, Rails-style source code template engine for generating new projects and for adding new components to existing projects. The input templates are here.

As you can see, I basically just open templates/new (or templates/_overrides/_default), and then selectively walkdir everything below that point, filtering out anything which begins with an underscore _.

So if you had a filesystem API, I could certainly use it, but it's not absolutely critical in this particular case, because falling back to brute force still has acceptable performance. But for a case like game assets, where there are potentially many more files, then an fs-like API could certainly be useful.

But in any case, the critical operation in my case is walkdir with filtering. Thank you for asking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants